X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Frun-55-transaction.c;h=a6607d11dbd3b97575f5f3788b01c87b83706702;hp=4ebf792a8c9d7858c81ed55ec21f999a1d2402ac;hb=8a47d50d72ea62e378dc92b150c92c1317c73fa3;hpb=b21004624683be5bf1d8f75e3b5be4e9618049ee diff --git a/ccan/tdb2/test/run-55-transaction.c b/ccan/tdb2/test/run-55-transaction.c index 4ebf792a..a6607d11 100644 --- a/ccan/tdb2/test/run-55-transaction.c +++ b/ccan/tdb2/test/run-55-transaction.c @@ -1,10 +1,4 @@ -#include -#include -#include -#include -#include -#include -#include +#include "tdb2-source.h" #include #include "logging.h" @@ -15,7 +9,7 @@ int main(int argc, char *argv[]) unsigned char *buffer; int flags[] = { TDB_DEFAULT, TDB_NOMMAP, TDB_CONVERT, TDB_NOMMAP|TDB_CONVERT }; - struct tdb_data key = { (unsigned char *)"key", 3 }; + struct tdb_data key = tdb_mkdata("key", 3); struct tdb_data data; buffer = malloc(1000); @@ -42,7 +36,8 @@ int main(int argc, char *argv[]) /* Cancelling a transaction means no store */ tdb_transaction_cancel(tdb); - ok1(tdb->allrecord_lock.count == 0 && tdb->num_lockrecs == 0); + ok1(tdb->file->allrecord_lock.count == 0 + && tdb->file->num_lockrecs == 0); ok1(tdb_check(tdb, NULL, NULL) == 0); ok1(tdb_fetch(tdb, key, &data) == TDB_ERR_NOEXIST); @@ -56,7 +51,8 @@ int main(int argc, char *argv[]) ok1(memcmp(data.dptr, buffer, data.dsize) == 0); free(data.dptr); ok1(tdb_transaction_commit(tdb) == 0); - ok1(tdb->allrecord_lock.count == 0 && tdb->num_lockrecs == 0); + ok1(tdb->file->allrecord_lock.count == 0 + && tdb->file->num_lockrecs == 0); ok1(tdb_check(tdb, NULL, NULL) == 0); ok1(tdb_fetch(tdb, key, &data) == TDB_SUCCESS); ok1(data.dsize == 1000);