]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
gunit/013: fix build warnings
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Tue, 19 Sep 2023 04:59:53 +0000 (10:29 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 25 Oct 2023 20:20:14 +0000 (14:20 -0600)
commitbc4c18ec63806d2cdc58cb0c064857bca6b49ec0
treed1f270ce56be2f0f4effb30c36ff716ea661eaf2
parente57e682f1b45e047ac1a9778314917c56536ec2c
gunit/013: fix build warnings

Fix unused variable warnings and signed comparison warning across the
test case:

013-cgroup_build_tasks_procs_path.cpp: In member function ‘virtual void BuildTasksProcPathTest_BuildTasksProcPathTest_CgV2_Test::TestBody()’:
013-cgroup_build_tasks_procs_path.cpp:112:27: warning: unused variable ‘ctrlr’ [-Wunused-variable]
  struct cgroup_controller ctrlr = {0};
                           ^~~~~
013-cgroup_build_tasks_procs_path.cpp: In member function ‘virtual void BuildTasksProcPathTest_BuildTasksProcPathTest_CgV1WithNs_Test::TestBody()’:
013-cgroup_build_tasks_procs_path.cpp:126:27: warning: unused variable ‘ctrlr’ [-Wunused-variable]
  struct cgroup_controller ctrlr = {0};
                           ^~~~~
013-cgroup_build_tasks_procs_path.cpp: In member function ‘virtual void BuildTasksProcPathTest_BuildTasksProcPathTest_CgV2WithNs_Test::TestBody()’:
013-cgroup_build_tasks_procs_path.cpp:140:27: warning: unused variable ‘ctrlr’ [-Wunused-variable]
  struct cgroup_controller ctrlr = {0};
                           ^~~~~
In file included from 013-cgroup_build_tasks_procs_path.cpp:9:
../../googletest/googletest/include/gtest/gtest.h: In instantiation of ‘testing::AssertionResult testing::internal::CmpHelperLT(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]’:
013-cgroup_build_tasks_procs_path.cpp:53:4:   required from here
../../googletest/googletest/include/gtest/gtest.h:1526:28: warning: comparison of integer expressions of different signedness: ‘const int’ and ‘const long unsigned int’ [-Wsign-compare]
../../googletest/googletest/include/gtest/gtest.h:1510:7:
   if (val1 op val2) {\
       ~~~~~~~~~~~~
../../googletest/googletest/include/gtest/gtest.h:1526:28:
 GTEST_IMPL_CMP_HELPER_(LT, <);
../../googletest/googletest/include/gtest/gtest.h:1510:12: note: in definition of macro ‘GTEST_IMPL_CMP_HELPER_’
   if (val1 op val2) {\
            ^~

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