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: SetFileAttributesA.c
8**
9**
10** Purpose: Tests the PAL implementation of the SetFileAttributesA function
11** Test that the function fails if the file doesn't exist..
12**
13**
14**===================================================================*/
15
16
17#include <palsuite.h>
18
19
20int __cdecl main(int argc, char **argv)
21{
22 DWORD TheResult;
23 char* FileName = {"no_file"};
24
25 if (0 != PAL_Initialize(argc,argv))
26 {
27 return FAIL;
28 }
29
30
31 /* Try to set the file to NORMAL on a file that doesn't
32 exist.
33 */
34
35 TheResult = SetFileAttributesA(FileName, FILE_ATTRIBUTE_NORMAL);
36
37 if(TheResult != 0)
38 {
39 Fail("ERROR: SetFileAttributesA returned non-zero0, success, when"
40 " trying to set the FILE_ATTRIBUTE_NORMAL attribute on a non "
41 "existant file. This should fail.");
42 }
43
44
45
46 PAL_Terminate();
47 return PASS;
48}
49