build: get rid of vars=locals() in source3/modules/wscript_build
[Samba.git] / lib / ntdb / test / run-tdb_errorstr.c
blob5b023140a7637da84d50575854b49155cd4973ec
1 #include "ntdb-source.h"
2 #include "tap-interface.h"
4 int main(int argc, char *argv[])
6 enum NTDB_ERROR e;
7 plan_tests(NTDB_ERR_RDONLY*-1 + 2);
9 for (e = NTDB_SUCCESS; e >= NTDB_ERR_RDONLY; e--) {
10 switch (e) {
11 case NTDB_SUCCESS:
12 ok1(!strcmp(ntdb_errorstr(e),
13 "Success"));
14 break;
15 case NTDB_ERR_IO:
16 ok1(!strcmp(ntdb_errorstr(e),
17 "IO Error"));
18 break;
19 case NTDB_ERR_LOCK:
20 ok1(!strcmp(ntdb_errorstr(e),
21 "Locking error"));
22 break;
23 case NTDB_ERR_OOM:
24 ok1(!strcmp(ntdb_errorstr(e),
25 "Out of memory"));
26 break;
27 case NTDB_ERR_EXISTS:
28 ok1(!strcmp(ntdb_errorstr(e),
29 "Record exists"));
30 break;
31 case NTDB_ERR_EINVAL:
32 ok1(!strcmp(ntdb_errorstr(e),
33 "Invalid parameter"));
34 break;
35 case NTDB_ERR_NOEXIST:
36 ok1(!strcmp(ntdb_errorstr(e),
37 "Record does not exist"));
38 break;
39 case NTDB_ERR_RDONLY:
40 ok1(!strcmp(ntdb_errorstr(e),
41 "write not permitted"));
42 break;
43 case NTDB_ERR_CORRUPT:
44 ok1(!strcmp(ntdb_errorstr(e),
45 "Corrupt database"));
46 break;
49 ok1(!strcmp(ntdb_errorstr(e), "Invalid error code"));
51 return exit_status();