diff --git a/server/core/test/CMakeLists.txt b/server/core/test/CMakeLists.txt index b6bf9d25c..2a0977088 100644 --- a/server/core/test/CMakeLists.txt +++ b/server/core/test/CMakeLists.txt @@ -25,8 +25,8 @@ target_link_libraries(test_service fullcore) target_link_libraries(test_server fullcore) target_link_libraries(test_users fullcore) target_link_libraries(test_adminusers fullcore) -add_test(testMySQLUsers test_mysql_users) target_link_libraries(testmemlog fullcore) +add_test(testMySQLUsers test_mysql_users) add_test(TestHash test_hash) add_test(TestHint test_hint) add_test(TestSpinlock test_spinlock) @@ -35,8 +35,22 @@ add_test(TestBuffer test_buffer) add_test(TestDCB test_dcb) add_test(TestModutil test_modutil) add_test(TestPoll test_poll) -add_test(TestService /bin/sh -c " MAXSCALE_HOME=${CMAKE_BINARY_DIR} && ${CMAKE_CURRENT_BINAR_DIR}/test_service") +add_test(TestService test_service) add_test(TestServer test_server) add_test(TestUsers test_users) add_test(TestAdminUsers test_adminusers) add_test(TestMemlog testmemlog) +set_tests_properties(testMySQLUsers + TestHash + TestHint + TestSpinlock + TestFilter + TestBuffer + TestDCB + TestModutil + TestPoll + TestService + TestServer + TestUsers + TestAdminUsers + TestMemlog PROPERTIES ENVIRONMENT MAXSCALE_HOME=${CMAKE_BINARY_DIR}/) diff --git a/server/core/test/testservice.c b/server/core/test/testservice.c index 49f6d0e24..085a411ca 100644 --- a/server/core/test/testservice.c +++ b/server/core/test/testservice.c @@ -32,7 +32,7 @@ #include #include #include - +#include /** * test1 Allocate a service and do lots of other things * @@ -52,7 +52,7 @@ char* argv[] = { NULL }; skygw_logmanager_init(argc,argv); - +poll_init(); /* Service tests */ ss_dfprintf(stderr, "testservice : creating service called MyService with router nonexistent"); diff --git a/server/core/test/testusers.c b/server/core/test/testusers.c index 2186de335..d947075a0 100644 --- a/server/core/test/testusers.c +++ b/server/core/test/testusers.c @@ -72,6 +72,11 @@ int result, count; skygw_log_sync_all(); ss_info_dassert(NULL != authdata, "Fetch valid user must not return NULL"); ss_info_dassert(0 == strcmp("newauth", authdata), "User authorisation should be correctly updated"); + + ss_dfprintf(stderr, "\t..done\nAdd another user"); + count = users_add(users, "username2", "authorisation2"); + skygw_log_sync_all(); + ss_info_dassert(1 == count, "Should add one user"); ss_dfprintf(stderr, "\t..done\nDelete a user."); count = users_delete(users, "username"); skygw_log_sync_all(); diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 00269cfd8..cc1a2e8f1 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -3842,7 +3842,7 @@ static bool execute_sescmd_in_backend( tmpbuf = scur->scmd_cur_cmd->my_sescmd_buf; qlen = MYSQL_GET_PACKET_LEN((unsigned char*)tmpbuf->start); memset(data->db,0,MYSQL_DATABASE_MAXLEN+1); - if(qlen > 0 && qlen < UINT_MAX) + if(qlen > 0 && qlen < MYSQL_DATABASE_MAXLEN+1) strncpy(data->db,tmpbuf->start+5,qlen - 1); } /** Fallthrough */