Parse multiple group names. Fixes #146
This commit is contained in:
@@ -807,6 +807,24 @@ TEST_CASE("line-primitive", "[line]") {
|
||||
REQUIRE(6 == shapes[0].path.indices.size());
|
||||
}
|
||||
|
||||
TEST_CASE("multiple-group-names", "[group]") {
|
||||
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, "../models/cube.obj", gMtlBasePath);
|
||||
|
||||
if (!err.empty()) {
|
||||
std::cerr << "[group] " << err << std::endl;
|
||||
}
|
||||
|
||||
REQUIRE(true == ret);
|
||||
REQUIRE(6 == shapes.size());
|
||||
REQUIRE(0 == shapes[0].name.compare("front cube"));
|
||||
REQUIRE(0 == shapes[1].name.compare("back cube")); // multiple whitespaces are aggregated as single white space.
|
||||
}
|
||||
|
||||
// Fuzzer test.
|
||||
// Just check if it does not crash.
|
||||
// Disable by default since Windows filesystem can't create filename of afl testdata
|
||||
|
||||
Reference in New Issue
Block a user