add solver test
All checks were successful
Linux arm64 / Build (push) Successful in 30m33s

This commit is contained in:
2024-02-16 11:09:27 +01:00
parent d156602da7
commit 88cc529009
2 changed files with 38 additions and 0 deletions

26
test/test_solver.cpp Normal file
View 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;
}