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: test14.c |
8 | ** |
9 | ** Purpose: Tests swscanf with floats (exponential notation, lowercase) |
10 | ** |
11 | ** |
12 | **==========================================================================*/ |
13 | |
14 | |
15 | |
16 | #include <palsuite.h> |
17 | #include "../swscanf.h" |
18 | |
19 | |
20 | int __cdecl main(int argc, char *argv[]) |
21 | { |
22 | if (PAL_Initialize(argc, argv)) |
23 | { |
24 | return FAIL; |
25 | } |
26 | |
27 | DoFloatTest(convert("123.0" ), convert("%e" ), 123.0f); |
28 | DoFloatTest(convert("123.0" ), convert("%2e" ), 12.0f); |
29 | DoFloatTest(convert("10E1" ), convert("%e" ), 100.0f); |
30 | DoFloatTest(convert("-12.01e-2" ), convert("%e" ), -0.1201f); |
31 | DoFloatTest(convert("+12.01e-2" ), convert("%e" ), 0.1201f); |
32 | DoFloatTest(convert("-12.01e+2" ), convert("%e" ), -1201.0f); |
33 | DoFloatTest(convert("+12.01e+2" ), convert("%e" ), 1201.0f); |
34 | DoFloatTest(convert("1234567890.0123456789f" ), convert("%e" ), 1234567936); |
35 | |
36 | PAL_Terminate(); |
37 | return PASS; |
38 | } |
39 | |