Formatted package
This commit is contained in:
Dhanya Thattil
2022-08-05 15:39:34 +02:00
committed by GitHub
parent 7173785b29
commit 6bf9dbf6d3
89 changed files with 1366 additions and 1210 deletions

View File

@ -3,14 +3,14 @@
#include <stdlib.h>
#include "SharedMemory.h"
#include "CtbConfig.h"
#include "SharedMemory.h"
#include <fstream>
namespace sls {
TEST_CASE("Default construction"){
static_assert(sizeof(CtbConfig) == 360); // 18*20
TEST_CASE("Default construction") {
static_assert(sizeof(CtbConfig) == 360); // 18*20
CtbConfig c;
auto names = c.getDacNames();
@ -21,7 +21,7 @@ TEST_CASE("Default construction"){
REQUIRE(names[3] == "dac3");
}
TEST_CASE("Set and get a single dac name"){
TEST_CASE("Set and get a single dac name") {
CtbConfig c;
c.setDacName(3, "vrf");
auto names = c.getDacNames();
@ -30,28 +30,28 @@ TEST_CASE("Set and get a single dac name"){
REQUIRE(names[3] == "vrf");
}
TEST_CASE("Set a name that is too large throws"){
TEST_CASE("Set a name that is too large throws") {
CtbConfig c;
REQUIRE_THROWS(c.setDacName(3, "somestringthatisreallytolongforadatac"));
}
TEST_CASE("Length of dac name cannot be 0"){
TEST_CASE("Length of dac name cannot be 0") {
CtbConfig c;
REQUIRE_THROWS(c.setDacName(1, ""));
}
TEST_CASE("Copy a CTB config"){
TEST_CASE("Copy a CTB config") {
CtbConfig c1;
c1.setDacName(5, "somename");
auto c2 = c1;
//change the name on the first object
//to detecto shallow copy
// change the name on the first object
// to detecto shallow copy
c1.setDacName(5, "someothername");
REQUIRE(c2.getDacName(5) == "somename");
}
TEST_CASE("Move CtbConfig "){
TEST_CASE("Move CtbConfig ") {
CtbConfig c1;
c1.setDacName(3, "yetanothername");
CtbConfig c2(std::move(c1));