Fix unit tests that use durations

The tests that used objects that expected a default value for a duration
failed due to missing parameters.
This commit is contained in:
Markus Mäkelä
2019-05-06 05:19:38 +03:00
parent 24df547ac8
commit 20a7170024
5 changed files with 37 additions and 16 deletions

View File

@ -61,14 +61,18 @@ static int test1()
set_libdir(MXS_STRDUP_A("../../modules/routing/readconnroute/"));
load_module("readconnroute", MODULE_ROUTER);
MXS_CONFIG_PARAMETER parameters;
parameters.set(CN_MAX_RETRY_INTERVAL, "10s");
parameters.set(CN_CONNECTION_TIMEOUT, "10s");
/* Service tests */
fprintf(stderr,
"testservice : creating service called MyService with router nonexistent");
service = service_alloc("MyService", "non-existent", NULL);
service = service_alloc("MyService", "non-existent", &parameters);
mxb_assert_message(NULL == service, "New service with invalid router should be null");
mxb_assert_message(0 == service_isvalid(service), "Service must not be valid after incorrect creation");
fprintf(stderr, "\t..done\nValid service creation, router testroute.");
service = service_alloc("MyService", "readconnroute", NULL);
service = service_alloc("MyService", "readconnroute", &parameters);
mxb_assert_message(NULL != service, "New service with valid router must not be null");
mxb_assert_message(0 != service_isvalid(service), "Service must be valid after creation");