tdb2: unify tdb1_store into tdb_store
[ccan] / ccan / tdb2 / test / run-tdb1-traverse-in-transaction.c
index 3865289a6d40cd0604768af390440e1741f56313..90783198d91be5bf62bce6d1ce809c28e002b95d 100644 (file)
@@ -47,9 +47,9 @@ int main(int argc, char *argv[])
        if (!agent)
                err(1, "preparing agent");
 
-       tdb = tdb1_open("run-traverse-in-transaction.tdb",
-                       TDB_DEFAULT, O_CREAT|O_TRUNC|O_RDWR,
-                       0600, &hsize);
+       tdb = tdb_open("run-traverse-in-transaction.tdb1",
+                      TDB_VERSION1, O_CREAT|O_TRUNC|O_RDWR,
+                      0600, &hsize);
        ok1(tdb);
 
        key.dsize = strlen("hi");
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
        data.dptr = (void *)"world";
        data.dsize = strlen("world");
 
-       ok1(tdb1_store(tdb, key, data, TDB_INSERT) == 0);
+       ok1(tdb_store(tdb, key, data, TDB_INSERT) == TDB_SUCCESS);
 
        ok1(external_agent_operation1(agent, OPEN, tdb->name) == SUCCESS);
 
@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
        ok1(external_agent_operation1(agent, TRANSACTION_START, tdb->name)
            == SUCCESS);
 
-       tdb1_close(tdb);
+       tdb_close(tdb);
 
        return exit_status();
 }