##// END OF EJS Templates
Fixed bug range diff, the upper range was wrong, tstart and tstop...
Fixed bug range diff, the upper range was wrong, tstart and tstop were swapped Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r0:86b06c4cec3c
r33:ebdfb72336f0
Show More
TestContainers.cpp
36 lines | 860 B | text/x-c | CppLexer
/ tests / Common / TestContainers.cpp
First init from SciQLop Core module...
r0 #include <Common/containers.h>
#include <vector>
#include <set>
#include <list>
#include <QVector>
#include <QList>
#include <QObject>
#include <QtTest>
template<class T>
void test()
{
T cont{{1,2,3,3,3}};
T empty;
QCOMPARE(SciQLop::containers::contains(cont,1),true);
QCOMPARE(SciQLop::containers::contains(cont,3),true);
QCOMPARE(SciQLop::containers::contains(cont,-1),false);
QCOMPARE(SciQLop::containers::contains(empty,1),false);
}
class TestContainers: public QObject {
Q_OBJECT
private slots:
void testVector() { test< std::vector<int> >();}
void testSet() { test< std::set<int> >();}
void testList() { test< std::list<int> >();}
void testQVector(){ test< QVector<int> >();}
void testQList() { test< QList<int> >();}
};
QTEST_MAIN(TestContainers)
#include "TestContainers.moc"