Complete disaster-recovery snapshot: engine/game source, game data assets, VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive. Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false, no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
61 lines
2.2 KiB
C++
61 lines
2.2 KiB
C++
//===========================================================================//
|
|
// File: filestrm.tcp //
|
|
// Project: MUNGA Brick: Filestream Manager //
|
|
// Contents: Test stuff for MMIO class //
|
|
//---------------------------------------------------------------------------//
|
|
// Date Who Modification //
|
|
// -------- --- ---------------------------------------------------------- //
|
|
// 4/25/96 JTR Initial Creation //
|
|
//---------------------------------------------------------------------------//
|
|
// Copyright (C) 1994, Virtual World Entertainment, Inc. All Rights reserved //
|
|
// PROPRIETARY AND CONFIDENTIAL //
|
|
//===========================================================================//
|
|
|
|
#include "StuffHeaders.hpp"
|
|
#include <GameOS\ToolOS.hpp>
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MMIOstream ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
//
|
|
//#############################################################################
|
|
//#############################################################################
|
|
//
|
|
|
|
bool
|
|
FileStream::TestClass()
|
|
{
|
|
char buffer[65535];
|
|
int i;
|
|
Time total;
|
|
Time s;
|
|
|
|
Check_Object(FileStreamManager::Instance);
|
|
FileStream Testit;
|
|
|
|
memset(buffer,'A',65535);
|
|
|
|
SPEW((GROUP_STUFF_TEST, "Starting FileStream test..."));
|
|
s = gos_GetHiResTime();
|
|
for(i=0; i < 1024; i++)
|
|
{
|
|
Testit.Open("filetest.tst",WriteOnly);
|
|
Testit.WriteBytes(buffer,65535);
|
|
Testit.Close();
|
|
Testit.Open("filetest.tst",ReadOnly);
|
|
Testit.ReadBytes(buffer,65535);
|
|
Testit.Close();
|
|
}
|
|
total = gos_GetHiResTime() - s;
|
|
for(i=0; i < 65535; i++) Verify(buffer[i] == 'A');
|
|
SPEW((GROUP_STUFF_TEST, "Opening, writing, closing, opening, reading, and closing"));
|
|
SPEW((
|
|
GROUP_STUFF_TEST,
|
|
" 64K file 1024 times, averaging out to %f ticks apiece...",
|
|
total / 1024.0f
|
|
));
|
|
SPEW((GROUP_STUFF_TEST, "File data checks out, as well..."));
|
|
SPEW((GROUP_STUFF_TEST, "Leaving FileStream test..."));
|
|
|
|
return true;
|
|
};
|