From 3e3d0147122e954b12001d481b742a22f404e36e Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Tue, 8 Aug 2023 16:26:49 +0530 Subject: [PATCH] gunit/009: use ARRAY_SIZE() macro Use ARRAY_SIZE() macro to calculate the length of the array, across the file. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- tests/gunit/009-cgroup_set_values_recursive.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/gunit/009-cgroup_set_values_recursive.cpp b/tests/gunit/009-cgroup_set_values_recursive.cpp index 7e6bad9c..0e7b09d8 100644 --- a/tests/gunit/009-cgroup_set_values_recursive.cpp +++ b/tests/gunit/009-cgroup_set_values_recursive.cpp @@ -20,7 +20,7 @@ static const char * const NAMES[] = { "cpu.foo", "cpu.bar" }; -static const int NAMES_CNT = sizeof(NAMES) / sizeof(NAMES[0]); +static const int NAMES_CNT = ARRAY_SIZE(NAMES); static const char * const VALUES[] = { "999", @@ -28,7 +28,7 @@ static const char * const VALUES[] = { "random", "data" }; -static const int VALUES_CNT = sizeof(VALUES) / sizeof(VALUES[0]); +static const int VALUES_CNT = ARRAY_SIZE(VALUES); class SetValuesRecursiveTest : public ::testing::Test { -- 2.47.2