diff options
author | Brad King <brad.king@kitware.com> | 2013-12-20 19:27:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-12-20 19:27:36 (GMT) |
commit | f4fcfc6ef354c9e56ef054ddf77151627fbea5dc (patch) | |
tree | 3e6a00d11508a68dd00e64bb4326e434ae96919c /Source/kwsys/testEncoding.cxx | |
parent | 6820882be57942403fa7eaf706a0169fd2816fc2 (diff) | |
parent | 7aa3c2015f773d9b9433ca72242d03470c461c27 (diff) | |
download | CMake-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.cxx | 31 |
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; } |