make tester fail for issue 177 failing (explicit MTL base dir given by API user)
This commit is contained in:
@@ -769,13 +769,19 @@ TEST_CASE("invalid-face-definition", "[face]") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Empty mtl basedir", "[Issue177]") {
|
TEST_CASE("Empty mtl basedir", "[Issue177]") {
|
||||||
// Win32 spesific?
|
|
||||||
tinyobj::attrib_t attrib;
|
tinyobj::attrib_t attrib;
|
||||||
std::vector<tinyobj::shape_t> shapes;
|
std::vector<tinyobj::shape_t> shapes;
|
||||||
std::vector<tinyobj::material_t> materials;
|
std::vector<tinyobj::material_t> materials;
|
||||||
|
|
||||||
std::string err;
|
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()) {
|
if (!err.empty()) {
|
||||||
std::cerr << "[Issue177] " << err << std::endl;
|
std::cerr << "[Issue177] " << err << std::endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user