diff -r 000000000000 -r a41df078684a kerneltest/f32test/tools/bigfilewriter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kerneltest/f32test/tools/bigfilewriter.cpp Mon Oct 19 15:55:17 2009 +0100 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +// +// T_BIGFILE_WRITER.CPP +// + + + +#include + +#pragma warning (disable:4201) // warning C4201: nonstandard extension used : nameless struct/union +#include + +#include + +#define __WRITE_FILE_CONTENTS__ + + +const DWORD K1Kb = 1 << 10; +const DWORD K1Mb = 1 << 20; +const DWORD K1Gb = 1 << 30; +const DWORD K2Gb = 0x80000000; +const DWORD K3Gb = 0xC0000000; +const DWORD K4GbMinusOne = 0xFFFFFFFF; +const DWORD KBufSize = 256 * K1Kb; + +BYTE gBuffer[KBufSize]; + +template +T Min(T aLeft,T aRight) + {return(aLeft\n"); + exit(0); + } + + char filePath[] = "\\\\.\\?:\\F32-TST"; + + char driveLetter = argv[1][0]; + filePath[4] = driveLetter; + printf("Creating big files on %s\n", filePath); + + BOOL success; + + + success = CreateDirectory(filePath, NULL); + if (!success && GetLastError() != ERROR_ALREADY_EXISTS) + { + printf("Unable to create directory %d", GetLastError()); + exit(4); + } + + success = SetCurrentDirectory(filePath); + if (!success) + { + printf("Unable to change to directory %d", GetLastError()); + exit(4); + } + + success = WriteFile("File2GBMinusOne.txt", K2Gb-1); + if (!success) exit(4); + + success = WriteFile("File2GB.txt", K2Gb); + if (!success) exit(4); + + success = WriteFile("File3GB.txt", K3Gb); + if (!success) exit(4); + + // NB This won't fit on an 8GB drive + success = WriteFile("File4GBMinusOne.txt", K4GbMinusOne); + if (!success) + { + DeleteFile("File4GBMinusOne.txt"); + exit(4); + } + + + return 0; + } \ No newline at end of file