LCOV - code coverage report
Current view: top level - test - GlobDynamicMemTest.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 13 13 100.0 %
Date: 2016-06-29 12:30:40 Functions: 4 5 80.0 %

          Line data    Source code
       1             : #ifndef DASH__TEST__GLOB_DYNAMIC_MEM_TEST_H_
       2             : #define DASH__TEST__GLOB_DYNAMIC_MEM_TEST_H_
       3             : 
       4             : #include <gtest/gtest.h>
       5             : #include <libdash.h>
       6             : 
       7             : #include "TestBase.h"
       8             : 
       9             : /**
      10             :  * Test fixture for class dash::GlobDynamicMem
      11             :  */
      12             : class GlobDynamicMemTest : public ::testing::Test {
      13             : protected:
      14             :   size_t _dash_id;
      15             :   size_t _dash_size;
      16             : 
      17          16 :   GlobDynamicMemTest()
      18             :   : _dash_id(0),
      19          16 :     _dash_size(0)
      20             :   {
      21             :     LOG_MESSAGE(">>> Test suite: GlobDynamicMemTest");
      22             :     LOG_MESSAGE(">>> Hostname: %s PID: %d", _hostname().c_str(), _pid());
      23          16 :   }
      24             : 
      25          16 :   virtual ~GlobDynamicMemTest() {
      26             :     LOG_MESSAGE("<<< Closing test suite: GlobDynamicMemTest");
      27          16 :   }
      28             : 
      29          16 :   virtual void SetUp() {
      30          16 :     _dash_id   = dash::myid();
      31          16 :     _dash_size = dash::size();
      32          16 :     dash::Team::All().barrier();
      33             :     LOG_MESSAGE("===> Running test case with %d units ...",
      34             :                 _dash_size);
      35          16 :   }
      36             : 
      37          16 :   virtual void TearDown() {
      38          16 :     dash::Team::All().barrier();
      39             :     LOG_MESSAGE("<=== Finished test case with %d units",
      40             :                 _dash_size);
      41          16 :   }
      42             : 
      43             : protected:
      44             :   std::string _hostname() {
      45             :     char hostname[100];
      46             :     gethostname(hostname, 100);
      47             :     return std::string(hostname);
      48             :   }
      49             : 
      50             :   int _pid() {
      51             :     return static_cast<int>(getpid());
      52             :   }
      53             : };
      54             : 
      55             : #endif // DASH__TEST__GLOB_DYNAMIC_MEM_TEST_H_

Generated by: LCOV version 1.12