GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tests/TestB.cpp Lines: 10 14 71.4 %
Date: 2021-03-10 23:02:29 Branches: 10 40 25.0 %

Line Branch Exec Source
1
#include <iostream>
2
3
#include <Eigen/Core>
4
5
#include "TestB.hpp"
6
7
using namespace eiquadprog::solvers;
8
namespace eiquadprog {
9
namespace tests {
10
11

1
B::B() : solution_(2) { solution_.setZero(); }
12
13
1
bool B::do_something() {
14
1
  eiquadprog::solvers::EiquadprogFast_status expected = EIQUADPROG_FAST_OPTIMAL;
15
16
2
  Eigen::VectorXd x(2);
17
18
1
  eiquadprog::solvers::EiquadprogFast_status status = A_.solve(x);
19
20
1
  bool rstatus = true;
21
22
1
  if (status != expected) {
23
    std::cerr << "Status not to true for A_" << expected << " " << status << std::endl;
24
    rstatus = false;
25
  }
26
27

2
  if (!x.isApprox(solution_)) {
28
    std::cerr << "x!=solution : " << x << "!=" << solution_ << std::endl;
29
    rstatus = false;
30
  }
31
2
  return rstatus;
32
}
33
34
}  // namespace tests
35

3
}  // namespace eiquadprog