1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * This file is part of the libgltf project. 4 * 5 * This Source Code Form is subject to the terms of the Mozilla Public 6 * License, v. 2.0. If a copy of the MPL was not distributed with this 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 */ 9 10 #ifndef APITEST_H_INCLUDED 11 #define APITEST_H_INCLUDED 12 13 #include <cppunit/TestFixture.h> 14 #include <cppunit/extensions/HelperMacros.h> 15 16 #include <libgltf.h> 17 18 #define DUCK_FILE_NAME "../data/duck_model/duck.json" 19 20 namespace libgltf { namespace test 21 { 22 23 class APITest : public CPPUNIT_NS::TestFixture 24 { 25 public: 26 virtual void setUp(); 27 virtual void tearDown(); 28 29 private: 30 CPPUNIT_TEST_SUITE(APITest); 31 CPPUNIT_TEST(test_gltf_renderer_init); 32 CPPUNIT_TEST(test_gltf_renderer_set_content); 33 CPPUNIT_TEST(test_gltf_get_camera_pos); 34 CPPUNIT_TEST(test_gltf_enable_disable_rotation); 35 CPPUNIT_TEST(test_gltf_get_model_center_pos); 36 CPPUNIT_TEST(test_gltf_get_model_size); 37 CPPUNIT_TEST_SUITE_END(); 38 39 private: 40 41 void test_gltf_renderer_init(); 42 void test_gltf_renderer_set_content(); 43 void test_gltf_get_camera_pos(); 44 void test_gltf_enable_disable_rotation(); 45 void test_gltf_get_model_center_pos(); 46 void test_gltf_get_model_size(); 47 48 // Helper methods 49 glTFHandle* parseJsonAndLoadInputFiles(std::vector<glTFFile>& vInputFiles, const std::string& sFilename = DUCK_FILE_NAME); 50 glTFHandle* initSceneAndSetContent(const std::string& sFilename = DUCK_FILE_NAME); 51 52 void readInputFiles(std::vector<glTFFile>& vInputFiles, const std::string& sJsonName); 53 void releaseInputFiles(std::vector<glTFFile>& vInputFiles); 54 }; 55 56 } // test 57 } // libgltf 58 59 #endif // APITEST_H_INCLUDED 60 61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 62