Skip to content

Commit 2c97752

Browse files
committed
Add specification of prints for testable assertions
1 parent 5bf5595 commit 2c97752

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gtsam/base/Testable.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <gtsam/base/concepts.h>
3737

3838
#include <functional>
39+
#include <iomanip>
3940
#include <iostream>
4041
#include <memory>
4142
#include <string>
@@ -100,8 +101,10 @@ namespace gtsam {
100101
if (traits<V>::Equals(actual,expected, tol))
101102
return true;
102103
printf("Equality assertion: \n");
103-
traits<V>::Print(expected," Expected:\n");
104-
traits<V>::Print(actual," Actual:\n");
104+
std::cout << std::setprecision(8) << std::scientific;
105+
traits<V>::Print(expected, " Expected:\n");
106+
traits<V>::Print(actual, " Actual:\n");
107+
std::cout << std::setprecision(5) << std::defaultfloat;
105108
return false;
106109
}
107110

0 commit comments

Comments
 (0)