|
From: Andre R. <and...@us...> - 2006-02-18 09:27:27
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32012/testSuperStress Modified Files: Tag: fUnit_Suite-branch testClock Log Message: Fixed date coercion to make it independent of current system date format. Index: testClock =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/suites/fUnit/testSuperStress/Attic/testClock,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** testClock 22 Aug 2005 00:41:20 -0000 1.1.2.1 --- testClock 18 Feb 2006 09:27:22 -0000 1.1.2.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testClock ! on testClock () { date.get (clock.now (), @thisday, @thismonth, @thisyear, @thishour, @thisminute, @thissecond); Çbundle Çclock.set Çlocal (x = clock.now ()) Çlocal (y) Çlocal (testdate = date ("December 11, 1996; 4:05:06 AM")) Çclock.set (date.set (11, 12, 96, 4, 5, 6)) Çy = clock.now () Çif (y - testdate + 3) > 5 // a little slop for Windows Çclock.set (x) Çrestore! ÇscriptError ("clock.set is broken.") Çclock.set (x) Çrestore assertEqual(date.set (24, 12, 1991, 12, 4, 9), date ("December 24, 1991; 12:04:09 PM")); // type coercian if not Frontier.isRuntime () { // check that timeCreated and timeModified seem to work local (adr = @scratchpad.SuperStressClockTest, now = clock.now()); if (defined(adr^)) { delete(adr)}; new(tableType, adr); assert(timeCreated(adr) >= now && timeCreated(adr) <= now + 1, "timeCreated is not working"); clock.waitSeconds(1); adr^.change = 1; assert(timeModified(adr) >= now + 1 && timeModified(adr) <= now + 2, "timeModified is not working"); delete(adr)}; bundle { Çclock.waitSixtieths local (i); local (origtime = clock.now ()); for i = 1 to 10 { clock.waitSixtieths (6)}; assert(abs(clock.now() - origtime) <= 2, "clock.waitsixtieths is broken")}} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:suites.fUnit.testSuperStress.testClock ! on testClock () { Çbundle //2006-02-18 aradke: can't run clock.set without admin rights anymore Çlocal (x = clock.now ()) Çlocal (y) Çlocal (testdate = date ("December 11, 1996; 4:05:06 AM")) Çclock.set (date.set (11, 12, 96, 4, 5, 6)) Çy = clock.now () Çif (y - testdate + 3) > 5 // a little slop for Windows Çclock.set (x) Çrestore! ÇscriptError ("clock.set is broken.") Çclock.set (x) Çrestore bundle { //2006-02-18 aradke: date.get, date.set local (now = clock.now ()); local (day, month, year, hour, minute, second); date.get (now, @day, @month, @year, @hour, @minute, @second); assertEqual (date.set (day, month, year, hour, minute, second), now, "date.get or date.set is broken")}; assertEqual(date.set (18, 2, 2006, 9, 22, 43) + date.getCurrentTimeZone (), date ("Sat, 18 Feb 2006 09:22:43 GMT")); if not Frontier.isRuntime () { // check that timeCreated and timeModified seem to work local (adr = @scratchpad.SuperStressClockTest, now = clock.now()); if (defined(adr^)) { delete(adr)}; new(tableType, adr); assert(timeCreated(adr) >= now && timeCreated(adr) <= now + 1, "timeCreated is not working"); clock.waitSeconds(1); adr^.change = 1; assert(timeModified(adr) >= now + 1 && timeModified(adr) <= now + 2, "timeModified is not working"); delete(adr)}; bundle { Çclock.waitSixtieths local (i); local (origtime = clock.now ()); for i = 1 to 10 { clock.waitSixtieths (6)}; assert(abs(clock.now() - origtime) <= 2, "clock.waitsixtieths is broken")}}; bundle { //debug code fUnit.runners.run (parentOf(this^), testCaseToRun: this)} \ No newline at end of file |