From: Wolfgang T. <wth...@us...> - 2005-07-27 02:36:19
|
Update of /cvsroot/hoc/hoc/Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14092/Tests Modified Files: TestFoundation.hs Log Message: Make struct return values work. Index: TestFoundation.hs =================================================================== RCS file: /cvsroot/hoc/hoc/Tests/TestFoundation.hs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TestFoundation.hs 25 Jul 2005 03:59:26 -0000 1.4 +++ TestFoundation.hs 27 Jul 2005 02:36:09 -0000 1.5 @@ -155,11 +155,28 @@ result @?= expected ) ], - "Description" ~: (assertNoLeaks $ do + "Super" ~: (assertNoLeaks $ do hobj <- _HaskellObjectWithDescription # alloc >>= init str <- hobj # description fromNSString str @?= "<HaskellObjectWithDescription: TEST>" - ) + ), + "structs" ~: test [ + "point" ~: (do + let point = NSPoint 6.42 7.42 + result <- _NSValue # valueWithPoint point >>= pointValue + result @?= point + ), + "size" ~: (do + let size = NSSize 6.42 7.42 + result <- _NSValue # valueWithSize size >>= sizeValue + result @?= size + ), + "rect" ~: (do + let rect = NSRect (NSPoint 1 2) (NSSize 3 4) + result <- _NSValue # valueWithRect rect >>= rectValue + result @?= rect + ) + ] ] go = withAutoreleasePool $ runTestTT tests |