diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-18 02:45:00 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-01-18 03:41:59 +0100 |
commit | 85d60d2d091a2eb6bd4c73c87c94b10ee93167ee (patch) | |
tree | b0c1498f80bffbc7a7e0271f15a9847405ce2654 /source4/lib/registry/tests | |
parent | 4d8a60f617f941ff6481bcfbac73d7ed69e43daa (diff) | |
download | samba-85d60d2d091a2eb6bd4c73c87c94b10ee93167ee.tar.gz samba-85d60d2d091a2eb6bd4c73c87c94b10ee93167ee.tar.bz2 samba-85d60d2d091a2eb6bd4c73c87c94b10ee93167ee.zip |
registry: Improve error codes and update tests.
Rather than map the error returned by the registry to the correct error,
return the correct error in the first place.
Also deal with the fact that the right error code is now returned in a
couple of places.
(This used to be commit 1e31fcb8a097810a97e2d4bb1f243f1b34cc2415)
Diffstat (limited to 'source4/lib/registry/tests')
-rw-r--r-- | source4/lib/registry/tests/hive.c | 4 | ||||
-rw-r--r-- | source4/lib/registry/tests/registry.c | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/source4/lib/registry/tests/hive.c b/source4/lib/registry/tests/hive.c index 22b4785222..f72b7d6bf3 100644 --- a/source4/lib/registry/tests/hive.c +++ b/source4/lib/registry/tests/hive.c @@ -174,7 +174,7 @@ static bool test_get_value(struct torture_context *tctx, const void *test_data) torture_assert_werr_ok(tctx, error, "hive_key_add_name"); error = hive_get_value(mem_ctx, subkey, "Answer", &type, &value); - torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + torture_assert_werr_equal(tctx, error, WERR_BADFILE, "getting missing value"); error = hive_key_set_value(subkey, "Answer", REG_DWORD, @@ -215,7 +215,7 @@ static bool test_del_value(struct torture_context *tctx, const void *test_data) torture_assert_werr_ok(tctx, error, "deleting value"); error = hive_get_value(mem_ctx, subkey, "Answer", &type, &value); - torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, "getting value"); + torture_assert_werr_equal(tctx, error, WERR_BADFILE, "getting value"); error = hive_key_del_value(subkey, "Answer"); torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, diff --git a/source4/lib/registry/tests/registry.c b/source4/lib/registry/tests/registry.c index 75fbe1cbea..59e31f55dc 100644 --- a/source4/lib/registry/tests/registry.c +++ b/source4/lib/registry/tests/registry.c @@ -195,15 +195,15 @@ static bool test_del_key(struct torture_context *tctx, void *_data) torture_assert_werr_ok(tctx, error, "getting predefined key failed"); - error = reg_key_add_name(rctx, root, "Hamburg", NULL, NULL, &newkey); + error = reg_key_add_name(rctx, root, "Polen", NULL, NULL, &newkey); torture_assert_werr_ok(tctx, error, "Creating key return code"); torture_assert(tctx, newkey != NULL, "Creating new key"); - error = reg_key_del(root, "Hamburg"); + error = reg_key_del(root, "Polen"); torture_assert_werr_ok(tctx, error, "Delete key"); - error = reg_key_del(root, "Hamburg"); + error = reg_key_del(root, "Polen"); torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, "Delete missing key"); @@ -239,7 +239,7 @@ static bool test_flush_key(struct torture_context *tctx, void *_data) struct registry_key *root, *subkey; WERROR error; - if (!create_test_key(tctx, rctx, "Munchen", &root, &subkey)) + if (!create_test_key(tctx, rctx, "Bremen", &root, &subkey)) return false; error = reg_key_flush(subkey); @@ -416,7 +416,7 @@ static bool test_get_value(struct torture_context *tctx, void *_data) error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, &type, &data); - torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + torture_assert_werr_equal(tctx, error, WERR_BADFILE, "getting missing value"); error = reg_val_set(subkey, __FUNCTION__, REG_DWORD, @@ -447,12 +447,12 @@ static bool test_del_value(struct torture_context *tctx, void *_data) uint32_t value = 42; uint32_t type; - if (!create_test_key(tctx, rctx, "Duisburg", &root, &subkey)) + if (!create_test_key(tctx, rctx, "Warschau", &root, &subkey)) return false; error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, &type, &data); - torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + torture_assert_werr_equal(tctx, error, WERR_BADFILE, "getting missing value"); error = reg_val_set(subkey, __FUNCTION__, REG_DWORD, @@ -464,7 +464,7 @@ static bool test_del_value(struct torture_context *tctx, void *_data) error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, &type, &data); - torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + torture_assert_werr_equal(tctx, error, WERR_BADFILE, "getting missing value"); return true; |