Fix unused variable and sign comparison warnings across the test case:
017-API_fuzz_test.cpp: In member function ‘virtual void APIArgsTest_API_cgroup_add_controller_Test::TestBody()’:
017-API_fuzz_test.cpp:190:6: warning: unused variable ‘ret’ [-Wunused-variable]
int ret;
^~~
In file included from 017-API_fuzz_test.cpp:11:
../../googletest/googletest/include/gtest/gtest.h: In instantiation of ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 = int]’:
../../googletest/googletest/include/gtest/gtest.h:1421:23: required from ‘static testing::AssertionResult testing::internal::EqHelper<lhs_is_null_literal>::Compare(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 = int; bool lhs_is_null_literal = false]’
017-API_fuzz_test.cpp:480:2: required from here
../../googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison of integer expressions of different signedness: ‘const long unsigned int’ and ‘const int’ [-Wsign-compare]
if (lhs == rhs) {
~~~~^~~~~~
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
const char * const new_cg_ctrl = NULL;
struct cgroup_controller *cgc = NULL;
struct cgroup *cgroup = NULL;
- int ret;
// case 1
// cgrp = NULL, name = NULL
// check if the value was set right
ret = cgroup_get_value_uint64(cgc, name, &value);
ASSERT_EQ(ret, 0);
- ASSERT_EQ(value, 1024);
+ ASSERT_EQ((int)value, 1024);
free(name);
}