Commit c349997b authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Add test

parent 72ed8f2a
Pipeline #101280 passed with stages
in 4 minutes and 48 seconds
......@@ -6,6 +6,31 @@
#include "baseConfig.h"
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTableConst(const TableParameters & tab){
bool b(true);
b &= tab.getTabValue(0) != NULL;
b &= tab.getTabValueFull() != NULL;
return b;
}
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTable(TableParameters & tab){
bool b(true);
b &= tab.getTabValue(0) != NULL;
b &= tab.getTabValueFull() != NULL;
return b;
}
///Test to write data
/** @param fileName : name of the file to be written
* @return true on success, false otherwise
......@@ -16,6 +41,10 @@ bool testWriteData(const std::string & fileName){
table.setAllDim(nbCol); //Always set the dimentions before resize call
table.resize(nbRow);
bool b(true);
b &= checkGeneratedTableConst(table);
b &= checkGeneratedTable(table);
//Let's set some values in the Table
for(size_t i(0lu); i < nbRow; ++i){
table.setX(i, i);
......@@ -29,7 +58,7 @@ bool testWriteData(const std::string & fileName){
//And write our table directly in it
table.write(fileName);
return true;
return b;
}
///Test to read data
......
......@@ -6,6 +6,50 @@
#include "configTable.h"
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTableConst(const TableEvent & tab){
bool b(true);
std::cout << "checkGeneratedTable : get event id" << tab.getEventId(0) << std::endl;
b &= tab.getEventIdFull() != NULL;
std::cout << "checkGeneratedTable : get event id" << tab.getTimestamp(0) << std::endl;
b &= tab.getTimestampFull() != NULL;
b &= tab.getCalibSignal(0) != NULL;
b &= tab.getCalibSignalFull() != NULL;
b &= tab.getWaveform(0) != NULL;
b &= tab.getWaveformFull() != NULL;
return b;
}
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTable(TableEvent & tab){
bool b(true);
std::cout << "checkGeneratedTable : get event id" << tab.getEventId(0) << std::endl;
b &= tab.getEventIdFull() != NULL;
std::cout << "checkGeneratedTable : get event id" << tab.getTimestamp(0) << std::endl;
b &= tab.getTimestampFull() != NULL;
b &= tab.getCalibSignal(0) != NULL;
b &= tab.getCalibSignalFull() != NULL;
b &= tab.getWaveform(0) != NULL;
b &= tab.getWaveformFull() != NULL;
return b;
}
///Test to write data
/** @param fileName : name of the file to be written
* @return true on success, false otherwise
......@@ -16,6 +60,10 @@ bool testWriteData(const std::string & fileName){
table.setAllDim(nbPixel, nbSlice);
table.resize(nbRow);
bool b(true);
b &= checkGeneratedTableConst(table);
b &= checkGeneratedTable(table);
//Let's set some values in the Table
for(size_t i(0lu); i < nbRow; ++i){
table.setEventId(i, i);
......@@ -34,7 +82,7 @@ bool testWriteData(const std::string & fileName){
//And write our table directly in it
table.write(fileName);
return true;
return b;
}
///Test to read data
......
......@@ -6,6 +6,43 @@
#include "configTableFixedSize.h"
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTableConst(const TableVertex & tab){
bool b(true);
std::cout << "checkGeneratedTable : get event id" << tab.getEventId(0) << std::endl;
b &= tab.getEventIdFull() != NULL;
std::cout << "checkGeneratedTable : get event id" << tab.getTimestamp(0) << std::endl;
b &= tab.getTimestampFull() != NULL;
b &= tab.getTabVertex(0) != NULL;
b &= tab.getTabVertexFull() != NULL;
return b;
}
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTable(TableVertex & tab){
bool b(true);
std::cout << "checkGeneratedTable : get event id" << tab.getEventId(0) << std::endl;
b &= tab.getEventIdFull() != NULL;
std::cout << "checkGeneratedTable : get event id" << tab.getTimestamp(0) << std::endl;
b &= tab.getTimestampFull() != NULL;
b &= tab.getTabVertex(0) != NULL;
b &= tab.getTabVertexFull() != NULL;
return b;
}
///Test to write data
/** @param fileName : name of the file to be written
* @return true on success, false otherwise
......@@ -15,6 +52,10 @@ bool testWriteData(const std::string & fileName){
size_t nbRow(10lu);
table.resize(nbRow);
bool b(true);
b &= checkGeneratedTableConst(table);
b &= checkGeneratedTable(table);
//Let's set some values in the Table
for(size_t i(0lu); i < nbRow; ++i){
table.setEventId(i, i);
......@@ -28,7 +69,7 @@ bool testWriteData(const std::string & fileName){
//And write our table directly in it
table.write(fileName);
return true;
return b;
}
///Test to read data
......
......@@ -6,6 +6,43 @@
#include "configTableFixedSize2.h"
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTableConst(const TableVertex & tab){
bool b(true);
std::cout << "checkGeneratedTable : get event id" << tab.getEventId(0) << std::endl;
b &= tab.getEventIdFull() != NULL;
std::cout << "checkGeneratedTable : get event id" << tab.getTimestamp(0) << std::endl;
b &= tab.getTimestampFull() != NULL;
b &= tab.getTabVertex(0) != NULL;
b &= tab.getTabVertexFull() != NULL;
return b;
}
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTable(TableVertex & tab){
bool b(true);
std::cout << "checkGeneratedTable : get event id" << tab.getEventId(0) << std::endl;
b &= tab.getEventIdFull() != NULL;
std::cout << "checkGeneratedTable : get event id" << tab.getTimestamp(0) << std::endl;
b &= tab.getTimestampFull() != NULL;
b &= tab.getTabVertex(0) != NULL;
b &= tab.getTabVertexFull() != NULL;
return b;
}
///Test to write data
/** @param fileName : name of the file to be written
* @return true on success, false otherwise
......@@ -15,6 +52,10 @@ bool testWriteData(const std::string & fileName){
size_t nbRow(10lu);
table.resize(nbRow);
bool b(true);
b &= checkGeneratedTableConst(table);
b &= checkGeneratedTable(table);
//Let's set some values in the Table
for(size_t i(0lu); i < nbRow; ++i){
table.setEventId(i, i);
......@@ -29,7 +70,7 @@ bool testWriteData(const std::string & fileName){
//And write our table directly in it
table.write(fileName);
return true;
return b;
}
///Test to read data
......
......@@ -6,6 +6,62 @@
#include "configType.h"
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTableConst(const TableType & tab){
bool b(true);
std::cout << "checkGeneratedTable : get char" << tab.getValChar(0) << std::endl;
b &= tab.getValCharFull() != NULL;
std::cout << "checkGeneratedTable : get double" << tab.getValDouble(0) << std::endl;
b &= tab.getValDoubleFull() != NULL;
std::cout << "checkGeneratedTable : get float" << tab.getValFloat(0) << std::endl;
b &= tab.getValFloatFull() != NULL;
std::cout << "checkGeneratedTable : get int" << tab.getValInt(0) << std::endl;
b &= tab.getValIntFull() != NULL;
std::cout << "checkGeneratedTable : get short" << tab.getValShort(0) << std::endl;
b &= tab.getValShortFull() != NULL;
std::cout << "checkGeneratedTable : get unsigned int" << tab.getValUInt(0) << std::endl;
b &= tab.getValUIntFull() != NULL;
return b;
}
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTable(TableType & tab){
bool b(true);
std::cout << "checkGeneratedTable : get char" << tab.getValChar(0) << std::endl;
b &= tab.getValCharFull() != NULL;
std::cout << "checkGeneratedTable : get double" << tab.getValDouble(0) << std::endl;
b &= tab.getValDoubleFull() != NULL;
std::cout << "checkGeneratedTable : get float" << tab.getValFloat(0) << std::endl;
b &= tab.getValFloatFull() != NULL;
std::cout << "checkGeneratedTable : get int" << tab.getValInt(0) << std::endl;
b &= tab.getValIntFull() != NULL;
std::cout << "checkGeneratedTable : get short" << tab.getValShort(0) << std::endl;
b &= tab.getValShortFull() != NULL;
std::cout << "checkGeneratedTable : get unsigned int" << tab.getValUInt(0) << std::endl;
b &= tab.getValUIntFull() != NULL;
return b;
}
///Test to write data
/** @param fileName : name of the file to be written
* @return true on success, false otherwise
......@@ -15,6 +71,10 @@ bool testWriteData(const std::string & fileName){
size_t nbRow(10lu);
table.resize(nbRow);
bool b(true);
b &= checkGeneratedTableConst(table);
b &= checkGeneratedTable(table);
//Let's set some values in the Table
for(size_t i(0lu); i < nbRow; ++i){
table.setValFloat(i, i);
......
......@@ -6,6 +6,62 @@
#include "configType.h"
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTableConst(const TableType & tab){
bool b(true);
std::cout << "checkGeneratedTable : get char" << tab.getValChar(0) << std::endl;
b &= tab.getValCharFull() != NULL;
std::cout << "checkGeneratedTable : get double" << tab.getValDouble(0) << std::endl;
b &= tab.getValDoubleFull() != NULL;
std::cout << "checkGeneratedTable : get float" << tab.getValFloat(0) << std::endl;
b &= tab.getValFloatFull() != NULL;
std::cout << "checkGeneratedTable : get int" << tab.getValInt(0) << std::endl;
b &= tab.getValIntFull() != NULL;
std::cout << "checkGeneratedTable : get short" << tab.getValShort(0) << std::endl;
b &= tab.getValShortFull() != NULL;
std::cout << "checkGeneratedTable : get unsigned int" << tab.getValUInt(0) << std::endl;
b &= tab.getValUIntFull() != NULL;
return b;
}
///Check the generated table of data
/** @param tab : table of data
* @return true on success, false otherwise
*/
bool checkGeneratedTable(TableType & tab){
bool b(true);
std::cout << "checkGeneratedTable : get char" << tab.getValChar(0) << std::endl;
b &= tab.getValCharFull() != NULL;
std::cout << "checkGeneratedTable : get double" << tab.getValDouble(0) << std::endl;
b &= tab.getValDoubleFull() != NULL;
std::cout << "checkGeneratedTable : get float" << tab.getValFloat(0) << std::endl;
b &= tab.getValFloatFull() != NULL;
std::cout << "checkGeneratedTable : get int" << tab.getValInt(0) << std::endl;
b &= tab.getValIntFull() != NULL;
std::cout << "checkGeneratedTable : get short" << tab.getValShort(0) << std::endl;
b &= tab.getValShortFull() != NULL;
std::cout << "checkGeneratedTable : get unsigned int" << tab.getValUInt(0) << std::endl;
b &= tab.getValUIntFull() != NULL;
return b;
}
///Test to write data
/** @param fileName : name of the file to be written
* @return true on success, false otherwise
......@@ -15,6 +71,10 @@ bool testWriteData(const std::string & fileName){
size_t nbRow(10lu);
table.resize(nbRow);
bool b(true);
b &= checkGeneratedTableConst(table);
b &= checkGeneratedTable(table);
//Let's set some values in the Table
for(size_t i(0lu); i < nbRow; ++i){
table.setValFloat(i, i);
......@@ -28,7 +88,7 @@ bool testWriteData(const std::string & fileName){
//And write our table directly in it
table.write(fileName);
return true;
return b;
}
///Test to read data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment