From e07d3628e90427e38c0afa1d77554101bf749492 Mon Sep 17 00:00:00 2001 From: Kamalesh Babulal Date: Tue, 8 Aug 2023 16:26:53 +0530 Subject: [PATCH] gunit/012: 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/012-cgroup_create_cgroup.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/gunit/012-cgroup_create_cgroup.cpp b/tests/gunit/012-cgroup_create_cgroup.cpp index dbe7c534..1d771058 100644 --- a/tests/gunit/012-cgroup_create_cgroup.cpp +++ b/tests/gunit/012-cgroup_create_cgroup.cpp @@ -23,8 +23,7 @@ static const char * const CONTROLLERS[] = { "namespaces", "netns", }; -static const int CONTROLLERS_CNT = - sizeof(CONTROLLERS) / sizeof(CONTROLLERS[0]); +static const int CONTROLLERS_CNT = ARRAY_SIZE(CONTROLLERS); static cg_version_t VERSIONS[] = { CGROUP_V1, @@ -34,8 +33,7 @@ static cg_version_t VERSIONS[] = { CGROUP_V1, CGROUP_V2, }; -static const int VERSIONS_CNT = - sizeof(VERSIONS) / sizeof(VERSIONS[0]); +static const int VERSIONS_CNT = ARRAY_SIZE(VERSIONS); class CgroupCreateCgroupTest : public ::testing::Test { protected: -- 2.47.2