712 |
21 Dec 06 |
jari |
// $Id$ |
712 |
21 Dec 06 |
jari |
2 |
|
712 |
21 Dec 06 |
jari |
3 |
/* |
2119 |
12 Dec 09 |
peter |
Copyright (C) 2006 Jari Häkkinen |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2007 Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2009, 2013 Peter Johansson |
712 |
21 Dec 06 |
jari |
8 |
|
1437 |
25 Aug 08 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
712 |
21 Dec 06 |
jari |
10 |
|
712 |
21 Dec 06 |
jari |
The yat library is free software; you can redistribute it and/or |
712 |
21 Dec 06 |
jari |
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 |
712 |
21 Dec 06 |
jari |
License, or (at your option) any later version. |
712 |
21 Dec 06 |
jari |
15 |
|
712 |
21 Dec 06 |
jari |
The yat library is distributed in the hope that it will be useful, |
712 |
21 Dec 06 |
jari |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
712 |
21 Dec 06 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
712 |
21 Dec 06 |
jari |
General Public License for more details. |
712 |
21 Dec 06 |
jari |
20 |
|
712 |
21 Dec 06 |
jari |
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/>. |
712 |
21 Dec 06 |
jari |
23 |
*/ |
712 |
21 Dec 06 |
jari |
24 |
|
3050 |
12 Jun 13 |
peter |
25 |
#include <config.h> |
1456 |
30 Aug 08 |
peter |
26 |
|
1248 |
19 Mar 08 |
peter |
27 |
#include "Suite.h" |
1248 |
19 Mar 08 |
peter |
28 |
|
2055 |
08 Sep 09 |
peter |
29 |
#include <limits> |
712 |
21 Dec 06 |
jari |
30 |
#include <string> |
1458 |
30 Aug 08 |
peter |
31 |
#include <sys/stat.h> |
712 |
21 Dec 06 |
jari |
32 |
|
1456 |
30 Aug 08 |
peter |
33 |
using namespace theplu::yat; |
1456 |
30 Aug 08 |
peter |
34 |
void test_large_file_support(test::Suite&); |
1456 |
30 Aug 08 |
peter |
35 |
|
1248 |
19 Mar 08 |
peter |
36 |
int main(int argc,char* argv[]) |
4200 |
19 Aug 22 |
peter |
37 |
{ |
1248 |
19 Mar 08 |
peter |
38 |
test::Suite suite(argc, argv); |
712 |
21 Dec 06 |
jari |
39 |
|
1457 |
30 Aug 08 |
peter |
40 |
#ifndef YAT_LFS_DISABLED |
1456 |
30 Aug 08 |
peter |
41 |
test_large_file_support(suite); |
1457 |
30 Aug 08 |
peter |
42 |
#else |
1457 |
30 Aug 08 |
peter |
43 |
suite.err() << "Skipping test of large file support\n"; |
1458 |
30 Aug 08 |
peter |
44 |
exit(77); |
1457 |
30 Aug 08 |
peter |
45 |
#endif |
1248 |
19 Mar 08 |
peter |
46 |
return suite.return_value(); |
712 |
21 Dec 06 |
jari |
47 |
} |
1456 |
30 Aug 08 |
peter |
48 |
|
1456 |
30 Aug 08 |
peter |
49 |
void test_large_file_support(test::Suite& suite) |
1456 |
30 Aug 08 |
peter |
50 |
{ |
1456 |
30 Aug 08 |
peter |
51 |
bool ok=true; |
1456 |
30 Aug 08 |
peter |
52 |
suite.err() << "Testing Large File Support\n"; |
1456 |
30 Aug 08 |
peter |
53 |
off_t s = std::numeric_limits<off_t>::max() >> 20; |
1456 |
30 Aug 08 |
peter |
54 |
suite.err() << "maximal file size: " << s << " Mb" << std::endl; |
1456 |
30 Aug 08 |
peter |
55 |
suite.add(s>2048); |
1456 |
30 Aug 08 |
peter |
56 |
if (ok) |
1456 |
30 Aug 08 |
peter |
57 |
suite.err() << "Ok\n"; |
1456 |
30 Aug 08 |
peter |
58 |
else |
1456 |
30 Aug 08 |
peter |
59 |
suite.err() << "failed\n"; |
1456 |
30 Aug 08 |
peter |
60 |
} |