2015-04-15 23:00:17 +00:00
|
|
|
#include "../../include/assimp/DefaultLogger.hpp"
|
2020-03-22 11:13:09 +00:00
|
|
|
#include "UnitTestPCH.h"
|
2015-05-19 04:24:07 +00:00
|
|
|
#include <math.h>
|
|
|
|
#include <time.h>
|
|
|
|
|
2020-03-22 11:13:09 +00:00
|
|
|
int main(int argc, char *argv[]) {
|
2015-05-19 04:26:05 +00:00
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
2015-05-19 04:24:07 +00:00
|
|
|
|
2015-05-19 04:26:05 +00:00
|
|
|
// seed the randomizer with the current system time
|
2020-03-22 11:13:09 +00:00
|
|
|
time_t t;
|
|
|
|
time(&t);
|
2015-05-19 04:26:05 +00:00
|
|
|
srand((unsigned int)t);
|
2015-05-19 04:24:07 +00:00
|
|
|
|
2015-05-19 04:26:05 +00:00
|
|
|
// ............................................................................
|
2015-05-19 04:24:07 +00:00
|
|
|
|
2015-05-19 04:26:05 +00:00
|
|
|
// create a logger from both CPP
|
2020-03-22 11:13:09 +00:00
|
|
|
Assimp::DefaultLogger::create("AssimpLog_Cpp.txt", Assimp::Logger::VERBOSE,
|
|
|
|
aiDefaultLogStream_STDOUT | aiDefaultLogStream_DEBUGGER | aiDefaultLogStream_FILE);
|
2015-05-19 04:24:07 +00:00
|
|
|
|
2015-05-19 04:26:05 +00:00
|
|
|
// .. and C. They should smoothly work together
|
|
|
|
aiEnableVerboseLogging(AI_TRUE);
|
2020-03-22 11:13:09 +00:00
|
|
|
aiLogStream logstream = aiGetPredefinedLogStream(aiDefaultLogStream_FILE, "AssimpLog_C.txt");
|
2015-05-19 04:26:05 +00:00
|
|
|
aiAttachLogStream(&logstream);
|
2015-05-19 04:24:07 +00:00
|
|
|
|
2015-05-19 04:26:05 +00:00
|
|
|
int result = RUN_ALL_TESTS();
|
2015-05-19 04:24:07 +00:00
|
|
|
|
2015-05-19 04:26:05 +00:00
|
|
|
// ............................................................................
|
|
|
|
// but shutdown must be done from C to ensure proper deallocation
|
|
|
|
aiDetachAllLogStreams();
|
2015-05-19 04:24:07 +00:00
|
|
|
|
2015-05-19 04:26:05 +00:00
|
|
|
return result;
|
2015-05-19 04:24:07 +00:00
|
|
|
}
|