Directory: | ./ |
---|---|
File: | tests/task/test_multi_bound.cpp |
Date: | 2024-08-13 12:13:25 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 54 | 54 | 100.0% |
Branches: | 91 | 182 | 50.0% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | * Copyright 2010, | ||
3 | * François Bleibel, | ||
4 | * Olivier Stasse, | ||
5 | * | ||
6 | * CNRS/AIST | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | /* -------------------------------------------------------------------------- */ | ||
11 | /* --- INCLUDES ------------------------------------------------------------- */ | ||
12 | /* -------------------------------------------------------------------------- */ | ||
13 | #include <iostream> | ||
14 | #include <sot/core/debug.hh> | ||
15 | #include <sot/core/multi-bound.hh> | ||
16 | #include <sstream> | ||
17 | |||
18 | using namespace std; | ||
19 | using namespace dynamicgraph::sot; | ||
20 | |||
21 | 1 | int main(void) { | |
22 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | DebugTrace::openFile(); |
23 | |||
24 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | MultiBound mbs(1.2), mbdi(3.4, MultiBound::BOUND_INF), |
25 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | mbds(5.6, MultiBound::BOUND_SUP), mbdb(-7.8, 9.10); |
26 |
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.
|
1 | cout << "mbs =" << mbs << std::endl; |
27 |
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.
|
1 | cout << "mbdi=" << mbdi << std::endl; |
28 |
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.
|
1 | cout << "mbds=" << mbds << std::endl; |
29 |
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.
|
1 | cout << "mbdb=" << mbdb << std::endl; |
30 | |||
31 | { | ||
32 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | ostringstream oss; |
33 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | istringstream iss; |
34 |
2/4✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
|
1 | oss.str(""); |
35 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | oss << mbs; |
36 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | iss.str(oss.str()); |
37 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
1 | iss.seekg(0); |
38 | //{char strbuf[256]; iss.getline(strbuf,256); cout << | ||
39 | //"#"<<strbuf<<"#"<<std::endl;} | ||
40 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | iss >> mbs; |
41 |
5/10✓ 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.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
1 | cout << oss.str() << "=> mbs =" << mbs << std::endl; |
42 | 1 | } | |
43 | |||
44 | { | ||
45 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | ostringstream oss; |
46 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | istringstream iss; |
47 |
2/4✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
|
1 | oss.str(""); |
48 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | oss << mbdi; |
49 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | iss.str(oss.str()); |
50 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
1 | iss.seekg(0); |
51 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | iss >> mbdi; |
52 |
5/10✓ 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.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
1 | cout << oss.str() << "=> mbdi =" << mbdi << std::endl; |
53 | 1 | } | |
54 | { | ||
55 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | ostringstream oss; |
56 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | istringstream iss; |
57 |
2/4✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
|
1 | oss.str(""); |
58 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | oss << mbds; |
59 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | iss.str(oss.str()); |
60 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
1 | iss.seekg(0); |
61 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | iss >> mbds; |
62 |
5/10✓ 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.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
1 | cout << oss.str() << "=> mbds =" << mbds << std::endl; |
63 | 1 | } | |
64 | { | ||
65 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | ostringstream oss; |
66 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | istringstream iss; |
67 |
2/4✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
|
1 | oss.str(""); |
68 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | oss << mbdb; |
69 |
1/2✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
|
1 | iss.seekg(0); |
70 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | iss.str(oss.str()); |
71 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | iss >> mbdb; |
72 |
5/10✓ 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.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
|
1 | cout << oss.str() << "=> mbdb =" << mbdb << std::endl; |
73 | 1 | } | |
74 | |||
75 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | ostringstream oss; |
76 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | istringstream iss; |
77 |
9/18✓ 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.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
✓ Branch 25 taken 1 times.
✗ Branch 26 not taken.
|
1 | oss << "[4](" << mbs << "," << mbdi << "," << mbds << "," << mbdb << ")" |
78 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | << std::endl; |
79 |
2/4✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
1 | iss.str(oss.str()); |
80 | 1 | VectorMultiBound vmb; | |
81 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | iss >> vmb; |
82 |
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.
|
1 | cout << "vmb4 = " << vmb << std::endl; |
83 | |||
84 | 1 | return 0; | |
85 | 1 | } | |
86 |