audio-river/test/main.cpp

55 lines
1.3 KiB
C++
Raw Normal View History

2015-01-26 22:04:29 +01:00
/** @file
* @author Edouard DUPIN
* @copyright 2015, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
2015-01-26 22:04:29 +01:00
*/
2015-01-25 22:17:06 +01:00
2016-10-02 22:19:26 +02:00
#include <test-debug/debug.hpp>
2015-10-14 21:21:03 +02:00
#define TEST_SAVE_FILE_MACRO(type,fileName,dataPointer,nbElement) \
do { \
2018-06-19 22:13:48 +02:00
static FILE *pointerOnFile = null; \
2015-10-14 21:21:03 +02:00
static bool errorOpen = false; \
2018-06-19 22:13:48 +02:00
if (pointerOnFile == null) { \
2015-10-14 21:21:03 +02:00
TEST_WARNING("open file '" << fileName << "' type=" << #type); \
pointerOnFile = fopen(fileName,"w"); \
if ( errorOpen == false \
2018-06-19 22:13:48 +02:00
&& pointerOnFile == null) { \
2015-10-14 21:21:03 +02:00
TEST_ERROR("ERROR OPEN file ... '" << fileName << "' type=" << #type); \
errorOpen=true; \
} \
} \
2018-06-19 22:13:48 +02:00
if (pointerOnFile != null) { \
2015-10-14 21:21:03 +02:00
fwrite((dataPointer), sizeof(type), (nbElement), pointerOnFile); \
/* fflush(pointerOnFile);*/ \
} \
}while(0)
2016-10-02 22:19:26 +02:00
#include <audio/river/river.hpp>
#include <audio/river/Manager.hpp>
#include <audio/river/Interface.hpp>
2017-09-07 23:38:26 +02:00
#include <etest/etest.hpp>
2016-10-02 22:19:26 +02:00
#include <etk/etk.hpp>
2017-09-26 15:57:44 +02:00
extern "C" {
#include <math.h>
}
2016-10-13 21:29:18 +02:00
2017-09-07 23:38:26 +02:00
#include <ethread/Thread.hpp>
2015-03-03 23:17:43 +01:00
2015-04-11 09:38:30 +02:00
int main(int _argc, const char** _argv) {
2017-11-07 13:38:04 +01:00
etest::init(_argc, _argv);
2015-03-25 21:14:12 +01:00
for (int32_t iii=0; iii<_argc ; ++iii) {
2017-08-28 00:08:50 +02:00
etk::String data = _argv[iii];
2015-03-25 21:14:12 +01:00
if ( data == "-h"
|| data == "--help") {
2015-10-14 21:21:03 +02:00
TEST_PRINT("Help : ");
TEST_PRINT(" ./xxx ---");
2015-01-26 22:04:29 +01:00
exit(0);
}
2015-01-25 22:17:06 +01:00
}
2015-01-26 22:04:29 +01:00
return RUN_ALL_TESTS();
2015-01-25 22:17:06 +01:00
}