add unittest for x3d-importer.

pull/1542/head
Kim Kulling 2017-11-05 17:41:26 +01:00
parent d5692ccf30
commit 2929a27edc
3 changed files with 17 additions and 12 deletions

View File

@ -431,7 +431,7 @@ void OpenGEXImporter::handleNodes( DDLNode *node, aiScene *pScene ) {
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleMetricNode( DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleMetricNode( DDLNode *node, aiScene * /*pScene*/ ) {
if( nullptr == node || nullptr == m_ctx ) { if( nullptr == node || nullptr == m_ctx ) {
return; return;
} }
@ -467,7 +467,7 @@ void OpenGEXImporter::handleMetricNode( DDLNode *node, aiScene */*pScene*/ ) {
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleNameNode( DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleNameNode( DDLNode *node, aiScene * /*pScene*/ ) {
if( nullptr == m_currentNode ) { if( nullptr == m_currentNode ) {
throw DeadlyImportError( "No current node for name." ); throw DeadlyImportError( "No current node for name." );
return; return;
@ -512,7 +512,7 @@ static void getRefNames( DDLNode *node, std::vector<std::string> &names ) {
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleObjectRefNode( DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleObjectRefNode( DDLNode *node, aiScene * /*pScene*/ ) {
if( nullptr == m_currentNode ) { if( nullptr == m_currentNode ) {
throw DeadlyImportError( "No parent node for name." ); throw DeadlyImportError( "No parent node for name." );
return; return;
@ -536,7 +536,7 @@ void OpenGEXImporter::handleObjectRefNode( DDLNode *node, aiScene */*pScene*/ )
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleMaterialRefNode( ODDLParser::DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleMaterialRefNode( ODDLParser::DDLNode *node, aiScene * /*pScene*/ ) {
if( nullptr == m_currentNode ) { if( nullptr == m_currentNode ) {
throw DeadlyImportError( "No parent node for name." ); throw DeadlyImportError( "No parent node for name." );
return; return;
@ -674,7 +674,7 @@ static void setMatrix( aiNode *node, DataArrayList *transformData ) {
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleTransformNode( ODDLParser::DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleTransformNode( ODDLParser::DDLNode *node, aiScene * /*pScene*/ ) {
if( nullptr == m_currentNode ) { if( nullptr == m_currentNode ) {
throw DeadlyImportError( "No parent node for name." ); throw DeadlyImportError( "No parent node for name." );
return; return;
@ -819,7 +819,7 @@ static void copyColor4DArray( size_t numItems, DataArrayList *vaList, aiColor4D
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene * /*pScene*/ ) {
if( nullptr == node ) { if( nullptr == node ) {
throw DeadlyImportError( "No parent node for name." ); throw DeadlyImportError( "No parent node for name." );
return; return;
@ -862,7 +862,7 @@ void OpenGEXImporter::handleVertexArrayNode( ODDLParser::DDLNode *node, aiScene
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleIndexArrayNode( ODDLParser::DDLNode *node, aiScene * /*pScene*/ ) {
if( nullptr == node ) { if( nullptr == node ) {
throw DeadlyImportError( "No parent node for name." ); throw DeadlyImportError( "No parent node for name." );
return; return;
@ -1001,7 +1001,7 @@ void OpenGEXImporter::handleMaterialNode( ODDLParser::DDLNode *node, aiScene *pS
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleColorNode( ODDLParser::DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleColorNode( ODDLParser::DDLNode *node, aiScene * /*pScene*/ ) {
if( nullptr == node ) { if( nullptr == node ) {
return; return;
} }
@ -1040,7 +1040,7 @@ void OpenGEXImporter::handleColorNode( ODDLParser::DDLNode *node, aiScene */*pSc
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleTextureNode( ODDLParser::DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleTextureNode( ODDLParser::DDLNode *node, aiScene * /*pScene*/ ) {
if( nullptr == node ) { if( nullptr == node ) {
return; return;
} }
@ -1074,7 +1074,7 @@ void OpenGEXImporter::handleTextureNode( ODDLParser::DDLNode *node, aiScene */*p
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleParamNode( ODDLParser::DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleParamNode( ODDLParser::DDLNode *node, aiScene * /*pScene*/ ) {
if ( nullptr == node ) { if ( nullptr == node ) {
return; return;
} }
@ -1103,7 +1103,7 @@ void OpenGEXImporter::handleParamNode( ODDLParser::DDLNode *node, aiScene */*pSc
} }
//------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleAttenNode( ODDLParser::DDLNode *node, aiScene */*pScene*/ ) { void OpenGEXImporter::handleAttenNode( ODDLParser::DDLNode *node, aiScene * /*pScene*/ ) {
if ( nullptr == node ) { if ( nullptr == node ) {
return; return;
} }

View File

@ -41,7 +41,11 @@ struct Property;
template<class T> template<class T>
inline inline
bool isEmbeddedCommentOpenTag( T *in, T */*end*/ ) { bool isEmbeddedCommentOpenTag( T *in, T *end ) {
if ( in == end ) {
return false;
}
if ( in == '/' && in+1 == '*' ) { if ( in == '/' && in+1 == '*' ) {
return true; return true;
} }

View File

@ -129,6 +129,7 @@ SET( TEST_SRCS
unit/utVersion.cpp unit/utVersion.cpp
unit/utVector3.cpp unit/utVector3.cpp
unit/utXImporterExporter.cpp unit/utXImporterExporter.cpp
unit/utX3DImportExport.cpp
unit/utD3MFImportExport.cpp unit/utD3MFImportExport.cpp
unit/utQ3DImportExport.cpp unit/utQ3DImportExport.cpp
unit/utProfiler.cpp unit/utProfiler.cpp