Changeset b2a1ea3 in rtems
- Timestamp:
- 04/24/01 23:04:59 (22 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- eb22ebe
- Parents:
- 126405d9
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/tests/psxtests/ChangeLog
r126405d9 rb2a1ea3 1 2001-04-24 Joel Sherrill <joel@OARcorp.com> 2 3 * psxfile01/test.c, psxfile01/psxfile01.scn : Added test case for 4 open, write, reopen, append twice from Andrew Bythell 5 <abythell@nortelnetworks.com> that tripped an initialization 6 problem in the IMFS. 7 1 8 2001-04-20 Joel Sherrill <joel@OARcorp.com> 2 9 -
c/src/tests/psxtests/psxfile01/psxfile01.scn
r126405d9 rb2a1ea3 198 198 ........j (file 0) 199 199 *************** End of Dump *************** 200 Writing First File 201 Writing Second File 202 (0)this is a test line 203 this is a test line 204 205 (0)this is a test line 206 this is a test line 200 207 *** END OF FILE TEST 1 *** 201 208 -
c/src/tests/psxtests/psxfile01/test.c
r126405d9 rb2a1ea3 35 35 #include <rtems.h> 36 36 #include <rtems/libio.h> 37 38 void test_case_reopen_append(void); 37 39 38 40 char test_write_buffer[ 1024 ]; … … 499 501 rtems_status = rtems_io_register_name( "/dev/console", 0, 0 ); 500 502 503 test_case_reopen_append(); 504 501 505 printf( "*** END OF FILE TEST 1 ***\n" ); 502 506 exit( 0 ); 503 507 } 504 508 505 509 /* 510 * Open/Create a File and write to it 511 * 512 * Test case submitted by Andrew Bythell <abythell@nortelnetworks.com>. 513 * 514 */ 515 516 void test_file (char *filename, char *mode); 517 518 void test_case_reopen_append(void) 519 { 520 printf ("Writing First File\n"); 521 test_file ("/one.txt", "a"); 522 test_file ("/one.txt", "a"); 523 524 /* but not the second time - this will insert junk. 525 the number of ^@'s seems to equal the number of 526 actual characters in the file */ 527 528 printf ("Writing Second File\n"); 529 test_file ("/two.txt", "a"); 530 test_file ("/two.txt", "a"); 531 532 test_cat( "/one.txt", 0, 1024 ); 533 test_cat( "/two.txt", 0, 1024 ); 534 } 535 536 void test_file (char *filename, char *mode) 537 { 538 FILE *fp; 539 fp = fopen (filename, mode); 540 if (!fp) 541 perror ("fopen"); 542 fprintf (fp, "this is a test line\n"); 543 if (fclose (fp)) 544 perror ("fclose"); 545 } 546 547 -
testsuites/psxtests/ChangeLog
r126405d9 rb2a1ea3 1 2001-04-24 Joel Sherrill <joel@OARcorp.com> 2 3 * psxfile01/test.c, psxfile01/psxfile01.scn : Added test case for 4 open, write, reopen, append twice from Andrew Bythell 5 <abythell@nortelnetworks.com> that tripped an initialization 6 problem in the IMFS. 7 1 8 2001-04-20 Joel Sherrill <joel@OARcorp.com> 2 9 -
testsuites/psxtests/psxfile01/psxfile01.scn
r126405d9 rb2a1ea3 198 198 ........j (file 0) 199 199 *************** End of Dump *************** 200 Writing First File 201 Writing Second File 202 (0)this is a test line 203 this is a test line 204 205 (0)this is a test line 206 this is a test line 200 207 *** END OF FILE TEST 1 *** 201 208 -
testsuites/psxtests/psxfile01/test.c
r126405d9 rb2a1ea3 35 35 #include <rtems.h> 36 36 #include <rtems/libio.h> 37 38 void test_case_reopen_append(void); 37 39 38 40 char test_write_buffer[ 1024 ]; … … 499 501 rtems_status = rtems_io_register_name( "/dev/console", 0, 0 ); 500 502 503 test_case_reopen_append(); 504 501 505 printf( "*** END OF FILE TEST 1 ***\n" ); 502 506 exit( 0 ); 503 507 } 504 508 505 509 /* 510 * Open/Create a File and write to it 511 * 512 * Test case submitted by Andrew Bythell <abythell@nortelnetworks.com>. 513 * 514 */ 515 516 void test_file (char *filename, char *mode); 517 518 void test_case_reopen_append(void) 519 { 520 printf ("Writing First File\n"); 521 test_file ("/one.txt", "a"); 522 test_file ("/one.txt", "a"); 523 524 /* but not the second time - this will insert junk. 525 the number of ^@'s seems to equal the number of 526 actual characters in the file */ 527 528 printf ("Writing Second File\n"); 529 test_file ("/two.txt", "a"); 530 test_file ("/two.txt", "a"); 531 532 test_cat( "/one.txt", 0, 1024 ); 533 test_cat( "/two.txt", 0, 1024 ); 534 } 535 536 void test_file (char *filename, char *mode) 537 { 538 FILE *fp; 539 fp = fopen (filename, mode); 540 if (!fp) 541 perror ("fopen"); 542 fprintf (fp, "this is a test line\n"); 543 if (fclose (fp)) 544 perror ("fclose"); 545 } 546 547
Note: See TracChangeset
for help on using the changeset viewer.