This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Fix FILEIO tests
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: Thu, 26 May 2005 08:21:41 -0600
- Subject: Fix FILEIO tests
- Organization: MLB Associates
A couple of the fileio tests had some additional config tests
added which did not work. Also, reduce the number of iterations
in the 'pselect' test so it can finish in a reasonable amount
of time.
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
Index: io/fileio/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/io/fileio/current/ChangeLog,v
retrieving revision 1.57
diff -u -5 -p -r1.57 ChangeLog
--- io/fileio/current/ChangeLog 27 Mar 2005 17:36:28 -0000 1.57
+++ io/fileio/current/ChangeLog 26 May 2005 14:19:00 -0000
@@ -1,5 +1,13 @@
+2005-05-26 Gary Thomas <gary@mlbassoc.com>
+
+ * tests/socket.c: Fix config test (CYGPKG_POSIX_SIGNALS)
+
+ * tests/pselect.c: Fix config test (CYGPKG_POSIX_SIGNALS is
+ only defined in <pkgconf/posix.h>) Also, reduce number of
+ iterations so test completes in a reasonable time (~30 seconds).
+
2005-03-27 Andrew Lunn <andrew.lunn@ascom.ch>
* tests/testfs.c: Fixed compiler warnigs for passing wrong types
to diag_printf.
* tests/fileio1.c: Ditto
Index: io/fileio/current/tests/pselect.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/io/fileio/current/tests/pselect.c,v
retrieving revision 1.3
diff -u -5 -p -r1.3 pselect.c
--- io/fileio/current/tests/pselect.c 13 Oct 2004 21:15:32 -0000 1.3
+++ io/fileio/current/tests/pselect.c 26 May 2005 14:16:50 -0000
@@ -54,16 +54,19 @@
//
//==========================================================================
#include <pkgconf/system.h>
#include <pkgconf/isoinfra.h>
+#ifdef CYGPKG_POSIX
+#include <pkgconf/posix.h>
+#endif
#ifndef CYGINT_ISO_PTHREAD_IMPL
# define NA_MSG "POSIX threads needed to run test"
-#elif !defined CYGPKG_NET
+#elif !defined(CYGPKG_NET)
# define NA_MSG "NET package needed to run test"
-#elif !defined CYGPKG_POSIX_SIGNALS
+#elif !defined(CYGPKG_POSIX_SIGNALS)
# define NA_MSG "POSIX signals package needed to run test"
#endif
#include <cyg/infra/testcase.h>
@@ -94,10 +97,12 @@
#include <sys/select.h>
#include <cyg/infra/diag.h> // HAL polled output
+#define NUM_TEST_SIGNALS 1500 // So test completes in ~30 seconds
+
//--------------------------------------------------------------------------
#define SHOW_RESULT( _fn, _res ) \
diag_printf("INFO: " #_fn "() returned %d %s\n", _res, _res<0?strerror(errno):"");
@@ -263,11 +268,11 @@ void *pthread_entry2( void *arg)
CYG_TEST_INFO( "Thread 2: sleeping" );
nanosleep( &zzz, NULL );
nanosleep( &zzz, NULL );
nanosleep( &zzz, NULL );
- while( sigusr1_sent < 20000 )
+ while( sigusr1_sent < NUM_TEST_SIGNALS )
{
nanosleep( &zzz, NULL );
err = pthread_kill( thread1, SIGUSR1 );
if( err < 0 ) SHOW_RESULT( pthread_kill, err );
Index: io/fileio/current/tests/socket.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/io/fileio/current/tests/socket.c,v
retrieving revision 1.5
diff -u -5 -p -r1.5 socket.c
--- io/fileio/current/tests/socket.c 17 Nov 2004 15:12:05 -0000 1.5
+++ io/fileio/current/tests/socket.c 26 May 2005 14:16:50 -0000
@@ -53,10 +53,13 @@
//
//==========================================================================
#include <pkgconf/system.h>
#include <pkgconf/isoinfra.h>
+#ifdef CYGPKG_POSIX
+#include <pkgconf/posix.h>
+#endif
#ifndef CYGINT_ISO_PTHREAD_IMPL
# define NA_MSG "POSIX threads needed to run test"
#elif !defined CYGPKG_NET
# define NA_MSG "NET package needed to run test"