Skip to content

Instantly share code, notes, and snippets.

@philsquared
Created January 14, 2019 10:09
Show Gist options
  • Save philsquared/d6f4f08763af9614c386d1c7a6411114 to your computer and use it in GitHub Desktop.
Save philsquared/d6f4f08763af9614c386d1c7a6411114 to your computer and use it in GitHub Desktop.
Kellabyte's rewind tests using flattened REQUIRESs (depends on https://gist.github.com/philsquared/567fdd233d574fe1957d17aff3e5d02c)
TEST_CASE("initialize rewind", "[rewind]") {
int rc;
MDB_env* env;
MDB_dbi dbi;
MDB_txn *txn;
REQUIRE( SuccessFrom( mdb_env_create(&env) ) );
REQUIRE( SuccessFrom( mdb_env_set_mapsize(env, size_t(1048576000) ) ) );
REQUIRE( SuccessFrom( mdb_env_set_maxdbs(env, 1024) ) );
REQUIRE( SuccessFrom( mdb_env_open(env, "/tmp", MDB_FIXEDMAP /*|MDB_NOSYNC*/, 0664) ) );
REQUIRE( SuccessFrom( mdb_txn_begin(env, NULL, 0, &txn) ) );
REQUIRE( SuccessFrom( mdb_dbi_open(txn, NULL, 0, &dbi) ) );
REQUIRE( SuccessFrom( mdb_open(txn, NULL, 0, &dbi) ) );
REQUIRE( SuccessFrom( mdb_txn_commit(txn) ) );
mdb_dbi_close(env, dbi);
mdb_env_close(env);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment