Logo ROOT   6.10/09
Reference Guide
TSeqTests.cxx
Go to the documentation of this file.
1 #include "gtest/gtest.h"
2 #include "ROOT/TSeq.hxx"
3 
4 TEST(TSeqIterators, Containers)
5 {
6  ROOT::TSeqI seq(0, 6, 2);
7  auto b = seq.begin();
8  auto c = b + 1; // addition with integer
9  ASSERT_TRUE(c++ == ++b); // pre and post-increment
10  ASSERT_EQ(seq.end() - seq.begin(), int(seq.size())); // difference of iterators, size
11  ASSERT_TRUE((--c)-- == seq.begin() + 1); // pre-decrement and post-decrement
12  b -= 1; // compound assignment
13  ASSERT_TRUE(c == b--); // post decrement
14  // comparison operators
15  ASSERT_GE(c, b);
16  ASSERT_LE(b, c);
17  ASSERT_EQ(c[3], *(seq.begin() + 3)); // subscript operator
18 }
std::size_t size() const
Definition: TSeq.hxx:180
TEST(TSeqIterators, Containers)
Definition: TSeqTests.cxx:4
A pseudo container class which is a generator of indices.
Definition: TSeq.hxx:66
iterator end() const
Definition: TSeq.hxx:166
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
iterator begin() const
Definition: TSeq.hxx:163