utImporter.h 1.26 KB
Newer Older
wester committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
#ifndef TESTIMPORTER_H
#define TESTIMPORTER_H

#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>

#include <assimp/Importer.hpp>
#include <BaseImporter.h>

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 (testMemoryRead);
	CPPUNIT_TEST (testMultipleReads);
    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);
		void  testMemoryRead (void);

		void  testMultipleReads (void);

	private:

		Importer* pImp;
};

class TestPlugin : public BaseImporter
{
public:

	// overriden
	bool CanRead( const std::string& pFile, 
		IOSystem* pIOHandler, bool test) const;

	// overriden
	const aiImporterDesc* GetInfo () const;

	// overriden
	void InternReadFile( const std::string& pFile, 
		aiScene* pScene, IOSystem* pIOHandler);
};

#endif