MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / isNullOperandTest

Method isNullOperandTest

test/testastutils.cpp:130–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128 }
129
130 void isNullOperandTest() {
131 ASSERT_EQUALS(true, isNullOperand("(void*)0;"));
132 ASSERT_EQUALS(true, isNullOperand("(void*)0U;"));
133 ASSERT_EQUALS(true, isNullOperand("(void*)0x0LL;"));
134 ASSERT_EQUALS(true, isNullOperand("NULL;"));
135 ASSERT_EQUALS(true, isNullOperand("nullptr;"));
136 ASSERT_EQUALS(true, isNullOperand("(void*)NULL;"));
137 ASSERT_EQUALS(true, isNullOperand("static_cast<int*>(0);"));
138 ASSERT_EQUALS(false, isNullOperand("0;"));
139 ASSERT_EQUALS(false, isNullOperand("(void*)0.0;"));
140 ASSERT_EQUALS(false, isNullOperand("(void*)1;"));
141 }
142
143#define isReturnScope(...) isReturnScope_(__FILE__, __LINE__, __VA_ARGS__)
144 template<size_t size>

Callers

nothing calls this directly

Calls 1

isNullOperandFunction · 0.85

Tested by

no test coverage detected