diff options
author | Rasmus Munk Larsen <rmlarsen@google.com> | 2020-07-09 12:49:58 -0700 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2020-07-09 12:49:58 -0700 |
commit | fb77b7288ce5406ff819d8fd71ad59e317d1817f (patch) | |
tree | 2212d9e61c9a0650e7a5933e347bab875ad3f269 /test/geo_quaternion.cpp | |
parent | ee4715ff488d5cf685820ad06374cbe7d509ac1a (diff) |
Add operator<< to print a quaternion.
Diffstat (limited to 'test/geo_quaternion.cpp')
-rw-r--r-- | test/geo_quaternion.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index 1da683c0e..b339a5f39 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -75,6 +75,11 @@ template<typename Scalar, int Options> void quaternion(void) q1.coeffs().setRandom(); VERIFY_IS_APPROX(q1.coeffs(), (q1*q2).coeffs()); + // Printing + std::ostringstream ss; + ss << q2; + VERIFY(ss.str() == "0i + 0j + 0k + 1"); + // concatenation q1 *= q2; |