v0.14.0
test_ostream.hpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <sstream>
3 
4 #pragma once
5 
6 template <class T>
7 void test_ostream(const T &t, const std::string &expected,
8  const std::string &test_name)
9 {
10  std::stringstream ss;
11  ss << t;
12  if(ss.str() == expected)
13  {
14  std::cout << "PASS: " << test_name << "\n";
15  }
16  else
17  {
18  std::cout << "FAIL: " << test_name << ": " << ss.str()
19  << "!=" << expected << "\n";
20  }
21 }
test_ostream
void test_ostream(const T &t, const std::string &expected, const std::string &test_name)
Definition: test_ostream.hpp:7
t
constexpr double t
plate stiffness
Definition: plate.cpp:59