summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp')
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp b/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp
new file mode 100644
index 0000000000..ecd6374264
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp
@@ -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: test6.c
+**
+** Purpose: Tests swprintf with character
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../swprintf.h"
+
+/*
+ * Uses memcmp & wcslen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR wb = (WCHAR) 'b';
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoWCharTest(convert("foo %c"), wb, convert("foo b"));
+ DoCharTest(convert("foo %hc"), 'c', convert("foo c"));
+ DoWCharTest(convert("foo %lc"), wb, convert("foo b"));
+ DoWCharTest(convert("foo %Lc"), wb, convert("foo b"));
+ DoWCharTest(convert("foo %I64c"), wb, convert("foo b"));
+ DoWCharTest(convert("foo %5c"), wb, convert("foo b"));
+ DoWCharTest(convert("foo %.0c"), wb, convert("foo b"));
+ DoWCharTest(convert("foo %-5c"), wb, convert("foo b "));
+ DoWCharTest(convert("foo %05c"), wb, convert("foo 0000b"));
+ DoWCharTest(convert("foo % c"), wb, convert("foo b"));
+ DoWCharTest(convert("foo %#c"), wb, convert("foo b"));
+
+ PAL_Terminate();
+ return PASS;
+}