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

Function TEST_F

test/binary_header_get_test.cpp:45–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43};
44
45TEST_F(BinaryHeaderGet, Default) {
46 spv_endianness_t endian;
47 spv_const_binary_t const_bin = get_const_binary();
48 ASSERT_EQ(SPV_SUCCESS, spvBinaryEndianness(&const_bin, &endian));
49
50 spv_header_t header;
51 ASSERT_EQ(SPV_SUCCESS, spvBinaryHeaderGet(&const_bin, endian, &header));
52
53 ASSERT_EQ(static_cast<uint32_t>(spv::MagicNumber), header.magic);
54 // Expect SPIRV-Headers updated to SPIR-V 1.6.
55 ASSERT_EQ(0x00010600u, header.version);
56 ASSERT_EQ(static_cast<uint32_t>(SPV_GENERATOR_CODEPLAY), header.generator);
57 ASSERT_EQ(1u, header.bound);
58 ASSERT_EQ(0u, header.schema);
59 ASSERT_EQ(&code[5], header.instructions);
60}
61
62TEST_F(BinaryHeaderGet, InvalidCode) {
63 spv_const_binary_t my_binary = {nullptr, 0};

Callers

nothing calls this directly

Calls 2

spvBinaryEndiannessFunction · 0.85
spvBinaryHeaderGetFunction · 0.85

Tested by

no test coverage detected