Skip to content
Snippets Groups Projects
Commit 115bd30a authored by René Fritze's avatar René Fritze
Browse files

Merge remote-tracking branch 'tobias/master'

Conflicts:
	dune/stuff/test/common_logger.cc
parents 515a0552 b9843499
No related branches found
No related tags found
No related merge requests found
...@@ -125,9 +125,10 @@ struct ConfigTest : public testing::Test ...@@ -125,9 +125,10 @@ struct ConfigTest : public testing::Test
static const int count = 2; static const int count = 2;
DefaultRNG<T> rng; DefaultRNG<T> rng;
RandomStrings key_gen; RandomStrings key_gen;
// std::array is not assignable from list_of it seems // std::array is not assignable from list_of it seems. Don't make the following two arrays const (triggers boost/intel
const boost::array<T, count> values; // compiler bug, last tested with icpc version 14.0.3).
const boost::array<std::string, count> keys; boost::array<T, count> values;
boost::array<std::string, count> keys;
ConfigTest() ConfigTest()
: key_gen(8) : key_gen(8)
, values(boost::assign::list_of<T>().repeat_fun(values.size() - 1, rng)) , values(boost::assign::list_of<T>().repeat_fun(values.size() - 1, rng))
......
...@@ -3,10 +3,9 @@ ...@@ -3,10 +3,9 @@
// Copyright holders: Rene Milk, Felix Schindler // Copyright holders: Rene Milk, Felix Schindler
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) // License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
#include "config.h" #include "main.hxx"
#include <dune/stuff/test/gtest/gtest.h> // dune-stuff
#include <dune/stuff/test/common.hh>
#include <dune/stuff/common/logging.hh> #include <dune/stuff/common/logging.hh>
#include <dune/stuff/common/logstreams.hh> #include <dune/stuff/common/logstreams.hh>
...@@ -29,10 +28,8 @@ void do_something_that_takes_long(std::ostream& out) ...@@ -29,10 +28,8 @@ void do_something_that_takes_long(std::ostream& out)
out << std::endl; out << std::endl;
} // void do_something_that_takes_long() } // void do_something_that_takes_long()
int main(int argc, char** argv) TEST(LoggerTest, all)
{ {
testing::InitGoogleTest(&argc, argv);
DSC::Logger().create(DSC::LOG_CONSOLE | DSC::LOG_ERROR); DSC::Logger().create(DSC::LOG_CONSOLE | DSC::LOG_ERROR);
DSC::Logger().error() << "This should be in output\n"; DSC::Logger().error() << "This should be in output\n";
DSC::Logger().info() << "This should NOT be in output\n"; DSC::Logger().info() << "This should NOT be in output\n";
...@@ -61,6 +58,4 @@ int main(int argc, char** argv) ...@@ -61,6 +58,4 @@ int main(int argc, char** argv)
std::cout << "begin Logger().error() test" << std::endl; std::cout << "begin Logger().error() test" << std::endl;
do_something_that_takes_long(err); do_something_that_takes_long(err);
std::cout << "end Logger().error() test" << std::endl; std::cout << "end Logger().error() test" << std::endl;
return 0;
} }
...@@ -162,11 +162,13 @@ TEST(StringTest, ConvertFrom) ...@@ -162,11 +162,13 @@ TEST(StringTest, ConvertFrom)
// Hex, whitespacify, tokenize, stringFromTime tests // Hex, whitespacify, tokenize, stringFromTime tests
TEST(StringTest, Hex) TEST(StringTest, Hex)
{ {
// disabled the following test for Intel compiler because it causes compilation failures for no obvious reason
#ifndef __INTEL_COMPILER
EXPECT_GT(boost::lexical_cast<HexToString<unsigned long>>(cout), 0u); EXPECT_GT(boost::lexical_cast<HexToString<unsigned long>>(cout), 0u);
#endif
EXPECT_EQ(boost::lexical_cast<HexToString<unsigned long>>("0x00000F"), 15u); EXPECT_EQ(boost::lexical_cast<HexToString<unsigned long>>("0x00000F"), 15u);
} }
TEST(StringTest, Whitespace) TEST(StringTest, Whitespace)
{ {
EXPECT_EQ("---------", whitespaceify("\t\t\t\t\t\t\t\t\t", '-')); EXPECT_EQ("---------", whitespaceify("\t\t\t\t\t\t\t\t\t", '-'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment