|
From: creedon <icr...@us...> - 2006-02-16 01:25:27
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/com/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4248 Added Files: compileError oneThread manyThreads oneThread2 runTimeError Log Message: builtins.com from the Windows Frontier.root --- NEW FILE: runTimeError --- FrontierVcsFile:1:scpt:system.verbs.builtins.com.tests.runTimeError local (scriptCode = "Sub Main\r\nDim s\r\nSet s = CreateObject (\"Foo.Bar\")\r\nEnd Sub"); com.callScript (scriptCode, "VBScript", "Main", {}) --- NEW FILE: compileError --- FrontierVcsFile:1:scpt:system.verbs.builtins.com.tests.compileError local (scriptCode = "Sub Main\r\nsdfj adh asdflh\r\nEnd Sub"); com.callScript (scriptCode, "VBScript", "Main", {}) --- NEW FILE: oneThread2 --- (This appears to be a binary file; contents omitted.) --- NEW FILE: oneThread --- FrontierVcsFile:1:scpt:system.verbs.builtins.com.tests.oneThread local (scriptCode = ""); on addLine (s) { scriptCode = scriptCode + s + "\r\n"}; addLine ("Function Main (x)"); addLine ("\tMain = x * 3"); addLine ("End Function"); local (num = random (1, 50)); local (expectedResult = num * 3); local (actualResult); actualResult = com.callScript (scriptCode, "VBScript", "Main", {num}); if actualResult != expectedResult { scriptError (actualResult + " != " + expectedResult)}; temp.testct++ --- NEW FILE: manyThreads --- FrontierVcsFile:1:scpt:system.verbs.builtins.com.tests.manyThreads local (origTicks = clock.ticks ()); local (ctThreads = 10); local (ctReps = 100); local (i, j); temp.testct = 0; //each thread will incremement this at the end -- it's a check for silent failures for i = 1 to ctReps { msg ("Test " + i + " of " + ctReps + ". Thread count: " + frontier.countThreads ()); for j = 1 to ctThreads { thread.evaluate ("com.tests.oneThread ()")}; sys.systemTask ()}; while (frontier.countThreads () > 2) { //wait until all spawned threads have stopped executing msg (frontier.countThreads ())}; if temp.testct != ctReps * ctThreads { //each thread increments temp.testct scriptError ("Not all the threads ran all the way!")}; msg (((clock.ticks () - origticks))) |