Commit 3f924718 authored by hybrid's avatar hybrid

Fix eol-style for all code files to CRLF for simpler file handling.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2526 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 3ef1b183
#include "irrlicht.h"
#include "testUtils.h"
using namespace irr;
using namespace core;
using namespace io;
bool filesystem(void)
{
IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2d<u32>(1, 1));
assert(device);
if(!device)
return false;
io::IFileSystem * fs = device->getFileSystem ();
if ( !fs )
return false;
bool result = true;
core::string<c16> workingDir = device->getFileSystem()->getWorkingDirectory();
core::string<c16> empty;
if ( fs->existFile(empty) )
{
logTestString("Empty filename should not exist.\n");
result = false;
}
stringc newWd = workingDir + "/media";
bool changed = device->getFileSystem()->changeWorkingDirectoryTo(newWd);
assert(changed);
if ( fs->existFile(empty) )
{
logTestString("Empty filename should not exist even in another workingdirectory.\n");
result = false;
}
// The working directory must be restored for the other tests to work.
changed = device->getFileSystem()->changeWorkingDirectoryTo(workingDir.c_str());
assert(changed);
// adding a folder archive which just should not really change anything
device->getFileSystem()->addFolderFileArchive( "./" );
if ( fs->existFile(empty) )
{
logTestString("Empty filename should not exist in folder file archive.\n");
result = false;
}
// remove it again to not affect other tests
device->getFileSystem()->unregisterFileArchive( device->getFileSystem()->getFileArchiveCount() );
return result;
}
#include "irrlicht.h"
#include "testUtils.h"
using namespace irr;
using namespace core;
using namespace io;
bool filesystem(void)
{
IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2d<u32>(1, 1));
assert(device);
if(!device)
return false;
io::IFileSystem * fs = device->getFileSystem ();
if ( !fs )
return false;
bool result = true;
core::string<c16> workingDir = device->getFileSystem()->getWorkingDirectory();
core::string<c16> empty;
if ( fs->existFile(empty) )
{
logTestString("Empty filename should not exist.\n");
result = false;
}
stringc newWd = workingDir + "/media";
bool changed = device->getFileSystem()->changeWorkingDirectoryTo(newWd);
assert(changed);
if ( fs->existFile(empty) )
{
logTestString("Empty filename should not exist even in another workingdirectory.\n");
result = false;
}
// The working directory must be restored for the other tests to work.
changed = device->getFileSystem()->changeWorkingDirectoryTo(workingDir.c_str());
assert(changed);
// adding a folder archive which just should not really change anything
device->getFileSystem()->addFolderFileArchive( "./" );
if ( fs->existFile(empty) )
{
logTestString("Empty filename should not exist in folder file archive.\n");
result = false;
}
// remove it again to not affect other tests
device->getFileSystem()->unregisterFileArchive( device->getFileSystem()->getFileArchiveCount() );
return result;
}
#include "irrlicht.h"
#include "testUtils.h"
using namespace irr;
using namespace core;
using namespace io;
bool zipReader(void)
{
IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2d<u32>(1, 1));
assert(device);
if(!device)
return false;
io::IFileSystem * fs = device->getFileSystem ();
if ( !fs )
return false;
if ( !fs->registerFileArchive(core::string<c16>("media/file_with_path.zip"), /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) )
return false;
// log what we got
io::IFileArchive* archive = fs->getFileArchive(fs->getFileArchiveCount()-1);
for ( u32 f=0; f < archive->getFileCount(); ++f)
{
const io::IFileArchiveEntry* entry = archive->getFileInfo(f);
logTestString("simpleFileName: %s\n", entry->simpleFileName.c_str());
logTestString("path: %s\n", entry->path.c_str());
}
bool result = true;
core::string<c16> filename("mypath/myfile.txt");
result &= fs->existFile(filename);
if (!result )
{
logTestString("existFile failed");
}
IReadFile* readFile = fs->createAndOpenFile(filename);
if ( !readFile )
{
result = false;
logTestString("createAndOpenFilefailed");
}
return result;
}
#include "irrlicht.h"
#include "testUtils.h"
using namespace irr;
using namespace core;
using namespace io;
bool zipReader(void)
{
IrrlichtDevice * device = irr::createDevice(video::EDT_NULL, dimension2d<u32>(1, 1));
assert(device);
if(!device)
return false;
io::IFileSystem * fs = device->getFileSystem ();
if ( !fs )
return false;
if ( !fs->registerFileArchive(core::string<c16>("media/file_with_path.zip"), /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) )
return false;
// log what we got
io::IFileArchive* archive = fs->getFileArchive(fs->getFileArchiveCount()-1);
for ( u32 f=0; f < archive->getFileCount(); ++f)
{
const io::IFileArchiveEntry* entry = archive->getFileInfo(f);
logTestString("simpleFileName: %s\n", entry->simpleFileName.c_str());
logTestString("path: %s\n", entry->path.c_str());
}
bool result = true;
core::string<c16> filename("mypath/myfile.txt");
result &= fs->existFile(filename);
if (!result )
{
logTestString("existFile failed");
}
IReadFile* readFile = fs->createAndOpenFile(filename);
if ( !readFile )
{
result = false;
logTestString("createAndOpenFilefailed");
}
return result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment