summaryrefslogtreecommitdiffstats
path: root/testEncoding.cxx
diff options
context:
space:
mode:
authorKWSys Robot <kwrobot@kitware.com>2013-12-19 14:39:26 (GMT)
committerBrad King <brad.king@kitware.com>2013-12-19 15:44:24 (GMT)
commitf788d9a1b27efc9b463b1174a93e780bef00a5d9 (patch)
treead8871c410d7cc02d04c19be76465db32aab8dca /testEncoding.cxx
parent704ab3d24827cfe5754a00028086f21503c2e08b (diff)
downloadCMake-f788d9a1b27efc9b463b1174a93e780bef00a5d9.zip
CMake-f788d9a1b27efc9b463b1174a93e780bef00a5d9.tar.gz
CMake-f788d9a1b27efc9b463b1174a93e780bef00a5d9.tar.bz2
KWSys 2013-12-19 (88165c5e)
Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 88165c5e | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 1010d0e3..88165c5e Clinton Stimpson (2): ab6f8c36 FStream: Fix rdbuf() return and use use of FStream in SystemTools. 88165c5e Encoding: Fix bug in kwsysEncoding_DupToNarrow. Rolf Eike Beer (2): d2bcbe11 SystemInformation: extract CPU information on Linux/Sparc b2fd7da5 ProcessUNIX: close /proc entry before starting recursion Ådne Hovda (1): a02a1ad2 SystemInformation: Fix compilation on HP-UX 11.11 hppa Change-Id: I225e0517379d88612f18215b43c7d6a9daad6326
Diffstat (limited to 'testEncoding.cxx')
-rw-r--r--testEncoding.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/testEncoding.cxx b/testEncoding.cxx
index 8e74a50..a65c430 100644
--- a/testEncoding.cxx
+++ b/testEncoding.cxx
@@ -16,14 +16,18 @@
#endif
#include KWSYS_HEADER(Encoding.hxx)
+#include KWSYS_HEADER(Encoding.h)
#include KWSYS_HEADER(ios/iostream)
#include <locale.h>
+#include <string.h>
+#include <stdlib.h>
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "Encoding.hxx.in"
+# include "Encoding.h.in"
# include "kwsys_ios_iostream.h.in"
#endif
@@ -68,11 +72,16 @@ static int testHelloWorldEncoding()
std::cout << str << std::endl;
std::wstring wstr = kwsys::Encoding::ToWide(str);
std::string str2 = kwsys::Encoding::ToNarrow(wstr);
- if(!wstr.empty() && str != str2)
+ wchar_t* c_wstr = kwsysEncoding_DupToWide(str.c_str());
+ char* c_str2 = kwsysEncoding_DupToNarrow(c_wstr);
+ if(!wstr.empty() && (str != str2 || strcmp(c_str2, str.c_str())))
{
std::cout << "converted string was different: " << str2 << std::endl;
+ std::cout << "converted string was different: " << c_str2 << std::endl;
ret++;
}
+ free(c_wstr);
+ free(c_str2);
}
return ret;
}