| 43 | }; |
| 44 | |
| 45 | TEST_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 | |
| 62 | TEST_F(BinaryHeaderGet, InvalidCode) { |
| 63 | spv_const_binary_t my_binary = {nullptr, 0}; |
nothing calls this directly
no test coverage detected