diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-02-15 21:06:33 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:48:22 -0500 |
commit | 8bcad6b9010a3a47620d4b34c34d2205f754ce14 (patch) | |
tree | 4797de886115d00426fd9d5867a7a91e0d932322 /source4/torture/ndr/winreg.c | |
parent | a009659e46f692aeb23c7c60cdd5b258d56c49d5 (diff) | |
download | samba-8bcad6b9010a3a47620d4b34c34d2205f754ce14.tar.gz samba-8bcad6b9010a3a47620d4b34c34d2205f754ce14.tar.xz samba-8bcad6b9010a3a47620d4b34c34d2205f754ce14.zip |
r21373: More tests.
(This used to be commit 83a47e30b59f5289cdcb68ba54aa236795bc42b2)
Diffstat (limited to 'source4/torture/ndr/winreg.c')
-rw-r--r-- | source4/torture/ndr/winreg.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/source4/torture/ndr/winreg.c b/source4/torture/ndr/winreg.c index 30f2dccf5f6..8259a0a45e9 100644 --- a/source4/torture/ndr/winreg.c +++ b/source4/torture/ndr/winreg.c @@ -473,6 +473,45 @@ static bool getkeysecurity_out_check(struct torture_context *tctx, struct winreg return true; } +static const uint8_t enumkey_in_data[] = { + 0x00, 0x00, 0x00, 0x00, 0x85, 0xb8, 0x41, 0xb0, 0x17, 0xe4, 0x28, 0x45, + 0x8a, 0x69, 0xbf, 0x40, 0x79, 0x82, 0x8b, 0xcb, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x14, 0x04, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f +}; + +static bool enumkey_in_check(struct torture_context *tctx, struct winreg_EnumKey *r) +{ + torture_assert_int_equal(tctx, r->in.enum_index, 0, "enum index"); + torture_assert_int_equal(tctx, r->in.name->size, 1044, "name size"); + torture_assert_int_equal(tctx, r->in.name->length, 0, "name len"); + torture_assert(tctx, r->in.keyclass != NULL, "keyclass pointer"); + torture_assert(tctx, r->in.keyclass->name == NULL, "keyclass"); + torture_assert(tctx, r->in.last_changed_time != NULL, "last_changed_time != NULL"); + return true; +} + +static const uint8_t enumkey_out_data[] = { + 0x08, 0x00, 0x14, 0x04, 0x18, 0xe8, 0x07, 0x00, 0x0a, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x53, 0x00, 0x41, 0x00, + 0x4d, 0x00, 0x00, 0x00, 0xd0, 0x62, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xdc, 0x62, 0x07, 0x00, 0x50, 0x67, 0xd0, 0x8b, + 0x16, 0x06, 0xc2, 0x01, 0x00, 0x00, 0x00, 0x00 +}; + +static bool enumkey_out_check(struct torture_context *tctx, struct winreg_EnumKey *r) +{ + torture_assert_int_equal(tctx, r->out.name->size, 1044, "name size"); + torture_assert_int_equal(tctx, r->out.name->length, 8, "name len"); + torture_assert(tctx, r->out.keyclass != NULL, "keyclass pointer"); + torture_assert(tctx, r->out.keyclass->name == NULL, "keyclass"); + torture_assert(tctx, r->out.last_changed_time != NULL, "last_changed_time pointer"); + /* FIXME: *last_changed_time */ + return true; +} + struct torture_suite *ndr_winreg_suite(TALLOC_CTX *ctx) { struct torture_suite *suite = torture_suite_create(ctx, "winreg"); @@ -516,6 +555,9 @@ struct torture_suite *ndr_winreg_suite(TALLOC_CTX *ctx) /*torture_suite_add_ndr_pull_fn_test(suite, winreg_GetKeySecurity, getkeysecurity_in_data, NDR_IN, getkeysecurity_in_check ); torture_suite_add_ndr_pull_fn_test(suite, winreg_GetKeySecurity, getkeysecurity_out_data, NDR_OUT, getkeysecurity_out_check );*/ + torture_suite_add_ndr_pull_fn_test(suite, winreg_EnumKey, enumkey_in_data, NDR_IN, enumkey_in_check ); + torture_suite_add_ndr_pull_fn_test(suite, winreg_EnumKey, enumkey_out_data, NDR_OUT, enumkey_out_check ); + return suite; } |