Commit d35f698d authored by johan's avatar johan
Browse files

name collision when building tests for android

parent 111734a1
......@@ -29,14 +29,14 @@
using namespace::std;
using namespace::lime;
static belle_sip_stack_t *stack=NULL;
static belle_sip_stack_t *bc_stack=NULL;
static belle_http_provider_t *prov=NULL;
static int http_before_all(void) {
stack=belle_sip_stack_new(NULL);
bc_stack=belle_sip_stack_new(NULL);
prov=belle_sip_stack_create_http_provider(stack,"0.0.0.0");
prov=belle_sip_stack_create_http_provider(bc_stack,"0.0.0.0");
belle_tls_crypto_config_t *crypto_config=belle_tls_crypto_config_new();
......@@ -48,7 +48,7 @@ static int http_before_all(void) {
static int http_after_all(void) {
belle_sip_object_unref(prov);
belle_sip_object_unref(stack);
belle_sip_object_unref(bc_stack);
return 0;
}
......@@ -221,13 +221,13 @@ static void helloworld_basic_test(const lime::CurveId curve, const std::string &
aliceManager->create_user(tmp_aliceDeviceId, x3dh_server_url, curve, lime_tester::OPkInitialBatchSize, callback);
tmp_aliceDeviceId.clear(); // deviceId may go out of scope as soon as we come back from call
// wait for the operation to complete
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
auto tmp_bobDeviceId = *bobDeviceId; // use a temporary variable as it may be a local variable which get out of scope right after call to create_user
bobManager->create_user(tmp_bobDeviceId, x3dh_server_url, curve, callback);
tmp_bobDeviceId.clear(); // deviceId may go out of scope as soon as we come back from call
// wait for the operation to complete
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
/*** alice encrypt a message to bob, all parameters given to encrypt function are shared_ptr. ***/
......@@ -301,7 +301,7 @@ static void helloworld_basic_test(const lime::CurveId curve, const std::string &
/************** SYNCHRO **************************************/
// this is just waiting for the callback to increase the operation_success field in counters
// sending ticks to the belle-sip stack in order to process messages
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
LIME_LOGI<<"Alice encrypt the message, callback Ok or timeout reached"<<endl;
/****** end of SYNCHRO **************************************/
......@@ -347,13 +347,13 @@ static void helloworld_basic_test(const lime::CurveId curve, const std::string &
expected_success+=2;
/******* end of Users maintenance ****************************/
// wait for updates to complete
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,expected_success,lime_tester::wait_for_timeout));
// delete the users
if (cleanDatabase) {
aliceManager->delete_user(*aliceDeviceId, callback);
bobManager->delete_user(*bobDeviceId, callback);
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,expected_success+2,lime_tester::wait_for_timeout)); // we must get a callback saying all went well
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,expected_success+2,lime_tester::wait_for_timeout)); // we must get a callback saying all went well
remove(dbFilenameAlice.data());
remove(dbFilenameBob.data());
}
......@@ -432,13 +432,13 @@ static void helloworld_verifyIdentity_test(const lime::CurveId curve, const std:
aliceManager->create_user(tmp_aliceDeviceId, x3dh_server_url, curve, lime_tester::OPkInitialBatchSize, callback);
tmp_aliceDeviceId.clear(); // deviceId may go out of scope as soon as we come back from call
// wait for the operation to complete
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
auto tmp_bobDeviceId = *bobDeviceId; // use a temporary variable as it may be a local variable which get out of scope right after call to create_user
bobManager->create_user(tmp_bobDeviceId, x3dh_server_url, curve, callback);
tmp_bobDeviceId.clear(); // deviceId may go out of scope as soon as we come back from call
// wait for the operation to complete
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
// [verify] Retrieve from Managers Bob and Alice device Identity Key
std::vector<uint8_t> aliceIk{};
......@@ -538,7 +538,7 @@ static void helloworld_verifyIdentity_test(const lime::CurveId curve, const std:
/************** SYNCHRO **************************************/
// this is just waiting for the callback to increase the operation_success field in counters
// sending ticks to the belle-sip stack in order to process messages
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
LIME_LOGI<<"Alice encrypt the message, callback Ok or timeout reached"<<endl;
/****** end of SYNCHRO **************************************/
......@@ -588,13 +588,13 @@ static void helloworld_verifyIdentity_test(const lime::CurveId curve, const std:
expected_success+=2;
/******* end of Users maintenance ****************************/
// wait for updates to complete
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,expected_success,lime_tester::wait_for_timeout));
// delete the users
if (cleanDatabase) {
aliceManager->delete_user(*aliceDeviceId, callback);
bobManager->delete_user(*bobDeviceId, callback);
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,expected_success+2,lime_tester::wait_for_timeout)); // we must get a callback saying all went well
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,expected_success+2,lime_tester::wait_for_timeout)); // we must get a callback saying all went well
remove(dbFilenameAlice.data());
remove(dbFilenameBob.data());
}
......
This diff is collapsed.
......@@ -35,7 +35,7 @@
using namespace::std;
using namespace::lime;
static belle_sip_stack_t *stack=NULL;
static belle_sip_stack_t *bc_stack=NULL;
static belle_http_provider_t *prov=NULL;
// maximum runtime target for a bench run, the group size will be adjusted to match it
......@@ -43,9 +43,9 @@ static belle_http_provider_t *prov=NULL;
uint64_t maximumBenchTime = 120000; // in ms
static int http_before_all(void) {
stack=belle_sip_stack_new(NULL);
bc_stack=belle_sip_stack_new(NULL);
prov=belle_sip_stack_create_http_provider(stack,"0.0.0.0");
prov=belle_sip_stack_create_http_provider(bc_stack,"0.0.0.0");
belle_tls_crypto_config_t *crypto_config=belle_tls_crypto_config_new();
......@@ -57,7 +57,7 @@ static int http_before_all(void) {
static int http_after_all(void) {
belle_sip_object_unref(prov);
belle_sip_object_unref(stack);
belle_sip_object_unref(bc_stack);
return 0;
}
......@@ -191,7 +191,7 @@ static void group_basic_test(const lime::CurveId curve, const std::string &dbBas
// create user
manager->create_user(deviceId, x3dh_server_url, curve, lime_tester::OPkInitialBatchSize+i, callback); // give them at least <index> OPk at creation
expected_success++;
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success, expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success, expected_success,lime_tester::wait_for_timeout));
}
if (bench) {
......@@ -227,7 +227,7 @@ static void group_basic_test(const lime::CurveId curve, const std::string &dbBas
//encrypt
auto cipherMessage = make_shared<std::vector<uint8_t>>();
manager->encrypt(*(devicesId[senderIndex]), groupName, recipients, message, cipherMessage, callback);
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,++expected_success,lime_tester::wait_for_timeout));
if (bench) {
if (i==0) { // first run shall be the longest as we have deviceNumber-1 sessions to establish
......@@ -283,7 +283,7 @@ static void group_basic_test(const lime::CurveId curve, const std::string &dbBas
manager = std::unique_ptr<LimeManager>(new LimeManager(dbFilename[i], X3DHServerPost));
manager->delete_user(*(devicesId[i]), callback);
expected_success++;
BC_ASSERT_TRUE(lime_tester::wait_for(stack,&counters.operation_success,expected_success,lime_tester::wait_for_timeout));
BC_ASSERT_TRUE(lime_tester::wait_for(bc_stack,&counters.operation_success,expected_success,lime_tester::wait_for_timeout));
}
for (auto i=0; i<deviceNumber; i++) {
......
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