app: cosmetic
authorIntel <intel.com>
Wed, 19 Dec 2012 23:00:00 +0000 (00:00 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 25 Jul 2013 13:54:18 +0000 (15:54 +0200)
Signed-off-by: Intel
app/test/test_alarm.c
app/test/test_atomic.c
app/test/test_cycles.c

index 20c3f05..a49e142 100644 (file)
@@ -132,7 +132,8 @@ test_multi_alarms(void)
        rte_delay_ms(3500);
        if (cb_count.cnt != 2 || rm_count != 1) {
                printf("Error: invalid flags count or alarm removal failure"
-                               " -  flags value = %d, expected = %d\n", cb_count.cnt, 2);
+                               " -  flags value = %d, expected = %d\n",
+                               (int)cb_count.cnt, 2);
                /* remove any callbacks that might remain */
                rte_eal_alarm_cancel(test_multi_cb, (void *)-1);
                return -1;
index 9faa063..8b115b3 100644 (file)
@@ -349,7 +349,7 @@ test_atomic(void)
        rte_atomic32_clear(&synchro);
 
        if (rte_atomic32_read(&count) != NUM_ATOMIC_TYPES) {
-               printf("Atomic inc and test failed %d\n", count.cnt);
+               printf("Atomic inc and test failed %d\n", (int)count.cnt);
                return -1;
        }
 
index 377643a..1d2ad25 100644 (file)
@@ -48,7 +48,7 @@
  * Cycles test
  * ===========
  *
- * - Loop N times and check that the timer alway increments and
+ * - Loop N times and check that the timer always increments and
  *   never decrements during this loop.
  *
  * - Wait one second using rte_usleep() and check that the increment
@@ -79,13 +79,13 @@ test_cycles(void)
        prev_cycles = rte_get_hpet_cycles();
        rte_delay_us(1000000);
        cycles = rte_get_hpet_cycles();
+
        if ((uint64_t)(cycles - prev_cycles) > (hz + max_inc)) {
-               printf("delay_us is not accurate\n");
+               printf("delay_us is not accurate: too long\n");
                return -1;
        }
-       cycles = rte_get_hpet_cycles();
-       if ((uint64_t)(cycles - prev_cycles) < (hz)) {
-               printf("delay_us is not accurate\n");
+       if ((uint64_t)(cycles - prev_cycles) < (hz - max_inc)) {
+               printf("delay_us is not accurate: too short\n");
                return -1;
        }