break;
case 'D': // DirectX container file - DXBC
- if (startswith(Magic, "DXBC") && Magic.size() == 4)
+ if (startswith(Magic, "DXBC"))
return file_magic::dxcontainer_object;
break;
}
TEST(DXCFile, IdentifyMagic) {
- StringRef Buffer("DXBC");
- EXPECT_EQ(identify_magic(Buffer), file_magic::dxcontainer_object);
+ {
+ StringRef Buffer("DXBC");
+ EXPECT_EQ(identify_magic(Buffer), file_magic::dxcontainer_object);
+ }
+ {
+ StringRef Buffer("DXBCBlahBlahBlah");
+ EXPECT_EQ(identify_magic(Buffer), file_magic::dxcontainer_object);
+ }
}
TEST(DXCFile, ParseHeaderErrors) {