| 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 printf function. A single, basic, test |
| 10 | ** case with no formatting. |
| 11 | ** |
| 12 | ** |
| 13 | **==========================================================================*/ |
| 14 | |
| 15 | |
| 16 | |
| 17 | #include <palsuite.h> |
| 18 | #include "../printf.h" |
| 19 | |
| 20 | int __cdecl main(int argc, char *argv[]) |
| 21 | { |
| 22 | char checkstr[] = "hello world" ; |
| 23 | int ret; |
| 24 | |
| 25 | |
| 26 | if (PAL_Initialize(argc, argv)) |
| 27 | { |
| 28 | return FAIL; |
| 29 | } |
| 30 | |
| 31 | ret = printf("hello world" ); |
| 32 | |
| 33 | if (ret != strlen(checkstr)) |
| 34 | { |
| 35 | Fail("Expected printf to return %d, got %d.\n" , |
| 36 | strlen(checkstr), ret); |
| 37 | |
| 38 | } |
| 39 | |
| 40 | PAL_Terminate(); |
| 41 | return PASS; |
| 42 | } |
| 43 | |
| 44 | |