@@ -14,6 +14,7 @@
int replacement_logging_used;
static int odp_init_log(odp_log_level_e level , const char *fmt, ...);
+static void odp_init_abort(void) ODP_NORETURN;
static void test_odp_init_global(void)
{
@@ -30,6 +31,7 @@ static void test_odp_init_global_replace_log(void)
int status;
struct odp_init_t init_data;
+ memset(&init_data, 0, sizeof(init_data));
init_data.log_fn = &odp_init_log;
replacement_logging_used = 0;
@@ -43,9 +45,25 @@ static void test_odp_init_global_replace_log(void)
CU_ASSERT(status == 0);
}
+static void test_odp_init_global_replace_abort(void)
+{
+ int status;
+ struct odp_init_t init_data;
+
+ memset(&init_data, 0, sizeof(init_data));
+ init_data.abort_fn = &odp_init_abort;
+
+ status = odp_init_global(&init_data, NULL);
+ CU_ASSERT_FATAL(status == 0);
+
+ status = odp_term_global();
+ CU_ASSERT(status == 0);
+}
+
CU_TestInfo test_odp_init[] = {
{"test_odp_init_global", test_odp_init_global},
{"replace log", test_odp_init_global_replace_log},
+ {"replace abort", test_odp_init_global_replace_abort},
CU_TEST_INFO_NULL,
};
@@ -90,3 +108,8 @@ int odp_init_log(odp_log_level_e level __attribute__((unused)),
return r;
}
+
+void odp_init_abort(void)
+{
+ abort();
+}
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> --- test/validation/odp_init.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)