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: test15.c
8**
9** Purpose: Test #15 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 double val = 256.0;
24 double neg = -256.0;
25
26 if (PAL_Initialize(argc, argv) != 0)
27 return(FAIL);
28
29 DoDoubleTest(convert("foo %E"), val, convert("foo 2.560000E+002"),
30 convert("foo 2.560000E+02"));
31 DoDoubleTest(convert("foo %lE"), val, convert("foo 2.560000E+002"),
32 convert("foo 2.560000E+02"));
33 DoDoubleTest(convert("foo %hE"), val, convert("foo 2.560000E+002"),
34 convert("foo 2.560000E+02"));
35 DoDoubleTest(convert("foo %LE"), val, convert("foo 2.560000E+002"),
36 convert("foo 2.560000E+02"));
37 DoDoubleTest(convert("foo %I64E"), val, convert("foo 2.560000E+002"),
38 convert("foo 2.560000E+02"));
39 DoDoubleTest(convert("foo %14E"), val, convert("foo 2.560000E+002"),
40 convert("foo 2.560000E+02"));
41 DoDoubleTest(convert("foo %-14E"), val, convert("foo 2.560000E+002 "),
42 convert("foo 2.560000E+02 "));
43 DoDoubleTest(convert("foo %.1E"), val, convert("foo 2.6E+002"),
44 convert("foo 2.6E+02"));
45 DoDoubleTest(convert("foo %.8E"), val, convert("foo 2.56000000E+002"),
46 convert("foo 2.56000000E+02"));
47 DoDoubleTest(convert("foo %014E"), val, convert("foo 02.560000E+002"),
48 convert("foo 002.560000E+02"));
49 DoDoubleTest(convert("foo %#E"), val, convert("foo 2.560000E+002"),
50 convert("foo 2.560000E+02"));
51 DoDoubleTest(convert("foo %+E"), val, convert("foo +2.560000E+002"),
52 convert("foo +2.560000E+02"));
53 DoDoubleTest(convert("foo % E"), val, convert("foo 2.560000E+002"),
54 convert("foo 2.560000E+02"));
55 DoDoubleTest(convert("foo %+E"), neg, convert("foo -2.560000E+002"),
56 convert("foo -2.560000E+02"));
57 DoDoubleTest(convert("foo % E"), neg, convert("foo -2.560000E+002"),
58 convert("foo -2.560000E+002"));
59
60 PAL_Terminate();
61 return PASS;
62}
63