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: Test for FreeEnvironmentStringsW() function |
10 | ** |
11 | ** |
12 | **=========================================================*/ |
13 | |
14 | #define UNICODE |
15 | #include <palsuite.h> |
16 | |
17 | int __cdecl main(int argc, char *argv[]) |
18 | { |
19 | |
20 | LPWSTR CapturedEnvironment = NULL; |
21 | BOOL TheResult = 0; |
22 | |
23 | /* |
24 | * Initialize the PAL and return FAILURE if this fails |
25 | */ |
26 | |
27 | if(0 != (PAL_Initialize(argc, argv))) |
28 | { |
29 | return FAIL; |
30 | } |
31 | |
32 | CapturedEnvironment = GetEnvironmentStrings(); |
33 | |
34 | /* If it's pointing to NULL, it failed. This checks the dependency */ |
35 | if(CapturedEnvironment == NULL) { |
36 | Fail("The function GetEnvironmentStrings() failed, and the " |
37 | "FreeEnvironmentStrings() tests is dependant on it.\n" ); |
38 | } |
39 | |
40 | /* This should return 1, if it succeeds, otherwise, test fails */ |
41 | TheResult = FreeEnvironmentStrings(CapturedEnvironment); |
42 | if(TheResult != 1) { |
43 | Fail("The function returned %d which indicates failure to Free the " |
44 | "Environment Strings.\n" ,TheResult); |
45 | } |
46 | |
47 | |
48 | PAL_Terminate(); |
49 | return PASS; |
50 | } |
51 | |
52 | |
53 | |
54 | |