make tester fail for issue 177 failing (explicit MTL base dir given by API user)

This commit is contained in:
Max Limper
2018-07-09 12:19:33 +02:00
parent 7a88cddefc
commit eba327b9c0

View File

@@ -769,13 +769,19 @@ TEST_CASE("invalid-face-definition", "[face]") {
}
TEST_CASE("Empty mtl basedir", "[Issue177]") {
// Win32 spesific?
tinyobj::attrib_t attrib;
std::vector<tinyobj::shape_t> shapes;
std::vector<tinyobj::material_t> materials;
std::string err;
bool ret = tinyobj::LoadObj(&attrib, &shapes, &materials, &err, "issue-177.obj");
// A case where the user explicitly provides an empty string
// Win32 specific?
const char * userBaseDir = "";
bool ret = tinyobj::LoadObj(&attrib, &shapes, &materials, &err, "issue-177.obj", userBaseDir);
// if mtl loading fails, we get an error message (WARN) here
ret &= err.empty();
if (!err.empty()) {
std::cerr << "[Issue177] " << err << std::endl;