summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-15 11:52:24 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-03-15 13:27:35 +0100
commit1e5010d35313d851a3904b116d3a4c2d3f0e199f (patch)
treef59e0408f6a77f86d37354989523157b14e81898 /source4/lib/registry
parent00934d4c2fd449493ad52127616445673f0de5b5 (diff)
downloadsamba-1e5010d35313d851a3904b116d3a4c2d3f0e199f.tar.gz
samba-1e5010d35313d851a3904b116d3a4c2d3f0e199f.tar.bz2
samba-1e5010d35313d851a3904b116d3a4c2d3f0e199f.zip
s4:registry - local testsuite - add a test for REG_QWORD
Change also here to fixed-length HEX values output to test for the right representation.
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/tests/generic.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c
index 3de7602e53..a881c3d1d2 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(11),
+ "REG_QWORD", "REG_QWORD failed");
return true;
}
@@ -44,12 +46,22 @@ static bool test_reg_val_data_string_dword(struct torture_context *ctx)
{
uint32_t d = 0x20;
DATA_BLOB db = { (uint8_t *)&d, sizeof(d) };
- torture_assert_str_equal(ctx, "0x20",
+ torture_assert_str_equal(ctx, "0x00000020",
reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_DWORD, db),
"dword failed");
return true;
}
+static bool test_reg_val_data_string_qword(struct torture_context *ctx)
+{
+ uint64_t d = 0x20;
+ DATA_BLOB db = { (uint8_t *)&d, sizeof(d) };
+ torture_assert_str_equal(ctx, "0x0000000000000020",
+ reg_val_data_string(ctx, lp_iconv_convenience(ctx->lp_ctx), REG_QWORD, db),
+ "qword failed");
+ return true;
+}
+
static bool test_reg_val_data_string_sz(struct torture_context *ctx)
{
DATA_BLOB db;
@@ -119,6 +131,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 qword",
+ test_reg_val_data_string_qword);
torture_suite_add_simple_test(suite, "reg_val_data_string sz",
test_reg_val_data_string_sz);
torture_suite_add_simple_test(suite, "reg_val_data_string binary",