create / free replicas, plus error handling

This commit is contained in:
Dustin J. Mitchell
2022-01-23 17:24:54 +00:00
parent 33f5f056b1
commit ce56127bbf
9 changed files with 132 additions and 30 deletions

12
binding-tests/replica.cpp Normal file
View File

@@ -0,0 +1,12 @@
#include <string.h>
#include "doctest.h"
#include "taskchampion.h"
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);
}