testsuites: Fix warnings

This commit is contained in:
Sebastian Huber
2013-04-11 13:58:33 +02:00
parent dc76d98a53
commit 7b369afba9
15 changed files with 51 additions and 40 deletions

View File

@@ -196,7 +196,10 @@ static void test_ide_part_table(void)
rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_status_code sc = RTEMS_SUCCESSFUL;
test_logical_disks(&ide_part_table_rdax [0], false); test_logical_disks(&ide_part_table_rdax [0], false);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
sc = rtems_ide_part_table_initialize(rda); sc = rtems_ide_part_table_initialize(rda);
#pragma GCC diagnostic pop
ASSERT_SC(sc); ASSERT_SC(sc);
test_logical_disks(&ide_part_table_rdax [0], true); test_logical_disks(&ide_part_table_rdax [0], true);
} }

View File

@@ -29,7 +29,7 @@
#include "fstest.h" #include "fstest.h"
#include "pmacros.h" #include "pmacros.h"
volatile void *prevent_compiler_optimizations; void *volatile prevent_compiler_optimizations;
/* Break out of a chroot() environment in C */ /* Break out of a chroot() environment in C */
static void break_out_of_chroot(void) static void break_out_of_chroot(void)

View File

@@ -2,11 +2,14 @@
*************** Dump of Entire IMFS *************** *************** Dump of Entire IMFS ***************
/ /
....dev/ ....dev/
........console_a (device 0, 0)
........console (device 0, 0) ........console (device 0, 0)
........console_b (device 0, 1)
*************** End of Dump *************** *************** End of Dump ***************
stat of /dev/console stat of /dev/console
....st_dev (0xfffe:0x0) ....st_dev (0xfffe:0x0)
....st_ino 3 may vary by small amount ....st_rdev (0x0:0x0)
....st_ino 4 may vary by small amount
....mode = 00020755 ....mode = 00020755
....nlink = 1 ....nlink = 1
....uid = 0 ....uid = 0
@@ -14,7 +17,7 @@ stat of /dev/console
....atime = Fri Jan 1 00:00:00 1988 ....atime = Fri Jan 1 00:00:00 1988
....mtime = Fri Jan 1 00:00:00 1988 ....mtime = Fri Jan 1 00:00:00 1988
....ctime = Fri Jan 1 00:00:00 1988 ....ctime = Fri Jan 1 00:00:00 1988
....st_blksize 80 ....st_blksize 0
....st_blocks 0 ....st_blocks 0
mkdir /dev/tty mkdir /dev/tty
@@ -31,7 +34,6 @@ rmdir /usr
rmdir /dev rmdir /dev
rmdir /fred rmdir /fred
rmdir /tmp/bha rmdir /tmp/bha
unlink /dev/tty
mknod /dev/test_console mknod /dev/test_console
mknod /dev/tty/S3 mknod /dev/tty/S3
mknod /etc/passwd mknod /etc/passwd
@@ -48,7 +50,6 @@ unlink /tmp
create and close /tmp/tom create and close /tmp/tom
Attempt to recreate /tmp/tom Attempt to recreate /tmp/tom
create /tmp/john create /tmp/john
tcdrain /tmp/john
Attempt to create a file, open in read-only mode and truncate it Attempt to create a file, open in read-only mode and truncate it
Exercise the reentrant version _link_r -- Expect ENOENT Exercise the reentrant version _link_r -- Expect ENOENT
Unlink /tmp/bha using the reentrant version -- OK Unlink /tmp/bha using the reentrant version -- OK
@@ -85,7 +86,8 @@ End of _rename_r tests
stat( /tmp/joel ) returned stat( /tmp/joel ) returned
....st_dev (0xfffe:0x0) ....st_dev (0xfffe:0x0)
....st_ino 15 may vary by small amount ....st_rdev (0x0:0x0)
....st_ino 17 may vary by small amount
....mode = 00100700 ....mode = 00100700
....nlink = 1 ....nlink = 1
....uid = 0 ....uid = 0
@@ -118,7 +120,8 @@ Skipping maximum file size test since max_size is 4329344 bytes
That is likely to be bigger than the available RAM on many targets. That is likely to be bigger than the available RAM on many targets.
stat( /tmp/joel ) returned stat( /tmp/joel ) returned
....st_dev (0xfffe:0x0) ....st_dev (0xfffe:0x0)
....st_ino 16 may vary by small amount ....st_rdev (0x0:0x0)
....st_ino 18 may vary by small amount
....mode = 00100700 ....mode = 00100700
....nlink = 1 ....nlink = 1
....uid = 0 ....uid = 0
@@ -130,16 +133,17 @@ stat( /tmp/joel ) returned
....st_blocks 0 ....st_blocks 0
stat of /tmp/j stat of /tmp/j
stat(/tmp/j) returned -1 (errno=2) stat(/tmp/j) returned -1 (errno=2)
....st_dev (0xfffe:0x0) ....st_dev (0x0:0x0)
....st_ino 3 may vary by small amount ....st_rdev (0x0:0x0)
....mode = 00020755 ....st_ino 0 may vary by small amount
....nlink = 1 ....mode = 00000000
....nlink = 0
....uid = 0 ....uid = 0
....gid = 0 ....gid = 0
....atime = Fri Jan 1 00:00:00 1988 ....atime = Thu Jan 1 00:00:00 1970
....mtime = Fri Jan 1 00:00:00 1988 ....mtime = Thu Jan 1 00:00:00 1970
....ctime = Fri Jan 1 00:00:00 1988 ....ctime = Thu Jan 1 00:00:00 1970
....st_blksize 80 ....st_blksize 0
....st_blocks 0 ....st_blocks 0
fopen of /tmp/j fopen of /tmp/j
fprintf to /tmp/j fprintf to /tmp/j
@@ -149,7 +153,8 @@ fprintf to /tmp/j
(4) 26 characters written to the file (4) 26 characters written to the file
(5) 26 characters written to the file (5) 26 characters written to the file
....st_dev (0xfffe:0x0) ....st_dev (0xfffe:0x0)
....st_ino 17 may vary by small amount ....st_rdev (0x0:0x0)
....st_ino 19 may vary by small amount
....mode = 00100644 ....mode = 00100644
....nlink = 1 ....nlink = 1
....uid = 0 ....uid = 0
@@ -165,7 +170,8 @@ This is call 3 to fprintf
This is call 4 to fprintf This is call 4 to fprintf
This is call 5 to fprintf This is call 5 to fprintf
....st_dev (0xfffe:0x0) ....st_dev (0xfffe:0x0)
....st_ino 17 may vary by small amount ....st_rdev (0x0:0x0)
....st_ino 19 may vary by small amount
....mode = 00100644 ....mode = 00100644
....nlink = 1 ....nlink = 1
....uid = 0 ....uid = 0
@@ -178,7 +184,9 @@ This is call 5 to fprintf
*************** Dump of Entire IMFS *************** *************** Dump of Entire IMFS ***************
/ /
....dev/ ....dev/
........console_a (device 0, 0)
........console (device 0, 0) ........console (device 0, 0)
........console_b (device 0, 1)
........tty/ ........tty/
............S3 (device 255, 128) ............S3 (device 255, 128)
........test_console (device 0, 0) ........test_console (device 0, 0)
@@ -195,7 +203,8 @@ This is call 5 to fprintf
*************** End of Dump *************** *************** End of Dump ***************
truncate /tmp/j to length of 40 truncate /tmp/j to length of 40
....st_dev (0xfffe:0x0) ....st_dev (0xfffe:0x0)
....st_ino 17 may vary by small amount ....st_rdev (0x0:0x0)
....st_ino 19 may vary by small amount
....mode = 00100644 ....mode = 00100644
....nlink = 1 ....nlink = 1
....uid = 0 ....uid = 0
@@ -208,7 +217,9 @@ truncate /tmp/j to length of 40
*************** Dump of Entire IMFS *************** *************** Dump of Entire IMFS ***************
/ /
....dev/ ....dev/
........console_a (device 0, 0)
........console (device 0, 0) ........console (device 0, 0)
........console_b (device 0, 1)
........tty/ ........tty/
............S3 (device 255, 128) ............S3 (device 255, 128)
........test_console (device 0, 0) ........test_console (device 0, 0)
@@ -229,7 +240,9 @@ truncate /tmp to length of 0 should fail with EISDIR
*************** Dump of Entire IMFS *************** *************** Dump of Entire IMFS ***************
/ /
....dev/ ....dev/
........console_a (device 0, 0)
........console (device 0, 0) ........console (device 0, 0)
........console_b (device 0, 1)
........tty/ ........tty/
............S3 (device 255, 128) ............S3 (device 255, 128)
........test_console (device 0, 0) ........test_console (device 0, 0)

