1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5/*=====================================================================
6**
7** Source: test1.c
8**
9** Purpose: Test #1 for the vswprintf function.
10**
11**
12**===================================================================*/
13
14#include <palsuite.h>
15#include "../vswprintf.h"
16
17/* memcmp is used to verify the results, so this test is dependent on it. */
18/* ditto with wcslen */
19
20
21int __cdecl main(int argc, char *argv[])
22{
23 WCHAR *checkstr = NULL;
24 WCHAR buf[256] = { 0 };
25
26 if (PAL_Initialize(argc, argv) != 0)
27 return(FAIL);
28
29 checkstr = convert("hello world");
30 testvswp(buf, _countof(buf), checkstr);
31
32 if (memcmp(checkstr, buf, wcslen(checkstr)*2+2) != 0)
33 {
34 Fail("ERROR: Expected \"%s\", got \"%s\"\n",
35 convertC(checkstr), convertC(buf));
36 }
37
38 free(checkstr);
39 PAL_Terminate();
40 return PASS;
41}
42