3 #include "../private.h"
4 #include "tap-interface.h"
6 #include "helpapi-external-agent.h"
8 static bool add_records(struct ntdb_context *ntdb)
11 NTDB_DATA key = { (unsigned char *)&i, sizeof(i) };
12 NTDB_DATA data = { (unsigned char *)&i, sizeof(i) };
14 for (i = 0; i < 1000; i++) {
15 if (ntdb_store(ntdb, key, data, NTDB_REPLACE) != 0)
22 int main(int argc, char *argv[])
25 struct ntdb_context *ntdb;
26 int flags[] = { NTDB_INTERNAL, NTDB_DEFAULT, NTDB_NOMMAP,
27 NTDB_INTERNAL|NTDB_CONVERT, NTDB_CONVERT,
28 NTDB_NOMMAP|NTDB_CONVERT };
30 plan_tests(sizeof(flags) / sizeof(flags[0]) * 4 + 1);
31 for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++) {
32 ntdb = ntdb_open("run-16-wipe_all.ntdb", flags[i]|MAYBE_NOSYNC,
33 O_RDWR|O_CREAT|O_TRUNC, 0600, &tap_log_attr);
36 ok1(add_records(ntdb));
37 ok1(ntdb_wipe_all(ntdb) == NTDB_SUCCESS);
38 ok1(ntdb_firstkey(ntdb, &key) == NTDB_ERR_NOEXIST);
43 ok1(tap_log_messages == 0);