ATLAS Offline Software
Typedefs | Functions | Variables
TreeTest.cxx File Reference
#include "CxxUtils/checker_macros.h"
#include "gtest/gtest.h"
#include "TrigHLTJetHypo/../src/Tree.h"
#include <vector>
#include <map>
Include dependency graph for TreeTest.cxx:

Go to the source code of this file.

Typedefs

using res = std::pair< std::vector< unsigned int >, bool >
 
using vec = std::vector< std::size_t >
 

Functions

 TEST (TreeTester, empty)
 
 TEST (TreeTester, simple)
 
 TEST (TreeTester, notsimple)
 

Variables

 ATLAS_NO_CHECK_FILE_THREAD_SAFETY
 

Typedef Documentation

◆ res

using res = std::pair<std::vector<unsigned int>, bool>

Definition at line 13 of file TreeTest.cxx.

◆ vec

using vec = std::vector<std::size_t>

Definition at line 14 of file TreeTest.cxx.

Function Documentation

◆ TEST() [1/3]

TEST ( TreeTester  ,
empty   
)

Definition at line 16 of file TreeTest.cxx.

16  {
17  std::vector<std::size_t> parents;
18 
19  Tree tree(parents);
20 
21  EXPECT_EQ(tree.size(), 0u);
22 }

◆ TEST() [2/3]

TEST ( TreeTester  ,
notsimple   
)

Definition at line 42 of file TreeTest.cxx.

42  {
43  std::vector<std::size_t> parents {0u, 0u, 1u};
44 
45  Tree tree(parents);
46 
47  vec leaves {2u};
48  EXPECT_EQ(tree.size(), 3u);
49  EXPECT_EQ(tree.leaves(), leaves);
50  EXPECT_FALSE(tree.is_leaf(0u));
51  EXPECT_FALSE(tree.is_leaf(1u));
52  EXPECT_TRUE(tree.is_leaf(2u));
53 
54  EXPECT_FALSE(tree.is_simple());
55 
56 }

◆ TEST() [3/3]

TEST ( TreeTester  ,
simple   
)

Definition at line 25 of file TreeTest.cxx.

25  {
26  std::vector<std::size_t> parents {0u, 0u, 0u};
27 
28  Tree tree(parents);
29 
30  vec leaves {1u, 2u};
31  EXPECT_EQ(tree.size(), 3u);
32  EXPECT_EQ(tree.leaves(), leaves);
33  EXPECT_FALSE(tree.is_leaf(0u));
34  EXPECT_TRUE(tree.is_leaf(1u));
35  EXPECT_TRUE(tree.is_leaf(1u));
36 
37  EXPECT_TRUE(tree.is_simple());
38 
39 }

Variable Documentation

◆ ATLAS_NO_CHECK_FILE_THREAD_SAFETY

ATLAS_NO_CHECK_FILE_THREAD_SAFETY

Definition at line 6 of file TreeTest.cxx.

Tree
Definition: Tree.h:18
python.DecayParser.parents
parents
print ("==> buf:",buf)
Definition: DecayParser.py:31
tree
TChain * tree
Definition: tile_monitor.h:30
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77