This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libc-time-clock test doesn't seem to be written correctly??


Brij Bihari Pandey wrote:
Hi Jonathan,

[snip]

40%, because err(100*(3-2)/2) > TOLERANCE(40).

[snip]
I suppose it's possible with small values, although I've never seen a port do this in practice - the processor would have to be slow and the clock rate fast.

Sure. Had there been some port like that in practice, someone should have surely mentioned that on the list. I pointed out issues with test so that newbies on hardwares don't break their heads looking for problems, perturbed by test FAIL messages. Possibly I would have - how could there be problem with the test, wouldn't anyone on list have mentioned it earlier, if it was so?

Not necessarily I suppose. But there would probably have been something in the wide variety of hardware that used to exist in the Red Hat test farm.


I would accept a patch on those lines; or more precisely, something that checks for the %tolerance, and then checks if the difference is greater than an absolute amount. A fudge factor really :-). That will allow minor anomalies to pass, as well as small values.

Send me a patch like that and I'll review it.

Will do as you ask for. It looks like maximum 2-3 lines of code insertion. Plain diff of patched code vs original code will do?

cvs diff -u5 -p is preferred. Mail it to ecos-patches@sources.redhat.com


If the underlying clock is correctly periodic, the return value of clock() should change similarly periodically. And counting how long it takes to do this in a for loop in a consistent way should therefore result in similar numbers.

Do you mean to say that the time taken between 1st iteration of for-loop in two consecutive calls of clock_loop in the test will be same or is it something different that I am not getting here? First one is obvious enough, always supposed to happen.

The for loop counts how long it takes for the return value of clock() to change, that's all. Since the code is looped over in a consistent way, how far the for loop counts should be roughly the same if you run it again and again.


Jifl
--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine


-- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]