View File

@@ -35,6 +35,7 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <inttypes.h>
#include <ctype.h> #include <ctype.h>
#include <reent.h> #include <reent.h>
#include <rtems/imfs.h> #include <rtems/imfs.h>
@@ -80,15 +81,16 @@ void test_extend(
*/ */
void dump_statbuf( struct stat *buf ) void dump_statbuf( struct stat *buf )
{ {
int major1; rtems_device_major_number major1;
int minor1; rtems_device_minor_number minor1;
int major2; rtems_device_major_number major2;
int minor2; rtems_device_minor_number minor2;
rtems_filesystem_split_dev_t( buf->st_dev, major1, minor1 ); rtems_filesystem_split_dev_t( buf->st_dev, major1, minor1 );
rtems_filesystem_split_dev_t( buf->st_rdev, major2, minor2 ); rtems_filesystem_split_dev_t( buf->st_rdev, major2, minor2 );
printf( "....st_dev (0x%x:0x%x)\n", major1, minor1 ); printf( "....st_dev (0x%" PRIx32 ":0x%" PRIx32 ")\n", major1, minor1 );
printf( "....st_rdev (0x%" PRIx32 ":0x%" PRIx32 ")\n", major2, minor2 );
printf( "....st_ino %" PRIxino_t " may vary by small amount\n", buf->st_ino ); printf( "....st_ino %" PRIxino_t " may vary by small amount\n", buf->st_ino );
printf( "....mode = %08" PRIomode_t "\n", buf->st_mode ); printf( "....mode = %08" PRIomode_t "\n", buf->st_mode );
printf( "....nlink = %d\n", buf->st_nlink ); printf( "....nlink = %d\n", buf->st_nlink );

View File

@@ -12,6 +12,7 @@
#endif #endif
#include <timesys.h> #include <timesys.h>
#include <pthread.h>
#include <rtems/timerdrv.h> #include <rtems/timerdrv.h>
#include "test_support.h" #include "test_support.h"

View File

@@ -27,6 +27,7 @@
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
#include <errno.h> #include <errno.h>
#include <sched.h>
#include <timesys.h> #include <timesys.h>
#include <tmacros.h> #include <tmacros.h>
#include <rtems/timerdrv.h> #include <rtems/timerdrv.h>
@@ -88,16 +89,14 @@ void *Middle(
#elif defined(USE_TIMEDWAIT_WAIT_VALUE_IN_PAST) #elif defined(USE_TIMEDWAIT_WAIT_VALUE_IN_PAST)
{ {
long end_time;
/* override sleepTime with something obviously in the past */ /* override sleepTime with something obviously in the past */
sleepTime.tv_sec = 0; sleepTime.tv_sec = 0;
sleepTime.tv_nsec = 5; sleepTime.tv_nsec = 5;
/* this does all the work of timedwait but immediately returns */ /* this does all the work of timedwait but immediately returns */
rc = pthread_cond_timedwait( &CondID, &MutexID, &sleepTime ); rc = pthread_cond_timedwait( &CondID, &MutexID, &sleepTime );
end_time = benchmark_timer_read();
rtems_test_assert(rc == ETIMEDOUT); rtems_test_assert(rc == ETIMEDOUT);
benchmark_timer_read();
} }
#endif #endif

View File

@@ -19,7 +19,7 @@
/* forward declarations to avoid warnings */ /* forward declarations to avoid warnings */
void *POSIX_Init(void *argument); void *POSIX_Init(void *argument);
void benchmark_pthread_create(void); void benchmark_pthread_create(void);
void thread(void *argument); void *thread(void *argument);
void benchmark_pthread_create(void) void benchmark_pthread_create(void)
{ {
@@ -46,11 +46,12 @@ void benchmark_pthread_create(void)
} }
void thread( void *thread(
void *argument void *argument
) )
{ {
//Empty thread used in pthread_create(). //Empty thread used in pthread_create().
return NULL;
} }
void *POSIX_Init( void *POSIX_Init(

View File

@@ -23,7 +23,6 @@ rtems_task Init(
char ch; char ch;
rtems_id id; rtems_id id;
rtems_status_code status; rtems_status_code status;
bool allDone;
/* Put start of test message */ /* Put start of test message */
puts( "\n\n*** spatomic02 TEST ***\n" ); puts( "\n\n*** spatomic02 TEST ***\n" );

View File

@@ -23,7 +23,6 @@ rtems_task Init(
char ch; char ch;
rtems_id id; rtems_id id;
rtems_status_code status; rtems_status_code status;
bool allDone;
/* Put start of test message */ /* Put start of test message */
puts( "\n\n*** spatomic03 TEST ***\n" ); puts( "\n\n*** spatomic03 TEST ***\n" );

View File

@@ -23,7 +23,6 @@ rtems_task Init(
char ch; char ch;
rtems_id id; rtems_id id;
rtems_status_code status; rtems_status_code status;
bool allDone;
/* Put start of test message */ /* Put start of test message */
puts( "\n\n*** spatomic04 TEST ***\n" ); puts( "\n\n*** spatomic04 TEST ***\n" );

View File

@@ -23,7 +23,6 @@ rtems_task Init(
char ch; char ch;
rtems_id id; rtems_id id;
rtems_status_code status; rtems_status_code status;
bool allDone;
/* Put start of test message */ /* Put start of test message */
puts( "\n\n*** spatomic05 TEST ***\n" ); puts( "\n\n*** spatomic05 TEST ***\n" );

View File

@@ -23,7 +23,6 @@ rtems_task Init(
char ch; char ch;
rtems_id id; rtems_id id;
rtems_status_code status; rtems_status_code status;
bool allDone;
/* Put start of test message */ /* Put start of test message */
puts( "\n\n*** spatomic06 TEST ***\n" ); puts( "\n\n*** spatomic06 TEST ***\n" );

View File

@@ -23,7 +23,6 @@ rtems_task Init(
char ch; char ch;
rtems_id id; rtems_id id;
rtems_status_code status; rtems_status_code status;
bool allDone;
/* Put start of test message */ /* Put start of test message */
puts( "\n\n*** spatomic07 TEST ***\n" ); puts( "\n\n*** spatomic07 TEST ***\n" );

View File

@@ -28,8 +28,6 @@
void boot_card( const char *cmdline ) void boot_card( const char *cmdline )
{ {
_Internal_error_Occurred( FATAL_SOURCE, FATAL_IS_INTERNAL, FATAL_ERROR ); _Internal_error_Occurred( FATAL_SOURCE, FATAL_IS_INTERNAL, FATAL_ERROR );
return 0;
} }
static void fatal_extension( static void fatal_extension(

View File

@@ -23,8 +23,8 @@
static void test_internal_error_description(void) static void test_internal_error_description(void)
{ {
rtems_fatal_code error = 0; rtems_fatal_code error = 0;
const char *desc_last = NULL; const char *desc = NULL;
const char *desc; const char *desc_last;
do { do {
desc_last = desc; desc_last = desc;
@@ -39,8 +39,8 @@ static void test_internal_error_description(void)
static void test_fatal_source_description(void) static void test_fatal_source_description(void)
{ {
rtems_fatal_source source = 0; rtems_fatal_source source = 0;
const char *desc_last = NULL; const char *desc = NULL;
const char *desc; const char *desc_last;
do { do {
desc_last = desc; desc_last = desc;