summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-08-26 21:52:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:02:41 -0500
commit3c9f28334c62167c80589b348c7662388342a922 (patch)
treea4e7de4069cfef1de5b648eff823e4c96ed41b3a
parentfa4049d8c999d9c3fd8841fffa7d7ed373da68d6 (diff)
downloadsamba-3c9f28334c62167c80589b348c7662388342a922.tar.gz
samba-3c9f28334c62167c80589b348c7662388342a922.tar.bz2
samba-3c9f28334c62167c80589b348c7662388342a922.zip
r24683: Add two more tests.
(This used to be commit c87576743b09773489478e6eebeb3a282d6ec21b)
-rw-r--r--source4/lib/registry/tests/generic.c2
-rw-r--r--source4/lib/registry/tests/registry.c35
2 files changed, 37 insertions, 0 deletions
diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c
index 6595f86b18..549ed6282d 100644
--- a/source4/lib/registry/tests/generic.c
+++ b/source4/lib/registry/tests/generic.c
@@ -101,6 +101,8 @@ static bool test_reg_val_description_nullname(struct torture_context *ctx)
return true;
}
+
+
struct torture_suite *torture_registry(TALLOC_CTX *mem_ctx)
{
struct torture_suite *suite = torture_suite_create(mem_ctx,
diff --git a/source4/lib/registry/tests/registry.c b/source4/lib/registry/tests/registry.c
index 0fda7587dc..2aab034ff3 100644
--- a/source4/lib/registry/tests/registry.c
+++ b/source4/lib/registry/tests/registry.c
@@ -57,6 +57,37 @@ static bool test_get_predefined_unknown(struct torture_context *tctx,
WERROR error;
error = reg_get_predefined_key(rctx, 1337, &root);
+ torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
+ "getting predefined key failed");
+ return true;
+}
+
+static bool test_predef_key_by_name(struct torture_context *tctx,
+ const void *_data)
+{
+ const struct registry_context *rctx = _data;
+ struct registry_key *root;
+ WERROR error;
+
+ error = reg_get_predefined_key_by_name(rctx, "HKEY_CLASSES_ROOT", &root);
+ torture_assert_werr_ok(tctx, error,
+ "getting predefined key failed");
+
+ error = reg_get_predefined_key_by_name(rctx, "HKEY_classes_ROOT", &root);
+ torture_assert_werr_ok(tctx, error,
+ "getting predefined key case insensitively failed");
+
+ return true;
+}
+
+static bool test_predef_key_by_name_invalid(struct torture_context *tctx,
+ const void *_data)
+{
+ const struct registry_context *rctx = _data;
+ struct registry_key *root;
+ WERROR error;
+
+ error = reg_get_predefined_key_by_name(tctx, "BLA", &root);
torture_assert_werr_equal(tctx, error, WERR_BADFILE,
"getting predefined key failed");
return true;
@@ -491,6 +522,10 @@ static void tcase_add_tests(struct torture_tcase *tcase)
torture_tcase_add_simple_test(tcase, "flush_key", test_flush_key);
torture_tcase_add_simple_test(tcase, "query_key", test_query_key);
torture_tcase_add_simple_test(tcase, "query_key_nums", test_query_key_nums);
+ torture_tcase_add_simple_test(tcase, "test_predef_key_by_name",
+ test_predef_key_by_name);
+ torture_tcase_add_simple_test(tcase, "test_predef_key_by_name_invalid",
+ test_predef_key_by_name_invalid);
}
struct torture_suite *torture_registry_registry(TALLOC_CTX *mem_ctx)