| 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: test.c |
| 8 | ** |
| 9 | ** Purpose: A sample to show how to structure a test case. |
| 10 | ** |
| 11 | ** |
| 12 | **===================================================================*/ |
| 13 | |
| 14 | #include <palsuite.h> |
| 15 | |
| 16 | int __cdecl main(int argc, char **argv) |
| 17 | { |
| 18 | int exampleInt = 9; |
| 19 | |
| 20 | /* Initialize the PAL. |
| 21 | */ |
| 22 | if(0 != PAL_Initialize(argc, argv)) |
| 23 | { |
| 24 | return FAIL; |
| 25 | } |
| 26 | |
| 27 | |
| 28 | Trace("\nTest #2...\n" ); |
| 29 | |
| 30 | #ifdef WIN32 |
| 31 | Trace("\nWe are testing under Win32 environment.\n" ); |
| 32 | #else |
| 33 | Trace("\nWe are testing under Non-Win32 environment.\n" ); |
| 34 | #endif |
| 35 | |
| 36 | if (exampleInt == 9) |
| 37 | { |
| 38 | Fail("This is an example to how to code a failure. " |
| 39 | "This failure was caused by exampleInt equalling %d\n" , |
| 40 | exampleInt); |
| 41 | } |
| 42 | |
| 43 | /* Shutdown the PAL. |
| 44 | */ |
| 45 | PAL_Terminate(); |
| 46 | |
| 47 | return PASS; |
| 48 | } |
| 49 | |