mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
M3badchannels (#526)
* badchannels for m3 and modify for g2 (file from single and multi) * m3: invert polarity of bit 7 and 11 signals from setmodule, allow commas in bad channel file * badchannel file can take commas, colons and comments (also taking care of spaces at the end of channel numbers) * tests 'badchannels' and 'Channel file reading' added, removing duplicates in badchannel list, defining macro for num counters in client side * fix segfault when list from file is empty, * fix tests assertion for ctbconfig (adding message) for c++11 * fixed badchannels in m3server (clocking in trimming) * badchannel tests can be run from any folder (finds the file)
This commit is contained in:
@ -7,6 +7,8 @@
|
||||
#include <unistd.h>
|
||||
#include <vector>
|
||||
|
||||
#include "tests/globals.h"
|
||||
|
||||
namespace sls {
|
||||
|
||||
TEST_CASE("Get size of empty file") {
|
||||
@ -29,4 +31,13 @@ TEST_CASE("Get size of file with data") {
|
||||
REQUIRE(ifs.tellg() == 0); // getting size resets pos!
|
||||
}
|
||||
|
||||
TEST_CASE("Channel file reading") {
|
||||
std::string fname =
|
||||
getAbsolutePathFromCurrentProcess(TEST_FILE_NAME_BAD_CHANNELS);
|
||||
std::vector<int> list;
|
||||
REQUIRE_NOTHROW(list = getChannelsFromFile(fname));
|
||||
std::vector<int> expected = {0, 12, 15, 40, 41, 42, 43, 44, 1279};
|
||||
REQUIRE(list == expected);
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
Reference in New Issue
Block a user