From: Kamalesh Babulal Date: Tue, 8 Aug 2023 10:56:49 +0000 (+0530) Subject: gunit/009: use ARRAY_SIZE() macro X-Git-Tag: v3.2.0~238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e3d0147122e954b12001d481b742a22f404e36e;p=thirdparty%2Flibcgroup.git 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 --- 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 {