summaryrefslogtreecommitdiff
path: root/tests/lib/test_printfrr.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/test_printfrr.c')
-rw-r--r--tests/lib/test_printfrr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/test_printfrr.c b/tests/lib/test_printfrr.c
index 5a8d10e9b7..8fa8bfcc23 100644
--- a/tests/lib/test_printfrr.c
+++ b/tests/lib/test_printfrr.c
@@ -128,6 +128,21 @@ static int printchk(const char *ref, const char *fmt, ...)
return 0;
}
+static void test_va(const char *ref, const char *fmt, ...) PRINTFRR(2, 3);
+static void test_va(const char *ref, const char *fmt, ...)
+{
+ struct va_format vaf;
+ va_list ap;
+
+ va_start(ap, fmt);
+ vaf.fmt = fmt;
+ vaf.va = ≈
+
+ printchk(ref, "VA [%pVA] %s", &vaf, "--");
+
+ va_end(ap);
+}
+
int main(int argc, char **argv)
{
size_t i;
@@ -168,6 +183,8 @@ int main(int argc, char **argv)
printcmp("%p", &ip);
+ test_va("VA [192.168.1.2 1234] --", "%pI4 %u", &ip, 1234);
+
snprintfrr(buf, sizeof(buf), "test%s", "#1");
csnprintfrr(buf, sizeof(buf), "test%s", "#2");
assert(strcmp(buf, "test#1test#2") == 0);