aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/qutil.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2020-01-14 17:38:48 +0100
committerJay Berkenbilt <ejb@ql.org>2020-01-14 17:40:51 +0100
commita44b5a34a07b9f2905d419d5571fd53832c1f6c0 (patch)
treeb263fc2ca894f5f08fc8f71e14e1be74b2af42ad /libtests/qutil.cc
parentab4061f1ee4e71a586f60bd65b9be4c96bf0bed8 (diff)
downloadqpdf-a44b5a34a07b9f2905d419d5571fd53832c1f6c0.tar.zst
Pull wmain -> main code from qpdf.cc into QUtil.cc
Diffstat (limited to 'libtests/qutil.cc')
-rw-r--r--libtests/qutil.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/libtests/qutil.cc b/libtests/qutil.cc
index 935cdfc2..b8429a44 100644
--- a/libtests/qutil.cc
+++ b/libtests/qutil.cc
@@ -543,6 +543,17 @@ void rename_delete_test()
assert_no_file("old\xcf\x80.~tmp");
}
+void wmain_test()
+{
+ auto realmain = [](int argc, char* argv[]) {
+ for (int i = 0; i < argc; ++i) { std::cout << argv[i] << std::endl; } return 0; };
+ wchar_t* argv[3];
+ argv[0] = const_cast<wchar_t*>(L"ascii");
+ argv[1] = const_cast<wchar_t*>(L"10 \xf7 2 = 5");
+ argv[2] = const_cast<wchar_t*>(L"qwww\xf7\x03c0");
+ QUtil::call_main_from_wmain(3, argv, realmain);
+}
+
int main(int argc, char* argv[])
{
try
@@ -573,6 +584,8 @@ int main(int argc, char* argv[])
hex_encode_decode_test();
std::cout << "---- rename/delete" << std::endl;
rename_delete_test();
+ std::cout << "---- wmain" << std::endl;
+ wmain_test();
}
catch (std::exception& e)
{