source: trunk/test/large_file.cc @ 3050

Last change on this file since 3050 was 3050, checked in by Peter, 9 years ago

prefer including as <config.h> rather than "config.h"

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