File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1414#include "utils.h"
1515#include "sqlite3.h"
1616
17+ // Define the number of simulated peers, when it's 0 it skips the peer test.
18+ #ifdef __linux__
19+ #define PEERS 0
20+ #else
21+ #define PEERS 5
22+ #endif
23+
24+ #ifdef PEERS
1725#ifdef _WIN32
1826#include <windows.h>
1927#else
2028#include <pthread.h>
2129#endif
22- #define PEERS 5
30+ #endif // PEERS
2331
2432#ifdef CLOUDSYNC_LOAD_FROM_SOURCES
2533#include "cloudsync.h"
@@ -319,6 +327,7 @@ int test_report(const char *description, int rc){
319327 return rc ;
320328}
321329
330+ #ifdef PEERS
322331#ifdef _WIN32
323332DWORD WINAPI worker (LPVOID arg ) {
324333#else
@@ -342,6 +351,7 @@ void* worker(void* arg) {
342351 return NULL ;
343352#endif
344353}
354+ #endif // PEERS
345355
346356int main (void ) {
347357 int rc = SQLITE_OK ;
@@ -363,6 +373,7 @@ int main (void) {
363373
364374 remove (DB_PATH ); // remove the database file
365375
376+ #ifdef PEERS
366377 #ifdef _WIN32
367378 HANDLE threads [PEERS ];
368379 #else
@@ -448,6 +459,7 @@ int main (void) {
448459 printf ("Threading test failed: %d thread(s) had errors\n" , thread_errors );
449460 rc += thread_errors ;
450461 }
462+ #endif // PEERS
451463
452464 printf ("\n" );
453465 return rc ;
You can’t perform that action at this time.
0 commit comments