create / free replicas, plus error handling
This commit is contained in:
@@ -3,7 +3,7 @@ INC=-I ../lib
|
||||
LIB=-L ../target/debug
|
||||
RPATH=-Wl,-rpath,../target/debug
|
||||
|
||||
TESTS = uuid.cpp
|
||||
TESTS = replica.cpp
|
||||
|
||||
.PHONY: all test
|
||||
|
||||
|
||||
12
binding-tests/replica.cpp
Normal file
12
binding-tests/replica.cpp
Normal 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);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
#include "doctest.h"
|
||||
#include "taskchampion.h"
|
||||
|
||||
TEST_CASE("creating a UUID") {
|
||||
StoragePtr *storage = storage_new_in_memory();
|
||||
storage_free(storage);
|
||||
}
|
||||
Reference in New Issue
Block a user