mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-15 12:56:01 +08:00
Clear error/warn message.
This commit is contained in:
parent
612e57816f
commit
e9fbc03e2d
@ -501,6 +501,9 @@ TEST_CASE("empty-bin-buffer", "[issue-382]") {
|
||||
}
|
||||
REQUIRE(true == ret);
|
||||
|
||||
err.clear();
|
||||
warn.clear();
|
||||
|
||||
tinygltf::Model model_empty_buffer;
|
||||
model_empty_buffer.buffers.push_back(tinygltf::Buffer());
|
||||
stream = std::stringstream();
|
||||
@ -514,6 +517,9 @@ TEST_CASE("empty-bin-buffer", "[issue-382]") {
|
||||
}
|
||||
REQUIRE(false == ret);
|
||||
|
||||
err.clear();
|
||||
warn.clear();
|
||||
|
||||
tinygltf::Model model_single_byte_buffer;
|
||||
tinygltf::Buffer buffer;
|
||||
buffer.data.push_back(0);
|
||||
@ -522,10 +528,15 @@ TEST_CASE("empty-bin-buffer", "[issue-382]") {
|
||||
ret = ctx.WriteGltfSceneToStream(&model_single_byte_buffer, stream, false, true);
|
||||
REQUIRE(ret == true);
|
||||
str = stream.str();
|
||||
{
|
||||
std::ofstream ofs("tmp.glb");
|
||||
ofs.write(str.data(), str.size());
|
||||
}
|
||||
|
||||
bytes = (unsigned char*)str.data();
|
||||
ret = ctx.LoadBinaryFromMemory(&model_single_byte_buffer, &err, &warn, bytes, str.size());
|
||||
if (!err.empty()) {
|
||||
std::cerr << err << std::endl;
|
||||
}
|
||||
REQUIRE(true == ret);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user