|
|
@@ -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"));
|