Changeset a841314 in rtems
- Timestamp:
- 03/30/04 19:46:38 (20 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- b5cfa4e
- Parents:
- 378aed9
- Location:
- testsuites/sptests
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/sptests/ChangeLog
r378aed9 ra841314 1 2004-03-30 David Querbach <querbach@realtime.bc.ca> 2 3 PR 595/tests 4 * sp13/fillbuff.c, sp13/init.c, sp13/putbuff.c, sp13/system.h, 5 sp13/task1.c, sp13/task2.c: Fill_buffer() in fillbuff.c overruns the 6 supplied buffer due to confusion in the definition of MESSAGE_SIZE. 7 Some files in the sp13 test treat MESSAGE_SIZE as a count of bytes, 8 others treat it as a count of longs. 9 1 10 2004-03-30 David Querbach <querbach@realtime.bc.ca> 2 11 -
testsuites/sptests/sp13/fillbuff.c
r378aed9 ra841314 22 22 #include "system.h" 23 23 24 #define MESSAGE_SIZE (sizeof(long) * 4)25 26 24 void Fill_buffer( 27 25 char *source, … … 30 28 { 31 29 char *p; 32 int i; 33 /* 34 memcpy( buffer, source, 16 ); 35 */ 30 int i, j; 31 36 32 p = source; 37 for ( i=0 ; i<MESSAGE_SIZE ; i++ ) { 38 buffer[i] = *p++; 39 buffer[i] <<= 8; 40 buffer[i] |= *p++; 41 buffer[i] <<= 8; 42 buffer[i] |= *p++; 43 buffer[i] <<= 8; 44 buffer[i] |= *p++; 33 for ( i = 0 ; i < MESSAGE_SIZE / sizeof(long) ; i++ ) { 34 buffer[i] = 0; 35 for ( j = sizeof(long) - 1; j >= 0; j-- ) { 36 buffer[i] |= *p++ << (8 * j); 37 } 45 38 } 46 39 } -
testsuites/sptests/sp13/init.c
r378aed9 ra841314 24 24 #define TEST_INIT 25 25 #include "system.h" 26 27 #define MESSAGE_SIZE (sizeof(long) * 4)28 26 29 27 rtems_task Init( -
testsuites/sptests/sp13/putbuff.c
r378aed9 ra841314 21 21 #include "system.h" 22 22 23 #define MESSAGE_SIZE (4)24 25 23 void Put_buffer( 26 24 long *buffer 27 25 ) 28 26 { 29 int i ;30 /* 31 printf( "%16s", (char *)buffer ); 32 */ 33 for ( i=0 ; i< MESSAGE_SIZE ; i++) {34 printf( "%c%c%c%c", (char) (buffer[i] >> 24),35 (char) (buffer[i] >> 16 & 0xff),36 (char) (buffer[i] >> 8 & 0xff),37 (char) (buffer[i] >> 0 & 0xff) );27 int i, j; 28 char c; 29 30 for ( i = 0; i < MESSAGE_SIZE / sizeof(long); i++ ) { 31 for ( j = sizeof(long) - 1; j >= 0; j-- ) { 32 if ( (c = (buffer[i] >> (8 * j)) & 0xFF) == 0 ) 33 return; 34 printf( "%c", c ); 35 } 38 36 } 39 40 37 } -
testsuites/sptests/sp13/system.h
r378aed9 ra841314 67 67 TEST_EXTERN rtems_name Queue_name[ 4 ]; /* array of queue names */ 68 68 69 /* test configuration */ 70 71 #define MESSAGE_SIZE (sizeof(long) * 4) /* must be multiple of sizeof(long) */ 72 69 73 /* end of include file */ -
testsuites/sptests/sp13/task1.c
r378aed9 ra841314 24 24 char big_receive_buffer[2048]; 25 25 26 long buffer[ 4 ]; 27 28 #define MESSAGE_SIZE (sizeof(long) * 4) 26 long buffer[ MESSAGE_SIZE / sizeof(long) ]; 29 27 30 28 void dope_buffer(unsigned char *buff, -
testsuites/sptests/sp13/task2.c
r378aed9 ra841314 20 20 21 21 #include "system.h" 22 23 #define MESSAGE_SIZE (sizeof(long) * 4)24 22 25 23 rtems_task Task_2(
Note: See TracChangeset
for help on using the changeset viewer.