void open_test_database( database& db, const fc::path& dir ) { database::open_args args; args.data_dir = dir; args.shared_mem_dir = dir; args.initial_supply = INITIAL_TEST_SUPPLY; args.shared_file_size = TEST_SHARED_MEM_SIZE; db.open( args ); }
fixtureStore() : m_db(NULL) { nsdatabase::setCheckTablePtr(true); bool db_created = g_db_created; m_db = database::create(); if (!m_db) printf("Error database::create()\n"); short ret = createTestDataBase(m_db); if (ret) { printf("Error createDataBase\n"); return; } if (!db_created) ret = createTestTable(m_db); else { m_db->open(makeUri(PROTOCOL, HOSTNAME, DBNAMEV3, BDFNAME), TYPE_SCHEMA_BDF,TD_OPEN_NORMAL); ret = m_db->stat(); } if (ret) printf("Error createTable\n"); }