diff options
author | Günther Deschner <gd@samba.org> | 2007-10-10 12:44:48 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:42:49 +0100 |
commit | c353a7b05e8475bbc726123ae41c91102d96c6f5 (patch) | |
tree | 6718c229573323eeda35ed1ede68a3b3ade9852c /source4 | |
parent | 34d166111e4faca4dd13f0d2fc111eb1167e9b04 (diff) | |
download | samba-c353a7b05e8475bbc726123ae41c91102d96c6f5.tar.gz samba-c353a7b05e8475bbc726123ae41c91102d96c6f5.tar.bz2 samba-c353a7b05e8475bbc726123ae41c91102d96c6f5.zip |
r25605: Last round of registry reformats (before this gets an obsession...).
Guenther
(This used to be commit ceb2ebfbf1eeb80bd34beadbba3a3c7a04da306a)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/registry/tests/diff.c | 34 | ||||
-rw-r--r-- | source4/lib/registry/tests/generic.c | 99 | ||||
-rw-r--r-- | source4/lib/registry/tests/hive.c | 154 | ||||
-rw-r--r-- | source4/lib/registry/tests/registry.c | 312 |
4 files changed, 328 insertions, 271 deletions
diff --git a/source4/lib/registry/tests/diff.c b/source4/lib/registry/tests/diff.c index 99a4589309..8e6907382c 100644 --- a/source4/lib/registry/tests/diff.c +++ b/source4/lib/registry/tests/diff.c @@ -1,20 +1,20 @@ -/* +/* Unix SMB/CIFS implementation. local testing of registry diff functionality Copyright (C) Jelmer Vernooij 2007 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -27,8 +27,8 @@ static bool test_generate_diff(struct torture_context *test) { - /* WERROR reg_generate_diff(struct registry_context *ctx1, - struct registry_context *ctx2, + /* WERROR reg_generate_diff(struct registry_context *ctx1, + struct registry_context *ctx2, const struct reg_diff_callbacks *callbacks, void *callback_data) */ @@ -52,7 +52,7 @@ static bool test_diff_apply(struct torture_context *test) static const char *added_key = NULL; -static WERROR test_add_key (void *callback_data, const char *key_name) +static WERROR test_add_key(void *callback_data, const char *key_name) { added_key = talloc_strdup(callback_data, key_name); @@ -90,14 +90,18 @@ static bool test_generate_diff_key_null(struct torture_context *test) return true; } -struct torture_suite *torture_registry_diff(TALLOC_CTX *mem_ctx) +struct torture_suite *torture_registry_diff(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(mem_ctx, - "DIFF"); - torture_suite_add_simple_test(suite, "test_generate_diff_key_add", test_generate_diff_key_add); - torture_suite_add_simple_test(suite, "test_generate_diff_key_null", test_generate_diff_key_null); - torture_suite_add_simple_test(suite, "test_diff_apply", test_diff_apply); - torture_suite_add_simple_test(suite, "test_generate_diff", test_generate_diff); - torture_suite_add_simple_test(suite, "test_diff_load", test_diff_load); + struct torture_suite *suite = torture_suite_create(mem_ctx, "DIFF"); + torture_suite_add_simple_test(suite, "test_generate_diff_key_add", + test_generate_diff_key_add); + torture_suite_add_simple_test(suite, "test_generate_diff_key_null", + test_generate_diff_key_null); + torture_suite_add_simple_test(suite, "test_diff_apply", + test_diff_apply); + torture_suite_add_simple_test(suite, "test_generate_diff", + test_generate_diff); + torture_suite_add_simple_test(suite, "test_diff_load", + test_diff_load); return suite; } diff --git a/source4/lib/registry/tests/generic.c b/source4/lib/registry/tests/generic.c index 549ed6282d..1b680f20b7 100644 --- a/source4/lib/registry/tests/generic.c +++ b/source4/lib/registry/tests/generic.c @@ -1,20 +1,20 @@ -/* +/* Unix SMB/CIFS implementation. local testing of registry library Copyright (C) Jelmer Vernooij 2005-2007 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -31,8 +31,10 @@ struct torture_suite *torture_registry_diff(TALLOC_CTX *mem_ctx); static bool test_str_regtype(struct torture_context *ctx) { - torture_assert_str_equal(ctx, str_regtype(1), "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(1), + "REG_SZ", "REG_SZ failed"); + torture_assert_str_equal(ctx, str_regtype(4), + "REG_DWORD", "REG_DWORD failed"); return true; } @@ -42,18 +44,24 @@ 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", - reg_val_data_string(ctx, REG_DWORD, db), "dword failed"); + torture_assert_str_equal(ctx, "0x20", + reg_val_data_string(ctx, REG_DWORD, db), + "dword failed"); return true; } static bool test_reg_val_data_string_sz(struct torture_context *ctx) { DATA_BLOB db; - db.length = convert_string_talloc(ctx, CH_UNIX, CH_UTF16, "bla", 3, (void **)&db.data); - torture_assert_str_equal(ctx, "bla", reg_val_data_string(ctx, REG_SZ, db), "sz failed"); + db.length = convert_string_talloc(ctx, CH_UNIX, CH_UTF16, + "bla", 3, (void **)&db.data); + torture_assert_str_equal(ctx, "bla", + reg_val_data_string(ctx, REG_SZ, db), + "sz failed"); db.length = 4; - torture_assert_str_equal(ctx, "bl", reg_val_data_string(ctx, REG_SZ, db), "sz failed"); + torture_assert_str_equal(ctx, "bl", + reg_val_data_string(ctx, REG_SZ, db), + "sz failed"); return true; } @@ -61,9 +69,9 @@ static bool test_reg_val_data_string_binary(struct torture_context *ctx) { uint8_t x[] = { 0x1, 0x2, 0x3, 0x4 }; DATA_BLOB db = { x, 4 }; - torture_assert_str_equal(ctx, "01020304", - reg_val_data_string(ctx, REG_BINARY, db), - "binary failed"); + torture_assert_str_equal(ctx, "01020304", + reg_val_data_string(ctx, REG_BINARY, db), + "binary failed"); return true; } @@ -71,21 +79,22 @@ static bool test_reg_val_data_string_binary(struct torture_context *ctx) static bool test_reg_val_data_string_empty(struct torture_context *ctx) { DATA_BLOB db = { NULL, 0 }; - torture_assert_str_equal(ctx, "", - reg_val_data_string(ctx, REG_BINARY, db), "empty failed"); + torture_assert_str_equal(ctx, "", + reg_val_data_string(ctx, REG_BINARY, db), + "empty failed"); return true; } static bool test_reg_val_description(struct torture_context *ctx) { DATA_BLOB data; - data.length = convert_string_talloc(ctx, CH_UNIX, CH_UTF16, - "stationary traveller", - strlen("stationary traveller"), - (void **)&data.data); - torture_assert_str_equal(ctx, "camel = REG_SZ : stationary traveller", - reg_val_description(ctx, "camel", REG_SZ, data), - "reg_val_description failed"); + data.length = convert_string_talloc(ctx, CH_UNIX, CH_UTF16, + "stationary traveller", + strlen("stationary traveller"), + (void **)&data.data); + torture_assert_str_equal(ctx, "camel = REG_SZ : stationary traveller", + reg_val_description(ctx, "camel", REG_SZ, data), + "reg_val_description failed"); return true; } @@ -93,33 +102,35 @@ static bool test_reg_val_description(struct torture_context *ctx) static bool test_reg_val_description_nullname(struct torture_context *ctx) { DATA_BLOB data; - data.length = convert_string_talloc(ctx, CH_UNIX, CH_UTF16, "west berlin", - strlen("west berlin"), (void **)&data.data); - torture_assert_str_equal(ctx, "<No Name> = REG_SZ : west berlin", - reg_val_description(ctx, NULL, REG_SZ, data), - "description with null name failed"); + data.length = convert_string_talloc(ctx, CH_UNIX, CH_UTF16, + "west berlin", + strlen("west berlin"), + (void **)&data.data); + torture_assert_str_equal(ctx, "<No Name> = REG_SZ : west berlin", + reg_val_description(ctx, NULL, REG_SZ, data), + "description with null name failed"); return true; } -struct torture_suite *torture_registry(TALLOC_CTX *mem_ctx) +struct torture_suite *torture_registry(TALLOC_CTX *mem_ctx) { - struct torture_suite *suite = torture_suite_create(mem_ctx, - "REGISTRY"); - torture_suite_add_simple_test(suite, "str_regtype", 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 sz", - test_reg_val_data_string_sz); - torture_suite_add_simple_test(suite, "reg_val_data_string binary", - test_reg_val_data_string_binary); - torture_suite_add_simple_test(suite, "reg_val_data_string empty", - test_reg_val_data_string_empty); - torture_suite_add_simple_test(suite, "reg_val_description", - test_reg_val_description); - torture_suite_add_simple_test(suite, "reg_val_description null", - test_reg_val_description_nullname); + struct torture_suite *suite = torture_suite_create(mem_ctx, "REGISTRY"); + torture_suite_add_simple_test(suite, "str_regtype", + 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 sz", + test_reg_val_data_string_sz); + torture_suite_add_simple_test(suite, "reg_val_data_string binary", + test_reg_val_data_string_binary); + torture_suite_add_simple_test(suite, "reg_val_data_string empty", + test_reg_val_data_string_empty); + torture_suite_add_simple_test(suite, "reg_val_description", + test_reg_val_description); + torture_suite_add_simple_test(suite, "reg_val_description null", + test_reg_val_description_nullname); torture_suite_add_suite(suite, torture_registry_hive(mem_ctx)); torture_suite_add_suite(suite, torture_registry_registry(mem_ctx)); diff --git a/source4/lib/registry/tests/hive.c b/source4/lib/registry/tests/hive.c index dff6d1e829..9e76ce6aa1 100644 --- a/source4/lib/registry/tests/hive.c +++ b/source4/lib/registry/tests/hive.c @@ -1,20 +1,20 @@ -/* +/* Unix SMB/CIFS implementation. local testing of registry library - hives Copyright (C) Jelmer Vernooij 2005-2007 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -32,36 +32,38 @@ static bool test_del_nonexistant_key(struct torture_context *tctx, { const struct hive_key *root = (const struct hive_key *)test_data; WERROR error = hive_key_del(root, "bla"); - torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, - "invalid return code"); + torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + "invalid return code"); return true; } static bool test_keyinfo_root(struct torture_context *tctx, - const void *test_data) + const void *test_data) { uint32_t num_subkeys, num_values; const struct hive_key *root = (const struct hive_key *)test_data; WERROR error; - /* This is a new backend. There should be no subkeys and no + /* This is a new backend. There should be no subkeys and no * values */ - error = hive_key_get_info(tctx, root, NULL, &num_subkeys, &num_values, - NULL); + error = hive_key_get_info(tctx, root, NULL, &num_subkeys, &num_values, + NULL); torture_assert_werr_ok(tctx, error, "reg_key_num_subkeys()"); - torture_assert_int_equal(tctx, num_subkeys, 0, "New key has non-zero subkey count"); + torture_assert_int_equal(tctx, num_subkeys, 0, + "New key has non-zero subkey count"); torture_assert_werr_ok(tctx, error, "reg_key_num_values"); - torture_assert_int_equal(tctx, num_values, 0, "New key has non-zero value count"); + torture_assert_int_equal(tctx, num_values, 0, + "New key has non-zero value count"); return true; } static bool test_keyinfo_nums(struct torture_context *tctx, - const void *test_data) + const void *test_data) { uint32_t num_subkeys, num_values; const struct hive_key *root = (const struct hive_key *)test_data; @@ -69,18 +71,18 @@ static bool test_keyinfo_nums(struct torture_context *tctx, struct hive_key *subkey; uint32_t data = 42; - error = hive_key_add_name(tctx, root, "Nested Keyll", NULL, - NULL, &subkey); + error = hive_key_add_name(tctx, root, "Nested Keyll", NULL, + NULL, &subkey); torture_assert_werr_ok(tctx, error, "hive_key_add_name"); - error = hive_set_value(root, "Answer", REG_DWORD, - data_blob_talloc(tctx, &data, sizeof(data))); + error = hive_set_value(root, "Answer", REG_DWORD, + data_blob_talloc(tctx, &data, sizeof(data))); torture_assert_werr_ok(tctx, error, "hive_set_value"); - /* This is a new backend. There should be no subkeys and no + /* This is a new backend. There should be no subkeys and no * values */ - error = hive_key_get_info(tctx, root, NULL, &num_subkeys, &num_values, - NULL); + error = hive_key_get_info(tctx, root, NULL, &num_subkeys, &num_values, + NULL); torture_assert_werr_ok(tctx, error, "reg_key_num_subkeys()"); torture_assert_int_equal(tctx, num_subkeys, 1, "subkey count"); @@ -93,15 +95,15 @@ static bool test_keyinfo_nums(struct torture_context *tctx, } static bool test_add_subkey(struct torture_context *tctx, - const void *test_data) + const void *test_data) { WERROR error; struct hive_key *subkey; const struct hive_key *root = (const struct hive_key *)test_data; TALLOC_CTX *mem_ctx = tctx; - error = hive_key_add_name(mem_ctx, root, "Nested Key", NULL, - NULL, &subkey); + error = hive_key_add_name(mem_ctx, root, "Nested Key", NULL, + NULL, &subkey); torture_assert_werr_ok(tctx, error, "hive_key_add_name"); error = hive_key_del(root, "Nested Key"); @@ -127,8 +129,8 @@ static bool test_del_key(struct torture_context *tctx, const void *test_data) const struct hive_key *root = (const struct hive_key *)test_data; TALLOC_CTX *mem_ctx = tctx; - error = hive_key_add_name(mem_ctx, root, "Nested Key", NULL, - NULL, &subkey); + error = hive_key_add_name(mem_ctx, root, "Nested Key", NULL, + NULL, &subkey); torture_assert_werr_ok(tctx, error, "hive_key_add_name"); error = hive_key_del(root, "Nested Key"); @@ -141,7 +143,7 @@ static bool test_del_key(struct torture_context *tctx, const void *test_data) } static bool test_set_value(struct torture_context *tctx, - const void *test_data) + const void *test_data) { WERROR error; struct hive_key *subkey; @@ -149,12 +151,12 @@ static bool test_set_value(struct torture_context *tctx, TALLOC_CTX *mem_ctx = tctx; uint32_t data = 42; - error = hive_key_add_name(mem_ctx, root, "YA Nested Key", NULL, - NULL, &subkey); + error = hive_key_add_name(mem_ctx, root, "YA Nested Key", NULL, + NULL, &subkey); torture_assert_werr_ok(tctx, error, "hive_key_add_name"); - error = hive_set_value(subkey, "Answer", REG_DWORD, - data_blob_talloc(mem_ctx, &data, sizeof(data))); + error = hive_set_value(subkey, "Answer", REG_DWORD, + data_blob_talloc(mem_ctx, &data, sizeof(data))); torture_assert_werr_ok(tctx, error, "hive_set_value"); return true; @@ -170,16 +172,16 @@ static bool test_get_value(struct torture_context *tctx, const void *test_data) uint32_t type; DATA_BLOB value; - error = hive_key_add_name(mem_ctx, root, "EYA Nested Key", NULL, - NULL, &subkey); + error = hive_key_add_name(mem_ctx, root, "EYA Nested Key", NULL, + NULL, &subkey); 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, - "getting missing value"); + torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + "getting missing value"); - error = hive_set_value(subkey, "Answer", REG_DWORD, - data_blob_talloc(mem_ctx, &data, sizeof(data))); + error = hive_set_value(subkey, "Answer", REG_DWORD, + data_blob_talloc(mem_ctx, &data, sizeof(data))); torture_assert_werr_ok(tctx, error, "hive_set_value"); error = hive_get_value(mem_ctx, subkey, "Answer", &type, &value); @@ -203,12 +205,12 @@ static bool test_del_value(struct torture_context *tctx, const void *test_data) uint32_t type; DATA_BLOB value; - error = hive_key_add_name(mem_ctx, root, "EEYA Nested Key", NULL, + error = hive_key_add_name(mem_ctx, root, "EEYA Nested Key", NULL, NULL, &subkey); torture_assert_werr_ok(tctx, error, "hive_key_add_name"); - error = hive_set_value(subkey, "Answer", REG_DWORD, - data_blob_talloc(mem_ctx, &data, sizeof(data))); + error = hive_set_value(subkey, "Answer", REG_DWORD, + data_blob_talloc(mem_ctx, &data, sizeof(data))); torture_assert_werr_ok(tctx, error, "hive_set_value"); error = hive_del_value(subkey, "Answer"); @@ -218,13 +220,14 @@ static bool test_del_value(struct torture_context *tctx, const void *test_data) torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, "getting value"); error = hive_del_value(subkey, "Answer"); - torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, "deleting value"); + torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + "deleting value"); return true; } -static bool test_list_values(struct torture_context *tctx, - const void *test_data) +static bool test_list_values(struct torture_context *tctx, + const void *test_data) { WERROR error; struct hive_key *subkey; @@ -235,15 +238,16 @@ static bool test_list_values(struct torture_context *tctx, DATA_BLOB value; const char *name; - error = hive_key_add_name(mem_ctx, root, "AYAYA Nested Key", NULL, - NULL, &subkey); + error = hive_key_add_name(mem_ctx, root, "AYAYA Nested Key", NULL, + NULL, &subkey); torture_assert_werr_ok(tctx, error, "hive_key_add_name"); - error = hive_set_value(subkey, "Answer", REG_DWORD, - data_blob_talloc(mem_ctx, &data, sizeof(data))); + error = hive_set_value(subkey, "Answer", REG_DWORD, + data_blob_talloc(mem_ctx, &data, sizeof(data))); torture_assert_werr_ok(tctx, error, "hive_set_value"); - error = hive_get_value_by_index(mem_ctx, subkey, 0, &name, &type, &value); + error = hive_get_value_by_index(mem_ctx, subkey, 0, &name, + &type, &value); torture_assert_werr_ok(tctx, error, "getting value"); torture_assert_str_equal(tctx, name, "Answer", "value name"); @@ -252,26 +256,36 @@ static bool test_list_values(struct torture_context *tctx, torture_assert_int_equal(tctx, value.length, 4, "value length"); torture_assert_int_equal(tctx, type, REG_DWORD, "value type"); - error = hive_get_value_by_index(mem_ctx, subkey, 1, &name, &type, &value); - torture_assert_werr_equal(tctx, error, WERR_NO_MORE_ITEMS, - "getting missing value"); + error = hive_get_value_by_index(mem_ctx, subkey, 1, &name, + &type, &value); + torture_assert_werr_equal(tctx, error, WERR_NO_MORE_ITEMS, + "getting missing value"); return true; } -static void tcase_add_tests(struct torture_tcase *tcase) +static void tcase_add_tests(struct torture_tcase *tcase) { - torture_tcase_add_simple_test(tcase, "del_nonexistant_key", - test_del_nonexistant_key); - torture_tcase_add_simple_test(tcase, "add_subkey", test_add_subkey); - torture_tcase_add_simple_test(tcase, "flush_key", test_flush_key); - torture_tcase_add_simple_test(tcase, "get_info", test_keyinfo_root); - torture_tcase_add_simple_test(tcase, "get_info_nums", test_keyinfo_nums); - torture_tcase_add_simple_test(tcase, "set_value", test_set_value); - torture_tcase_add_simple_test(tcase, "get_value", test_get_value); - torture_tcase_add_simple_test(tcase, "list_values", test_list_values); - torture_tcase_add_simple_test(tcase, "del_key", test_del_key); - torture_tcase_add_simple_test(tcase, "del_value", test_del_value); + torture_tcase_add_simple_test(tcase, "del_nonexistant_key", + test_del_nonexistant_key); + torture_tcase_add_simple_test(tcase, "add_subkey", + test_add_subkey); + torture_tcase_add_simple_test(tcase, "flush_key", + test_flush_key); + torture_tcase_add_simple_test(tcase, "get_info", + test_keyinfo_root); + torture_tcase_add_simple_test(tcase, "get_info_nums", + test_keyinfo_nums); + torture_tcase_add_simple_test(tcase, "set_value", + test_set_value); + torture_tcase_add_simple_test(tcase, "get_value", + test_get_value); + torture_tcase_add_simple_test(tcase, "list_values", + test_list_values); + torture_tcase_add_simple_test(tcase, "del_key", + test_del_key); + torture_tcase_add_simple_test(tcase, "del_value", + test_del_value); } static bool hive_setup_dir(struct torture_context *tctx, void **data) @@ -348,21 +362,19 @@ static bool hive_setup_regf(struct torture_context *tctx, void **data) static bool test_dir_refuses_null_location(struct torture_context *tctx) { - torture_assert_werr_equal(tctx, WERR_INVALID_PARAM, - reg_open_directory(NULL, NULL, NULL), - "reg_open_directory accepts NULL location"); + torture_assert_werr_equal(tctx, WERR_INVALID_PARAM, + reg_open_directory(NULL, NULL, NULL), + "reg_open_directory accepts NULL location"); return true; } -struct torture_suite *torture_registry_hive(TALLOC_CTX *mem_ctx) +struct torture_suite *torture_registry_hive(TALLOC_CTX *mem_ctx) { struct torture_tcase *tcase; - struct torture_suite *suite = torture_suite_create(mem_ctx, - "HIVE"); - - torture_suite_add_simple_test(suite, "dir-refuses-null-location", - test_dir_refuses_null_location); + struct torture_suite *suite = torture_suite_create(mem_ctx, "HIVE"); + torture_suite_add_simple_test(suite, "dir-refuses-null-location", + test_dir_refuses_null_location); tcase = torture_suite_add_tcase(suite, "dir"); torture_tcase_set_fixture(tcase, hive_setup_dir, NULL); diff --git a/source4/lib/registry/tests/registry.c b/source4/lib/registry/tests/registry.c index 962c7fd2b5..9b1c6ff249 100644 --- a/source4/lib/registry/tests/registry.c +++ b/source4/lib/registry/tests/registry.c @@ -1,20 +1,20 @@ -/* +/* Unix SMB/CIFS implementation. local testing of registry library - registry backend Copyright (C) Jelmer Vernooij 2005-2007 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -32,16 +32,16 @@ * Test obtaining a predefined key. */ static bool test_get_predefined(struct torture_context *tctx, - const void *_data) + const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *root; WERROR error; error = reg_get_predefined_key(rctx, HKEY_CLASSES_ROOT, &root); - torture_assert_werr_ok(tctx, error, - "getting predefined key failed"); + torture_assert_werr_ok(tctx, error, + "getting predefined key failed"); return true; } @@ -49,7 +49,7 @@ static bool test_get_predefined(struct torture_context *tctx, * Test obtaining a predefined key. */ static bool test_get_predefined_unknown(struct torture_context *tctx, - const void *_data) + const void *_data) { const struct registry_context *rctx = _data; struct registry_key *root; @@ -57,40 +57,42 @@ static bool test_get_predefined_unknown(struct torture_context *tctx, error = reg_get_predefined_key(rctx, 1337, &root); torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, - "getting predefined key failed"); + "getting predefined key failed"); return true; } static bool test_predef_key_by_name(struct torture_context *tctx, - const void *_data) + const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_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 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"); + 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 void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *root; WERROR error; error = reg_get_predefined_key_by_name(rctx, "BLA", &root); torture_assert_werr_equal(tctx, error, WERR_BADFILE, - "getting predefined key failed"); + "getting predefined key failed"); return true; } @@ -98,18 +100,19 @@ static bool test_predef_key_by_name_invalid(struct torture_context *tctx, * Test creating a new subkey */ static bool test_create_subkey(struct torture_context *tctx, - const void *_data) + const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *root, *newkey; WERROR error; error = reg_get_predefined_key(rctx, HKEY_CLASSES_ROOT, &root); - torture_assert_werr_ok(tctx, error, - "getting predefined key failed"); + torture_assert_werr_ok(tctx, error, + "getting predefined key failed"); - error = reg_key_add_name(rctx, root, "Bad Bentheim", NULL, NULL, &newkey); + error = reg_key_add_name(rctx, root, "Bad Bentheim", NULL, NULL, + &newkey); torture_assert_werr_ok(tctx, error, "Creating key return code"); torture_assert(tctx, newkey != NULL, "Creating new key"); @@ -120,24 +123,24 @@ static bool test_create_subkey(struct torture_context *tctx, * Test creating a new nested subkey */ static bool test_create_nested_subkey(struct torture_context *tctx, - const void *_data) + const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *root, *newkey1, *newkey2; WERROR error; error = reg_get_predefined_key(rctx, HKEY_CLASSES_ROOT, &root); - torture_assert_werr_ok(tctx, error, - "getting predefined key failed"); + torture_assert_werr_ok(tctx, error, + "getting predefined key failed"); - error = reg_key_add_name(rctx, root, "Hamburg", NULL, NULL, - &newkey1); + error = reg_key_add_name(rctx, root, "Hamburg", NULL, NULL, + &newkey1); torture_assert_werr_ok(tctx, error, "Creating key return code"); torture_assert(tctx, newkey1 != NULL, "Creating new key"); - error = reg_key_add_name(rctx, root, "Hamburg\\Hamburg", NULL, NULL, - &newkey2); + error = reg_key_add_name(rctx, root, "Hamburg\\Hamburg", NULL, NULL, + &newkey2); torture_assert_werr_ok(tctx, error, "Creating key return code"); torture_assert(tctx, newkey2 != NULL, "Creating new key"); @@ -148,15 +151,17 @@ static bool test_create_nested_subkey(struct torture_context *tctx, * Test creating a new subkey */ static bool test_key_add_abs_top(struct torture_context *tctx, - const void *_data) + const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *root; WERROR error; - error = reg_key_add_abs(tctx, rctx, "HKEY_CLASSES_ROOT", 0, NULL, &root); - torture_assert_werr_equal(tctx, error, WERR_ALREADY_EXISTS, "create top level"); + error = reg_key_add_abs(tctx, rctx, "HKEY_CLASSES_ROOT", 0, NULL, + &root); + torture_assert_werr_equal(tctx, error, WERR_ALREADY_EXISTS, + "create top level"); return true; } @@ -165,22 +170,24 @@ static bool test_key_add_abs_top(struct torture_context *tctx, * Test creating a new subkey */ static bool test_key_add_abs(struct torture_context *tctx, - const void *_data) + const void *_data) { WERROR error; - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *root, *result1, *result2; - error = reg_key_add_abs(tctx, rctx, "HKEY_CLASSES_ROOT\\bloe", 0, NULL, &result1); + error = reg_key_add_abs(tctx, rctx, "HKEY_CLASSES_ROOT\\bloe", 0, NULL, + &result1); torture_assert_werr_ok(tctx, error, "create lowest"); - error = reg_key_add_abs(tctx, rctx, "HKEY_CLASSES_ROOT\\bloe\\bla", 0, NULL, &result1); + error = reg_key_add_abs(tctx, rctx, "HKEY_CLASSES_ROOT\\bloe\\bla", 0, + NULL, &result1); torture_assert_werr_ok(tctx, error, "create nested"); error = reg_get_predefined_key(rctx, HKEY_CLASSES_ROOT, &root); - torture_assert_werr_ok(tctx, error, - "getting predefined key failed"); + torture_assert_werr_ok(tctx, error, + "getting predefined key failed"); error = reg_open_key(tctx, root, "bloe", &result2); torture_assert_werr_ok(tctx, error, "opening key"); @@ -194,14 +201,14 @@ static bool test_key_add_abs(struct torture_context *tctx, static bool test_del_key(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *root, *newkey; WERROR error; error = reg_get_predefined_key(rctx, HKEY_CLASSES_ROOT, &root); - torture_assert_werr_ok(tctx, error, - "getting predefined key failed"); + torture_assert_werr_ok(tctx, error, + "getting predefined key failed"); error = reg_key_add_name(rctx, root, "Hamburg", NULL, NULL, &newkey); @@ -212,27 +219,27 @@ static bool test_del_key(struct torture_context *tctx, const void *_data) torture_assert_werr_ok(tctx, error, "Delete key"); error = reg_key_del(root, "Hamburg"); - torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, - "Delete missing key"); + torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + "Delete missing key"); return true; } /** - * Convenience function for opening the HKEY_CLASSES_ROOT hive and + * Convenience function for opening the HKEY_CLASSES_ROOT hive and * creating a single key for testing purposes. */ -static bool create_test_key(struct torture_context *tctx, - const struct registry_context *rctx, - const char *name, - struct registry_key **root, - struct registry_key **subkey) +static bool create_test_key(struct torture_context *tctx, + const struct registry_context *rctx, + const char *name, + struct registry_key **root, + struct registry_key **subkey) { WERROR error; error = reg_get_predefined_key(rctx, HKEY_CLASSES_ROOT, root); - torture_assert_werr_ok(tctx, error, - "getting predefined key failed"); + torture_assert_werr_ok(tctx, error, + "getting predefined key failed"); error = reg_key_add_name(rctx, *root, name, NULL, NULL, subkey); torture_assert_werr_ok(tctx, error, "Creating key return code"); @@ -243,7 +250,7 @@ static bool create_test_key(struct torture_context *tctx, static bool test_flush_key(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *root, *subkey; WERROR error; @@ -254,15 +261,15 @@ static bool test_flush_key(struct torture_context *tctx, const void *_data) error = reg_key_flush(subkey); torture_assert_werr_ok(tctx, error, "flush key"); - torture_assert_werr_equal(tctx, reg_key_flush(NULL), - WERR_INVALID_PARAM, "flush key"); + torture_assert_werr_equal(tctx, reg_key_flush(NULL), + WERR_INVALID_PARAM, "flush key"); return true; } static bool test_query_key(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *root, *subkey; WERROR error; @@ -274,8 +281,8 @@ static bool test_query_key(struct torture_context *tctx, const void *_data) return false; error = reg_key_get_info(tctx, subkey, &classname, - &num_subkeys, &num_values, - &last_changed_time); + &num_subkeys, &num_values, + &last_changed_time); torture_assert_werr_ok(tctx, error, "get info key"); torture_assert(tctx, classname == NULL, "classname"); @@ -287,7 +294,7 @@ static bool test_query_key(struct torture_context *tctx, const void *_data) static bool test_query_key_nums(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *root, *subkey1, *subkey2; WERROR error; @@ -297,15 +304,16 @@ static bool test_query_key_nums(struct torture_context *tctx, const void *_data) if (!create_test_key(tctx, rctx, "Berlin", &root, &subkey1)) return false; - error = reg_key_add_name(rctx, subkey1, "Bentheim", NULL, NULL, &subkey2); + error = reg_key_add_name(rctx, subkey1, "Bentheim", NULL, NULL, + &subkey2); torture_assert_werr_ok(tctx, error, "Creating key return code"); - error = reg_val_set(subkey1, "Answer", REG_DWORD, - data_blob_talloc(tctx, &data, sizeof(data))); + error = reg_val_set(subkey1, "Answer", REG_DWORD, + data_blob_talloc(tctx, &data, sizeof(data))); torture_assert_werr_ok(tctx, error, "set value"); error = reg_key_get_info(tctx, subkey1, NULL, &num_subkeys, - &num_values, NULL); + &num_values, NULL); torture_assert_werr_ok(tctx, error, "get info key"); torture_assert_int_equal(tctx, num_subkeys, 1, "num subkeys"); @@ -315,13 +323,13 @@ static bool test_query_key_nums(struct torture_context *tctx, const void *_data) } /** - * Test that the subkeys of a key can be enumerated, that - * the returned parameters for get_subkey_by_index are optional and + * Test that the subkeys of a key can be enumerated, that + * the returned parameters for get_subkey_by_index are optional and * that enumerating the parents of a non-top-level node works. */ static bool test_list_subkeys(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; @@ -331,8 +339,8 @@ static bool test_list_subkeys(struct torture_context *tctx, const void *_data) if (!create_test_key(tctx, rctx, "Goettingen", &root, &subkey)) return false; - error = reg_key_get_subkey_by_index(tctx, root, 0, &name, &classname, - &last_mod_time); + error = reg_key_get_subkey_by_index(tctx, root, 0, &name, &classname, + &last_mod_time); torture_assert_werr_ok(tctx, error, "Enum keys return code"); torture_assert_str_equal(tctx, name, "Goettingen", "Enum keys data"); @@ -340,17 +348,18 @@ static bool test_list_subkeys(struct torture_context *tctx, const void *_data) error = reg_key_get_subkey_by_index(tctx, root, 0, NULL, NULL, NULL); - torture_assert_werr_ok(tctx, error, "Enum keys with NULL arguments return code"); + torture_assert_werr_ok(tctx, error, + "Enum keys with NULL arguments return code"); error = reg_key_get_subkey_by_index(tctx, root, 1, NULL, NULL, NULL); - - torture_assert_werr_equal(tctx, error, WERR_NO_MORE_ITEMS, - "Invalid error for no more items"); + + torture_assert_werr_equal(tctx, error, WERR_NO_MORE_ITEMS, + "Invalid error for no more items"); error = reg_key_get_subkey_by_index(tctx, subkey, 0, NULL, NULL, NULL); - - torture_assert_werr_equal(tctx, error, WERR_NO_MORE_ITEMS, - "Invalid error for no more items"); + + torture_assert_werr_equal(tctx, error, WERR_NO_MORE_ITEMS, + "Invalid error for no more items"); return true; } @@ -360,7 +369,7 @@ static bool test_list_subkeys(struct torture_context *tctx, const void *_data) */ static bool test_set_value(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; @@ -369,8 +378,8 @@ static bool test_set_value(struct torture_context *tctx, const void *_data) if (!create_test_key(tctx, rctx, "Dusseldorf", &root, &subkey)) return false; - error = reg_val_set(subkey, "Answer", REG_DWORD, - data_blob_talloc(tctx, &data, sizeof(data))); + error = reg_val_set(subkey, "Answer", REG_DWORD, + data_blob_talloc(tctx, &data, sizeof(data))); torture_assert_werr_ok (tctx, error, "setting value"); return true; @@ -381,7 +390,7 @@ static bool test_set_value(struct torture_context *tctx, const void *_data) */ static bool test_security(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; @@ -391,12 +400,12 @@ static bool test_security(struct torture_context *tctx, const void *_data) return false; osd = security_descriptor_create(tctx, - NULL, NULL, - SID_NT_AUTHENTICATED_USERS, - SEC_ACE_TYPE_ACCESS_ALLOWED, - SEC_GENERIC_ALL, - SEC_ACE_FLAG_OBJECT_INHERIT, - NULL); + NULL, NULL, + SID_NT_AUTHENTICATED_USERS, + SEC_ACE_TYPE_ACCESS_ALLOWED, + SEC_GENERIC_ALL, + SEC_ACE_FLAG_OBJECT_INHERIT, + NULL); error = reg_set_security(subkey, osd); torture_assert_werr_ok(tctx, error, "setting security"); @@ -404,8 +413,8 @@ static bool test_security(struct torture_context *tctx, const void *_data) error = reg_get_security(tctx, subkey, &nsd); torture_assert_werr_ok (tctx, error, "setting security"); - torture_assert(tctx, security_descriptor_equal(osd, nsd), - "security descriptor changed!"); + torture_assert(tctx, security_descriptor_equal(osd, nsd), + "security descriptor changed!"); return true; } @@ -415,7 +424,7 @@ static bool test_security(struct torture_context *tctx, const void *_data) */ static bool test_get_value(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; @@ -426,21 +435,22 @@ static bool test_get_value(struct torture_context *tctx, const void *_data) if (!create_test_key(tctx, rctx, "Duisburg", &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, - "getting missing value"); + error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, &type, + &data); + torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + "getting missing value"); - error = reg_val_set(subkey, __FUNCTION__, REG_DWORD, - data_blob_talloc(tctx, &value, 4)); - torture_assert_werr_ok (tctx, error, "setting value"); + error = reg_val_set(subkey, __FUNCTION__, REG_DWORD, + data_blob_talloc(tctx, &value, 4)); + torture_assert_werr_ok(tctx, error, "setting value"); - error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, &type, - &data); + error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, &type, + &data); torture_assert_werr_ok(tctx, error, "getting value"); torture_assert_int_equal(tctx, 4, data.length, "value length ok"); - torture_assert(tctx, memcmp(data.data, &value, 4) == 0, "value content ok"); + torture_assert(tctx, memcmp(data.data, &value, 4) == 0, + "value content ok"); torture_assert_int_equal(tctx, REG_DWORD, type, "value type"); return true; @@ -451,7 +461,7 @@ static bool test_get_value(struct torture_context *tctx, const void *_data) */ static bool test_del_value(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; @@ -462,21 +472,22 @@ static bool test_del_value(struct torture_context *tctx, const void *_data) if (!create_test_key(tctx, rctx, "Duisburg", &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, - "getting missing value"); + error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, &type, + &data); + torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + "getting missing value"); - error = reg_val_set(subkey, __FUNCTION__, REG_DWORD, - data_blob_talloc(tctx, &value, 4)); + error = reg_val_set(subkey, __FUNCTION__, REG_DWORD, + data_blob_talloc(tctx, &value, 4)); torture_assert_werr_ok (tctx, error, "setting value"); error = reg_del_value(subkey, __FUNCTION__); torture_assert_werr_ok (tctx, error, "unsetting value"); - error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, &type, &data); - torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, - "getting missing value"); + error = reg_key_get_value_by_name(tctx, subkey, __FUNCTION__, + &type, &data); + torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND, + "getting missing value"); return true; } @@ -486,7 +497,7 @@ static bool test_del_value(struct torture_context *tctx, const void *_data) */ static bool test_list_values(struct torture_context *tctx, const void *_data) { - const struct registry_context *rctx = + const struct registry_context *rctx = (const struct registry_context *)_data; struct registry_key *subkey = NULL, *root; WERROR error; @@ -498,21 +509,24 @@ static bool test_list_values(struct torture_context *tctx, const void *_data) 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)); + error = reg_val_set(subkey, "bar", REG_DWORD, + data_blob_talloc(tctx, &value, 4)); torture_assert_werr_ok (tctx, error, "setting value"); - error = reg_key_get_value_by_index(tctx, subkey, 0, &name, &type, &data); + error = reg_key_get_value_by_index(tctx, subkey, 0, &name, + &type, &data); torture_assert_werr_ok(tctx, error, "getting value"); torture_assert_str_equal(tctx, name, "bar", "value name"); torture_assert_int_equal(tctx, 4, data.length, "value length"); - torture_assert(tctx, memcmp(data.data, &value, 4) == 0, "value content"); + torture_assert(tctx, memcmp(data.data, &value, 4) == 0, + "value content"); torture_assert_int_equal(tctx, REG_DWORD, type, "value type"); - error = reg_key_get_value_by_index(tctx, subkey, 1, &name, &type, &data); - torture_assert_werr_equal(tctx, error, WERR_NO_MORE_ITEMS, - "getting missing value"); + error = reg_key_get_value_by_index(tctx, subkey, 1, &name, + &type, &data); + torture_assert_werr_equal(tctx, error, WERR_NO_MORE_ITEMS, + "getting missing value"); return true; } @@ -546,33 +560,49 @@ static bool setup_local_registry(struct torture_context *tctx, void **data) static void tcase_add_tests(struct torture_tcase *tcase) { - torture_tcase_add_simple_test(tcase, "list_subkeys", test_list_subkeys); - torture_tcase_add_simple_test(tcase, "get_predefined_key", test_get_predefined); - torture_tcase_add_simple_test(tcase, "get_predefined_key", test_get_predefined_unknown); - torture_tcase_add_simple_test(tcase, "create_key", test_create_subkey); - torture_tcase_add_simple_test(tcase, "create_key", test_create_nested_subkey); - torture_tcase_add_simple_test(tcase, "key_add_abs", test_key_add_abs); - torture_tcase_add_simple_test(tcase, "key_add_abs_top", test_key_add_abs_top); - torture_tcase_add_simple_test(tcase, "set_value", test_set_value); - torture_tcase_add_simple_test(tcase, "get_value", test_get_value); - torture_tcase_add_simple_test(tcase, "list_values", test_list_values); - torture_tcase_add_simple_test(tcase, "del_key", test_del_key); - torture_tcase_add_simple_test(tcase, "del_value", test_del_value); - 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", + torture_tcase_add_simple_test(tcase, "list_subkeys", + test_list_subkeys); + torture_tcase_add_simple_test(tcase, "get_predefined_key", + test_get_predefined); + torture_tcase_add_simple_test(tcase, "get_predefined_key", + test_get_predefined_unknown); + torture_tcase_add_simple_test(tcase, "create_key", + test_create_subkey); + torture_tcase_add_simple_test(tcase, "create_key", + test_create_nested_subkey); + torture_tcase_add_simple_test(tcase, "key_add_abs", + test_key_add_abs); + torture_tcase_add_simple_test(tcase, "key_add_abs_top", + test_key_add_abs_top); + torture_tcase_add_simple_test(tcase, "set_value", + test_set_value); + torture_tcase_add_simple_test(tcase, "get_value", + test_get_value); + torture_tcase_add_simple_test(tcase, "list_values", + test_list_values); + torture_tcase_add_simple_test(tcase, "del_key", + test_del_key); + torture_tcase_add_simple_test(tcase, "del_value", + test_del_value); + 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, "security", test_security); - torture_tcase_add_simple_test(tcase, "test_predef_key_by_name_invalid", + torture_tcase_add_simple_test(tcase, "security", + test_security); + 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) +struct torture_suite *torture_registry_registry(TALLOC_CTX *mem_ctx) { struct torture_tcase *tcase; struct torture_suite *suite = torture_suite_create(mem_ctx, "REGISTRY"); - + tcase = torture_suite_add_tcase(suite, "local"); torture_tcase_set_fixture(tcase, setup_local_registry, NULL); tcase_add_tests(tcase); |