From 23ca0c68c1dec974db74e3a7b9f87b2e04b7eb20 Mon Sep 17 00:00:00 2001 From: Nina Dzugasova <dzugasova.nina@gmail.com> Date: Tue, 13 Nov 2018 09:50:04 +0100 Subject: [PATCH] Added unit tests for Timer. --- src/UnitTests/TimerTest.cpp | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 src/UnitTests/TimerTest.cpp diff --git a/src/UnitTests/TimerTest.cpp b/src/UnitTests/TimerTest.cpp new file mode 100644 index 0000000000..16acbbd21a --- /dev/null +++ b/src/UnitTests/TimerTest.cpp @@ -0,0 +1,45 @@ +/*************************************************************************** + FileNameTest.cpp - description + ------------------- + begin : Oct 17, 2018 + copyright : (C) 2018 by Tomas Oberhuber + email : tomas.oberhuber@fjfi.cvut.cz + ***************************************************************************/ + +/* See Copyright Notice in tnl/Copyright */ + +// Implemented by Nina Dzugasova + +#ifdef HAVE_GTEST +#include <gtest/gtest.h> +#endif + +#include <TNL/Timer.h> + +using namespace TNL; + +#ifdef HAVE_GTEST +TEST( TimerTest, Constructor ) +{ + Timer time; + time.reset(); + EXPECT_EQ(time.getRealTime(),0); + time.start(); + time.stop(); + EXPECT_NE(time.getRealTime(),0); +} +#endif + + +#include "GtestMissingError.h" +int main( int argc, char* argv[] ) +{ +#ifdef HAVE_GTEST + ::testing::InitGoogleTest( &argc, argv ); + return RUN_ALL_TESTS(); +#else + throw GtestMissingError(); +#endif +} + + -- GitLab