@@ -823,23 +823,38 @@ TEST(DXCFile, MalformedSignature) {
823
823
}
824
824
825
825
TEST (RootSignature, ParseRootFlags) {
826
- uint8_t Buffer[] = {
827
- 0x44 , 0x58 , 0x42 , 0x43 , 0x32 , 0x9A , 0x53 , 0xD8 , 0xEC , 0xBE , 0x35 , 0x6F ,
828
- 0x05 , 0x39 , 0xE1 , 0xFE , 0x31 , 0x20 , 0xF0 , 0xC1 , 0x01 , 0x00 , 0x00 , 0x00 ,
829
- 0x44 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x24 , 0x00 , 0x00 , 0x00 ,
830
- 0x52 , 0x54 , 0x53 , 0x30 , 0x18 , 0x00 , 0x00 , 0x00 , 0x02 , 0x00 , 0x00 , 0x00 ,
831
- 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
832
- 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
833
- };
834
- DXContainer C =
835
- llvm::cantFail (DXContainer::create (getMemoryBuffer<180 >(Buffer)));
826
+ {
827
+ uint8_t Buffer[] = {
828
+ 0x44 , 0x58 , 0x42 , 0x43 , 0x32 , 0x9A , 0x53 , 0xD8 , 0xEC , 0xBE , 0x35 , 0x6F ,
829
+ 0x05 , 0x39 , 0xE1 , 0xFE , 0x31 , 0x20 , 0xF0 , 0xC1 , 0x01 , 0x00 , 0x00 , 0x00 ,
830
+ 0x44 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x24 , 0x00 , 0x00 , 0x00 ,
831
+ 0x52 , 0x54 , 0x53 , 0x30 , 0x18 , 0x00 , 0x00 , 0x00 , 0x02 , 0x00 , 0x00 , 0x00 ,
832
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
833
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 ,
834
+ };
835
+ DXContainer C =
836
+ llvm::cantFail (DXContainer::create (getMemoryBuffer<180 >(Buffer)));
837
+
838
+ const auto &RS = C.getRootSignature ();
839
+ ASSERT_TRUE (RS.has_value ());
840
+ ASSERT_EQ (RS->getVersion (), 2 );
841
+ ASSERT_EQ (RS->getNumParameters (), 0 );
842
+ ASSERT_EQ (RS->getRootParametersOffset (), 0 );
843
+ ASSERT_EQ (RS->getNumStaticSamplers (), 0 );
844
+ ASSERT_EQ (RS->getStaticSamplersOffset (), 0 );
845
+ ASSERT_EQ (RS->getFlags (), 0x01 );
846
+ }
836
847
837
- const auto &RS = C.getRootSignature ();
838
- ASSERT_TRUE (RS.has_value ());
839
- ASSERT_EQ (RS->getVersion (), 2 );
840
- ASSERT_EQ (RS->getNumParameters (), 0 );
841
- ASSERT_EQ (RS->getRootParametersOffset (), 0 );
842
- ASSERT_EQ (RS->getNumStaticSamplers (), 0 );
843
- ASSERT_EQ (RS->getStaticSamplersOffset (), 0 );
844
- ASSERT_EQ (RS->getFlags (), 0x01 );
848
+ {
849
+ uint8_t Buffer[] = {
850
+ 0x44 , 0x58 , 0x42 , 0x43 , 0x32 , 0x9A , 0x53 , 0xD8 , 0xEC , 0xBE , 0x35 ,
851
+ 0x6F , 0x05 , 0x39 , 0xE1 , 0xFE , 0x31 , 0x20 , 0xF0 , 0xC1 , 0x01 , 0x00 ,
852
+ 0x00 , 0x00 , 0x44 , 0x00 , 0x00 , 0x00 , 0x01 , 0x00 , 0x00 , 0x00 , 0x24 ,
853
+ 0x00 , 0x00 , 0x00 , 0x52 , 0x54 , 0x53 , 0x30 , 0x18 , 0x00 , 0x00 , 0x00 ,
854
+ 0x02 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
855
+ 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ,
856
+ };
857
+ EXPECT_THAT_EXPECTED (DXContainer::create (getMemoryBuffer<44 >(Buffer)),
858
+ FailedWithMessage (" Invalid data. Too small." ));
859
+ }
845
860
}
0 commit comments