ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Utilities/TestClass.pm
(Generate patch)

Comparing COMP/SCRAM/src/Utilities/TestClass.pm (file contents):
Revision 1.11 by williamc, Mon Sep 11 11:31:49 2000 UTC vs.
Revision 1.13 by williamc, Fri Sep 29 06:42:03 2000 UTC

# Line 12 | Line 12
12   # verifydir(dir) : Check existence of the directory
13   # verifyexists(file) : Verify the existence of file
14   # datadir([dir]) : return the current data directory (set it to dir if supplied)
15 < # testswitch(bool,"true text","falsetext") : testpass or fail according to bool
15 > # testswitch(int,"0 text"," non 0 text") : testpass or fail according to bool
16   # testfail(string) : report that current test has failed
17   # testpass(string) : report that current test has passed
18   # newfilename() : return a new filename that can be opened etc.
# Line 106 | Line 106 | sub cmpstring {
106          my $s2=shift;
107  
108          if ( ! defined $s2) {
109 <          $self->testfail("Return string is undefined expecting $s1"),
109 >          if ( ( ! defined $s1 ) || ( $s1==undef )) {
110 >            $self->testpass("Got undefined as expected");
111 >          }
112 >          else {
113 >            $self->testfail("Return string is undefined expecting $s1"),
114 >          }
115          }
116          elsif ( $s1 ne $s2 ) {
117            $self->testfail("Expecting $s1 got $s2");
# Line 193 | Line 198 | sub testswitch {
198          my $string1=shift;
199          my $string2=shift;
200  
201 <        if ( $bool ) {
201 >        if ( ! $bool ) {
202             $self->testpass($string1);
203          }
204          else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines