Test SPV_CAPABILITY_AS_MASK macro

This commit is contained in:
David Neto 2015-10-01 13:46:38 -04:00
parent 0cd7352d7d
commit 287fdb0eb0

View File

@ -65,6 +65,15 @@ TEST(OpcodeRequiresCapability, None) {
ASSERT_EQ(0, spvOpcodeRequiresCapabilities(&entry));
}
/// Test SPV_CAPBILITY_AS_MASK
TEST(CapabilityAsMaskMacro, Sample) {
EXPECT_EQ(uint64_t(1), SPV_CAPABILITY_AS_MASK(spv::CapabilityMatrix));
EXPECT_EQ(uint64_t(0x10000), SPV_CAPABILITY_AS_MASK(spv::CapabilityImageSRGBWrite));
EXPECT_EQ(uint64_t(0x100000000ULL), SPV_CAPABILITY_AS_MASK(spv::CapabilityClipDistance));
EXPECT_EQ(uint64_t(1) << 53, SPV_CAPABILITY_AS_MASK(spv::CapabilityTransformFeedback));
};
/// Capabilities required by an Opcode.
struct ExpectedOpCodeCapabilities {
spv::Op opcode;