Rev 11186: Get the tests building and running again (don't pass yet though). in file:///home/jelmer/bzr.samba-old/4.0-regwrite/

Jelmer Vernooij jelmer at samba.org
Wed Jun 13 17:38:16 GMT 2007


At file:///home/jelmer/bzr.samba-old/4.0-regwrite/

------------------------------------------------------------
revno: 11186
revision-id: jelmer at samba.org-20070612165440-1x7k1m3nb1bzbal0
parent: jelmer at samba.org-20070611134928-pew4ydd6a0qnh3iv
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 4.0-regwrite
timestamp: Tue 2007-06-12 18:54:40 +0200
message:
  Get the tests building and running again (don't pass yet though).
added:
  source/lib/registry/tests/hive.c hive.c-20070612151642-hsxkm8j4r69ej3px-1
modified:
  source/lib/registry/creg.c     svn-v2:4132 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2freg_backend_w95.c
  source/lib/registry/dir.c      svn-v2:4132 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2freg_backend_dir.c
  source/lib/registry/hive.c     hive.c-20070602140117-9a3wth1mhbrq7ej1-1
  source/lib/registry/hive.h     hive.h-20070423140448-w1nvzs8d2qxvyswz-1
  source/lib/registry/interface.c svn-v2:20 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2fcommon%2freg_interface.c
  source/lib/registry/ldb.c      svn-v2:4132 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2freg_backend_ldb.c
  source/lib/registry/local.c    local.c-20070602140117-9a3wth1mhbrq7ej1-2
  source/lib/registry/patchfile.c svn-v2:10605 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2fpatchfile.c
  source/lib/registry/patchfile_dotreg.c patchfile_dotreg.c-20070114041738-0dfmkdtsa8bfu20l-1
  source/lib/registry/samba.c    svn-v2:4132 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2freg_samba.c
  source/lib/registry/tests/generic.c svn-v2:21656 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2ftests%2fgeneric.c
  source/lib/registry/tools/regdiff.c svn-v2:20 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2ftools%2fregdiff.c
  source/lib/registry/tools/regpatch.c svn-v2:20 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2ftools%2fregpatch.c
  source/lib/registry/tools/regshell.c svn-v2:20 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2ftools%2fregshell.c
  source/lib/registry/tools/regtree.c svn-v2:20 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2ftools%2fregtree.c
  source/lib/registry/util.c     svn-v2:20 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2fcommon%2freg_util.c
  source/lib/registry/wine.c     svn-v2:4132 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2flib%2fregistry%2freg_backend_wine.c
  source/torture/local/config.mk svn-v2:12008 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2ftorture%2flocal%2fconfig.mk
  source/torture/ui.c            svn-v2:14718 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2ftorture%2fui.c
  source/torture/ui.h            svn-v2:14718 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2ftorture%2fui.h
=== added file 'source/lib/registry/tests/hive.c'
--- a/source/lib/registry/tests/hive.c	1970-01-01 00:00:00 +0000
+++ b/source/lib/registry/tests/hive.c	2007-06-12 16:54:40 +0000
@@ -0,0 +1,101 @@
+/* 
+   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.
+*/
+
+#include "includes.h"
+#include "lib/registry/registry.h"
+#include "lib/cmdline/popt_common.h"
+#include "torture/torture.h"
+#include "librpc/gen_ndr/winreg.h"
+
+static bool test_del_nonexistant_key(struct torture_context *tctx,
+									 const void *test_data)
+{
+	const struct hive_key *root = test_data;
+	WERROR error = hive_key_del(root, "bla");
+	torture_assert_werr_equal(tctx, error, WERR_BADFILE, 
+							  "invalid return code");
+
+	return true;
+}
+
+static bool test_keyinfo_root(struct torture_context *tctx,
+						 const void *test_data)
+{
+	uint32_t num_subkeys, num_values;
+	const struct hive_key *root = test_data;
+	WERROR error;
+
+	/* 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);
+	torture_assert_werr_ok(tctx, error, "reg_key_num_subkeys()");
+
+	torture_assert(tctx, num_subkeys != 0, "New key has non-zero subkey count");
+
+	torture_assert_werr_ok(tctx, error, "reg_key_num_values");
+
+	torture_assert(tctx, num_values != 0, "New key has non-zero value count");
+
+	return true;
+}
+
+static bool test_add_subkey(struct torture_context *tctx,
+					  const void *test_data)
+{
+	WERROR error;
+	struct hive_key *subkey;
+	const struct hive_key *root = test_data;
+	TALLOC_CTX *mem_ctx = tctx;
+
+	error = hive_key_add_name(mem_ctx, root, "Nested Key", NULL, 
+							 NULL, &subkey);
+	torture_assert_werr_ok(tctx, error, "reg_key_add_name");
+
+	error = hive_key_del(root, "Nested Key");
+	torture_assert_werr_ok(tctx, error, "reg_key_del");
+
+	return true;
+}
+
+struct torture_suite *torture_registry_hive(TALLOC_CTX *mem_ctx) 
+{
+	struct torture_tcase *tcase;
+	struct torture_suite *suite = torture_suite_create(mem_ctx, 
+													   "HIVE");
+
+	struct hive_key *key;
+
+	reg_create_directory(mem_ctx, "bla", &key);
+
+	tcase = torture_suite_add_tcase(suite, "dir");
+	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, "get_info", 
+								  test_keyinfo_root);
+
+	return suite;
+}

=== modified file 'source/lib/registry/creg.c'
--- a/source/lib/registry/creg.c	2007-06-02 15:25:04 +0000
+++ b/source/lib/registry/creg.c	2007-06-12 16:54:40 +0000
@@ -1,6 +1,6 @@
 /*
    Samba Unix/Linux SMB client utility libeditreg.c 
-   Copyright (C) 2004 Jelmer Vernooij, jelmer at samba.org
+   Copyright (C) 2004-2007 Jelmer Vernooij, jelmer at samba.org
 
    Backend for Windows '95 registry files. Explanation of file format 
    comes from http://www.cs.mun.ca/~michael/regutils/.

=== modified file 'source/lib/registry/dir.c'
--- a/source/lib/registry/dir.c	2007-06-08 21:56:52 +0000
+++ b/source/lib/registry/dir.c	2007-06-12 16:54:40 +0000
@@ -1,7 +1,7 @@
 /* 
    Unix SMB/CIFS implementation.
    Registry interface
-   Copyright (C) Jelmer Vernooij					  2004.
+   Copyright (C) Jelmer Vernooij					  2004-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
@@ -155,6 +155,16 @@
 	return WERR_OK;
 }
 
+WERROR reg_create_directory(TALLOC_CTX *parent_ctx, 
+							const char *location, struct hive_key **key)
+{
+	if (mkdir(location, 0644) != 0) {
+		return WERR_GENERAL_FAILURE;
+	}
+
+	return reg_open_directory(parent_ctx, location, key);
+}
+
 static struct hive_operations reg_backend_dir = {
 	.name = "dir",
 	.get_key_by_name = reg_dir_open_key,

=== modified file 'source/lib/registry/hive.c'
--- a/source/lib/registry/hive.c	2007-06-02 14:03:25 +0000
+++ b/source/lib/registry/hive.c	2007-06-12 16:54:40 +0000
@@ -23,19 +23,6 @@
 #include "hive.h"
 #include "system/filesys.h"
 
-WERROR reg_open_directory(TALLOC_CTX *parent_ctx, 
-			const char *location, struct hive_key **key);
-WERROR reg_open_creg_file(TALLOC_CTX *parent_ctx, const char *location, 
-						  struct hive_key **root);
-WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx, 
-						  const char *location, struct hive_key **key);
-WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location, 
-								struct auth_session_info *session_info,
-								struct cli_credentials *credentials,
-								struct hive_key **k);
-
-
-
 /** Open a registry file/host/etc */
 _PUBLIC_ WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location, 
 							  struct auth_session_info *session_info, 
@@ -74,4 +61,23 @@
 	return WERR_BADFILE;
 }
 
-
+_PUBLIC_ WERROR hive_key_get_info(TALLOC_CTX *mem_ctx, const struct hive_key *key,
+						 const char **classname, uint32_t *num_subkeys, 
+						 uint32_t *num_values,
+						 NTTIME *last_change_time)
+{
+	return key->context->ops->get_key_info(mem_ctx, key, classname, num_subkeys, 
+									num_values, last_change_time);
+}
+
+_PUBLIC_ WERROR hive_key_add_name(TALLOC_CTX *ctx, const struct hive_key *parent_key,
+						 const char *name, const char *classname, struct security_descriptor *desc,
+						 struct hive_key **key)
+{
+	return parent_key->context->ops->add_key(ctx, parent_key, name, classname, desc, key);
+}
+
+_PUBLIC_ WERROR hive_key_del(const struct hive_key *key, const char *name)
+{
+	return key->context->ops->del_key(key, name);
+}

=== modified file 'source/lib/registry/hive.h'
--- a/source/lib/registry/hive.h	2007-06-10 22:26:52 +0000
+++ b/source/lib/registry/hive.h	2007-06-12 16:54:40 +0000
@@ -72,13 +72,13 @@
 	 * Add a new key.
 	 */
 	WERROR (*add_key) (TALLOC_CTX *ctx,
-					   struct hive_key *parent_key, const char *name, 
-					   uint32_t access_mask, struct security_descriptor *desc, 
+					   const struct hive_key *parent_key, const char *name, 
+					   const char *classname, struct security_descriptor *desc, 
 					   struct hive_key **key);
 	/**
 	 * Remove an existing key.
 	 */
-	WERROR (*del_key) (struct hive_key *key, const char *name);
+	WERROR (*del_key) (const struct hive_key *key, const char *name);
 
 	/**
 	 * Force write of a key to disk.
@@ -151,5 +151,31 @@
 							  struct auth_session_info *session_info, 
 							  struct cli_credentials *credentials, 
 							  struct hive_key **root);
+WERROR hive_key_get_info(TALLOC_CTX *mem_ctx, const struct hive_key *key,
+						 const char **classname, uint32_t *num_subkeys, 
+						 uint32_t *num_values,
+						 NTTIME *last_change_time);
+WERROR hive_key_add_name(TALLOC_CTX *ctx, const struct hive_key *parent_key,
+						 const char *name, const char *classname, struct security_descriptor *desc,
+						 struct hive_key **key);
+_PUBLIC_ WERROR hive_key_del(const struct hive_key *key, const char *name);
+
+
+/* Individual backends */
+WERROR reg_open_directory(TALLOC_CTX *parent_ctx, 
+			const char *location, struct hive_key **key);
+WERROR reg_open_creg_file(TALLOC_CTX *parent_ctx, const char *location, 
+						  struct hive_key **root);
+WERROR reg_open_regf_file(TALLOC_CTX *parent_ctx, 
+						  const char *location, struct hive_key **key);
+WERROR reg_open_ldb_file(TALLOC_CTX *parent_ctx, const char *location, 
+								struct auth_session_info *session_info,
+								struct cli_credentials *credentials,
+								struct hive_key **k);
+
+
+WERROR reg_create_directory(TALLOC_CTX *parent_ctx, 
+			const char *location, struct hive_key **key);
+
 
 #endif /* __REGISTRY_HIVE_H__ */

=== modified file 'source/lib/registry/interface.c'
--- a/source/lib/registry/interface.c	2007-06-10 22:26:52 +0000
+++ b/source/lib/registry/interface.c	2007-06-12 16:54:40 +0000
@@ -1,7 +1,7 @@
 /* 
    Unix SMB/CIFS implementation.
    Transparent registry backend handling
-   Copyright (C) Jelmer Vernooij			2003-2004.
+   Copyright (C) Jelmer Vernooij			2003-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

=== modified file 'source/lib/registry/ldb.c'
--- a/source/lib/registry/ldb.c	2007-06-08 21:56:52 +0000
+++ b/source/lib/registry/ldb.c	2007-06-12 16:54:40 +0000
@@ -1,7 +1,7 @@
 /* 
    Unix SMB/CIFS implementation.
    Registry interface
-   Copyright (C) Jelmer Vernooij  2004.
+   Copyright (C) Jelmer Vernooij  2004-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

=== modified file 'source/lib/registry/local.c'
--- a/source/lib/registry/local.c	2007-06-08 21:56:52 +0000
+++ b/source/lib/registry/local.c	2007-06-12 16:54:40 +0000
@@ -1,7 +1,7 @@
 /* 
    Unix SMB/CIFS implementation.
    Transparent registry backend handling
-   Copyright (C) Jelmer Vernooij			2003-2004.
+   Copyright (C) Jelmer Vernooij			2003-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
@@ -45,7 +45,8 @@
 	struct hive_key hive;
 };
 
-WERROR reg_mount_hive(struct registry_context *ctx, struct reg_key_path *path, struct hive_context *hive);
+WERROR reg_mount_hive(struct registry_context *ctx, struct reg_key_path *path, 
+					  struct hive_context *hive);
 WERROR reg_unmount_hive(struct registry_context *ctx, struct hive_context *hive);
 
 static WERROR local_open_key(TALLOC_CTX *mem_ctx,
@@ -59,11 +60,11 @@
 	struct registry_key *curkey = parent;
 	WERROR error;
 
-	while(curbegin && *curbegin) {
+	while (curbegin && *curbegin) {
 		if (curend != NULL)
 			*curend = '\0';
 		error = reg_open_key(mem_ctx, curkey, curbegin, &curkey);
-		if(!W_ERROR_IS_OK(error)) {
+		if (!W_ERROR_IS_OK(error)) {
 			SAFE_FREE(orig);
 			return error;
 		}
@@ -98,5 +99,3 @@
 	
 	return WERR_OK;
 }
-
-

=== modified file 'source/lib/registry/patchfile.c'
--- a/source/lib/registry/patchfile.c	2007-06-10 22:26:52 +0000
+++ b/source/lib/registry/patchfile.c	2007-06-12 16:54:40 +0000
@@ -2,7 +2,7 @@
    Unix SMB/CIFS implementation.
    Reading registry patch files
    
-   Copyright (C) Jelmer Vernooij 2004,2006
+   Copyright (C) Jelmer Vernooij 2004-2007
    Copyright (C) Wilco Baan Hofman 2006
 
    This program is free software; you can redistribute it and/or modify

=== modified file 'source/lib/registry/patchfile_dotreg.c'
--- a/source/lib/registry/patchfile_dotreg.c	2007-06-10 22:26:52 +0000
+++ b/source/lib/registry/patchfile_dotreg.c	2007-06-12 16:54:40 +0000
@@ -2,7 +2,7 @@
    Unix SMB/CIFS implementation.
    Reading .REG files
    
-   Copyright (C) Jelmer Vernooij 2004,2006
+   Copyright (C) Jelmer Vernooij 2004-2007
    Copyright (C) Wilco Baan Hofman 2006
 
    This program is free software; you can redistribute it and/or modify

=== modified file 'source/lib/registry/samba.c'
--- a/source/lib/registry/samba.c	2007-06-02 14:03:25 +0000
+++ b/source/lib/registry/samba.c	2007-06-12 16:54:40 +0000
@@ -1,6 +1,6 @@
 /* 
    Unix SMB/CIFS implementation.
-   Copyright (C) Jelmer Vernooij			2004.
+   Copyright (C) Jelmer Vernooij			2004-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

=== modified file 'source/lib/registry/tests/generic.c'
--- a/source/lib/registry/tests/generic.c	2007-06-10 22:26:52 +0000
+++ b/source/lib/registry/tests/generic.c	2007-06-12 16:54:40 +0000
@@ -3,7 +3,7 @@
 
    local testing of registry library
 
-   Copyright (C) Jelmer Vernooij 2005
+   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
@@ -26,51 +26,7 @@
 #include "torture/torture.h"
 #include "librpc/gen_ndr/winreg.h"
 
-const static struct test_backend_settings {
-	const char *name;
-	const char *location;
-} backends[] = {
-	{ "nt4", "TEST.DAT" },
-	{ "ldb", "test.ldb" },
-	{ "gconf", "." },
-	{ "dir", "." },
-	{ NULL, NULL }
-};
-
-static bool test_hive(struct torture_context *tctx,
-					  const void *test_data)
-{
-	WERROR error;
-	struct hive_key *root, *subkey;
-	uint32_t num_subkeys, num_values;
-	const struct test_backend_settings *backend = test_data;
-	TALLOC_CTX *mem_ctx = tctx;
-
-	error = reg_open_hive(mem_ctx, 
-						  backend->location, NULL, cmdline_credentials, &root);
-	torture_assert_werr_ok(tctx, error, "reg_open_hive()");
-
-	/* This is a new backend. There should be no subkeys and no 
-	 * values */
-	error = reg_key_get_info(tctx, root, NULL, &num_subkeys, &num_values, NULL);
-	torture_assert_werr_ok(tctx, error, "reg_key_num_subkeys()");
-
-	torture_assert(tctx, num_subkeys != 0, "New key has non-zero subkey count");
-
-	torture_assert_werr_ok(tctx, error, "reg_key_num_values");
-
-	torture_assert(tctx, num_values != 0, "New key has non-zero value count");
-
-	error = reg_key_add_name(mem_ctx, root, "Nested\\Key", NULL, 
-							 NULL, &subkey);
-	torture_assert_werr_ok(tctx, error, "reg_key_add_name");
-
-	error = reg_key_del(root, "Nested\\Key");
-	torture_assert_werr_ok(tctx, error, "reg_key_del");
-
-	talloc_free(root);
-	return true;
-}
+struct torture_suite *torture_registry_hive(TALLOC_CTX *mem_ctx);
 
 static bool test_str_regtype(struct torture_context *ctx)
 {
@@ -123,7 +79,7 @@
 	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, "name", REG_SZ, data),
+							 reg_val_description(ctx, "camel", REG_SZ, data),
 							 "reg_val_description failed");
 	return true;
 }
