@@ -186,20 +186,19 @@ int test_init (const char *db_path, int init) {
186186 // init network with connection string + apikey
187187 char network_init [512 ];
188188 snprintf (network_init , sizeof (network_init ), "SELECT cloudsync_network_init('%s?apikey=%s');" , getenv ("CONNECTION_STRING" ), getenv ("APIKEY" ));
189- printf ("Network init: %s\n" , network_init );
190189 rc = db_exec (db , network_init ); RCHECK
191190
192191 rc = db_expect_int (db , "SELECT COUNT(*) as count FROM activities;" , 0 ); RCHECK
193192 rc = db_expect_int (db , "SELECT COUNT(*) as count FROM workouts;" , 0 ); RCHECK
194- /* char value[UUID_STR_MAXLEN];
193+ char value [UUID_STR_MAXLEN ];
195194 cloudsync_uuid_v7_string (value , true);
196195 char sql [256 ];
197196 snprintf (sql , sizeof (sql ), "INSERT INTO users (id, name) VALUES ('%s', '%s');" , value , value );
198- rc = db_exec(db, sql); RCHECK */
199- rc = db_expect_int (db , "SELECT COUNT(*) as count FROM users;" , 0 ); RCHECK
200- rc = db_print (db , "SELECT cloudsync_network_sync(500, 100);" ); RCHECK
201- rc = db_print (db , "SELECT COUNT(*) as count FROM users;" ); RCHECK
202- rc = db_print (db , "SELECT COUNT(*) as count FROM activities;" ); RCHECK
197+ rc = db_exec (db , sql ); RCHECK
198+ rc = db_expect_int (db , "SELECT COUNT(*) as count FROM users;" , 1 ); RCHECK
199+ rc = db_expect_gt0 (db , "SELECT cloudsync_network_sync(500, 100);" ); RCHECK
200+ rc = db_expect_gt0 (db , "SELECT COUNT(*) as count FROM users;" ); RCHECK
201+ rc = db_expect_gt0 (db , "SELECT COUNT(*) as count FROM activities;" ); RCHECK
203202 rc = db_expect_int (db , "SELECT COUNT(*) as count FROM workouts;" , 0 ); RCHECK
204203 rc = db_exec (db , "SELECT cloudsync_terminate();" );
205204
0 commit comments