Commit cb39b74e authored by johan's avatar johan Committed by johan
Browse files

Fix build when C interface is not enabled

parent 4926cbc7
...@@ -168,6 +168,8 @@ int wait_for(belle_sip_stack_t*s1,int* counter,int value,int timeout); ...@@ -168,6 +168,8 @@ int wait_for(belle_sip_stack_t*s1,int* counter,int value,int timeout);
extern "C" { extern "C" {
#ifdef FFI_ENABLED
/* some shared variable defined in lime_ff-tester, used only when FFI is enabled /* some shared variable defined in lime_ff-tester, used only when FFI is enabled
* and they are duplicate of command line arguments variable already existing in C++ from lime_tester-utils.cpp * and they are duplicate of command line arguments variable already existing in C++ from lime_tester-utils.cpp
* but it's easier to read and implement this way */ * but it's easier to read and implement this way */
...@@ -178,6 +180,7 @@ extern char ffi_test_x3dh_c448_server_port[16]; ...@@ -178,6 +180,7 @@ extern char ffi_test_x3dh_c448_server_port[16];
// ffi default value for the timeout // ffi default value for the timeout
extern int ffi_wait_for_timeout; extern int ffi_wait_for_timeout;
#endif
} }
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
static FILE * log_file = NULL; static FILE * log_file = NULL;
static const char *log_domain = "lime"; static const char *log_domain = "lime";
bool cleanDatabase = true; bool cleanDatabase = true;
#ifdef FFI_ENABLED
uint8_t ffi_cleanDatabase = 1; uint8_t ffi_cleanDatabase = 1;
#endif
bool bench = false; bool bench = false;
static void log_handler(int lev, const char *fmt, va_list args) { static void log_handler(int lev, const char *fmt, va_list args) {
...@@ -54,7 +56,9 @@ void lime_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list ...@@ -54,7 +56,9 @@ void lime_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list
bc_tester_add_suite(&lime_lime_test_suite); bc_tester_add_suite(&lime_lime_test_suite);
bc_tester_add_suite(&lime_massive_group_test_suite); bc_tester_add_suite(&lime_massive_group_test_suite);
bc_tester_add_suite(&lime_helloworld_test_suite); bc_tester_add_suite(&lime_helloworld_test_suite);
#ifdef FFI_ENABLED
bc_tester_add_suite(&lime_ffi_test_suite); bc_tester_add_suite(&lime_ffi_test_suite);
#endif
} }
void lime_tester_uninit(void) { void lime_tester_uninit(void) {
...@@ -133,22 +137,32 @@ int main(int argc, char *argv[]) { ...@@ -133,22 +137,32 @@ int main(int argc, char *argv[]) {
} else if (strcmp(argv[i],"--x3dh-server-name")==0){ } else if (strcmp(argv[i],"--x3dh-server-name")==0){
CHECK_ARG("--x3dh-server-name", ++i, argc); CHECK_ARG("--x3dh-server-name", ++i, argc);
lime_tester::test_x3dh_server_url=std::string(argv[i]); lime_tester::test_x3dh_server_url=std::string(argv[i]);
#ifdef FFI_ENABLED
strncpy(ffi_test_x3dh_server_url, argv[i], sizeof(ffi_test_x3dh_server_url)-1); strncpy(ffi_test_x3dh_server_url, argv[i], sizeof(ffi_test_x3dh_server_url)-1);
#endif
} else if (strcmp(argv[i],"--c255-x3dh-server-port")==0){ } else if (strcmp(argv[i],"--c255-x3dh-server-port")==0){
CHECK_ARG("--c255-x3dh-server-port", ++i, argc); CHECK_ARG("--c255-x3dh-server-port", ++i, argc);
lime_tester::test_x3dh_c25519_server_port=std::string(argv[i]); lime_tester::test_x3dh_c25519_server_port=std::string(argv[i]);
#ifdef FFI_ENABLED
strncpy(ffi_test_x3dh_c25519_server_port, argv[i], sizeof(ffi_test_x3dh_c25519_server_port)-1); strncpy(ffi_test_x3dh_c25519_server_port, argv[i], sizeof(ffi_test_x3dh_c25519_server_port)-1);
#endif
} else if (strcmp(argv[i],"--c448-x3dh-server-port")==0){ } else if (strcmp(argv[i],"--c448-x3dh-server-port")==0){
CHECK_ARG("--c448-x3dh-server-port", ++i, argc); CHECK_ARG("--c448-x3dh-server-port", ++i, argc);
lime_tester::test_x3dh_c448_server_port=std::string(argv[i]); lime_tester::test_x3dh_c448_server_port=std::string(argv[i]);
#ifdef FFI_ENABLED
strncpy(ffi_test_x3dh_c448_server_port, argv[i], sizeof(ffi_test_x3dh_c448_server_port)-1); strncpy(ffi_test_x3dh_c448_server_port, argv[i], sizeof(ffi_test_x3dh_c448_server_port)-1);
#endif
} else if (strcmp(argv[i],"--operation-timeout")==0){ } else if (strcmp(argv[i],"--operation-timeout")==0){
CHECK_ARG("--operation-timeout", ++i, argc); CHECK_ARG("--operation-timeout", ++i, argc);
lime_tester::wait_for_timeout=std::atoi(argv[i]); lime_tester::wait_for_timeout=std::atoi(argv[i]);
#ifdef FFI_ENABLED
ffi_wait_for_timeout=lime_tester::wait_for_timeout; ffi_wait_for_timeout=lime_tester::wait_for_timeout;
#endif
} else if (strcmp(argv[i],"--keep-tmp-db")==0){ } else if (strcmp(argv[i],"--keep-tmp-db")==0){
cleanDatabase=false; cleanDatabase=false;
#ifdef FFI_ENABLED
ffi_cleanDatabase=0; ffi_cleanDatabase=0;
#endif
} else if (strcmp(argv[i],"--bench")==0){ } else if (strcmp(argv[i],"--bench")==0){
bench=true; bench=true;
}else { }else {
......
...@@ -35,7 +35,9 @@ extern test_suite_t lime_lime_test_suite; ...@@ -35,7 +35,9 @@ extern test_suite_t lime_lime_test_suite;
extern test_suite_t lime_helloworld_test_suite; extern test_suite_t lime_helloworld_test_suite;
extern test_suite_t lime_crypto_test_suite; extern test_suite_t lime_crypto_test_suite;
extern test_suite_t lime_massive_group_test_suite; extern test_suite_t lime_massive_group_test_suite;
#ifdef FFI_ENABLED
extern test_suite_t lime_ffi_test_suite; extern test_suite_t lime_ffi_test_suite;
#endif
void lime_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list args)); void lime_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list args));
void lime_tester_uninit(void); void lime_tester_uninit(void);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment