From dd943da4134bcfe7f50b6923842fe96094170169 Mon Sep 17 00:00:00 2001 From: brunsch Date: Thu, 19 Oct 2000 20:25:08 +0000 Subject: ChangeLogTag:Thu Oct 19 13:17:41 2000 Darrell Brunsch --- tests/ACE_Init_Test.cpp | 9 +++++++-- tests/Reactors_Test.cpp | 6 ++---- tests/SOCK_Send_Recv_Test.cpp | 2 +- tests/run_test.pl | 39 ++++++++++++++------------------------- tests/test_config.h | 17 ++++++++++------- 5 files changed, 34 insertions(+), 39 deletions(-) (limited to 'tests') diff --git a/tests/ACE_Init_Test.cpp b/tests/ACE_Init_Test.cpp index 77a041fd58e..5284915e7f3 100644 --- a/tests/ACE_Init_Test.cpp +++ b/tests/ACE_Init_Test.cpp @@ -14,10 +14,12 @@ // // ACE_Init_Test.cpp : Defines the class behaviors for the application. -#include "ace/Thread_Manager.h" #include "ACE_Init_Test_StdAfx.h" #include "ACE_Init_Test.h" #include "ACE_Init_TestDlg.h" +#include "test_config.h" +#include "ace/Thread_Manager.h" + #ifdef _DEBUG #define new DEBUG_NEW @@ -57,12 +59,13 @@ CACE_Init_TestApp theApp; BOOL CACE_Init_TestApp::InitInstance() { - // This is needed because there's no overridden main(int, char *[]) // which would normally handle the initialization. Also see the // corresponding ACE::fini, below. ACE::init(); + ACE_START_TEST (ACE_TEXT ("ACE_Init_Test")); + CACE_Init_TestDlg dlg; m_pMainWnd = &dlg; ACE_Thread_Manager::instance()->spawn (wait_and_kill_dialog, @@ -81,6 +84,8 @@ BOOL CACE_Init_TestApp::InitInstance() ACE_Thread_Manager::instance()->wait(); + ACE_END_TEST; + // Since the dialog has been closed, return FALSE so that we exit the // application, rather than start the application's message pump. ACE::fini(); diff --git a/tests/Reactors_Test.cpp b/tests/Reactors_Test.cpp index b71fc2fc0f3..1bac9ecc835 100644 --- a/tests/Reactors_Test.cpp +++ b/tests/Reactors_Test.cpp @@ -189,10 +189,8 @@ worker (void *args) 0); /* NOTREACHED */ case 0: - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%t) Reactor shutdown\n")), - 0); - /* NOTREACHED */ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) Reactor shutdown\n"))); + return 0; } ACE_NOTREACHED (return 0); diff --git a/tests/SOCK_Send_Recv_Test.cpp b/tests/SOCK_Send_Recv_Test.cpp index 46b5a7ffa20..2a44acf30dd 100644 --- a/tests/SOCK_Send_Recv_Test.cpp +++ b/tests/SOCK_Send_Recv_Test.cpp @@ -168,7 +168,7 @@ client (void *arg) { errno = 0; sent = cli_stream.send_n (buff, sizeof (buff)); - if (errno != 0 || sent != sizeof (buff)) + if (sent != sizeof (buff) && errno != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) Test 3, pass %d, sent %d, %p\n"), diff --git a/tests/run_test.pl b/tests/run_test.pl index 795fe522d7e..c645cedf9fa 100755 --- a/tests/run_test.pl +++ b/tests/run_test.pl @@ -1,3 +1,4 @@ + eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' & eval 'exec perl -S $0 $argv:q' if 0; @@ -5,6 +6,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- # This file is for running the tests in the ACE tests directory. +# It is usually used for auto_compiles. unshift @INC, '../bin'; require ACEutils; @@ -40,13 +42,14 @@ else { print "Defaulting to configuration: $config\n"; } -if (!($ACE_ROOT = $ENV{ACE_ROOT})) { - my $cd = getcwd (); - chdir ('..'); - $ACE_ROOT = getcwd ().$DIR_SEPARATOR; - chdir ($cd); - warn "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT"; -} +### Doesn't look like we need $ACE_ROOT now +#if (!($ACE_ROOT = $ENV{ACE_ROOT})) { +# my $cd = getcwd (); +# chdir ('..'); +# $ACE_ROOT = getcwd ().$DIR_SEPARATOR; +# chdir ($cd); +# warn "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT"; +#} if (!($tmp = $ENV{TMP})) { $tmp="/tmp"; @@ -120,12 +123,11 @@ sub check_log ($) if (! -e $log ) { print STDERR "Error: No log file ($log) is present\n"; } else { - if (open (LOG, "<". $log) == 0) { + if (open (LOG, "<".$log) == 0) { print STDERR "Error: Cannot open log file $log\n"; } else { my $starting_matched = 0; my $ending_matched = 0; - my $bad_matched = 0; while () { chomp; @@ -137,19 +139,10 @@ sub check_log ($) if (m/Ending/) { $ending_matched = 1; } - - if (m/assertion failed|timeout|Bad file number/) { - $bad_matched = 1; - } - - if ($log =~ /Cached_Accept_Conn_Test/ - && m/No such file or directory/) { - $bad_matched = 1; - } - if (m/not supported/) { - print STDERR "Error: ($log): $_\n"; - } + if (/LM\_ERROR\@(.*)$/) { + print STDERR "Error: ($log): $1\n"; + } } close (LOG); # ignore errors @@ -162,10 +155,6 @@ sub check_log ($) print STDERR "Error ($log): no line with 'Ending'\n"; } - if ($bad_matched == 1) { - print STDERR "Error ($log): unexpected output\n"; - } - } } } diff --git a/tests/test_config.h b/tests/test_config.h index 2a0f14f82e0..564b3d2e23d 100644 --- a/tests/test_config.h +++ b/tests/test_config.h @@ -43,6 +43,9 @@ // The second #undef protects against being reset in a config.h file. #undef ACE_NDEBUG +#undef ACE_TEXT +#define ACE_TEXT ACE_LIB_TEXT + #if defined (ACE_HAS_WINCE) # define ACE_LOG_DIRECTORY ACE_TEXT ("log\\") # define MAKE_PIPE_NAME(X) ACE_TEXT ("\\\\.\\pipe\\"#X) @@ -75,7 +78,7 @@ const size_t ACE_MAX_ITERATIONS = 10; const size_t ACE_MAX_PROCESSES = 10; const size_t ACE_MAX_THREADS = 4; -char ACE_ALPHABET[] = "abcdefghijklmnopqrstuvwxyz"; +static const char ACE_ALPHABET[] = "abcdefghijklmnopqrstuvwxyz"; #define ACE_START_TEST(NAME) \ const ACE_TCHAR *program = NAME; \ @@ -165,7 +168,7 @@ private: typedef ACE_Singleton ace_file_stream; -ACE_Test_Output::ACE_Test_Output (void) +inline ACE_Test_Output::ACE_Test_Output (void) : output_file_ (0) { #if !defined (ACE_LACKS_IOSTREAM_TOTALLY) @@ -173,7 +176,7 @@ ACE_Test_Output::ACE_Test_Output (void) #endif /* ACE_LACKS_IOSTREAM_TOTALLY */ } -ACE_Test_Output::~ACE_Test_Output (void) +inline ACE_Test_Output::~ACE_Test_Output (void) { #if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_PSOS) ACE_LOG_MSG->msg_ostream (&cerr); @@ -187,7 +190,7 @@ ACE_Test_Output::~ACE_Test_Output (void) #endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ } -int +inline int ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append) { #if defined (ACE_HAS_PHARLAP) @@ -257,13 +260,13 @@ ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append) return 0; } -OFSTREAM * +inline OFSTREAM * ACE_Test_Output::output_file (void) { return this->output_file_; } -void +inline void ACE_Test_Output::close (void) { #if !defined (ACE_LACKS_IOSTREAM_TOTALLY) @@ -275,7 +278,7 @@ ACE_Test_Output::close (void) #endif /* !ACE_LACKS_IOSTREAM_TOTALLY */ } -void +inline void randomize (int array[], size_t size) { size_t i; -- cgit v1.2.1