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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Changes to tracefs library APIs were introduced by this patch set:
https://lore.kernel.org/linux-trace-devel/20210409180423.72497-1-y.karadz@xxxxxxxxx/
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@xxxxxxxxx>
Suggested-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx>
---
 utest/tracefs-utest.c | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

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)
-- 
2.30.2




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux