]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
gunit/009: use ARRAY_SIZE() macro
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 8 Aug 2023 10:56:49 +0000 (16:26 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 10 Aug 2023 15:56:48 +0000 (09:56 -0600)
Use ARRAY_SIZE() macro to calculate the length of the array, across the
file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
tests/gunit/009-cgroup_set_values_recursive.cpp

index 7e6bad9ccc7f601b3e57796ccf2f987f97efe0eb..0e7b09d8d0e17ee0e47520aeb044f98efd163ae8 100644 (file)
@@ -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 {