vprint_message() truncates messages
In cmocka\src\cmocka.c
vprint_message() implemented as below uses a 1024-byte to capture all the logs for a certain test case and then prints out.
/* Standard output and error print methods. / void vprint_message(const char const format, va_list args) { char buffer[1024]; vsnprintf(buffer, sizeof(buffer), format, args); printf("%s", buffer); fflush(stdout); #ifdef _WIN32 OutputDebugString(buffer); #endif /* _WIN32 */ }
However, when the logs for each test case exceed 1024 bytes, the logs are truncated.
I changed the implementation to below and the truncation disappeared. void vprint_message(const char* const format, va_list args) { vprintf (format, args); fflush(stdout); }
The implementation was in the existing way in the very beginning of cmocka project (first check-in).
I am not sure why it cannot be implemented in the new way.