3 #include "tap-interface.h"
10 #define MAX_SIZE 10000
13 int main(int argc
, char *argv
[])
16 struct ntdb_context
*ntdb
;
17 int flags
[] = { NTDB_INTERNAL
, NTDB_DEFAULT
, NTDB_NOMMAP
,
18 NTDB_INTERNAL
|NTDB_CONVERT
, NTDB_CONVERT
,
19 NTDB_NOMMAP
|NTDB_CONVERT
};
20 NTDB_DATA key
= ntdb_mkdata("key", 3);
23 data
.dptr
= malloc(MAX_SIZE
);
24 memset(data
.dptr
, 0x24, MAX_SIZE
);
26 plan_tests(sizeof(flags
) / sizeof(flags
[0])
27 * (3 + (1 + (MAX_SIZE
/SIZE_STEP
)) * 2) + 1);
28 for (i
= 0; i
< sizeof(flags
) / sizeof(flags
[0]); i
++) {
29 ntdb
= ntdb_open("run-record-expand.ntdb",
30 flags
[i
]|MAYBE_NOSYNC
,
31 O_RDWR
|O_CREAT
|O_TRUNC
, 0600, &tap_log_attr
);
37 ok1(ntdb_store(ntdb
, key
, data
, NTDB_INSERT
) == 0);
38 ok1(ntdb_check(ntdb
, NULL
, NULL
) == 0);
40 data
.dsize
< MAX_SIZE
;
41 data
.dsize
+= SIZE_STEP
) {
42 memset(data
.dptr
, data
.dsize
, data
.dsize
);
43 ok1(ntdb_store(ntdb
, key
, data
, NTDB_MODIFY
) == 0);
44 ok1(ntdb_check(ntdb
, NULL
, NULL
) == 0);
48 ok1(tap_log_messages
== 0);