mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-15 15:05:57 +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);
|
REQUIRE(true == ret);
|
||||||
|
|
||||||
|
err.clear();
|
||||||
|
warn.clear();
|
||||||
|
|
||||||
tinygltf::Model model_empty_buffer;
|
tinygltf::Model model_empty_buffer;
|
||||||
model_empty_buffer.buffers.push_back(tinygltf::Buffer());
|
model_empty_buffer.buffers.push_back(tinygltf::Buffer());
|
||||||
stream = std::stringstream();
|
stream = std::stringstream();
|
||||||
@ -514,6 +517,9 @@ TEST_CASE("empty-bin-buffer", "[issue-382]") {
|
|||||||
}
|
}
|
||||||
REQUIRE(false == ret);
|
REQUIRE(false == ret);
|
||||||
|
|
||||||
|
err.clear();
|
||||||
|
warn.clear();
|
||||||
|
|
||||||
tinygltf::Model model_single_byte_buffer;
|
tinygltf::Model model_single_byte_buffer;
|
||||||
tinygltf::Buffer buffer;
|
tinygltf::Buffer buffer;
|
||||||
buffer.data.push_back(0);
|
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);
|
ret = ctx.WriteGltfSceneToStream(&model_single_byte_buffer, stream, false, true);
|
||||||
REQUIRE(ret == true);
|
REQUIRE(ret == true);
|
||||||
str = stream.str();
|
str = stream.str();
|
||||||
|
{
|
||||||
|
std::ofstream ofs("tmp.glb");
|
||||||
|
ofs.write(str.data(), str.size());
|
||||||
|
}
|
||||||
|
|
||||||
bytes = (unsigned char*)str.data();
|
bytes = (unsigned char*)str.data();
|
||||||
ret = ctx.LoadBinaryFromMemory(&model_single_byte_buffer, &err, &warn, bytes, str.size());
|
ret = ctx.LoadBinaryFromMemory(&model_single_byte_buffer, &err, &warn, bytes, str.size());
|
||||||
if (!err.empty()) {
|
if (!err.empty()) {
|
||||||
std::cerr << err << std::endl;
|
std::cerr << err << std::endl;
|
||||||
}
|
}
|
||||||
REQUIRE(true == ret);
|
REQUIRE(true == ret);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user