Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10782 Added Files: Tag: fUnit_Suite-branch testLoops testMisc testCase testTypeOf testLists testSys testTryElse testMath name testObjects testLocalDatabaseAccess testOp testLocals testThreads testString testExternalDatabaseAccess testMacFileHandling description testClock testNesting testXML testGarbageCollection testSizeOf Log Message: fUnit Suite initial import --- NEW FILE: testXML --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testLocals --- FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testLocals on testLocals () { local (a = 1, b = 2, c = 3); bundle { local (a = 4, b = 5, c = 6); assertEqual(a+b+c, 15, "a+b+c should equal 15. Instead it equals " + (a+b+c) + ".")}; assertEqual(a+b+c, 6, "a+b+c should equal 6. Instead it equals " + (a+b+c) + ".")} --- NEW FILE: testMath --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testClock --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testNesting --- FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testNesting on testNesting () { local (username = user.prefs.name); on xxx (name) { return (string.lower (name))}; if (xxx (username) != string.lower (username)) { scriptError ("Local handlers feature is broken.")}; bundle { on xxx (name) { return (string.upper (username))}; if (xxx (username) != string.upper (username)) { scriptError ("Local handlers feature is broken.")}}} --- NEW FILE: testSizeOf --- FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testSizeOf on testSizeOf () { local (e = "sizeof is broken."); assertEqual(sizeof('A'), 1, e); assertEqual(sizeof('XXXX'), 4, e); assertEqual(sizeof(true), 1, e); assertEqual(sizeof(number(1)), 4, e); assertEqual(sizeof("123456789"), 9, e); assertEqual(sizeof(clock.now()), 4, e); assertEqual(sizeof(up), 1, e); assertEqual(sizeof(@system.misc), 11, e); assertEqual(sizeof(point.set(12, 24)), 4, e); assertEqual(sizeof(single(1)), 4, e); assertEqual(sizeof(double(2)), 10, e); if (sys.os () == osMacOS) { assertEqual(sizeof(fixed), 4, e); assertEqual(sizeof(rectangle.set(12, 24, 36, 48)), 8, e)}} --- NEW FILE: testString --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testMacFileHandling --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testMisc --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testTryElse --- (This appears to be a binary file; contents omitted.) --- NEW FILE: description --- FrontierVcsFile:1:wptx:suites.fUnit.testSuperStress.description These test scripts are derived from the SuperStress test suites as referenced at http://kernel.scripting.com/discuss/msgReader$43?mode=day . Because I am a Windows developer, I was not able to convert and test the Apple aspects of the stress test suite. If you are a mac developer, please help me out by doing so and removing this message. As I convert them I am deleting them, so anything left in fUnit.testing is yet to be converted. The following changes to SuperStress, beyond the use of assert*, have been made: * testClock does not copy the code that checked root's children and asserted their creating and modification time were between 1990 and 2000. It is replaced by code that creates an object in the scratchpad, checks that the creation time is within a second of now, waits a second, modifies the value, and checks that the modification time has changed. (It keeps the check on Frontier.isRuntime because I don't know what that is.) * testMacOSXFileHandling has been converted, but since I can't run it the original has been left behind in case I made an error. I may have screwed up the initial test for OS, too. A couple of tests that look like they should run have been uncommented. "time consuming stuff every 4 calls or so" has been promoted to every call for obvious reasons. There is a test that looks broken in "bundle // test 5.0.1 verbs", checking for osMacOS to see if the line feed is \n; seems incomplete. * testLists has a Mac-specific chunk, though I don't see what is Mac specific about it and it passes on my Frontier so I've added an "|| 1" to the if clause. If no one tells me otherwise a later release will remove the if so the code always runs. * testMisc has a mac-only portion I didn't translate. --- NEW FILE: testOp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testObjects --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testSys --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testLocalDatabaseAccess --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testLists --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testExternalDatabaseAccess --- FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testExternalDatabaseAccess on testExternalDatabaseAccess () { local (f = file.getSpecialFolderPath ("", "desktop", false) + "testing.root"); local (x, n, s = "scratchpad"); if not file.exists (f) { db.new (f)}; db.open (f, false); if not db.defined (f, s) { db.newTable (f, s)}; n = db.countItems (f, s); if n == 0 { db.setValue (f, s + ".test", user.prefs)}; s = s + '.' + db.getNthItem (f, s, 1); x = db.getValue (f, s); db.setValue (f, "scratchpad.bTable", x); db.save (f); db.close (f); db.open (f, true); x = db.getValue (f, "scratchpad.bTable"); db.close (f); file.delete (f); assertEqual(string(x), string(user.prefs), "The db verbs are broken.")} --- NEW FILE: testLoops --- (This appears to be a binary file; contents omitted.) --- NEW FILE: testCase --- FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testCase on testCase () { local (i, ct); ct = 0; for i = 1 to 8 { case i { 1 { ct = ct + 1}; 2 { ct = ct + 10}; 3; 7 { ct = ct + 100}; 4; 8 { ct = ct + 1000}; 5 { ct = ct + 10000}} else { ct = ct + 100000}}; assertEqual(ct, 112211)} --- NEW FILE: testThreads --- (This appears to be a binary file; contents omitted.) --- NEW FILE: name --- FrontierVcsFile:1:TEXT:suites.fUnit.testSuperStress.name SuperStress --- NEW FILE: testTypeOf --- FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testTypeOf on testTypeOf () { on testIt (val, type) { assertEqual(typeOf(val), type, "typeOf (" + string (val) + ") should have been '" + type + "', but was '" + typeOf (val) + "\'.")}; testIt ('A', charType); testIt ('XXXX', string4Type); testIt (true, booleanType); testIt (number (1), longType); testIt ("123456789", stringType); testIt (clock.now (), dateType); testIt (up, directionType); testIt (@system.misc, addressType); testIt (point.set (12, 24), pointType); testIt (rectangle.set (12, 24, 36, 48), rectType); testIt (single (1), singleType); testIt (double (2), doubleType); if (sys.os() == osMacOS) { testIt (objectModel.high, enumeratorType); testIt (fixed (3), fixedType)}; testIt ({}, listType); testIt (record ({}), recordType); assertEqual(typeOf(system), tableType, "typeOf is broken")} --- NEW FILE: testGarbageCollection --- FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testGarbageCollection on testGarbageCollection () { // a loop that really stresses garbage collection local (i, s, t); for i = 1 to 10 { s = "a" + "a" + "a" + "a" + "a" + "a" + "a" + "a" + "a" + "a" + "a" + "a" + "a" + "a"; t = "z" + "z" + "z" + "z" + "z" + "z" + "z" + "z" + "z" + "z" + "z" + "z" + "z" + "z"; assertEqual(sizeof(s), sizeof(t), "Something is wrong with the tmpstack.")}} |