+2024-02-23 Bruno Haible <bruno@clisp.org>
+
+ unistdio/*printf tests: Update expected test results regarding %n.
+ * tests/unistdio/test-u8-printf1.h (test_xfunction): If
+ NEED_PRINTF_WITH_N_DIRECTIVE is not defined, expect a NULL result in the
+ %n test.
+ * tests/unistdio/test-u16-printf1.h (test_xfunction): Likewise.
+ * tests/unistdio/test-u32-printf1.h (test_xfunction): Likewise.
+ * tests/unistdio/test-ulc-printf1.h (test_xfunction): Likewise.
+
2024-02-22 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Follow gnulib-tool changes, part 26.
int count = -1;
uint16_t *result =
my_xasprintf ("%d %n", 123, &count, 33, 44, 55);
+#if NEED_PRINTF_WITH_N_DIRECTIVE
static const uint16_t expected[] =
{ '1', '2', '3', ' ', 0 };
ASSERT (result != NULL);
ASSERT (u16_strcmp (result, expected) == 0);
ASSERT (count == 4);
free (result);
+#else
+ ASSERT (result == NULL);
+#endif
}
/* Test the support of the POSIX/XSI format strings with positions. */
int count = -1;
uint32_t *result =
my_xasprintf ("%d %n", 123, &count, 33, 44, 55);
+#if NEED_PRINTF_WITH_N_DIRECTIVE
static const uint32_t expected[] =
{ '1', '2', '3', ' ', 0 };
ASSERT (result != NULL);
ASSERT (u32_strcmp (result, expected) == 0);
ASSERT (count == 4);
free (result);
+#else
+ ASSERT (result == NULL);
+#endif
}
/* Test the support of the POSIX/XSI format strings with positions. */
int count = -1;
uint8_t *result =
my_xasprintf ("%d %n", 123, &count, 33, 44, 55);
+#if NEED_PRINTF_WITH_N_DIRECTIVE
static const uint8_t expected[] = "123 ";
ASSERT (result != NULL);
ASSERT (u8_strcmp (result, expected) == 0);
ASSERT (count == 4);
free (result);
+#else
+ ASSERT (result == NULL);
+#endif
}
/* Test the support of the POSIX/XSI format strings with positions. */
int count = -1;
char *result =
my_xasprintf ("%d %n", 123, &count, 33, 44, 55);
+#if NEED_PRINTF_WITH_N_DIRECTIVE
ASSERT (result != NULL);
ASSERT (strcmp (result, "123 ") == 0);
ASSERT (count == 4);
free (result);
+#else
+ ASSERT (result == NULL);
+#endif
}
/* Test the support of the POSIX/XSI format strings with positions. */