Files
mars-nwe/tests/nwnss/stdio/test_nwnss_stdio.c
Mario Fetka 0f82de2743
All checks were successful
Source release / source-package (push) Successful in 1m20s
0536 build: introduce libnwnss for imported NSS runtime
2026-06-14 22:34:04 +02:00

20 lines
627 B
C

#include "library/xStdio.h"
#include <string.h>
int main(void)
{
char buf[64];
int n = LB_snprintf(buf, sizeof(buf), "vol=%s id=%d hex=%x", "SYS", 0, 0x57);
if (n <= 0) return 1;
if (strcmp(buf, "vol=SYS id=0 hex=57") != 0) return 2;
n = LB_snprintf(buf, 8, "abcdefghi");
if (n <= 0) return 3;
if (buf[7] != '\0') return 4;
LB_sprintf(buf, "name=%s", "_ADMIN");
if (strcmp(buf, "name=_ADMIN") != 0) return 5;
n = LB_snprintf(buf, sizeof(buf), "quad=%Lu", (unsigned long long)123456789ULL);
if (n <= 0) return 6;
if (strcmp(buf, "quad=123456789") != 0) return 7;
return 0;
}