]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
gunit/015: use ARRAY_SIZE() macro
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 8 Aug 2023 10:56:58 +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/015-cgroupv2_controller_enabled.cpp

index f5ad47c2fde66dd34c3c71fdee246d13a1a2c8c4..85db6fee26168b7d573303bafff5e43a42c354d3 100644 (file)
@@ -23,8 +23,7 @@ static const char * const CHILD_DIRS[] = {
        "test3-ctrlrenabled",
        "test4-ctrlrdisabled",
 };
-static const int CHILD_DIRS_CNT =
-       sizeof(CHILD_DIRS) / sizeof(CHILD_DIRS[0]);
+static const int CHILD_DIRS_CNT = ARRAY_SIZE(CHILD_DIRS);
 
 static const char * const CONTROLLERS[] = {
        "cpu",
@@ -34,8 +33,7 @@ static const char * const CONTROLLERS[] = {
        "net_cls",
        "pids",
 };
-static const int CONTROLLERS_CNT =
-       sizeof(CONTROLLERS) / sizeof(CONTROLLERS[0]);
+static const int CONTROLLERS_CNT = ARRAY_SIZE(CONTROLLERS);
 
 static const enum cg_version_t VERSIONS[] = {
        CGROUP_V2,