source: trunk/test/range.cc @ 3259

Last change on this file since 3259 was 3259, checked in by Peter, 8 years ago

deprecated class Range. closes #786

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1// $Id: range.cc 3259 2014-06-09 14:52:49Z peter $
2
3/*
4  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
5  Copyright (C) 2012 Peter Johansson
6
7  This file is part of the yat library, http://dev.thep.lu.se/yat
8
9  The yat library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 3 of the
12  License, or (at your option) any later version.
13
14  The yat library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with yat. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23// avoid deprecate warnings
24#define YAT_DEPRECATE
25
26#include <config.h>
27
28#include "Suite.h"
29
30#include "yat/utility/Range.h"
31
32#include <vector>
33
34int main(int argc, char* argv[])
35{
36  using namespace theplu::yat::utility;
37  theplu::yat::test::Suite suite(argc, argv);
38  suite.err() << "testing range" << std::endl;
39
40  typedef Range<std::vector<double>::iterator> range;
41  range r1;
42  std::vector<double> vec(10);
43  range r2(vec.begin(), vec.end());
44  range r3(r2);
45  r3 = r1;
46  r3 = r2;
47  r3.begin();
48  r3.end();
49  if (! (r3==r2))
50    suite.add(false);
51  if (r3!=r2)
52    suite.add(false);
53  if (r3<r2)
54    suite.add(false);
55  if (r3>r2)
56    suite.add(false);
57  if (!(r3<=r2))
58    suite.add(false);
59  if (!(r3>=r2))
60    suite.add(false);
61
62  return suite.return_value();
63}
Note: See TracBrowser for help on using the repository browser.