----- "Caspar Zhang" <[email protected]> wrote:

> Hi all,
> 
>    In my recent tests, not all desired time is equal to exact
> execution time,
>    sometimes it is +/-1s, and in a few times it becomes +/-2s. In most
> cases,
>    +/-2s is still a valid value between exact execute time and desired
> time.
> 
>    Signed-off-by: Caspar Zhang <[email protected]>
> 
> --- a/testcases/kernel/syscalls/pselect/pselect01.c     2010-04-01
> 14:23:10.000000000 +0800
> +++ b/testcases/kernel/syscalls/pselect/pselect01.c     2010-07-15
> 16:03:40.969426078 +0800
> @@ -109,7 +109,8 @@
>                             NULL);
>                 end = time(&t);
> 
> -               if (((end - start) == total_sec) || ((end - start) ==
> total_sec + 1))
> +               /* Is it still valid in range -2~2s? */
> +               if ((end - start - total_sec <= 2) && (end - start -
> total_sec >= -2))

Sorry for mistake, since end, start are unsigned int, use 
end-start-total_sec >= -2 will cause error, add (int)before 
(end-start) instead. New patch attached.

Thanks,
Caspar


-- 
Kernel Associate Quality Engineer
Red Hat Inc. (Beijing R&D Branch)

Red Hat China R&D Branch Unit 907, North Tower C, 
  Raycom Infotech Park, No.2 Kexueyuan Nanlu, 
  Haidian District, Beijing 100190

TEL: +86-10-62608150
Web: http://www.redhat.com/
Hi all,
   
   In my recent tests, not all desired time is equal to exact execution time, 
   sometimes it is +/-1s, and in a few times it becomes +/-2s. In most cases,
   +/-2s is still a valid value between exact execute time and desired time.
   
   Signed-off-by: Caspar Zhang <[email protected]>

--- a/testcases/kernel/syscalls/pselect/pselect01.c	2010-04-01 14:23:10.000000000 +0800
+++ b/testcases/kernel/syscalls/pselect/pselect01.c	2010-07-15 16:03:40.969426078 +0800
@@ -109,7 +109,8 @@
 			    NULL);
 		end = time(&t);
 
-		if (((end - start) == total_sec) || ((end - start) == total_sec + 1))
+		/* Is it still valid in range -2~2s? */
+		if (((int)(end - start) - total_sec <= 2) && ((int)(end - start) - total_sec >= -2))
 			tst_resm(TPASS, "Sleep time was correct");
 		else
 			tst_resm(TFAIL, "Sleep time was incorrect:%d != %d",
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to