diff Resources/EncodingTests.h @ 1088:6fd4434c1bcf

unit tests for encodings
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 04 Aug 2014 19:24:28 +0200
parents
children e494ceb8d763
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/EncodingTests.h	Mon Aug 04 19:24:28 2014 +0200
@@ -0,0 +1,40 @@
+static const unsigned int testEncodingsCount = 11;
+static const Orthanc::Encoding testEncodings[] = {
+  Orthanc::Encoding_Latin5,
+  Orthanc::Encoding_Hebrew,
+  Orthanc::Encoding_Greek,
+  Orthanc::Encoding_Arabic,
+  Orthanc::Encoding_Cyrillic,
+  Orthanc::Encoding_Latin4,
+  Orthanc::Encoding_Latin3,
+  Orthanc::Encoding_Latin2,
+  Orthanc::Encoding_Latin1,
+  Orthanc::Encoding_Utf8,
+  Orthanc::Encoding_Ascii
+};
+static const char *testEncodingsEncoded[11] = {
+  "\xe9\xe4\xf6\xf2\x3f\x3f\x3f\x3f\x3f\x3f\x3f",
+  "\x3f\x3f\x3f\x3f\x3f\x3f\x3f\xe3\x3f\x3f\x3f",
+  "\x3f\x3f\x3f\x3f\x3f\xc8\x3f\x3f\x3f\x3f\x3f",
+  "\x3f\x3f\x3f\x3f\x3f\x3f\x3f\x3f\xd5\x3f\x3f",
+  "\x3f\x3f\x3f\x3f\xb4\x3f\x3f\x3f\x3f\x3f\xfb",
+  "\xe9\xe4\xf6\x3f\x3f\x3f\x3f\x3f\x3f\xf3\x3f",
+  "\xe9\xe4\xf6\xf2\x3f\x3f\xf8\x3f\x3f\x3f\x3f",
+  "\xe9\xe4\xf6\x3f\x3f\x3f\x3f\x3f\x3f\x3f\x3f",
+  "\xe9\xe4\xf6\xf2\x3f\x3f\x3f\x3f\x3f\x3f\x3f",
+  "\xc3\xa9\xc3\xa4\xc3\xb6\xc3\xb2\xd0\x94\xce\x98\xc4\x9d\xd7\x93\xd8\xb5\xc4\xb7\xd1\x9b",
+  "\x3f\x3f\x3f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