|
12 | 12 | #include "sqlite3.h" |
13 | 13 | #include <pthread.h> |
14 | 14 |
|
15 | | -#define PEERS 2 |
| 15 | +#define PEERS 150 |
16 | 16 | #define DB_PATH "health-track.sqlite" |
17 | 17 | #define EXT_PATH "./dist/cloudsync" |
18 | 18 | #define RCHECK if (rc != SQLITE_OK) goto abort_test; |
@@ -194,10 +194,10 @@ int test_init (const char *db_path, int init) { |
194 | 194 | rc = db_expect_int(db, "SELECT COUNT(*) as count FROM users;", 1); RCHECK |
195 | 195 | if(init){ |
196 | 196 | rc = db_exec(db, "SELECT cloudsync_network_sync();"); RCHECK |
197 | | - rc = db_expect_gt0(db, "SELECT COUNT(*) as count FROM users;"); RCHECK //tofix |
198 | | - rc = db_expect_gt0(db, "SELECT COUNT(*) as count FROM activities;"); RCHECK //tofix |
199 | | - } else { |
| 197 | + } else { //tofix |
200 | 198 | rc = db_expect_gt0(db, "SELECT cloudsync_network_sync();"); RCHECK |
| 199 | + rc = db_expect_gt0(db, "SELECT COUNT(*) as count FROM users;"); RCHECK |
| 200 | + rc = db_expect_gt0(db, "SELECT COUNT(*) as count FROM activities;"); RCHECK |
201 | 201 | } |
202 | 202 | rc = db_expect_int(db, "SELECT COUNT(*) as count FROM workouts;", 0); RCHECK |
203 | 203 | rc = db_exec(db, "SELECT cloudsync_terminate();"); |
@@ -267,9 +267,9 @@ void* worker(void* arg) { |
267 | 267 | int thread_id = *(int*)arg; |
268 | 268 |
|
269 | 269 | char description[32]; |
270 | | - snprintf(description, sizeof(description), "%d/%d Peer Test", thread_id, PEERS); |
| 270 | + snprintf(description, sizeof(description), "%d/%d Peer Test", thread_id+1, PEERS); |
271 | 271 | if(test_report(description, test_init(":memory:", 1))){ |
272 | | - printf("PEER %d FAIL.\n", thread_id); |
| 272 | + printf("PEER %d FAIL.\n", thread_id+1); |
273 | 273 | exit(thread_id+1); |
274 | 274 | } |
275 | 275 |
|
|
0 commit comments