// NeL - MMORPG Framework
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
#ifndef UT_MISC_FILE
#define UT_MISC_FILE
#include
#include
#include
// Test suite for NLMISC::CFile behavior
struct CUTMiscFile : public Test::Suite
{
CUTMiscFile()
{
TEST_ADD(CUTMiscFile::copyOneBigFile);
TEST_ADD(CUTMiscFile::copyDifferentFileSize);
TEST_ADD(CUTMiscFile::moveOneBigFile);
TEST_ADD(CUTMiscFile::moveDifferentFileSize);
// Add a line here when adding a new test METHOD
}
private:
string _SrcFile;
string _DstFile;
void setup()
{
_SrcFile = "__copy_file_src.foo";
_DstFile = "__copy_file_dst.foo";
}
void tear_down()
{
}
void copyFileSize(uint fileSize)
{
// create a source file (using standard c code)
FILE *fp = NLMISC::nlfopen(_SrcFile, "wb");
nlverify(fp != NULL);
for (uint i=0; i