Revert "tests add to namespace sls (#464)" (#465)

This reverts commit f5745fcf18.
This commit is contained in:
Dhanya Thattil
2022-05-20 15:43:48 +02:00
committed by GitHub
parent f5745fcf18
commit 8656eeec25
44 changed files with 228 additions and 350 deletions

View File

@ -6,8 +6,6 @@
#include "tests/globals.h"
#include <iostream>
namespace sls {
class MultiDetectorFixture {
protected:
DetectorImpl d;
@ -138,7 +136,7 @@ TEST_CASE_METHOD(MultiDetectorFixture, "Get ID", "[.eigerintegration][cli]") {
std::string hn = test::hostname;
hn.erase(std::remove(begin(hn), end(hn), 'b'), end(hn));
hn.erase(std::remove(begin(hn), end(hn), 'e'), end(hn));
auto hostnames = split(hn, '+');
auto hostnames = sls::split(hn, '+');
CHECK(hostnames.size() == d.getNumberOfDetectors());
for (int i = 0; i != d.getNumberOfDetectors(); ++i) {
CHECK(d.getId(defs::DETECTOR_SERIAL_NUMBER, 0) ==
@ -200,5 +198,3 @@ TEST_CASE_METHOD(MultiDetectorFixture, "rate correction",
d.setRateCorrection(200);
CHECK(d.getRateCorrection() == 200);
}
} // namespace sls

View File

@ -24,8 +24,6 @@
// extern std::string detector_type;
// extern dt type;
namespace sls {
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
auto t = Module::getTypeFromDetector(test::hostname);
CHECK(t == test::type);
@ -285,14 +283,14 @@ TEST_CASE(
CHECK(m.getRateCorrection() == ratecorr);
// ratecorr fail with dr 4 or 8
CHECK_THROWS_AS(m.setDynamicRange(8), RuntimeError);
CHECK_THROWS_AS(m.setDynamicRange(8), sls::RuntimeError);
CHECK(m.getRateCorrection() == 0);
m.setDynamicRange(16);
m.setDynamicRange(16);
m.setRateCorrection(ratecorr);
m.setDynamicRange(16);
m.setRateCorrection(ratecorr);
CHECK_THROWS_AS(m.setDynamicRange(4), RuntimeError);
CHECK_THROWS_AS(m.setDynamicRange(4), sls::RuntimeError);
CHECK(m.getRateCorrection() == 0);
}
@ -331,11 +329,11 @@ TEST_CASE("Chiptestboard Loading Patterns", "[.ctbintegration]") {
m.setPatternWord(addr, word);
CHECK(m.setPatternWord(addr, -1) == word);
addr = MAX_ADDR;
CHECK_THROWS_AS(m.setPatternWord(addr, word), RuntimeError);
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
Catch::Matchers::Contains("be between 0 and"));
addr = -1;
CHECK_THROWS_AS(m.setPatternWord(addr, word), RuntimeError);
CHECK_THROWS_AS(m.setPatternWord(addr, word), sls::RuntimeError);
CHECK_THROWS_WITH(m.setPatternWord(addr, word),
Catch::Matchers::Contains("be between 0 and"));
@ -410,7 +408,7 @@ TEST_CASE("Chiptestboard Dbit offset, list, sampling, advinvert",
CHECK(m.getReceiverDbitList().size() == 10);
list.push_back(64);
CHECK_THROWS_AS(m.setReceiverDbitList(list), RuntimeError);
CHECK_THROWS_AS(m.setReceiverDbitList(list), sls::RuntimeError);
CHECK_THROWS_WITH(m.setReceiverDbitList(list),
Catch::Matchers::Contains("be between 0 and 63"));
@ -478,7 +476,7 @@ TEST_CASE("Eiger or Jungfrau nextframenumber",
CHECK(m.acquire() == slsDetectorDefs::OK);
CHECK(m.getReceiverCurrentFrameIndex() == val);
CHECK_THROWS_AS(m.setNextFrameNumber(0), RuntimeError);
CHECK_THROWS_AS(m.setNextFrameNumber(0), sls::RuntimeError);
if (m.getDetectorTypeAsString() == "Eiger") {
val = 281474976710655;
@ -513,10 +511,8 @@ TEST_CASE("Eiger partialread", "[.eigerintegration][partialread]") {
m.setDynamicRange(8);
m.setPartialReadout(256);
CHECK(m.getPartialReadout() == 256);
CHECK_THROWS_AS(m.setPartialReadout(1), RuntimeError);
CHECK_THROWS_AS(m.setPartialReadout(1), sls::RuntimeError);
CHECK(m.getPartialReadout() == 256);
CHECK_THROWS_AS(m.setPartialReadout(0), RuntimeError);
CHECK_THROWS_AS(m.setPartialReadout(0), sls::RuntimeError);
m.setPartialReadout(256);
}
} // namespace sls
}

View File

@ -6,12 +6,10 @@
#include "tests/globals.h"
#include <iostream>
namespace sls {
using namespace Catch::literals;
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
auto hostnames = split(test::hostname, '+');
auto hostnames = sls::split(test::hostname, '+');
DetectorImpl d(0, true, true);
d.setHostname(test::hostname.c_str());
@ -104,6 +102,3 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
d.freeSharedMemory();
}
} // namespace sls