catch exceptions
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2022-05-11 00:42:32 +02:00
parent 924f114fb3
commit 1904cc168d
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -5,30 +5,37 @@
#include "../testEnvironment.h" #include "../testEnvironment.h"
#include <fstream> #include <fstream>
#include <stdexcept>
#include <iostream> #include <iostream>
#include "rapidcsv.h" #include "rapidcsv.h"
TEST_CASE("ACS Controller", "[AcsController]") { TEST_CASE("ACS Controller", "[AcsController]") {
SECTION("SectionTest") { SECTION("SectionTest") {
//acsCtrl.performOperation(); //acsCtrl.performOperation();
CHECK(1 == 1); CHECK(1 == 1);
{ try {
std::ifstream file("unittest/meineTestDaten.txt"); {
if (file.good()) { std::ifstream file("unittest/meineTestDaten.txt");
std::string line; if (file.good()) {
while(std::getline(file, line)) { std::string line;
std::cout << "ACS CTRL Test test file: " << line << std::endl; while(std::getline(file, line)) {
std::cout << "ACS CTRL Test test file: " << line << std::endl;
}
} }
} }
{
rapidcsv::Document doc("unittest/meineTestDaten.txt");
std::vector<int> col = doc.GetColumn<int>("test0");
std::cout << "Read " << col.size() << " values: " << col[0] << ", " << col[1] << std::endl;
}
} catch (const std::exception& e) {
sif::warning << "CSV file test exception occured: " << e.what() << std::endl;
} }
{
// rapidcsv::Document doc("unittest/meineTestDaten.txt");
// std::vector<int> col = doc.GetColumn<int>("test0");
// std::cout << "Read " << col.size() << " values: " << col[0] << ", " << col[1] << std::endl;
}
REQUIRE(2 == 2); REQUIRE(2 == 2);
} }