The tracefs_printf() and tracefs_vprintf() APIs do not write the terminating NULL characted of the string in the trace marker, as it is not required by the kernel interafce. Fixed the unit test to not expect that terminating NULL while verifying the result of these APIs. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> --- utest/tracefs-utest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c index 04b5e81..d675c16 100644 --- a/utest/tracefs-utest.c +++ b/utest/tracefs-utest.c @@ -287,14 +287,14 @@ static void test_instance_ftrace_marker(struct tracefs_instance *instance) CU_TEST(tracefs_printf(instance, "Test marker: %s 0x%X", string, data) == 0); } asprintf(&str, "Test marker: %s 0x%X", string, data); - CU_TEST(find_test_marker(instance, str, strlen(str) + 1, MARKERS_WRITE_COUNT, false)); + CU_TEST(find_test_marker(instance, str, strlen(str), MARKERS_WRITE_COUNT, false)); free(str); for (i = 0; i < MARKERS_WRITE_COUNT; i++) { CU_TEST(marker_vprint(instance, "Test marker V: %s 0x%X", string, data) == 0); } asprintf(&str, "Test marker V: %s 0x%X", string, data); - CU_TEST(find_test_marker(instance, str, strlen(str) + 1, MARKERS_WRITE_COUNT, false)); + CU_TEST(find_test_marker(instance, str, strlen(str), MARKERS_WRITE_COUNT, false)); free(str); tracefs_print_close(instance); -- 2.30.2