Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
CBuffFileStream/HelloWorld.c
/* |
File: HelloWorld.c |
Contains: Test Jig. |
How to use this test jig |
I'm lazy, I never put this all together. |
So, it's left as an exercise to the student. |
If you want to run a test, first compilt his will the TestRandom line as the |
only test line uncommented. |
This will create a file called sizelist which is a list of the random |
sizes to write. |
Then, comment that out and make the DoWriteTest line the only one |
that is uncommented. |
Run it and it will create a file called testfile which contains the test |
data. It is a good idea to delete this file between tests to be sure to |
be testing all the same parts of the file system each time. |
When you want to test reading, make sure you have a both "testfile" and |
"sizelist" already generated and make the DoReadTest line the only one uncommented. |
See the file CTestJig.c for info on how to compare buffered vs. nonbuffered. |
Written by: Steve Bollinger |
Copyright: Copyright (c) 1999 Apple Computer, Inc., All Rights Reserved. |
You may incorporate this Apple sample source code into your program(s) without |
restriction. This Apple sample source code has been provided "AS IS" and the |
responsibility for its operation is yours. You are not permitted to redistribute |
this Apple sample source code as "Apple sample source code" after having made |
changes. If you're going to re-distribute the source, we require that you make |
it clear in the source that the code was descended from Apple sample source |
code, but that you've made changes. |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <time.h> |
#include "RandomTestJig.h" |
#include "CTestJig.h" |
int main(void) |
{ |
printf ("Hello World, this is CodeWarrior!\n\n"); |
srand(time(NULL)); |
printf ("This project uses the SIOUX console library: choose 'Quit' from the file menu to quit.\n\n"); |
printf ("For more information on the ANSI C library and the Metrowerks additions, "); |
printf ("including SIOUX, see the C Library Reference in the Metrowerks Documentation folder.\n\n"); |
printf ("To locate the right ANSI library for your preferences, see the CodeWarrior User's Guide.\n"); |
// Test lines are here. |
// TestRandom(); |
// printf ("Time in ticks: %lu\n",DoWriteTest()); |
printf ("Time in ticks: %lu\n",DoReadTest()); |
return 0; |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14