Fix error on short hptime_t CPU.
[bertos.git] / bertos / drv / timer_test.c
index a7839f41ebac382d957914324cec75a38d963189..c3414d79f697dfca648042873be8e70431e61cc2 100644 (file)
@@ -34,6 +34,7 @@
  *
  * \version $Id$
  * \author Bernie Innocenti <bernie@codewiz.org>
+ *
  */
 
 #include <cfg/test.h>
@@ -67,7 +68,9 @@ static void timer_test_constants(void)
        kprintf("ticks_to_us(10000) = %lu\n",   (unsigned long)ticks_to_us(10000));
        kprintf("\n");
        kprintf("hptime_to_us(100)  = %lu\n",   (unsigned long)hptime_to_us(100));
-       kprintf("hptime_to_us(10000)= %lu\n",   (unsigned long)hptime_to_us(10000));
+       #if (SIZEOF_HPTIME_T > 1)
+               kprintf("hptime_to_us(10000)= %lu\n",   (unsigned long)hptime_to_us(10000));
+       #endif
        kprintf("us_to_hptime(100)  = %lu\n",   (unsigned long)us_to_hptime(100));
        kprintf("us_to_hptime(10000)= %lu\n",   (unsigned long)us_to_hptime(10000));
 }
@@ -154,14 +157,5 @@ int timer_testTearDown(void)
        return 0;
 }
 
-#if UNIT_TEST
-       #include <drv/timer.c>
-       #include <drv/kdebug.c>
-       #include <mware/event.c>
-       #include <mware/formatwr.c>
-       #include <mware/hex.c>
-       #include <os/hptime.c>
-
-       TEST_MAIN(timer);
-#endif
+TEST_MAIN(timer);