add tc_replica_undo

This commit is contained in:
Dustin J. Mitchell
2022-01-23 17:34:59 +00:00
parent ce56127bbf
commit e590dc7c98
5 changed files with 33 additions and 14 deletions

View File

@@ -5,8 +5,14 @@
TEST_CASE("creating an in-memory Replica does not crash") {
Replica *rep = tc_replica_new(NULL);
CHECK(tc_replica_error(rep) == NULL);
uhoh(rep);
REQUIRE(tc_replica_error(rep) != NULL);
CHECK(strcmp(tc_replica_error(rep), "uhoh!") == 0);
tc_replica_free(rep);
}
TEST_CASE("undo on an empty in-memory Replica does nothing") {
Replica *rep = tc_replica_new(NULL);
CHECK(tc_replica_error(rep) == NULL);
int rv = tc_replica_undo(rep);
CHECK(rv == 0);
CHECK(tc_replica_error(rep) == NULL);
tc_replica_free(rep);
}