Unittests: add validation for TestIOSystem parameters.

pull/1003/merge
Kim Kulling 2017-04-19 19:57:20 +02:00
parent 3e4a01ab04
commit 1a8b23712e
1 changed files with 14 additions and 4 deletions

View File

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2016, assimp team
Copyright (c) 2006-2017, assimp team
All rights reserved.
@ -45,12 +45,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/IOSystem.hpp>
using namespace std;
using namespace Assimp;
namespace Assimp {
static const string Sep = "/";
class TestIOSystem : public IOSystem {
public:
TestIOSystem() : IOSystem() {}
TestIOSystem()
: IOSystem() {
// empty
}
virtual ~TestIOSystem() {}
virtual bool Exists( const char* ) const {
return true;
@ -60,10 +66,14 @@ public:
}
virtual IOStream* Open( const char* pFile, const char* pMode = "rb" ) {
EXPECT_NE( nullptr, pFile );
EXPECT_NE( nullptr, pMode );
return NULL;
}
virtual void Close( IOStream* pFile ) {
// empty
EXPECT_NE( nullptr, pFile );
}
};
} // Namespace Assimp