MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / TEST_F

Function TEST_F

test/api/system_config_test.cpp:26–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26TEST_F(SystemConfigTest, testAccessMode) {
27 systemConfig->readOnly = false;
28 auto db = std::make_unique<Database>(databasePath, *systemConfig);
29 auto con = std::make_unique<Connection>(db.get());
30 assertQuery(
31 *con->query("CREATE NODE TABLE Person1(name STRING, age INT64, PRIMARY KEY(name))"));
32 assertQuery(*con->query("CREATE (:Person1 {name: 'Alice', age: 25})"));
33 assertQuery(*con->query("MATCH (:Person1) RETURN COUNT(*)"));
34 db.reset();
35 systemConfig->readOnly = true;
36 if (databasePath == "" || databasePath == ":memory:") {
37 EXPECT_THROW(auto db2 = std::make_unique<Database>("", *systemConfig), Exception);
38 EXPECT_THROW(auto db2 = std::make_unique<Database>(":memory:", *systemConfig), Exception);
39 return;
40 }
41 std::unique_ptr<Database> db2;
42 std::unique_ptr<Connection> con2;
43 EXPECT_NO_THROW(db2 = std::make_unique<Database>(databasePath, *systemConfig));
44 EXPECT_NO_THROW(con2 = std::make_unique<Connection>(db2.get()));
45 ASSERT_FALSE(con2->query("DROP TABLE Person")->isSuccess());
46 EXPECT_NO_THROW(con2->query("MATCH (:Person) RETURN COUNT(*)"));
47}
48
49TEST_F(SystemConfigTest, testSpillToDisk) {
50 systemConfig->readOnly = false;

Callers

nothing calls this directly

Calls 12

assertQueryFunction · 0.85
whatMethod · 0.80
getTableCatalogEntryMethod · 0.80
getCatalogMethod · 0.80
tryGetPKIndexMethod · 0.80
getMethod · 0.45
queryMethod · 0.45
resetMethod · 0.45
isSuccessMethod · 0.45
toStringMethod · 0.45
getTableMethod · 0.45
getStorageManagerMethod · 0.45

Tested by

no test coverage detected