mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
a19234e8d1
git-svn-id: file:///svn/toku/tokudb.1195@7730 c7de825b-a66e-492c-adef-691d508d4ae1
34 lines
851 B
C++
34 lines
851 B
C++
#include <assert.h>
|
|
#include <db_cxx.h>
|
|
#include <errno.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
|
|
#define FNAME __FILE__ ".tdb"
|
|
|
|
#define TC(expr, expect) \
|
|
try { \
|
|
expr; \
|
|
assert(expect==0); \
|
|
} catch (DbException e) { \
|
|
if (e.get_errno()!=expect) fprintf(stderr, "err=%d %s\n", e.get_errno(), db_strerror(e.get_errno())); \
|
|
assert(e.get_errno()==expect); \
|
|
}
|
|
|
|
void test_no_env () {
|
|
#if 0
|
|
DbEnv env(0);
|
|
TC(env.open(".", DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE , 0777), 0);
|
|
Db db(&env, 0);
|
|
#else
|
|
Db db(0, 0);
|
|
#endif
|
|
unlink(FNAME);
|
|
TC(db.open(0, FNAME, 0, DB_BTREE, DB_CREATE, 0777), 0);
|
|
}
|
|
|
|
int main(int argc, char *argv[]) {
|
|
test_no_env();
|
|
system("rm -f *.tokulog");
|
|
return 0;
|
|
}
|