vprintf_tc.c 565 B

123456789101112131415161718192021222324252627282930
  1. #include <stdio.h>
  2. #include <stdarg.h>
  3. #include <string.h>
  4. static void WriteFrmtd(char *format, ...)
  5. {
  6. va_list args;
  7. va_start(args, format);
  8. vprintf(format, args);
  9. va_end(args);
  10. }
  11. static int vprintf_entry(void)
  12. {
  13. WriteFrmtd("vprintf test:%s-%d-%c %.02f 0x%x\n","2021" ,8 ,'1' ,3.14 ,0xff);
  14. return 0;
  15. }
  16. #include <utest.h>
  17. static void test_vprintf(void)
  18. {
  19. uassert_int_equal(vprintf_entry(), 0);
  20. }
  21. static void testcase(void)
  22. {
  23. UTEST_UNIT_RUN(test_vprintf);
  24. }
  25. UTEST_TC_EXPORT(testcase, "posix.stdio_h.vprintf.c", RT_NULL, RT_NULL, 10);