Line |
Branch |
Exec |
Source |
1 |
|
|
// ./tests/catch2-tests [section] -s |
2 |
|
|
|
3 |
|
|
|
4 |
|
|
/////////////////////// Stdlib includes |
5 |
|
|
#include <cassert> |
6 |
|
|
|
7 |
|
|
/////////////////////// Qt includes |
8 |
|
|
#include <QDebug> |
9 |
|
|
#include <QString> |
10 |
|
|
#include <QDir> |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
/////////////////////// Catch2 includes |
14 |
|
|
#include <catch2/catch_test_macros.hpp> |
15 |
|
|
#include <catch2/matchers/catch_matchers_floating_point.hpp> |
16 |
|
|
|
17 |
|
|
|
18 |
|
|
/////////////////////// Local includes |
19 |
|
|
#include "tests-config.h" |
20 |
|
|
#include <libXpertMass/PolChemDefSpec.hpp> |
21 |
|
|
|
22 |
|
|
namespace MsXpS |
23 |
|
|
{ |
24 |
|
|
|
25 |
|
|
namespace libXpertMass |
26 |
|
|
{ |
27 |
|
|
|
28 |
|
|
|
29 |
|
8 |
SCENARIO("PolChemDefSpec specifying a polymer chemistry definition") |
30 |
|
|
{ |
31 |
1/2
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
8 |
PolChemDefSpec pol_chem_def_spec; |
32 |
|
|
|
33 |
|
|
QString test_data_dir = |
34 |
3/6
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
|
16 |
QString("%1/polymer-chemistry-definitions").arg(TESTS_INPUT_DIR); |
35 |
|
|
|
36 |
1/2
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
8 |
QString pol_chem_def_name = "protein-1-letter.xml"; |
37 |
|
|
|
38 |
|
|
QString pol_chem_def_relative_file_path = |
39 |
1/2
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
|
8 |
"protein-1-letter/protein-1-letter.xml"; |
40 |
|
|
|
41 |
|
|
QString pol_chem_def_absolute_file_path = |
42 |
3/6
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
|
24 |
QString("%1/%2").arg(test_data_dir).arg(pol_chem_def_relative_file_path); |
43 |
|
|
|
44 |
8/14
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 8 times.
✗ Branch 11 not taken.
✓ Branch 15 taken 8 times.
✗ Branch 16 not taken.
✓ Branch 21 taken 8 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 4 times.
✓ Branch 24 taken 4 times.
|
8 |
GIVEN("Constructing an empty PolChemDefSpec") |
45 |
|
|
{ |
46 |
|
|
|
47 |
7/14
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 15 taken 4 times.
✗ Branch 16 not taken.
✓ Branch 21 taken 4 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 4 times.
✗ Branch 24 not taken.
|
4 |
THEN("The member data are empty") |
48 |
|
|
{ |
49 |
6/16
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 4 times.
✗ Branch 17 not taken.
✓ Branch 20 taken 4 times.
✗ Branch 21 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
|
4 |
REQUIRE(pol_chem_def_spec.name() == ""); |
50 |
6/16
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 4 times.
✗ Branch 17 not taken.
✓ Branch 21 taken 4 times.
✗ Branch 22 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
|
4 |
REQUIRE(pol_chem_def_spec.getFilePath() == ""); |
51 |
|
4 |
} |
52 |
|
8 |
} |
53 |
|
|
|
54 |
8/14
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 8 times.
✗ Branch 11 not taken.
✓ Branch 15 taken 8 times.
✗ Branch 16 not taken.
✓ Branch 21 taken 8 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 4 times.
✓ Branch 24 taken 4 times.
|
8 |
AND_GIVEN("Set name and file path") |
55 |
|
|
{ |
56 |
1/2
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
|
4 |
pol_chem_def_spec.setName(pol_chem_def_name); |
57 |
1/2
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
|
4 |
pol_chem_def_spec.setFilePath(pol_chem_def_relative_file_path); |
58 |
|
|
|
59 |
7/14
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 15 taken 4 times.
✗ Branch 16 not taken.
✓ Branch 21 taken 4 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 4 times.
✗ Branch 24 not taken.
|
4 |
THEN("The name and file path are set to the member data") |
60 |
|
|
{ |
61 |
8/20
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 4 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 4 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 4 times.
✗ Branch 23 not taken.
✓ Branch 28 taken 4 times.
✗ Branch 29 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
|
4 |
REQUIRE(pol_chem_def_spec.name().toStdString() == |
62 |
|
|
pol_chem_def_name.toStdString()); |
63 |
8/20
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 4 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 4 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 4 times.
✗ Branch 23 not taken.
✓ Branch 29 taken 4 times.
✗ Branch 30 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
|
4 |
REQUIRE(pol_chem_def_spec.getFilePath().toStdString() == pol_chem_def_relative_file_path.toStdString()); |
64 |
|
4 |
} |
65 |
|
8 |
} |
66 |
|
8 |
} |
67 |
|
|
|
68 |
|
|
|
69 |
|
|
} // namespace libXpertMass |
70 |
|
|
} // namespace MsXpS |
71 |
|
|
|