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