This commit is contained in:
12
matricies/test/matrice1.test
Normal file
12
matricies/test/matrice1.test
Normal file
@@ -0,0 +1,12 @@
|
||||
2 3
|
||||
1 2 3
|
||||
4 5 6
|
||||
|
||||
2 2
|
||||
0 1
|
||||
1 0
|
||||
|
||||
3 1
|
||||
1
|
||||
-2
|
||||
1
|
||||
26
test/test_solver.cpp
Normal file
26
test/test_solver.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "Solver.h"
|
||||
#include <cassert>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
int main() {
|
||||
std::string path = "test";
|
||||
for (const auto& entry : fs::directory_iterator(path)) {
|
||||
std::string fileName = entry.path().string();
|
||||
std::cout << "Opening " << fileName << " ...\n";
|
||||
std::ifstream in{fileName};
|
||||
Matrix mat{1, 1}, imageMat{1, 1}, noyauMat{1, 1};
|
||||
in >> mat >> imageMat >> noyauMat;
|
||||
|
||||
Vect image{imageMat};
|
||||
Vect noyau{noyauMat};
|
||||
|
||||
Solver solver{mat};
|
||||
assert(solver.Image() == image);
|
||||
assert(solver.Noyau() == noyau);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user