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

Function TEST

test/operand_test.cpp:24–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22using ::testing::ValuesIn;
23
24TEST(OperandString, AllAreDefinedExceptVariable) {
25 // None has no string, so don't test it.
26 EXPECT_EQ(0u, SPV_OPERAND_TYPE_NONE);
27 // Start testing at enum with value 1, skipping None.
28 for (int i = 1; i < int(SPV_OPERAND_TYPE_NUM_OPERAND_TYPES); i++) {
29 const auto type = static_cast<spv_operand_type_t>(i);
30 if (spvOperandIsVariable(type)) {
31 EXPECT_STREQ("unknown", spvOperandTypeStr(type))
32 << " variable type " << i << " has a name '"
33 << spvOperandTypeStr(type) << "'when it should not";
34 } else {
35 EXPECT_STRNE("unknown", spvOperandTypeStr(type))
36 << " operand type " << i << " has no name when it should";
37 }
38 }
39}
40
41TEST(OperandIsConcreteMask, Sample) {
42 // Check a few operand types preceding the concrete mask types.

Callers

nothing calls this directly

Calls 5

spvOperandIsVariableFunction · 0.85
spvOperandTypeStrFunction · 0.85
spvOperandIsConcreteMaskFunction · 0.85
spvOperandIsConcreteFunction · 0.85
spvOperandIsOptionalFunction · 0.85

Tested by

no test coverage detected