MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / GetTestMessageConsumer

Function GetTestMessageConsumer

test/opt/pass_utils.cpp:38–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36} // anonymous namespace
37
38MessageConsumer GetTestMessageConsumer(
39 std::vector<Message>& expected_messages) {
40 return [&expected_messages](spv_message_level_t level, const char* source,
41 const spv_position_t& position,
42 const char* message) {
43 EXPECT_TRUE(!expected_messages.empty());
44 if (expected_messages.empty()) {
45 return;
46 }
47
48 EXPECT_EQ(expected_messages[0].level, level);
49 EXPECT_EQ(expected_messages[0].line_number, position.line);
50 EXPECT_EQ(expected_messages[0].column_number, position.column);
51 EXPECT_STREQ(expected_messages[0].source_file, source);
52 EXPECT_STREQ(expected_messages[0].message, message);
53
54 expected_messages.erase(expected_messages.begin());
55 };
56}
57
58bool FindAndReplace(std::string* process_str, const std::string find_str,
59 const std::string replace_str) {

Callers 7

TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 3

emptyMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by 7

TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68