mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-14 00:20:41 +00:00
9ef169cb00
by cleaning up fluidsynth's private includes
23 lines
484 B
C
23 lines
484 B
C
|
|
#include "test.h"
|
|
#include "utils/fluid_sys.h"
|
|
|
|
// this test makes sure FLUID_SNPRINTF uses a proper C99 compliant implementation
|
|
|
|
int main(void)
|
|
{
|
|
char buf[2 + 1];
|
|
|
|
int ret = FLUID_SNPRINTF(buf, sizeof(buf), "99");
|
|
TEST_ASSERT(ret == 2);
|
|
|
|
TEST_ASSERT(buf[2] == '\0');
|
|
|
|
ret = FLUID_SNPRINTF(buf, sizeof(buf), "999");
|
|
TEST_ASSERT(ret == 3);
|
|
|
|
// output truncated, buffer must be NULL terminated!
|
|
TEST_ASSERT(buf[2] == '\0');
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|