diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-04-17 16:38:53 +0200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-04-17 16:38:53 +0200 |
commit | 8582063e9120932e598afbba00d0257e5e9a428f (patch) | |
tree | 20d451211690b6b9b2fd91f503ed4adfdcc50c0c /source4/lib | |
parent | e739fe91cfdbb7c8a792c4bdc6c5f18603507fc6 (diff) | |
download | samba-8582063e9120932e598afbba00d0257e5e9a428f.tar.gz samba-8582063e9120932e598afbba00d0257e5e9a428f.tar.bz2 samba-8582063e9120932e598afbba00d0257e5e9a428f.zip |
More work to avoid endian bugs in registry tests.
Andrew Bartlett
(This used to be commit 500544f4127d4042ab5ea8e3800156246982c297)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/registry/tests/registry.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/lib/registry/tests/registry.c b/source4/lib/registry/tests/registry.c index ac812823b2..7fad219752 100644 --- a/source4/lib/registry/tests/registry.c +++ b/source4/lib/registry/tests/registry.c @@ -448,8 +448,9 @@ static bool test_del_value(struct torture_context *tctx, void *_data) struct registry_key *subkey = NULL, *root; WERROR error; DATA_BLOB data; - uint32_t value = 42; uint32_t type; + char value[4]; + SIVAL(value, 0, 42); if (!create_test_key(tctx, rctx, "Warschau", &root, &subkey)) return false; @@ -460,7 +461,7 @@ static bool test_del_value(struct torture_context *tctx, void *_data) "getting missing value"); error = reg_val_set(subkey, __FUNCTION__, REG_DWORD, - data_blob_talloc(tctx, &value, 4)); + data_blob_talloc(tctx, value, sizeof(value))); torture_assert_werr_ok (tctx, error, "setting value"); error = reg_del_value(subkey, __FUNCTION__); @@ -483,15 +484,16 @@ static bool test_list_values(struct torture_context *tctx, void *_data) struct registry_key *subkey = NULL, *root; WERROR error; DATA_BLOB data; - uint32_t value = 42; uint32_t type; const char *name; + char value[4]; + SIVAL(value, 0, 42); if (!create_test_key(tctx, rctx, "Bonn", &root, &subkey)) return false; error = reg_val_set(subkey, "bar", REG_DWORD, - data_blob_talloc(tctx, &value, 4)); + data_blob_talloc(tctx, value, sizeof(val))); torture_assert_werr_ok (tctx, error, "setting value"); error = reg_key_get_value_by_index(tctx, subkey, 0, &name, @@ -500,7 +502,7 @@ static bool test_list_values(struct torture_context *tctx, void *_data) torture_assert_str_equal(tctx, name, "bar", "value name"); torture_assert_int_equal(tctx, 4, data.length, "value length"); - torture_assert_mem_equal(tctx, data.data, &value, 4, + torture_assert_mem_equal(tctx, data.data, &value, sizeof(value), "value content"); torture_assert_int_equal(tctx, REG_DWORD, type, "value type"); |