honor -r when writing test_file_readers files

This commit is contained in:
Glenn Maynard
2004-03-14 06:44:04 +00:00
parent b6bc1bf8ec
commit 90eadd647f
2 changed files with 13 additions and 5 deletions
+11 -3
View File
@@ -19,13 +19,21 @@ void CreateBinaryTestFile( FILE *out, int size )
}
}
extern CString g_Root;
void CreateBinaryTestFile( CString fn, int size )
{
FILE *out = fopen( fn, "w+b" );
FILE *out = fopen( g_Root + "/" + fn, "w+b" );
CreateBinaryTestFile( out, size );
fclose( out );
RageFile f(fn);
if( !f.Open(fn) )
{
LOG->Warn("CreateBinaryTestFile: error reopening %s: %s", fn.c_str(), f.GetError().c_str() );
return;
}
int test = f.GetFileSize();
if( test != size )
LOG->Warn("CreateBinaryTestFile: f.GetFileSize ret %i, exp %i", test, size );
@@ -95,7 +103,7 @@ void TestText( int LineSize, bool DOS )
filename += ssprintf( ".%i", LineSize );
if( CreateTestFiles )
{
FILE *out = fopen( filename, "w+b" );
FILE *out = fopen( g_Root + "/" + filename, "w+b" );
for( unsigned line = 0; line < NumLines; ++line )
{
@@ -196,7 +204,7 @@ void TestSeek( bool relative )
{
/* Output a line of text, followed by some junk, followed by binary
* test data. */
FILE *out = fopen( "test.seek", "w+b" );
FILE *out = fopen( g_Root + "/" + "test.seek", "w+b" );
fprintf( out, "%s", TestLine.c_str() );
fprintf( out, "%s", junk.c_str() );
CreateBinaryTestFile( out, 1024 );
+2 -2
View File
@@ -4,8 +4,8 @@
#include "RageFileManager.h"
#include "RageLog.h"
static CString g_Driver = "dir", g_Root = ".";
static CString argv0;
CString g_Driver = "dir", g_Root = ".";
CString argv0;
void test_handle_args( int argc, char *argv[] )
{