|
From: <jgr...@us...> - 2003-09-29 22:55:54
|
Update of /cvsroot/popfile/engine/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv6544/tests
Modified Files:
TestPOP3.tst
Log Message:
POP3 test suite updated to take into account the new way forking is handled
Index: TestPOP3.tst
===================================================================
RCS file: /cvsroot/popfile/engine/tests/TestPOP3.tst,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** TestPOP3.tst 15 Sep 2003 14:55:37 -0000 1.14
--- TestPOP3.tst 29 Sep 2003 22:55:48 -0000 1.15
***************
*** 35,62 ****
my $eol = "\015\012";
- sub forker
- {
- pipe my $reader, my $writer;
- my $pid = fork();
-
- if ( !defined( $pid ) ) {
- close $reader;
- close $writer;
- return (undef, undef);
- }
-
- if ( $pid == 0 ) {
- close $reader;
-
- use IO::Handle;
- $writer->autoflush(1);
-
- return (0, $writer);
- }
-
- close $writer;
- return ($pid, $reader);
- }
-
sub pipeready
{
--- 35,38 ----
***************
*** 266,269 ****
--- 242,272 ----
my $b = new Classifier::Bayes;
+ sub forker
+ {
+ pipe my $reader, my $writer;
+ $b->prefork();
+ my $pid = fork();
+
+ if ( !defined( $pid ) ) {
+ close $reader;
+ close $writer;
+ return (undef, undef);
+ }
+
+ if ( $pid == 0 ) {
+ $b->forked();
+ close $reader;
+
+ use IO::Handle;
+ $writer->autoflush(1);
+
+ return (0, $writer);
+ }
+
+ $b->postfork();
+ close $writer;
+ return ($pid, $reader);
+ }
+
$c->configuration( $c );
$c->mq( $mq );
***************
*** 288,291 ****
--- 291,295 ----
$b->initialize();
$b->module_config_( 'html', 'port', 8080 );
+ $b->module_config_( 'html', 'language', 'English' );
$b->config_( 'hostname', '127.0.0.1' );
$b->start();
***************
*** 372,375 ****
--- 376,380 ----
$p->initialize();
$p->config_( 'port', $port );
+ $p->config_( 'force_fork', 1 );
$p->global_config_( 'timeout', 1 );
$p->start();
|