From dfc3545d79e0cec89eab03f31c2a1f4322fd237c Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Wed, 22 Aug 2018 20:35:04 +0900 Subject: [PATCH] Fix unit test. Update README. --- README.md | 10 ++++++++-- tests/tester.cc | 6 ++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 734783b..5b357aa 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,15 @@ using namespace tinygltf; Model model; TinyGLTF loader; std::string err; +std::string warn; -bool ret = loader.LoadASCIIFromFile(&model, &err, argv[1]); -//bool ret = loader.LoadBinaryFromFile(&model, &err, argv[1]); // for binary glTF(.glb) +bool ret = loader.LoadASCIIFromFile(&model, &err, &warn, argv[1]); +//bool ret = loader.LoadBinaryFromFile(&model, &err, &warn, argv[1]); // for binary glTF(.glb) + +if (!warn.empty()) { + printf("Warn: %s\n", warn.c_str()); +} + if (!err.empty()) { printf("Err: %s\n", err.c_str()); } diff --git a/tests/tester.cc b/tests/tester.cc index 377ea0e..ca0ced3 100644 --- a/tests/tester.cc +++ b/tests/tester.cc @@ -18,8 +18,9 @@ TEST_CASE("parse-error", "[parse]") { tinygltf::Model model; tinygltf::TinyGLTF ctx; std::string err; + std::string warn; - bool ret = ctx.LoadASCIIFromString(&model, &err, "bora", strlen("bora"), /* basedir*/ ""); + bool ret = ctx.LoadASCIIFromString(&model, &err, &warn, "bora", strlen("bora"), /* basedir*/ ""); REQUIRE(false == ret); @@ -30,8 +31,9 @@ TEST_CASE("datauri-in-glb", "[issue-79]") { tinygltf::Model model; tinygltf::TinyGLTF ctx; std::string err; + std::string warn; - bool ret = ctx.LoadBinaryFromFile(&model, &err, "../models/box01.glb"); + bool ret = ctx.LoadBinaryFromFile(&model, &err, &warn, "../models/box01.glb"); if (!err.empty()) { std::cerr << err << std::endl; }