2008-08-28 17:35:36 +00:00
|
|
|
#ifndef TESTIMPORTER_H
|
|
|
|
#define TESTIMPORTER_H
|
|
|
|
|
|
|
|
#include <cppunit/TestFixture.h>
|
|
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
|
|
|
|
|
|
#include <assimp.hpp>
|
2009-01-12 22:06:54 +00:00
|
|
|
#include <BaseImporter.h>
|
2008-08-28 17:35:36 +00:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace Assimp;
|
|
|
|
|
|
|
|
class ImporterTest : public CPPUNIT_NS :: TestFixture
|
|
|
|
{
|
|
|
|
CPPUNIT_TEST_SUITE (ImporterTest);
|
|
|
|
CPPUNIT_TEST (testIntProperty);
|
|
|
|
CPPUNIT_TEST (testFloatProperty);
|
|
|
|
CPPUNIT_TEST (testStringProperty);
|
|
|
|
CPPUNIT_TEST (testPluginInterface);
|
|
|
|
CPPUNIT_TEST (testExtensionCheck);
|
|
|
|
CPPUNIT_TEST_SUITE_END ();
|
|
|
|
|
|
|
|
public:
|
|
|
|
void setUp (void);
|
|
|
|
void tearDown (void);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
void testIntProperty (void);
|
|
|
|
void testFloatProperty (void);
|
|
|
|
void testStringProperty (void);
|
|
|
|
|
|
|
|
void testPluginInterface (void);
|
|
|
|
void testExtensionCheck (void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Importer* pImp;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TestPlugin : public BaseImporter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// overriden
|
|
|
|
bool CanRead( const std::string& pFile,
|
|
|
|
IOSystem* pIOHandler) const;
|
|
|
|
|
|
|
|
// overriden
|
|
|
|
void GetExtensionList(std::string& append);
|
|
|
|
|
|
|
|
// overriden
|
|
|
|
void InternReadFile( const std::string& pFile,
|
|
|
|
aiScene* pScene, IOSystem* pIOHandler);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|