/** @file * @author Edouard DUPIN * @copyright 2015, Edouard DUPIN, all right reserved * @license MPL v2.0 (see license file) */ #include #define TEST_SAVE_FILE_MACRO(type,fileName,dataPointer,nbElement) \ do { \ static FILE *pointerOnFile = nullptr; \ static bool errorOpen = false; \ if (pointerOnFile == nullptr) { \ TEST_WARNING("open file '" << fileName << "' type=" << #type); \ pointerOnFile = fopen(fileName,"w"); \ if ( errorOpen == false \ && pointerOnFile == nullptr) { \ TEST_ERROR("ERROR OPEN file ... '" << fileName << "' type=" << #type); \ errorOpen=true; \ } \ } \ if (pointerOnFile != nullptr) { \ fwrite((dataPointer), sizeof(type), (nbElement), pointerOnFile); \ /* fflush(pointerOnFile);*/ \ } \ }while(0) #include