summaryrefslogtreecommitdiff
path: root/lib/util/charset/tests
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-04-11 20:46:42 +1000
committerAndrew Tridgell <tridge@samba.org>2011-04-13 14:47:07 +1000
commitb21129ae20b9d79b9481d26352130588b6ba8e1b (patch)
tree09f0e58c6a1db753b756c7b084df4f9e2a970be7 /lib/util/charset/tests
parentcd63c9205e79df250c4d4fefb35c917701fd7db6 (diff)
downloadsamba-b21129ae20b9d79b9481d26352130588b6ba8e1b.tar.gz
samba-b21129ae20b9d79b9481d26352130588b6ba8e1b.tar.bz2
samba-b21129ae20b9d79b9481d26352130588b6ba8e1b.zip
lib/util/charset Add expected values for upper/lower case tests
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'lib/util/charset/tests')
-rw-r--r--lib/util/charset/tests/convert_string.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/util/charset/tests/convert_string.c b/lib/util/charset/tests/convert_string.c
index a634e84e9c..22c44a4bde 100644
--- a/lib/util/charset/tests/convert_string.c
+++ b/lib/util/charset/tests/convert_string.c
@@ -82,7 +82,11 @@ static const char *plato_latin_utf16le_base64 =
"AG8AdQBkAOgAbgAgAGUAaQByABceawBhAHMAaQBuAC4A";
static const char *gd_utf8_base64 = "R8O8bnRoZXIgRGVzY2huZXI=";
+static const char *gd_utf8_upper_base64 = "R8OcTlRIRVIgREVTQ0hORVI=";
+static const char *gd_utf8_lower_base64 = "Z8O8bnRoZXIgZGVzY2huZXI=";
static const char *gd_cp850_base64 = "R4FudGhlciBEZXNjaG5lcg==";
+static const char *gd_cp850_upper_base64 = "R5pOVEhFUiBERVNDSE5FUg==";
+static const char *gd_cp850_lower_base64 = "Z4FudGhlciBkZXNjaG5lcg==";
static const char *gd_iso8859_1_base64 = "R/xudGhlciBEZXNjaG5lcg==";
static const char *gd_utf16le_base64 = "RwD8AG4AdABoAGUAcgAgAEQAZQBzAGMAaABuAGUAcgA=";
@@ -494,6 +498,8 @@ static bool test_gd_case_utf8(struct torture_context *tctx)
{
struct smb_iconv_handle *iconv_handle;
DATA_BLOB gd_utf8 = base64_decode_data_blob(gd_utf8_base64);
+ DATA_BLOB gd_utf8_upper = base64_decode_data_blob(gd_utf8_upper_base64);
+ DATA_BLOB gd_utf8_lower = base64_decode_data_blob(gd_utf8_lower_base64);
char *gd_lower, *gd_upper;
talloc_steal(tctx, gd_utf8.data);
@@ -508,8 +514,12 @@ static bool test_gd_case_utf8(struct torture_context *tctx)
"GD's name has an lower case character");
gd_lower = strlower_talloc_handle(iconv_handle, tctx, (const char *)gd_utf8.data);
torture_assert(tctx, gd_lower, "failed to convert GD's name into lower case");
+ torture_assert_data_blob_equal(tctx, data_blob_string_const(gd_lower), gd_utf8_lower,
+ "convert GD's name into lower case");
gd_upper = strupper_talloc_n_handle(iconv_handle, tctx, (const char *)gd_utf8.data, gd_utf8.length);
torture_assert(tctx, gd_lower, "failed to convert GD's name into upper case");
+ torture_assert_data_blob_equal(tctx, data_blob_string_const(gd_upper), gd_utf8_upper,
+ "convert GD's name into upper case");
torture_assert(tctx,
strhasupper_handle(iconv_handle, gd_upper),
@@ -551,6 +561,8 @@ static bool test_gd_case_cp850(struct torture_context *tctx)
{
struct smb_iconv_handle *iconv_handle;
DATA_BLOB gd_cp850 = base64_decode_data_blob(gd_cp850_base64);
+ DATA_BLOB gd_cp850_upper = base64_decode_data_blob(gd_cp850_upper_base64);
+ DATA_BLOB gd_cp850_lower = base64_decode_data_blob(gd_cp850_lower_base64);
char *gd_lower, *gd_upper;
talloc_steal(tctx, gd_cp850.data);
@@ -565,8 +577,12 @@ static bool test_gd_case_cp850(struct torture_context *tctx)
"GD's name has an lower case character");
gd_lower = strlower_talloc_handle(iconv_handle, tctx, (const char *)gd_cp850.data);
torture_assert(tctx, gd_lower, "failed to convert GD's name into lower case");
+ torture_assert_data_blob_equal(tctx, data_blob_string_const(gd_lower), gd_cp850_lower,
+ "convert GD's name into lower case");
gd_upper = strupper_talloc_n_handle(iconv_handle, tctx, (const char *)gd_cp850.data, gd_cp850.length);
torture_assert(tctx, gd_lower, "failed to convert GD's name into upper case");
+ torture_assert_data_blob_equal(tctx, data_blob_string_const(gd_upper), gd_cp850_upper,
+ "convert GD's name into upper case");
torture_assert(tctx,
strhasupper_handle(iconv_handle, gd_upper),