summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-15 22:46:20 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-16 08:58:31 +0100
commitb7c1444683d6fd63c29098b41d3ad6f792139136 (patch)
tree02917db144e52949c238a03e4334c828419e7a9d /source4/lib
parent2f686d8523c0978630c375d377afe23fe07cbf19 (diff)
downloadsamba-b7c1444683d6fd63c29098b41d3ad6f792139136.tar.gz
samba-b7c1444683d6fd63c29098b41d3ad6f792139136.tar.bz2
samba-b7c1444683d6fd63c29098b41d3ad6f792139136.zip
s4:registry - add a test for the "REG_DWORD_BIG_ENDIAN" datatype
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/registry/tests/generic.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c
index a881c3d1d2..a9c834994f 100644
--- a/source4/lib/registry/tests/generic.c
+++ b/source4/lib/registry/tests/generic.c
@@ -35,6 +35,8 @@ static bool test_str_regtype(struct torture_context *ctx)
"REG_SZ", "REG_SZ failed");
torture_assert_str_equal(ctx, str_regtype(4),
"REG_DWORD", "REG_DWORD failed");
+ torture_assert_str_equal(ctx, str_regtype(5),
+ "REG_DWORD_BIG_ENDIAN", "REG_DWORD_BIG_ENDIAN failed");
torture_assert_str_equal(ctx, str_regtype(11),
"REG_QWORD", "REG_QWORD failed");
@@ -52,6 +54,16 @@ static bool test_reg_val_data_string_dword(struct torture_context *ctx)
return true;
}
+static bool test_reg_val_data_string_dword_big_endian(struct torture_context *ctx)
+{
+ uint32_t d = 0x20;
+ DATA_BLOB db = { (uint8_t *)&d, sizeof(d) };
+ torture_assert_str_equal(ctx, "0x20000000",
+ reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_DWORD_BIG_ENDIAN, db),
+ "dword failed");
+ return true;
+}
+
static bool test_reg_val_data_string_qword(struct torture_context *ctx)
{
uint64_t d = 0x20;
@@ -131,6 +143,8 @@ struct torture_suite *torture_registry(TALLOC_CTX *mem_ctx)
test_str_regtype);
torture_suite_add_simple_test(suite, "reg_val_data_string dword",
test_reg_val_data_string_dword);
+ torture_suite_add_simple_test(suite, "reg_val_data_string dword_big_endian",
+ test_reg_val_data_string_dword_big_endian);
torture_suite_add_simple_test(suite, "reg_val_data_string qword",
test_reg_val_data_string_qword);
torture_suite_add_simple_test(suite, "reg_val_data_string sz",