Skip to content

Commit 946cec2

Browse files
committed
expect sync to be gt0 only when not initializing the db
1 parent a6321d3 commit 946cec2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ int test_init (const char *db_path, int init) {
192192
snprintf(sql, sizeof(sql), "INSERT INTO users (id, name) VALUES ('%s', '%s');", value, value);
193193
rc = db_exec(db, sql); RCHECK
194194
rc = db_expect_int(db, "SELECT COUNT(*) as count FROM users;", 1); RCHECK
195-
rc = db_expect_gt0(db, "SELECT cloudsync_network_sync();"); RCHECK
195+
if(init){
196+
rc = db_exec(db, "SELECT cloudsync_network_sync();"); RCHECK
197+
} else {
198+
rc = db_expect_gt0(db, "SELECT cloudsync_network_sync();"); RCHECK
199+
}
196200
rc = db_expect_gt0(db, "SELECT COUNT(*) as count FROM users;"); RCHECK
197201
rc = db_expect_gt0(db, "SELECT COUNT(*) as count FROM activities;"); RCHECK
198202
rc = db_expect_int(db, "SELECT COUNT(*) as count FROM workouts;", 0); RCHECK

0 commit comments

Comments
 (0)