using ::testing::HasSubstr;
using std::string;
-using std::pair;
using ValidateTypeUnique = spvtest::ValidateBase<bool>;
+// TODO(atgoo@github) Error logging temporarily disabled because it's failing
+// vulkancts tests. See https://github.com/KhronosGroup/SPIRV-Tools/issues/559
+// const spv_result_t kDuplicateTypeError = SPV_ERROR_INVALID_DATA;
+const spv_result_t kDuplicateTypeError = SPV_SUCCESS;
+
const string& GetHeader() {
static const string header = R"(
OpCapability Shader
%boolt2 = OpTypeVoid
)" + GetBody();
CompileSuccessfully(str.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ ASSERT_EQ(kDuplicateTypeError, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeVoid)));
}
%boolt2 = OpTypeBool
)" + GetBody();
CompileSuccessfully(str.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ ASSERT_EQ(kDuplicateTypeError, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeBool)));
}
%uintt2 = OpTypeInt 32 0
)" + GetBody();
CompileSuccessfully(str.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ ASSERT_EQ(kDuplicateTypeError, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeInt)));
}
%floatt2 = OpTypeFloat 32
)" + GetBody();
CompileSuccessfully(str.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ ASSERT_EQ(kDuplicateTypeError, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(), HasSubstr(GetErrorString(SpvOpTypeFloat)));
}
%vec3t2 = OpTypeVector %floatt 3
)" + GetBody();
CompileSuccessfully(str.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ ASSERT_EQ(kDuplicateTypeError, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr(GetErrorString(SpvOpTypeVector)));
}
%mat33t2 = OpTypeMatrix %vec3t 3
)" + GetBody();
CompileSuccessfully(str.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ ASSERT_EQ(kDuplicateTypeError, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr(GetErrorString(SpvOpTypeMatrix)));
}
%vfunct2 = OpTypeFunction %voidt
)" + GetBody();
CompileSuccessfully(str.c_str());
- ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+ ASSERT_EQ(kDuplicateTypeError, ValidateInstructions());
EXPECT_THAT(getDiagnosticString(),
HasSubstr(GetErrorString(SpvOpTypeFunction)));
}
%ps2 = OpTypePipeStorage
)";
CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_1);
- ASSERT_EQ(SPV_ERROR_INVALID_DATA,
- ValidateInstructions(SPV_ENV_UNIVERSAL_1_1));
+ ASSERT_EQ(kDuplicateTypeError, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1));
EXPECT_THAT(getDiagnosticString(),
HasSubstr(GetErrorString(SpvOpTypePipeStorage)));
}
%nb2 = OpTypeNamedBarrier
)";
CompileSuccessfully(str.c_str(), SPV_ENV_UNIVERSAL_1_1);
- ASSERT_EQ(SPV_ERROR_INVALID_DATA,
- ValidateInstructions(SPV_ENV_UNIVERSAL_1_1));
+ ASSERT_EQ(kDuplicateTypeError, ValidateInstructions(SPV_ENV_UNIVERSAL_1_1));
EXPECT_THAT(getDiagnosticString(),
HasSubstr(GetErrorString(SpvOpTypeNamedBarrier)));
}