summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-22 05:03:02 -0600
committerStefan Metzmacher <metze@samba.org>2007-12-24 01:51:01 -0600
commit249cc734cebfef31320ec10b05dbfaaaa39682ca (patch)
treed9362b9316ea4bcbbaf561d2d062d01fe574a1d7 /source4/lib/registry/tests
parent09f820f0bd1a9fc7ffd171418ceb0e19df8e2e43 (diff)
downloadsamba-249cc734cebfef31320ec10b05dbfaaaa39682ca.tar.gz
samba-249cc734cebfef31320ec10b05dbfaaaa39682ca.tar.bz2
samba-249cc734cebfef31320ec10b05dbfaaaa39682ca.zip
r26565: Fix python registry bindings. 'PROVISION_PYTHON=yes make test' works now.
(This used to be commit 485d1fa3d17fe6cc7a0ecd80e8bac42d173bbb19)
Diffstat (limited to 'source4/lib/registry/tests')
-rw-r--r--source4/lib/registry/tests/bindings.py18
-rw-r--r--source4/lib/registry/tests/hive.c20
2 files changed, 28 insertions, 10 deletions
diff --git a/source4/lib/registry/tests/bindings.py b/source4/lib/registry/tests/bindings.py
index be87efe594..9f93ee9382 100644
--- a/source4/lib/registry/tests/bindings.py
+++ b/source4/lib/registry/tests/bindings.py
@@ -17,8 +17,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+import os
import unittest
import registry
+import samba.tests
class HelperTests(unittest.TestCase):
def test_predef_to_name(self):
@@ -29,6 +31,22 @@ class HelperTests(unittest.TestCase):
self.assertEquals("REG_DWORD", registry.str_regtype(4))
+
+class HiveTests(samba.tests.TestCaseInTempDir):
+ def setUp(self):
+ super(HiveTests, self).setUp()
+ self.hive = registry.open_ldb(os.path.join(self.tempdir, "ldb_new.ldb"))
+
+ def test_ldb_new(self):
+ self.assertTrue(self.hive is not None)
+
+ def test_flush(self):
+ self.hive.flush()
+
+ def test_del_value(self):
+ self.hive.del_value("FOO")
+
+
class RegistryTests(unittest.TestCase):
def test_new(self):
self.registry = registry.Registry()
diff --git a/source4/lib/registry/tests/hive.c b/source4/lib/registry/tests/hive.c
index e3a301710f..43ec9e4252 100644
--- a/source4/lib/registry/tests/hive.c
+++ b/source4/lib/registry/tests/hive.c
@@ -74,9 +74,9 @@ static bool test_keyinfo_nums(struct torture_context *tctx,
NULL, &subkey);
torture_assert_werr_ok(tctx, error, "hive_key_add_name");
- error = hive_set_value(root, "Answer", REG_DWORD,
+ error = hive_key_set_value(root, "Answer", REG_DWORD,
data_blob_talloc(tctx, &data, sizeof(data)));
- torture_assert_werr_ok(tctx, error, "hive_set_value");
+ torture_assert_werr_ok(tctx, error, "hive_key_set_value");
/* This is a new backend. There should be no subkeys and no
* values */
@@ -154,9 +154,9 @@ static bool test_set_value(struct torture_context *tctx,
NULL, &subkey);
torture_assert_werr_ok(tctx, error, "hive_key_add_name");
- error = hive_set_value(subkey, "Answer", REG_DWORD,
+ error = hive_key_set_value(subkey, "Answer", REG_DWORD,
data_blob_talloc(mem_ctx, &data, sizeof(data)));
- torture_assert_werr_ok(tctx, error, "hive_set_value");
+ torture_assert_werr_ok(tctx, error, "hive_key_set_value");
return true;
}
@@ -179,9 +179,9 @@ static bool test_get_value(struct torture_context *tctx, const void *test_data)
torture_assert_werr_equal(tctx, error, WERR_NOT_FOUND,
"getting missing value");
- error = hive_set_value(subkey, "Answer", REG_DWORD,
+ error = hive_key_set_value(subkey, "Answer", REG_DWORD,
data_blob_talloc(mem_ctx, &data, sizeof(data)));
- torture_assert_werr_ok(tctx, error, "hive_set_value");
+ torture_assert_werr_ok(tctx, error, "hive_key_set_value");
error = hive_get_value(mem_ctx, subkey, "Answer", &type, &value);
torture_assert_werr_ok(tctx, error, "getting value");
@@ -207,9 +207,9 @@ static bool test_del_value(struct torture_context *tctx, const void *test_data)
NULL, &subkey);
torture_assert_werr_ok(tctx, error, "hive_key_add_name");
- error = hive_set_value(subkey, "Answer", REG_DWORD,
+ error = hive_key_set_value(subkey, "Answer", REG_DWORD,
data_blob_talloc(mem_ctx, &data, sizeof(data)));
- torture_assert_werr_ok(tctx, error, "hive_set_value");
+ torture_assert_werr_ok(tctx, error, "hive_key_set_value");
error = hive_key_del_value(subkey, "Answer");
torture_assert_werr_ok(tctx, error, "deleting value");
@@ -240,9 +240,9 @@ static bool test_list_values(struct torture_context *tctx,
NULL, &subkey);
torture_assert_werr_ok(tctx, error, "hive_key_add_name");
- error = hive_set_value(subkey, "Answer", REG_DWORD,
+ error = hive_key_set_value(subkey, "Answer", REG_DWORD,
data_blob_talloc(mem_ctx, &data, sizeof(data)));
- torture_assert_werr_ok(tctx, error, "hive_set_value");
+ torture_assert_werr_ok(tctx, error, "hive_key_set_value");
error = hive_get_value_by_index(mem_ctx, subkey, 0, &name,
&type, &value);