MCPcopy Create free account
hub / github.com/ElementsProject/lightning / create_test_db

Function create_test_db

wallet/test/run-db.c:74–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74static struct db *create_test_db(void)
75{
76 struct db *db;
77 char *dsn, *filename;
78
79 int fd = tmpdir_mkstemp(tmpctx, "ldb-XXXXXX", &filename);
80 if (fd == -1)
81 return NULL;
82 close(fd);
83
84 dsn = tal_fmt(NULL, "sqlite3://%s", filename);
85 tal_free(filename);
86 db = db_open(NULL, dsn);
87 db->data_version = 0;
88 db->report_changes_fn = NULL;
89
90 tal_free(dsn);
91 return db;
92}
93
94static bool test_empty_db_migrate(struct lightningd *ld)
95{

Callers 4

test_empty_db_migrateFunction · 0.70
test_primitivesFunction · 0.70
test_varsFunction · 0.70
test_manip_columnsFunction · 0.70

Calls 3

tmpdir_mkstempFunction · 0.85
tal_freeFunction · 0.85
db_openFunction · 0.85

Tested by

no test coverage detected