#include #include #include #define SIZE 10000 #define SIZEL 10000L _main() { IMPORT BOOL bug, vdim(); IMPORT VOID vinit(), vwrite(); TEXT *vread(); COUNT i; DOUBLE d, *j; LONG time; putfmt("Testing the virtual array routines.\n"); vdim("dl0:xyz.swp", 0, SCRATCH, SIZEL, 8); vinit(); for ( i = 0; i < SIZE; i++ ) { d = (double)i; vwrite(0,(long)i,&d); } putfmt("Done writing, try reading all this garbage now.\n"); for ( i = 0; i < SIZE; i++ ) { j = vread( 0, (long)i); if ( *j != (double)i ) { putfmt("Error in location %i. bad val is %3.5e\n",i,*j); j = vread(0, (long)i); putfmt("In vtest after bug j = %3.5e\n",*j); } } putfmt("Done...closing up.\n"); vexit(); }