@@ -144,8 +100,6 @@
 {
 	struct torture_suite *suite = torture_suite_create(mem_ctx, 
 													   "REGISTRY");
-	int i;
-
 	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);
@@ -154,10 +108,7 @@
 	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);
 
-	for (i = 0; backends[i].name; i++) {
-		torture_suite_add_simple_tcase(suite, backends[i].name, test_hive, 
-									   &backends[i]);
-	}
+	torture_suite_add_suite(suite, torture_registry_hive(mem_ctx));
 
 	return suite;
 }

=== modified file 'source/lib/registry/tools/regdiff.c'
--- a/source/lib/registry/tools/regdiff.c	2007-06-02 14:03:25 +0000
+++ b/source/lib/registry/tools/regdiff.c	2007-06-12 16:54:40 +0000
@@ -2,7 +2,7 @@
    Unix SMB/CIFS implementation.
    simple registry frontend
    
-   Copyright (C) Jelmer Vernooij 2004-2006
+   Copyright (C) Jelmer Vernooij 2004-2007
    Copyright (C) Wilco Baan Hofman 2006
 
    This program is free software; you can redistribute it and/or modify

=== modified file 'source/lib/registry/tools/regpatch.c'
--- a/source/lib/registry/tools/regpatch.c	2007-06-08 21:56:52 +0000
+++ b/source/lib/registry/tools/regpatch.c	2007-06-12 16:54:40 +0000
@@ -2,7 +2,7 @@
    Unix SMB/CIFS implementation.
    simple registry frontend
    
