Commit f7113959 authored by Yoni Fogel's avatar Yoni Fogel

[t:4768] Remove obsolete test

git-svn-id: file:///svn/toku/tokudb@43761 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6e267397
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
#include "test.h"
/* Does removing a database free the DB structure's memory? */
#include <stdlib.h>
#include <sys/stat.h>
#include <errno.h>
#include <db.h>
#include <memory.h>
// ENVDIR is defined in the Makefile
DB_ENV *env;
DB *db;
DBT key;
DBT data;
int
test_main (int UU(argc), char UU(*const argv[])) {
int r;
r = system("rm -rf " ENVDIR);
CKERR(r);
r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
memset(&key, 0, sizeof(key));
memset(&data, 0, sizeof(data));
key.size = sizeof("name");
key.data = "name";
r=db_env_create(&env, 0); assert(r==0);
r=env->open(env, ENVDIR, DB_INIT_MPOOL|DB_PRIVATE|DB_CREATE, S_IRWXU+S_IRWXG+S_IRWXO); assert(r==0);
r=db_create(&db, env, 0); assert(r==0);
r=db->open(db, NULL, "master.db", NULL, DB_BTREE, DB_CREATE, 0666); assert(r==0);
data.size = sizeof("first.db");
data.data = "first.db";
db->put(db, NULL, &key, &data, 0);
r=db->close(db, 0); assert(r==0);
r=db_create(&db, env, 0); assert(r==0);
#if defined(TOKUDB)
r=env->dbremove(env, NULL, "master.db", NULL, 0); assert(r==0);
#else
r=db->remove(db, "master.db", NULL, 0); assert(r==0);
#endif
r=env->close(env, 0); assert(r==0);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment