summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/testEncoding.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-12-20 19:27:36 (GMT)
committerBrad King <brad.king@kitware.com>2013-12-20 19:27:36 (GMT)
commitf4fcfc6ef354c9e56ef054ddf77151627fbea5dc (patch)
tree3e6a00d11508a68dd00e64bb4326e434ae96919c /Source/kwsys/testEncoding.cxx
parent6820882be57942403fa7eaf706a0169fd2816fc2 (diff)
parent7aa3c2015f773d9b9433ca72242d03470c461c27 (diff)
downloadCMake-f4fcfc6ef354c9e56ef054ddf77151627fbea5dc.zip
CMake-f4fcfc6ef354c9e56ef054ddf77151627fbea5dc.tar.gz
CMake-f4fcfc6ef354c9e56ef054ddf77151627fbea5dc.tar.bz2
Merge branch 'upstream-kwsys' into update-kwsys
Diffstat (limited to 'Source/kwsys/testEncoding.cxx')
-rw-r--r--Source/kwsys/testEncoding.cxx31
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/kwsys/testEncoding.cxx b/Source/kwsys/testEncoding.cxx
index a65c430..094588c 100644
--- a/Source/kwsys/testEncoding.cxx
+++ b/Source/kwsys/testEncoding.cxx
@@ -145,6 +145,36 @@ static int testRobustEncoding()
return ret;
}
+static int testCommandLineArguments()
+{
+ int status = 0;
+
+ char const* argv[2] = {
+ "./app.exe",
+ (char const*)helloWorldStrings[1]
+ };
+
+ kwsys::Encoding::CommandLineArguments args(2, argv);
+ kwsys::Encoding::CommandLineArguments arg2 =
+ kwsys::Encoding::CommandLineArguments(args);
+
+ char const* const* u8_argv = args.argv();
+ for(int i=0; i<args.argc(); i++)
+ {
+ char const* u8_arg = u8_argv[i];
+ if(strcmp(argv[i], u8_arg) != 0)
+ {
+ std::cout << "argv[" << i << "] " << argv[i] << " != "
+ << u8_arg << std::endl;
+ status++;
+ }
+ }
+
+ kwsys::Encoding::CommandLineArguments args3 =
+ kwsys::Encoding::CommandLineArguments::Main(2, argv);
+
+ return status;
+}
//----------------------------------------------------------------------------
int testEncoding(int, char*[])
@@ -163,6 +193,7 @@ int testEncoding(int, char*[])
ret |= testHelloWorldEncoding();
ret |= testRobustEncoding();
+ ret |= testCommandLineArguments();
return ret;
}