[PATCH 4/4] tests/qtest: Replace magic value by NANOSECONDS_PER_SECOND definition

Philippe Mathieu-Daudé posted 4 patches 5 years, 4 months ago
There is a newer version of this series
[PATCH 4/4] tests/qtest: Replace magic value by NANOSECONDS_PER_SECOND definition
Posted by Philippe Mathieu-Daudé 5 years, 4 months ago
Use self-explicit NANOSECONDS_PER_SECOND definition instead
of a magic value.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/qtest/rtc-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/qtest/rtc-test.c b/tests/qtest/rtc-test.c
index c7af34f6b1b..402ce2c6090 100644
--- a/tests/qtest/rtc-test.c
+++ b/tests/qtest/rtc-test.c
@@ -292,7 +292,7 @@ static void alarm_time(void)
             break;
         }
 
-        clock_step(1000000000);
+        clock_step(NANOSECONDS_PER_SECOND);
     }
 
     g_assert(get_irq(RTC_ISA_IRQ));
-- 
2.26.2

Re: [PATCH 4/4] tests/qtest: Replace magic value by NANOSECONDS_PER_SECOND definition
Posted by Thomas Huth 5 years, 4 months ago
On 11/10/2020 21.49, Philippe Mathieu-Daudé wrote:
> Use self-explicit NANOSECONDS_PER_SECOND definition instead
> of a magic value.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/qtest/rtc-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/rtc-test.c b/tests/qtest/rtc-test.c
> index c7af34f6b1b..402ce2c6090 100644
> --- a/tests/qtest/rtc-test.c
> +++ b/tests/qtest/rtc-test.c
> @@ -292,7 +292,7 @@ static void alarm_time(void)
>              break;
>          }
>  
> -        clock_step(1000000000);
> +        clock_step(NANOSECONDS_PER_SECOND);
>      }
>  
>      g_assert(get_irq(RTC_ISA_IRQ));
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>