source: trunk/test/large_file_test.cc @ 1607

Last change on this file since 1607 was 1487, checked in by Jari Häkkinen, 13 years ago

Addresses #436. GPL license copy reference should also be updated.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1// $Id: large_file_test.cc 1487 2008-09-10 08:41:36Z jari $
2
3/*
4  Copyright (C) 2008 Peter Johansson
5
6  This file is part of the yat library, http://dev.thep.lu.se/yat
7
8  The yat library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 3 of the
11  License, or (at your option) any later version.
12
13  The yat library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with yat. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#ifdef HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#include "Suite.h"
27
28#include <string>
29#include <sys/stat.h>
30
31using namespace theplu::yat;
32void test_large_file_support(test::Suite&);
33
34int main(int argc,char* argv[])
35{ 
36  test::Suite suite(argc, argv);
37
38  #ifndef YAT_LFS_DISABLED
39  test_large_file_support(suite);
40  #else
41  suite.err() << "Skipping test of large file support\n";
42  exit(77);
43  #endif
44  return suite.return_value();
45}
46
47void test_large_file_support(test::Suite& suite)
48{
49  bool ok=true;
50  suite.err() << "Testing Large File Support\n";
51  off_t s = std::numeric_limits<off_t>::max() >> 20;
52  suite.err() << "maximal file size: " << s << " Mb" << std::endl;
53  suite.add(s>2048);
54  if (ok)
55    suite.err() << "Ok\n";
56  else
57    suite.err() << "failed\n";
58}
Note: See TracBrowser for help on using the repository browser.