X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-11-simple-fetch.c;h=8cd281e24fe31fc9feb78b406adc209a00ab4a9f;hp=3a6ac5d97fc312290720476b76fc6ef7d6098fa9;hb=b21004624683be5bf1d8f75e3b5be4e9618049ee;hpb=acfeff3aee13b58cb114e7f82afeb2d159e80c05 diff --git a/ccan/tdb2/test/run-11-simple-fetch.c b/ccan/tdb2/test/run-11-simple-fetch.c index 3a6ac5d9..8cd281e2 100644 --- a/ccan/tdb2/test/run-11-simple-fetch.c +++ b/ccan/tdb2/test/run-11-simple-fetch.c @@ -27,15 +27,13 @@ int main(int argc, char *argv[]) struct tdb_data d; /* fetch should fail. */ - d = tdb_fetch(tdb, key); - ok1(d.dptr == NULL); - ok1(tdb_error(tdb) == TDB_ERR_NOEXIST); + ok1(tdb_fetch(tdb, key, &d) == TDB_ERR_NOEXIST); ok1(tdb_check(tdb, NULL, NULL) == 0); /* Insert should succeed. */ ok1(tdb_store(tdb, key, data, TDB_INSERT) == 0); ok1(tdb_check(tdb, NULL, NULL) == 0); /* Fetch should now work. */ - d = tdb_fetch(tdb, key); + ok1(tdb_fetch(tdb, key, &d) == TDB_SUCCESS); ok1(data_equal(d, data)); free(d.dptr); ok1(tdb_check(tdb, NULL, NULL) == 0);