summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tests
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/registry/tests')
-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",