tdb2: unify tdb1_store into tdb_store
[ccan] / ccan / tdb2 / test / run-tdb1-endian.c
index 5e529ce2d0e95bae64aefeee27a31d4be7484d20..bb5acf627b2c12f4fb2ab317a548a17c34e9cee3 100644 (file)
@@ -14,7 +14,7 @@ int main(int argc, char *argv[])
        hsize.base.next = &tap_log_attr;
        hsize.tdb1_hashsize.hsize = 1024;
 
-       plan_tests(13);
+       plan_tests(11);
        tdb = tdb_open("run-endian.tdb1",
                       TDB_VERSION1|TDB_CONVERT,
                       O_CREAT|O_TRUNC|O_RDWR, 0600, &hsize);
@@ -25,12 +25,10 @@ int main(int argc, char *argv[])
        data.dsize = strlen("world");
        data.dptr = (void *)"world";
 
-       ok1(tdb1_store(tdb, key, data, TDB_MODIFY) < 0);
-       ok1(tdb_error(tdb) == TDB_ERR_NOEXIST);
-       ok1(tdb1_store(tdb, key, data, TDB_INSERT) == 0);
-       ok1(tdb1_store(tdb, key, data, TDB_INSERT) < 0);
-       ok1(tdb_error(tdb) == TDB_ERR_EXISTS);
-       ok1(tdb1_store(tdb, key, data, TDB_MODIFY) == 0);
+       ok1(tdb_store(tdb, key, data, TDB_MODIFY) == TDB_ERR_NOEXIST);
+       ok1(tdb_store(tdb, key, data, TDB_INSERT) == TDB_SUCCESS);
+       ok1(tdb_store(tdb, key, data, TDB_INSERT) == TDB_ERR_EXISTS);
+       ok1(tdb_store(tdb, key, data, TDB_MODIFY) == TDB_SUCCESS);
 
        data = tdb1_fetch(tdb, key);
        ok1(data.dsize == strlen("world"));