mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 15:01:40 +00:00
9382edabd5
using astyle
23 lines
490 B
C
23 lines
490 B
C
|
|
#include "test.h"
|
|
#include "utils/fluidsynth_priv.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;
|
|
}
|