Jpp
test-rotations-old-57-g407471f53
the software that should make you happy
Loading...
Searching...
No Matches
software
AcousticDataFilter
src
Config
parser.t.cc
Go to the documentation of this file.
1
#include <catch2/catch_test_macros.hpp>
2
#include <catch2/matchers/catch_matchers_vector.hpp>
3
#include "
parser.h
"
4
5
const
Waveform<float>
expected
{
6
14, {1.1F, 2.2F, 3.3F}};
7
8
TEST_CASE
(
"samples string separated by single spaces should not fail"
,
"[parseWaveformSamples]"
)
9
{
10
auto
result =
parseWaveformSamples<float>
(
"14 3 1.1 2.2 3.3"
);
11
12
REQUIRE(result.value() ==
expected
);
13
}
14
15
TEST_CASE
(
"samples string separated by multiple spaces should not fail"
,
"[parseWaveformSamples]"
)
16
{
17
auto
result =
parseWaveformSamples<float>
(
"14 3 1.1 2.2 3.3"
);
18
19
REQUIRE(result.value() ==
expected
);
20
}
21
22
TEST_CASE
(
"if the waveform id is not an integer return std::nullopt"
,
"[parseWaveformSamples]"
)
23
{
24
auto
result =
parseWaveformSamples<float>
(
"1.1 2.2 3.3"
);
25
26
REQUIRE(result == std::nullopt);
27
}
28
29
TEST_CASE
(
"if the number of samples is not an integer return std::nullopt"
,
"[parseWaveformSamples]"
)
30
{
31
auto
result =
parseWaveformSamples<float>
(
"3 1.1 2.2 3.3"
);
32
33
REQUIRE(result == std::nullopt);
34
}
parseWaveformSamples
std::optional< Waveform< T > > parseWaveformSamples(const std::string &adf_waveform_line)
Definition
parser.cc:46
parser.h
expected
const Waveform< float > expected
Definition
parser.t.cc:5
TEST_CASE
TEST_CASE("samples string separated by single spaces should not fail", "[parseWaveformSamples]")
Definition
parser.t.cc:8
Waveform
Definition
parser.h:28
Generated by
1.12.0