source: trunk/test/large_file_test.cc @ 1458

Last change on this file since 1458 was 1458, checked in by Peter, 13 years ago

moving LFS test to separate file so skipping the test (when using --disable-largefile) becomes more visible.

  • 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 1458 2008-08-30 19:41:00Z peter $
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 2 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 this program; if not, write to the Free Software
20  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21  02111-1307, USA.
22*/
23
24#ifdef HAVE_CONFIG_H
25#include "config.h"
26#endif
27
28#include "Suite.h"
29
30#include <string>
31#include <sys/stat.h>
32
33using namespace theplu::yat;
34void test_large_file_support(test::Suite&);
35
36int main(int argc,char* argv[])
37{ 
38  test::Suite suite(argc, argv);
39
40  #ifndef YAT_LFS_DISABLED
41  test_large_file_support(suite);
42  #else
43  suite.err() << "Skipping test of large file support\n";
44  exit(77);
45  #endif
46  return suite.return_value();
47}
48
49void test_large_file_support(test::Suite& suite)
50{
51  bool ok=true;
52  suite.err() << "Testing Large File Support\n";
53  off_t s = std::numeric_limits<off_t>::max() >> 20;
54  suite.err() << "maximal file size: " << s << " Mb" << std::endl;
55  suite.add(s>2048);
56  if (ok)
57    suite.err() << "Ok\n";
58  else
59    suite.err() << "failed\n";
60}
Note: See TracBrowser for help on using the repository browser.