diff mbox series

[1/3] libtracefs: Fix trace options unit test

Message ID 20210412042419.3295237-2-tz.stoyanov@gmail.com (mailing list archive)
State Accepted
Commit a263e1fff95014340f889a3c5e76fd332de92982
Headers show
Series Fix unit tests and APIs for loading saved mappings | expand

Commit Message

Tzvetomir Stoyanov (VMware) April 12, 2021, 4:24 a.m. UTC
Changes to tracefs library APIs were introduced by this patch set:
https://lore.kernel.org/linux-trace-devel/20210409180423.72497-1-y.karadz@gmail.com/
which make the option mask immutable and controlled by the library.
However, the unit test was not updated and fails.
Fixed the trace options unit test, to reflect the changes in the API.

Reported-by: Sameeruddin Shaik <sameeruddin.shaik8@gmail.com>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 utest/tracefs-utest.c | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)
diff mbox series

Patch

diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c
index 1f48e6f..04b5e81 100644
--- a/utest/tracefs-utest.c
+++ b/utest/tracefs-utest.c
@@ -679,21 +679,11 @@  out:
 	return ret;
 }
 
-static bool check_options_mask_empty(struct tracefs_options_mask *mask)
-{
-	int i;
-
-	for (i = 1; i < TRACEFS_OPTION_MAX; i++) {
-		if (tracefs_option_mask_is_set(mask, i))
-			return false;
-	}
-	return true;
-}
-
 static void test_instance_tracing_options(struct tracefs_instance *instance)
 {
-	struct tracefs_options_mask *enabled;
-	struct tracefs_options_mask *all, *all_copy;
+	const struct tracefs_options_mask *enabled;
+	const struct tracefs_options_mask *all_copy;
+	const struct tracefs_options_mask *all;
 	enum tracefs_option_id i = 1;
 	char file[PATH_MAX];
 	const char *name;
@@ -743,11 +733,6 @@  static void test_instance_tracing_options(struct tracefs_instance *instance)
 			CU_TEST(check_option(instance, i, true, 0));
 		}
 	}
-	CU_TEST(check_options_mask_empty(all));
-	CU_TEST(check_options_mask_empty(enabled));
-
-	free(all);
-	free(enabled);
 }
 
 static void test_tracing_options(void)