source: trunk/test/range.cc @ 2919

Last change on this file since 2919 was 2919, checked in by Peter, 10 years ago

update copyright years

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.4 KB
Line 
1// $Id: range.cc 2919 2012-12-19 06:54:23Z 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#include <config.h>
24
25#include "Suite.h"
26
27#include "yat/utility/Range.h"
28
29#include <vector>
30
31int main(int argc, char* argv[])
32{ 
33  using namespace theplu::yat::utility;
34  theplu::yat::test::Suite suite(argc, argv);
35  suite.err() << "testing range" << std::endl;
36
37  typedef Range<std::vector<double>::iterator> range;
38  range r1;
39  std::vector<double> vec(10);
40  range r2(vec.begin(), vec.end());
41  range r3(r2);
42  r3 = r1;
43  r3 = r2;
44  r3.begin();
45  r3.end();
46  if (! (r3==r2))
47    suite.add(false);
48  if (r3!=r2)
49    suite.add(false);
50  if (r3<r2)
51    suite.add(false);
52  if (r3>r2)
53    suite.add(false);
54  if (!(r3<=r2))
55    suite.add(false);
56  if (!(r3>=r2))
57    suite.add(false);
58
59  return suite.return_value();
60}
Note: See TracBrowser for help on using the repository browser.