|
From: Andre R. <and...@us...> - 2006-02-18 11:27:32
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20040/testSuperStress Modified Files: Tag: fUnit_Suite-branch testMisc Log Message: Cleaned up testMisc and moved required infrastructure into the testSuperStress.data sub-table. Index: testMisc =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress/Attic/testMisc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** testMisc 22 Aug 2005 00:41:19 -0000 1.1.2.1 --- testMisc 18 Feb 2006 11:27:24 -0000 1.1.2.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testMisc ! on testMisc () { Çmiscellaneous random stuff bundle { Çbinary values as arrays x = binary (0xaabbccdd); assert(x[1] == 0xaa and x[4] == 0xdd, "binary array indexing is broken"); on checkRange() { x[5]}; assertErrors(@checkRange, "out of range"); delete (@x [1]); delete (@x [1]); setBinaryType (@x, shortType); assertEqual(number(x), 0xccdd, "delete of binary array item is broken"); x [2] = 3; assertEqual(short(x), short(0xcc03), "binary array assignment is broken")}; bundle { Çscript.getCode on foo (x) { return (x)}; local (miscUserTalk); script.getCode (@testing.miscUserTalk, @miscUserTalk); assertEqual(miscUserTalk(2, 3, 4), 14, "script.getCode is broken")}; bundle { Çtry out nested bundles bundle { Çcheck rects local (x, t, l, b, r); x = rectangle.set (10, 20, 30, 40); rectangle.get (x, @t, @l, @b, @r); assert(t == 10 and l == 20 and b == 30 and r == 40, "Problems with rects. " + x)}; bundle { Çmess with keyboard local (s); s = ""; if kb.optionKey () { s = s + "opt "}; if kb.cmdKey () { s = s + "cmd "}; if kb.shiftKey () { s = s + "shift "}; if kb.controlKey () { s = s + "ctrl "}; };// no asserts in original superstress - Monday, October 04, 2004 at 6:45:46 PM by JPB bundle { Çcheck addresses local (adr); adr = address ("root.system"); assert(sizeOf(adr^) > 0, "Something's wrong with addresses.")}; bundle { Çcheck targeting if not Frontier.isRuntime () { if defined (root.examples.list2) { target.set (@root.examples.list2); op.firstSummit (); assertEqual(op.getLineText(), "Nebraska", "Something's wrong with targeting."); assertEqual(target.get(), @root.examples.list2, "Something's wrong with targeting."); target.clear (); assertNotEqual(target.get(), @root.examples.list2, "Something's wrong with targeting.")}; }};ÇmyMoof (5, 1) // don't know what this is - Monday, October 04, 2004 at 6:47:02 PM by JPB bundle { Çtable surgery local (adr); adr = @scratchpad.tableTesting; assert(new(tableType, adr)); assert(defined(adr^), "new verb didn't create anything"); assertEqual(typeOf(adr^), tableType, "new didn't create a table."); delete (adr); assert(!defined(adr^), "delete didn't delete " + adr)}; bundle { Çcheck typeOf assertEqual(typeOf(root), tableType, "typeOf has a problem"); assertEqual(typeOf(user.prefs["name"]), stringType, "typeOf has a problem."); assertEqual(typeOf(examples.yesterday), dateType, "typeOf has a problem")}; bundle { Çcheck evaluate assertEqual(evaluate("12 + 24 + abs (-12)"), 48, "evaluate has a problem")}}; bundle { Çcheck addressing modes & case insenstivity assertEqual(@user.prefs ["name"], @User.prefs.Name, "array operations are broken"); assertEqual((@uSEr.prefs.NamE)^, user.Prefs.name, "dereferencing is broken"); assertEqual((@user)^.Prefs ["name"], uSEr.pRefs.NamE, "dereferencing or array is broken"); assertEqual(user.prefs.["name"], user.prefs.NAME, "bracketed expressions are broken")}; bundle { Çcheck with statement table.surePath ("temp.foo.test.xyzzy"); temp.foo.test.xyzzy = 5; with temp { with foo { with test { assertEqual(xyzzy, 5, "with statement is broken")}}}; with temp, foo, test { delete (@xyzzy)}; delete (@temp.foo)}; states.looper (); assertEqual(states.nthState(45), "Vermont", "states.nthState is broken."); Çif (sys.os() == osMacOS) Çbundle Çtest extensions, sys.memAvail Çlocal (x, y) Çx = number (callXCMD (@testing.miscXCMD)) Çy = sys.memAvail () Çx = number (callXCMD (@testing.miscXCMD)) Çy = sys.memAvail () Çif x != y ÇscriptError ("callXCMD or sys.memAvail is broken.") bundle { Çtest semophores local (locked); semaphores.lock ("testing", 0); try { semaphores.lock ("testing", 6); locked = false} else { locked = true}; assert(locked, "semaphores.lock is broken"); assert(semaphores.unlock("testing"), "semaphores.unlock is broken")}} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testMisc ! on testMisc () { Çmiscellaneous random stuff local (adrdata = @parentOf (this^)^.data); bundle { Çbinary values as arrays x = binary (0xaabbccdd); assert(x[1] == 0xaa and x[4] == 0xdd, "binary array indexing is broken"); on checkRange() { x[5]}; assertErrors(@checkRange, "out of range"); delete (@x [1]); delete (@x [1]); setBinaryType (@x, shortType); assertEqual(number(x), 0xccdd, "delete of binary array item is broken"); x [2] = 3; assertEqual(short(x), short(0xcc03), "binary array assignment is broken")}; bundle { Çscript.getCode on foo (x) { return (x)}; local (miscUserTalk); script.getCode (@adrdata^.miscUserTalk, @miscUserTalk); assertEqual(miscUserTalk(2, 3, 4), 14, "script.getCode is broken")}; bundle { Çtry out nested bundles bundle { Çcheck rects local (x, t, l, b, r); x = rectangle.set (10, 20, 30, 40); rectangle.get (x, @t, @l, @b, @r); assert(t == 10 and l == 20 and b == 30 and r == 40, "Problems with rects. " + x)}; bundle { Çmess with keyboard local (s); s = ""; if kb.optionKey () { s = s + "opt "}; if kb.cmdKey () { s = s + "cmd "}; if kb.shiftKey () { s = s + "shift "}; if kb.controlKey () { s = s + "ctrl "}; };// no asserts in original superstress - Monday, October 04, 2004 at 6:45:46 PM by JPB bundle { Çcheck addresses local (adr); adr = address ("root.system"); assert(sizeOf(adr^) > 0, "Something's wrong with addresses.")}; bundle { Çcheck targeting if not Frontier.isRuntime () { if defined (root.examples.list2) { target.set (@root.examples.list2); op.firstSummit (); assertEqual(op.getLineText(), "Nebraska", "Something's wrong with targeting."); assertEqual(target.get(), @root.examples.list2, "Something's wrong with targeting."); target.clear (); assertNotEqual(target.get(), @root.examples.list2, "Something's wrong with targeting.")}}}; ÇmyMoof (5, 1) // don't know what this is - Monday, October 04, 2004 at 6:47:02 PM by JPB bundle { Çtable surgery local (adr); adr = @scratchpad.tableTesting; assert(new(tableType, adr)); assert(defined(adr^), "new verb didn't create anything"); assertEqual(typeOf(adr^), tableType, "new didn't create a table."); delete (adr); assert(!defined(adr^), "delete didn't delete " + adr)}; bundle { Çcheck typeOf assertEqual(typeOf(root), tableType, "typeOf has a problem"); assertEqual(typeOf(user.prefs["name"]), stringType, "typeOf has a problem."); assertEqual(typeOf(examples.yesterday), dateType, "typeOf has a problem")}; bundle { Çcheck evaluate assertEqual(evaluate("12 + 24 + abs (-12)"), 48, "evaluate has a problem")}}; bundle { Çcheck addressing modes & case insenstivity assertEqual(@user.prefs ["name"], @User.prefs.Name, "array operations are broken"); assertEqual((@uSEr.prefs.NamE)^, user.Prefs.name, "dereferencing is broken"); assertEqual((@user)^.Prefs ["name"], uSEr.pRefs.NamE, "dereferencing or array is broken"); assertEqual(user.prefs.["name"], user.prefs.NAME, "bracketed expressions are broken")}; bundle { Çcheck with statement table.surePath ("temp.foo.test.xyzzy"); temp.foo.test.xyzzy = 5; with temp { with foo { with test { assertEqual(xyzzy, 5, "with statement is broken")}}}; with temp, foo, test { delete (@xyzzy)}; delete (@temp.foo)}; states.looper (); assertEqual(states.nthState(45), "Vermont", "states.nthState is broken."); if system.environment.isMacOsClassic { local (x, y); x = number (callXCMD (@adrdata^.miscXCMD)); y = sys.memAvail (); if x != y { scriptError ("callXCMD or sys.memAvail is broken.")}}; bundle { Çtest semophores local (locked); semaphores.lock ("testing", 0); try { semaphores.lock ("testing", 6); locked = false} else { locked = true}; assert(locked, "semaphores.lock is broken"); assert(semaphores.unlock("testing"), "semaphores.unlock is broken")}}; bundle { //debug code fUnit.runners.run (parentOf(this^), testCaseToRun: this)} \ No newline at end of file |