Belle II Software  release-08-01-10
utils.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include <framework/utilities/Utils.h>
9 
10 #include <TSystem.h>
11 
12 #include <gtest/gtest.h>
13 
14 using namespace std;
15 using namespace Belle2;
16 
17 namespace {
18  TEST(Utilities, MemSize)
19  {
20  //compare memory measurements done by root and ourselves
21  //(should differ by less than 1MB even though function calls are a bit different)
22  ProcInfo_t meminfo;
23  gSystem->GetProcInfo(&meminfo);
24  long v = Utils::getVirtualMemoryKB();
25  ASSERT_TRUE(abs(v - meminfo.fMemVirtual) < 1000);
26 
27  gSystem->GetProcInfo(&meminfo);
28  long r = Utils::getRssMemoryKB();
29  ASSERT_TRUE(abs(r - meminfo.fMemResident) < 1000);
30  }
31 }
TEST(TestgetDetectorRegion, TestgetDetectorRegion)
Test Constructors.
Abstract base class for different kinds of events.