gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FAIL: -isClass returns NO on an instance


From: Willem Rein Oudshoorn
Subject: FAIL: -isClass returns NO on an instance
Date: 01 Dec 2002 22:22:26 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

When I run the tests in the tests directory on recent base
I get 12 unexpected fails.

Both the base and the tests are from CVS Dec. 1.
Note that this is my first look again on GNUstep in 8 months,
so I can not tell if it is a recent problem or not.  

But I do not  think the problem is base at all, and actually 
I do not understand why it fails at all.  I expect that on 
everyones machine but mine the test passes.  But I appreciate
any help on tracking this done.  

So let me explain:

When I run 

./gtest-base --tool NSObject

I get the following output:
---------------------------------
FAIL: -isClass returns NO on an instance
FAIL: -isClass returns NO on an instance (special evil test for broken libobjc)

# of testcases attempted   37
# of expected passes       33
# of expected failures     2
# of unexpected failures   2

                === Summary of all tests ===

# of expected passes       33
# of expected failures     2
# of unexpected failures   2
--------------------------------

Now lets look at the first fail, it produced by the following test case:
--------------------------------
(greg-testcase 
 "-isClass returns NO on an instance" #t
 (lambda ()
   (and 
    (not (gstep-bool ([] ([] "NSObject" new) isClass)))
    (not (gstep-bool ([] ($$ "this is a string") isClass)))
    (not (gstep-bool ([] ([] "NSArray" new) isClass)))
    )))
-------------------------------

And actually the fail is produced by the last line (the test on NSArray)
This I checked by seperating these tests out. 
Next step was trying it in an interactive shell.  This yields the following 
transcript:
------------------------------
[ ~/src/version-controlled/tests ] guile-base
guile> (use-modules (languages gstep-guile))
guile> ([] ([] "NSArray" new) isClass)
0
guile> ([] ([] "NSArray" new) isClass)
1
guile> (let ((x ([] "NSArray" new))) ([] x isClass))
1
guile> (define y ([] "NSArray" new))
guile> ([] y isClass)
0
guile>
------------------------------
Hm, strange:

* The first time the ([] ...) is executed it yields 0, as expected
  I did this scenario three times and in two cases the first result is
  0 and in one case the result is 1.
* Afterwards it is consistently 1, which is wrong.
* However if you first define it and than evaluate the ([] .. isClass) later
  it is 0 again.

Note that if you do the same, but than in a non-interactive shell, by running
        guile-base -s test-script.scm
Where `test-script.scm' contains the following text:
------------------------------
(use-modules (languages gstep-guile))

(if (gstep-bool ([] ([] "NSArray" new) isClass))
 (display "Fail\n")
 (display "Succeed\n"))

(if (gstep-bool ([] ([] "NSArray" new) isClass))
 (display "Fail\n")
 (display "Succeed\n"))

(define test-array ([] "NSArray" array))

(if (gstep-bool ([] test-array isClass))
 (display "Fail\n")
 (display "Succeed\n"))
------------------------------

The result is
------------------------------
Fail
Fail
Fail
------------------------------

The strange thing here is that there is a difference between 
the interactive shell and the non-interactive shell.  
In the interactive shell the test succeeds when you 
do `(define x ...)' first and than do `([] x isClass)'.
In the non-interactive shell the test still fails.

Some final remarks:

* This behaviour does NOT occur with: NSSet, NSString, NSDictionary, NSObject 
* guile version 1.4

Thanks for reading so far.

Wim Oudshoorn.








reply via email to

[Prev in Thread] Current Thread [Next in Thread]