-   Copyright (C) 2004-2005 Jelmer Vernooij, jelmer at samba.org
+   Copyright (C) 2004-2007 Jelmer Vernooij, jelmer at samba.org
 
    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

=== modified file 'source/lib/registry/tools/regshell.c'
--- a/source/lib/registry/tools/regshell.c	2007-06-10 23:47:55 +0000
+++ b/source/lib/registry/tools/regshell.c	2007-06-12 16:54:40 +0000
@@ -2,7 +2,7 @@
    Unix SMB/CIFS implementation.
    simple registry frontend
    
-   Copyright (C) Jelmer Vernooij 2004
+   Copyright (C) Jelmer Vernooij 2004-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

=== modified file 'source/lib/registry/tools/regtree.c'
--- a/source/lib/registry/tools/regtree.c	2007-06-10 22:26:52 +0000
+++ b/source/lib/registry/tools/regtree.c	2007-06-12 16:54:40 +0000
@@ -2,7 +2,7 @@
    Unix SMB/CIFS implementation.
    simple registry frontend
    
-   Copyright (C) Jelmer Vernooij 2004
+   Copyright (C) Jelmer Vernooij 2004-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

=== modified file 'source/lib/registry/util.c'
--- a/source/lib/registry/util.c	2007-06-08 21:56:52 +0000
+++ b/source/lib/registry/util.c	2007-06-12 16:54:40 +0000
@@ -1,7 +1,7 @@
 /* 
    Unix SMB/CIFS implementation.
    Transparent registry backend handling
-   Copyright (C) Jelmer Vernooij			2003-2004.
+   Copyright (C) Jelmer Vernooij			2003-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

=== modified file 'source/lib/registry/wine.c'
--- a/source/lib/registry/wine.c	2007-02-08 17:18:35 +0000
+++ b/source/lib/registry/wine.c	2007-06-12 16:54:40 +0000
@@ -1,7 +1,7 @@
 /* 
    Unix SMB/CIFS implementation.
    Registry interface
-   Copyright (C) Jelmer Vernooij					  2004.
+   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

=== modified file 'source/torture/local/config.mk'
--- a/source/torture/local/config.mk	2007-04-23 14:16:35 +0000
+++ b/source/torture/local/config.mk	2007-06-12 16:54:40 +0000
@@ -23,6 +23,7 @@
 		../../lib/socket_wrapper/testsuite.o \
 		irpc.o \
 		../../lib/registry/tests/generic.o \
+		../../lib/registry/tests/hive.o \
 		resolve.o \
 		../../lib/util/tests/strlist.o \
 		../../lib/util/tests/file.o \

=== modified file 'source/torture/ui.c'
--- a/source/torture/ui.c	2007-03-05 21:28:55 +0000
+++ b/source/torture/ui.c	2007-06-12 16:54:40 +0000
@@ -434,3 +434,37 @@
 
 	return NULL;
 }
+
+static bool wrap_test_with_simple_test(struct torture_context *torture_ctx,
+									struct torture_tcase *tcase,
+									struct torture_test *test)
+{
+	bool (*fn) (struct torture_context *, const void *tcase_data);
+
+	fn = test->fn;
+
+	return fn(torture_ctx, tcase->data);
+}
+
+struct torture_test *torture_tcase_add_simple_test(
+		struct torture_tcase *tcase,
+		const char *name,
+		bool (*run) (struct torture_context *test, const void *tcase_data))
+{
+	struct torture_test *test; 
+	
+	test = talloc(tcase, struct torture_test);
+
+	test->name = talloc_strdup(test, name);
+	test->description = NULL;
+	test->run = wrap_test_with_simple_test;
+	test->fn = run;
+	test->data = NULL;
+	test->dangerous = False;
+
+	DLIST_ADD_END(tcase->tests, test, struct torture_test *);
+
+	return test;
+}
+
+

=== modified file 'source/torture/ui.h'
--- a/source/torture/ui.h	2007-05-17 08:47:04 +0000
+++ b/source/torture/ui.h	2007-06-12 16:54:40 +0000
@@ -166,6 +166,13 @@
 		bool (*run) (struct torture_context *test, const void *test_data),
 		const void *data);
 
+/* Convenience function that adds a test which only 
+ * gets the test case data */
+struct torture_test *torture_tcase_add_simple_test(
+		struct torture_tcase *tcase,
+		const char *name,
+		bool (*run) (struct torture_context *test, const void *tcase_data));
+
 /* Convenience wrapper that adds a test that doesn't need any 
  * testcase data */
 struct torture_tcase *torture_suite_add_simple_test(



More information about the samba-cvs mailing list