Directory: | ./ |
---|---|
File: | tests/tools/test_sot_loader.cpp |
Date: | 2024-12-13 12:22:33 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 128 | 128 | 100.0% |
Branches: | 677 | 1352 | 50.1% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * License BSD3 | ||
3 | * Copyright 2021, | ||
4 | * Maximilien Naveau, | ||
5 | * | ||
6 | * CNRS | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #define BOOST_TEST_MODULE test_sot_loader | ||
11 | #include <dynamic-graph/entity.h> | ||
12 | #include <dynamic-graph/factory.h> | ||
13 | #include <dynamic-graph/pool.h> | ||
14 | |||
15 | #include <boost/test/included/unit_test.hpp> | ||
16 | #include <fstream> | ||
17 | #include <iostream> | ||
18 | |||
19 | #include "sot/core/debug.hh" | ||
20 | #include "sot/core/device.hh" | ||
21 | #include "sot/core/sot-loader.hh" | ||
22 | |||
23 | using namespace dynamicgraph; | ||
24 | using namespace dynamicgraph::sot; | ||
25 | namespace dg = dynamicgraph; | ||
26 | |||
27 | class TestDevice : public dg::sot::Device { | ||
28 | public: | ||
29 | TestDevice(const std::string &RobotName) : Device(RobotName) { | ||
30 | timestep_ = 0.001; | ||
31 | } | ||
32 | ~TestDevice() {} | ||
33 | }; | ||
34 | |||
35 | struct TestFixture { | ||
36 | 14 | TestFixture() { | |
37 |
1/2✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
|
14 | asotei_lib_file_ = LIB_PLUGIN_ABSTRACT_PATH; |
38 |
1/2✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
|
14 | good_python_script_ = TEST_GOOD_PYTHON_SCRIPT; |
39 |
1/2✓ Branch 1 taken 14 times.
✗ Branch 2 not taken.
|
14 | bad_python_script_ = TEST_BAD_PYTHON_SCRIPT; |
40 | 14 | } | |
41 | 14 | ~TestFixture() {} | |
42 | /// @brief Path to the AbstractSotExternalInterface test library. | ||
43 | std::string asotei_lib_file_; | ||
44 | /// @brief Path to a python srcipt to parse without error. | ||
45 | std::string good_python_script_; | ||
46 | /// @brief Path to a python srcipt to parse with error. | ||
47 | std::string bad_python_script_; | ||
48 | /// @brief Sensor values container. | ||
49 | std::map<std::string, SensorValues> sensors; | ||
50 | /// @brief Control values container. | ||
51 | std::map<std::string, ControlValues> controls; | ||
52 | }; | ||
53 | |||
54 | BOOST_AUTO_TEST_SUITE(sot_loader_test_suite) | ||
55 | |||
56 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_plugin_existance, TestFixture) { |
57 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | std::ifstream file(asotei_lib_file_); |
58 | 2 | bool file_exists = false; | |
59 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
|
2 | if (file) { |
60 | 2 | file_exists = true; | |
61 | } | ||
62 |
6/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✗ Branch 22 not taken.
✓ Branch 23 taken 1 times.
|
2 | BOOST_CHECK(file_exists); |
63 |
6/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 23 not taken.
✓ Branch 24 taken 1 times.
|
2 | BOOST_CHECK(asotei_lib_file_ != ""); |
64 | 2 | } | |
65 | |||
66 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_default_behavior, TestFixture) { |
67 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
68 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.initialization(); |
69 |
6/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 23 not taken.
✓ Branch 24 taken 1 times.
|
2 | BOOST_CHECK(sot_loader.isDynamicGraphStopped()); |
70 | 2 | } | |
71 | |||
72 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_start_stop_dg, TestFixture) { |
73 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
74 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.initialization(); |
75 |
6/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 23 not taken.
✓ Branch 24 taken 1 times.
|
2 | BOOST_CHECK(sot_loader.isDynamicGraphStopped()); |
76 | 2 | sot_loader.startDG(); | |
77 |
6/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 23 not taken.
✓ Branch 24 taken 1 times.
|
2 | BOOST_CHECK(!sot_loader.isDynamicGraphStopped()); |
78 | 2 | sot_loader.stopDG(); | |
79 |
6/12✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✗ Branch 23 not taken.
✓ Branch 24 taken 1 times.
|
2 | BOOST_CHECK(sot_loader.isDynamicGraphStopped()); |
80 | 2 | } | |
81 | |||
82 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_option_parsing_input_file, TestFixture) { |
83 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
84 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.setDynamicLibraryName(asotei_lib_file_); |
85 | |||
86 | 2 | char argv0[] = "test_sot_loader"; | |
87 | 2 | char argv1[] = "--input-file"; | |
88 | 2 | char argv2[] = LIB_PLUGIN_ABSTRACT_PATH; | |
89 | 2 | char *argv[] = {argv0, argv1, argv2, NULL}; | |
90 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.parseOptions(3, argv); |
91 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 1 times.
✗ Branch 21 not taken.
✗ Branch 25 not taken.
✓ Branch 26 taken 1 times.
|
2 | BOOST_CHECK(sot_loader.initialization()); |
92 | 2 | } | |
93 | |||
94 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_option_parsing_sot_dynamic_library, TestFixture) { |
95 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
96 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.setDynamicLibraryName(asotei_lib_file_); |
97 | |||
98 | 2 | char argv0[] = "test_sot_loader"; | |
99 | 2 | char argv1[] = "--sot-dynamic-library"; | |
100 | 2 | char argv2[] = LIB_PLUGIN_ABSTRACT_PATH; | |
101 | 2 | char *argv[] = {argv0, argv1, argv2, NULL}; | |
102 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.parseOptions(3, argv); |
103 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 1 times.
✗ Branch 21 not taken.
✗ Branch 25 not taken.
✓ Branch 26 taken 1 times.
|
2 | BOOST_CHECK(sot_loader.initialization()); |
104 | 2 | } | |
105 | |||
106 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_sot_loader_set_dynamic_library_name, TestFixture) { |
107 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
108 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.setDynamicLibraryName(asotei_lib_file_); |
109 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 1 times.
✗ Branch 21 not taken.
✗ Branch 25 not taken.
✓ Branch 26 taken 1 times.
|
2 | BOOST_CHECK(sot_loader.initialization()); |
110 | 2 | } | |
111 | |||
112 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_sot_loader_one_iteration, TestFixture) { |
113 | 2 | std::vector<double> controls_values; | |
114 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
115 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.setDynamicLibraryName(asotei_lib_file_); |
116 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.initialization(); |
117 | // Without running the graph: | ||
118 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.oneIteration(sensors, controls); |
119 |
8/16✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✗ Branch 33 not taken.
✓ Branch 34 taken 1 times.
|
2 | BOOST_CHECK(controls.find("ctrl_map_name") == controls.end()); |
120 | // With the graph running: | ||
121 | 2 | sot_loader.startDG(); | |
122 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
2 | std::cout << "running the graph" << std::endl; |
123 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.oneIteration(sensors, controls); |
124 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
2 | std::cout << "running the graph ... done" << std::endl; |
125 |
3/6✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
|
2 | controls_values = controls["ctrl_map_name"].getValues(); |
126 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 18 not taken.
✓ Branch 19 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(controls_values.size(), 5); |
127 |
2/2✓ Branch 5 taken 5 times.
✓ Branch 6 taken 1 times.
|
12 | for (auto value : controls_values) { |
128 |
5/10✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 5 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 5 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 5 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 5 times.
|
10 | BOOST_CHECK_EQUAL(value, 3.1415); |
129 | } | ||
130 | 2 | } | |
131 | |||
132 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_cleanup_no_init, TestFixture) { |
133 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
134 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.cleanUp(); |
135 | 2 | } | |
136 | |||
137 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_cleanup_init, TestFixture) { |
138 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
139 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.setDynamicLibraryName(asotei_lib_file_); |
140 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.initialization(); |
141 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.cleanUp(); |
142 | 2 | } | |
143 | |||
144 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_run_python_command, TestFixture) { |
145 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
146 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.setDynamicLibraryName(asotei_lib_file_); |
147 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.initialization(); |
148 | 2 | std::string res, out, err; | |
149 |
2/4✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
|
2 | sot_loader.runPythonCommand("1+1", res, out, err); |
150 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(res, "2"); |
151 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(out, ""); |
152 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(err, ""); |
153 | 2 | } | |
154 | |||
155 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_run_python_command_error, TestFixture) { |
156 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
157 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.setDynamicLibraryName(asotei_lib_file_); |
158 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.initialization(); |
159 | 2 | std::string res, out, err; | |
160 |
2/4✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
|
2 | sot_loader.runPythonCommand("print(a)", res, out, err); |
161 |
3/6✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
|
2 | std::cout << std::quoted(err) << std::endl; |
162 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(res, ""); |
163 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(out, ""); |
164 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(err, |
165 | "Traceback (most recent call last):\n" | ||
166 | " File \"<string>\", line 1, in <module>\n" | ||
167 | "NameError: name 'a' is not defined\n"); | ||
168 | 2 | } | |
169 | |||
170 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_run_python_scripts, TestFixture) { |
171 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
172 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.setDynamicLibraryName(asotei_lib_file_); |
173 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.initialization(); |
174 | 2 | std::string err; | |
175 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
2 | sot_loader.runPythonFile(good_python_script_, err); |
176 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(err, ""); |
177 | 2 | } | |
178 | |||
179 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_run_python_scripts_failure, TestFixture) { |
180 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
181 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.setDynamicLibraryName(asotei_lib_file_); |
182 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.initialization(); |
183 | 2 | std::string err; | |
184 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
2 | sot_loader.runPythonFile(bad_python_script_, err); |
185 |
7/14✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✗ Branch 25 not taken.
✓ Branch 26 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(err, |
186 | "Traceback (most recent call last):\n" | ||
187 | " File \"" + | ||
188 | bad_python_script_ + | ||
189 | "\", line 2, in <module>\n" | ||
190 | " print(b)\n" | ||
191 | "NameError: name 'b' is not defined\n"); | ||
192 | 2 | } | |
193 | |||
194 |
34/68✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 23 taken 1 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 1 times.
✗ Branch 27 not taken.
✓ Branch 30 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 44 taken 1 times.
✗ Branch 45 not taken.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 55 taken 1 times.
✗ Branch 56 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 61 taken 1 times.
✗ Branch 62 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 69 taken 1 times.
✗ Branch 70 not taken.
✓ Branch 73 taken 1 times.
✗ Branch 74 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 80 taken 1 times.
✗ Branch 81 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✓ Branch 86 taken 1 times.
✗ Branch 87 not taken.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 94 taken 1 times.
✗ Branch 95 not taken.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 105 taken 1 times.
✗ Branch 106 not taken.
✓ Branch 108 taken 1 times.
✗ Branch 109 not taken.
✓ Branch 111 taken 1 times.
✗ Branch 112 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✓ Branch 119 taken 1 times.
✗ Branch 120 not taken.
|
4 | BOOST_FIXTURE_TEST_CASE(test_load_device_in_python, TestFixture) { |
195 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | SotLoader sot_loader; |
196 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.setDynamicLibraryName(asotei_lib_file_); |
197 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
2 | sot_loader.initialization(); |
198 |
2/4✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
|
4 | Device device("device_name"); |
199 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
2 | sot_loader.loadDeviceInPython(device.getName()); |
200 | 2 | std::string res, out, err; | |
201 |
2/4✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
|
2 | sot_loader.runPythonCommand("print(device_cpp_object.name)", res, out, err); |
202 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(res, "None"); |
203 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(out, "device_name\n"); |
204 |
5/10✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
|
2 | BOOST_CHECK_EQUAL(err, ""); |
205 | 2 | } | |
206 | |||
207 | BOOST_AUTO_TEST_SUITE_END() | ||
208 |