Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
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
614, {1.1F, 2.2F, 3.3F}};
7
8TEST_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
15TEST_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
22TEST_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
29TEST_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}
std::optional< Waveform< T > > parseWaveformSamples(const std::string &adf_waveform_line)
Definition parser.cc:46
const Waveform< float > expected
Definition parser.t.cc:5
TEST_CASE("samples string separated by single spaces should not fail", "[parseWaveformSamples]")
Definition parser.t.cc:8