libcruft-util/test/stream.cpp
Danny Robson 34788756d2 build: don't use './' as an include prefix
GCC produces ODR error when including paths of the form './foo' and
'foo' in the same binary. Rather than managing duplication we just
universally pick the absolute form over the relative form.
2017-11-22 16:49:37 +11:00

40 lines
783 B
C++

#include "../tap.hpp"
#include "../stream.hpp"
///////////////////////////////////////////////////////////////////////////////
template <typename T>
void
test_scoped (util::TAP::logger&);
//-----------------------------------------------------------------------------
template <>
void
test_scoped<util::stream::scoped::flags> (util::TAP::logger &tap)
{
std::ostringstream os;
{
util::stream::scoped::flags f (os);
os << std::hex;
}
os << 15;
tap.expect_eq (os.str (), "15", "stream::scoped::flag reverts std::hex");
}
///////////////////////////////////////////////////////////////////////////////
int
main (int, char **)
{
util::TAP::logger tap;
test_scoped<util::stream::scoped::flags> (tap);
return tap.status ();
}