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