From e6c2d8328282e8e5ab4f98b185a143391aadc9a8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 23 Jan 2020 19:26:39 +0100 Subject: Add a test for the FILE * STL reader. --- test/stl_binary_reader_test.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/stl_binary_reader_test.cc b/test/stl_binary_reader_test.cc index 57fbd1c..0d17858 100644 --- a/test/stl_binary_reader_test.cc +++ b/test/stl_binary_reader_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014 Carl Hetherington + Copyright (C) 2014-2020 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ using std::list; using std::ifstream; /* Test reading of a binary STL file */ -BOOST_AUTO_TEST_CASE (stl_binary_reader_test) +BOOST_AUTO_TEST_CASE (stl_binary_reader_test1) { if (private_test.empty ()) { return; @@ -37,3 +37,18 @@ BOOST_AUTO_TEST_CASE (stl_binary_reader_test) ifstream f (p.string().c_str ()); sub::STLBinaryReader r (f); } + +/* Test reading the same file but with the FILE* interface */ +BOOST_AUTO_TEST_CASE (stl_binary_reader_test2) +{ + if (private_test.empty ()) { + return; + } + + boost::filesystem::path p = private_test / "Vampire_Academy_24fps_Reel_6_DE_FR.stl"; + FILE* f = fopen (p.string().c_str(), "rb"); + BOOST_REQUIRE (f); + sub::STLBinaryReader r (f); + fclose (f); +} + -- cgit v1.2.3