Skip to content

Instantly share code, notes, and snippets.

View philsquared's full-sized avatar

Phil Nash philsquared

View GitHub Profile
SCENARIO("initialize rewind", "[rewind]") {
GIVEN( "an uninitialised environment") {
int rc;
MDB_env *env;
MDB_dbi dbi;
MDB_txn *txn;
WHEN("an environment is created and opened") {
REQUIRE(SuccessFrom(mdb_env_create(&env)));
REQUIRE(SuccessFrom(mdb_env_set_mapsize(env, size_t(1048576000))));
@philsquared
philsquared / rewind-sections.cpp
Created January 14, 2019 10:09
Kellabyte's rewind tests using plain SECTIONs (depends on https://gist.github.com/philsquared/567fdd233d574fe1957d17aff3e5d02c)
TEST_CASE("initialize rewind", "[rewind]") {
int rc;
MDB_env *env;
MDB_dbi dbi;
MDB_txn *txn;
SECTION("create and open an environment") {
REQUIRE(SuccessFrom(mdb_env_create(&env)));
REQUIRE(SuccessFrom(mdb_env_set_mapsize(env, size_t(1048576000))));
@philsquared
philsquared / SquarePeg.rs
Last active May 5, 2021 10:54
Fitting a SquarePeg into a RoundHole, in Rust
trait Square {
fn size(&self) -> f64;
fn perimeter(&self) -> f64;
}
trait Circle {
fn radius(&self) -> f64;
fn perimeter(&self) -> f64;
}