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

Method testBitfields_

test/testvalueflow.cpp:9328–9334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9326
9327#define testBitfields(...) testBitfields_(__FILE__, __LINE__, __VA_ARGS__)
9328 void testBitfields_(const char *file, int line, const std::string &structBody, std::size_t expectedSize) {
9329 const Settings settingsUnix64 = settingsBuilder().platform(Platform::Type::Unix64).build();
9330 const std::string code = "struct S { " + structBody + " }; const std::size_t size = sizeof(S);";
9331 const auto values = tokenValues(code.c_str(), "( S", &settingsUnix64);
9332 ASSERT_LOC(!values.empty(), file, line);
9333 ASSERT_EQUALS_LOC(expectedSize, values.back().intvalue, file, line);
9334 }
9335
9336 void bitfields() {
9337

Callers

nothing calls this directly

Calls 2

buildMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected