X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fmware%2Fsprintf_test.c;h=8bcbabffd606255c4fc68cb690849b1f9a482c1f;hb=bb31ab5597a5a4299204f8c674f129506e0acdfe;hp=1bcedfd35175f289618f6494422d83f27d0019b4;hpb=791e167e053bdd9250d34a9a5ccae6ccde4d6679;p=bertos.git diff --git a/bertos/mware/sprintf_test.c b/bertos/mware/sprintf_test.c index 1bcedfd3..8bcbabff 100644 --- a/bertos/mware/sprintf_test.c +++ b/bertos/mware/sprintf_test.c @@ -33,21 +33,28 @@ * \brief sprintf() implementation based on _formatted_write() * * \version $Id$ - * \author Bernardo Innocenti + * \author Bernie Innocenti */ -#include "sprintf.c" -#include "formatwr.c" -#include "hex.c" + #include -#include +#include +#include + +#include + #include -#include /* assert() */ #include /* strcmp() */ +#warning FIXME:Review and refactor this test.. -int main(UNUSED_ARG(int, argc), UNUSED_ARG(char **,argv)) +#if (ARCH & ARCH_UNITTEST) +#include "sprintf.c" +#include "formatwr.c" +#include "hex.c" + +int main(void) { char buf[256]; static const char test_string[] = "Hello, world!\n"; @@ -80,7 +87,6 @@ int main(UNUSED_ARG(int, argc), UNUSED_ARG(char **,argv)) TEST("%-8.2f", -123.456, "-123.46 "); TEST("%8.0f", -123.456, " -123"); -#undef TEST /* * Stress tests. @@ -94,3 +100,5 @@ int main(UNUSED_ARG(int, argc), UNUSED_ARG(char **,argv)) return 0; } +#endif /* _TEST */ +