[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RFA/PATCH gtest - NSNumber float != double
From: |
David Ayers |
Subject: |
RFA/PATCH gtest - NSNumber float != double |
Date: |
Tue, 21 Jan 2003 22:17:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 |
Hello everyone,
I'm working on a set of GDL2 guile tests and ran into a base issue.
+numberWithFloat: 25.1 and +numberWithDouble: 25.1 are not equal. I've
attached an patch for gtest on this issue which also updates some other
changes in the general configuration.
I hope someone can find time to look into this, as I'm pretty bogged
down with setting up some GDL2 test cases right now.
Cheers,
Dave
? dev-apps/test/gtests/Archiver.dat
? dev-apps/test/gtests/gdl2
? dev-apps/test/gtests/Resources/IvarProxy.bundle
? dev-apps/test/gtests/Resources/NSBundleTest.bundle
Index: dev-apps/test/gtests/Basic.scm
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-apps/test/gtests/Basic.scm,v
retrieving revision 1.2
diff -u -r1.2 Basic.scm
--- dev-apps/test/gtests/Basic.scm 20 Nov 2002 16:55:55 -0000 1.2
+++ dev-apps/test/gtests/Basic.scm 21 Jan 2003 22:10:34 -0000
@@ -21,15 +21,15 @@
; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;
-; Define a convenience procedure to check for methods raising
-; expected exceptions.
+; Define a convenience procedure to check for methods raising
+; expected exceptions.
;
-; This procedure must be invoked with three arguments -
-; A string describing the operation being performed
-; eg. "Attempting to access boyond the end of a string"
-; The Gstep-Guile variable representing the exception
-; eg. NSRangeException
-; The 'thunk' (code) to actually perform the test.
+; This procedure must be invoked with three arguments -
+; A string describing the operation being performed
+; eg. "Attempting to access beyond the end of a string"
+; The Gstep-Guile variable representing the exception
+; eg. NSRangeException
+; The 'thunk' (code) to actually perform the test.
;
(define (test-exception assertion except thunk)
(define exception-name ([] except cString))
@@ -50,9 +50,9 @@
)
;
-; Define a procedure to test basic object allocation and initialisation
-; operations that should be common to pretty much all classes.
-; Return #t only if all tests pass, otherwise return #f
+; Define a procedure to test basic object allocation and initialisation
+; operations that should be common to pretty much all classes.
+; Return #t only if all tests pass, otherwise return #f
;
(define (test-alloc classname)
@@ -125,16 +125,16 @@
)
-;;
-;; Load a bundle with our required classes. Check if it's already been
-;; loaded from a previous test.
-;;
-;; class-in-bundle is a class that is in the bundle
-;; bundle-location is a path relative to the currentDirectoryPath or
-;; an absolute path.
+;
+; Load a bundle with our required classes. Check if it's already been
+; loaded from a previous test.
+;
+; class-in-bundle is a class that is in the bundle
+; bundle-location is a path relative to the currentDirectoryPath or
+; an absolute path.
-;; Example: (test-load-bundle "NicolaTest" "Resources" "BaseLibrary")
-;;
+; Example: (test-load-bundle "NicolaTest" "Resources" "BaseLibrary")
+;
(define (test-load-bundle class-in-bundle bundle-location bundle-name)
(define bnd gstep-nil)
(define theClass gstep-nil)
Index: dev-apps/test/gtests/ChangeLog
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-apps/test/gtests/ChangeLog,v
retrieving revision 1.82
diff -u -r1.82 ChangeLog
--- dev-apps/test/gtests/ChangeLog 4 Dec 2002 15:54:14 -0000 1.82
+++ dev-apps/test/gtests/ChangeLog 21 Jan 2003 22:10:34 -0000
@@ -1,3 +1,9 @@
+2003-01-21 David Ayers <d.ayers@inode.at>
+ * Basic.scm: Reformatted comments to improve readability.
+ * NSNumber/test00.scm: Added test to compare float and doubles.
+ * gui/gtest-gui.in: Changed GNUSTEP_PATHPREFIX_LIST to
+ GNUSTEP_PATHLIST and changed Apps to Applications.
+
2002-12-04 Richard Frith-Macdonald <richard@brainstorm.co.uk>
* NSDictionary/general.scm: serialization/deserialization test
Index: dev-apps/test/gtests/NSNumber/test00.scm
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-apps/test/gtests/NSNumber/test00.scm,v
retrieving revision 1.2
diff -u -r1.2 test00.scm
--- dev-apps/test/gtests/NSNumber/test00.scm 11 May 2000 04:08:16 -0000
1.2
+++ dev-apps/test/gtests/NSNumber/test00.scm 21 Jan 2003 22:10:34 -0000
@@ -125,6 +125,14 @@
(gstep-bool ([] val1 isEqual: val2))
)
)
+ (greg-testcase "A 25.1 float is a 25.1 double" #t
+ (lambda ()
+ (set! val1 ([] "NSNumber" numberWithFloat: 25.1))
+ (set! val2 ([] "NSNumber" numberWithDouble: 25.1))
+ (greg-dlog val1 val2)
+ (gstep-bool ([] val1 isEqual: val2))
+ )
+ )
(set! val1 ([] "NSNumber" numberWithInt: 127))
(set! val2 ([] "NSNumber" numberWithInt: 128))
Index: dev-apps/test/gtests/gui/gtest-gui.in
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-apps/test/gtests/gui/gtest-gui.in,v
retrieving revision 1.3
diff -u -r1.3 gtest-gui.in
--- dev-apps/test/gtests/gui/gtest-gui.in 17 Oct 2001 22:35:53 -0000
1.3
+++ dev-apps/test/gtests/gui/gtest-gui.in 21 Jan 2003 22:10:34 -0000
@@ -29,14 +29,14 @@
###
gtest_gui_app_extension=""
-gtest_gui_search_path=.:$GNUSTEP_PATHPREFIX_LIST
+gtest_gui_search_path=.:$GNUSTEP_PATHLIST
IFS=:
#
# Determine if guile-gui.app is installed,
# set extension to app if that is the case
#
for dir in $gtest_gui_search_path; do
- if [ -d $dir/Apps/guile-gui.app -o -d $dir/guile-gui.app ]; then
+ if [ -d $dir/Applications/guile-gui.app -o -d $dir/guile-gui.app ]; then
gtest_gui_extension=app;
echo "Using gtest-gui.app ...";
break;
@@ -48,7 +48,7 @@
#
if [ -z "$gtest_gui_extension" ]; then
for dir in $gtest_gui_search_path; do
- if [ -d $dir/Apps/guile-gui.debug -o -d $dir/guile-gui.debug ]; then
+ if [ -d $dir/Applications/guile-gui.debug -o -d $dir/guile-gui.debug ]; then
gtest_gui_extension=debug;
echo "Using gtest-gui.debug ...";
break;