summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.c')
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.c
new file mode 100644
index 0000000000..c5515a8640
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.c
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test7.c
+**
+** Purpose: Tests the wide char specifier (%C).
+** This test is modeled after the sprintf series.
+**
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+#include "../fwprintf.h"
+
+/*
+ * Depends on memcmp, strlen, fopen, fseek and fgets.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR wb = (WCHAR) 'b';
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+
+ DoCharTest(convert("foo %C"), 'c', "foo c");
+ DoWCharTest(convert("foo %hc"), wb, "foo b");
+ DoCharTest(convert("foo %lC"), 'c', "foo c");
+ DoCharTest(convert("foo %LC"), 'c', "foo c");
+ DoCharTest(convert("foo %I64C"), 'c', "foo c");
+ DoCharTest(convert("foo %5C"), 'c', "foo c");
+ DoCharTest(convert("foo %.0C"), 'c', "foo c");
+ DoCharTest(convert("foo %-5C"), 'c', "foo c ");
+ DoCharTest(convert("foo %05C"), 'c', "foo 0000c");
+ DoCharTest(convert("foo % C"), 'c', "foo c");
+ DoCharTest(convert("foo %#C"), 'c', "foo c");
+
+ PAL_Terminate();
+ return PASS;
+}
+