Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
abdca2f7
Commit
abdca2f7
authored
Jul 31, 2023
by
Francois Gouget
Committed by
Alexandre Julliard
Jul 31, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Fix the basic file informations failure messages.
Set the messages to accurately reflect what is being tested, make them unique and trace bad values.
parent
39ca507d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
18 deletions
+24
-18
file.c
dlls/ntdll/tests/file.c
+24
-18
No files found.
dlls/ntdll/tests/file.c
View file @
abdca2f7
...
...
@@ -1350,36 +1350,42 @@ static void test_file_basic_information(void)
fbi2
.
LastWriteTime
.
QuadPart
=
-
1
;
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
h
,
&
io
,
&
fbi2
,
sizeof
fbi2
,
FileBasicInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"can't set
system attribut
e, NtSetInformationFile returned %x
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"can't set
system attribut
e, io.Status is %lx
\n
"
,
io
.
Status
);
ok
(
res
==
STATUS_SUCCESS
,
"can't set
-1 write tim
e, NtSetInformationFile returned %x
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"can't set
-1 write tim
e, io.Status is %lx
\n
"
,
io
.
Status
);
memset
(
&
fbi2
,
0
,
sizeof
(
fbi2
));
fbi2
.
LastAccessTime
.
QuadPart
=
0x200deadcafebeef
;
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
h
,
&
io
,
&
fbi2
,
sizeof
(
fbi2
),
FileBasicInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"can't set
system attribut
e, NtSetInformationFile returned %x
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"can't set
system attribut
e, io.Status is %lx
\n
"
,
io
.
Status
);
ok
(
res
==
STATUS_SUCCESS
,
"can't set
access tim
e, NtSetInformationFile returned %x
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"can't set
access tim
e, io.Status is %lx
\n
"
,
io
.
Status
);
res
=
pNtQueryInformationFile
(
h
,
&
io
,
&
fbi
,
sizeof
(
fbi
),
FileBasicInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get
system attribut
e, NtQueryInformationFile returned %x
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"can't get
system attribut
e, io.Status is %lx
\n
"
,
io
.
Status
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get
access tim
e, NtQueryInformationFile returned %x
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"can't get
access tim
e, io.Status is %lx
\n
"
,
io
.
Status
);
ok
(
fbi2
.
LastAccessTime
.
QuadPart
==
fbi
.
LastAccessTime
.
QuadPart
,
"large access time set/get does not match.
\n
"
);
"access time mismatch, set: %s get: %s
\n
"
,
wine_dbgstr_longlong
(
fbi2
.
LastAccessTime
.
QuadPart
),
wine_dbgstr_longlong
(
fbi
.
LastAccessTime
.
QuadPart
)
);
memset
(
&
fbi2
,
0
,
sizeof
(
fbi2
));
res
=
pNtQueryInformationFile
(
h
,
&
io
,
&
fbi2
,
sizeof
fbi2
,
FileBasicInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get attributes, res %x
\n
"
,
res
);
ok
(
fbi2
.
LastWriteTime
.
QuadPart
==
fbi
.
LastWriteTime
.
QuadPart
,
"unexpected write time.
\n
"
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get write time 1, res %x
\n
"
,
res
);
ok
(
fbi2
.
LastWriteTime
.
QuadPart
==
fbi
.
LastWriteTime
.
QuadPart
,
"write time mismatch, %s != %s
\n
"
,
wine_dbgstr_longlong
(
fbi2
.
LastWriteTime
.
QuadPart
),
wine_dbgstr_longlong
(
fbi
.
LastWriteTime
.
QuadPart
)
);
memset
(
&
fbi2
,
0
,
sizeof
(
fbi2
));
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
h
,
&
io
,
&
fbi2
,
sizeof
fbi2
,
FileBasicInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"can't set
system attribute
, NtSetInformationFile returned %x
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"can't set
system attribute
, io.Status is %lx
\n
"
,
io
.
Status
);
ok
(
res
==
STATUS_SUCCESS
,
"can't set
nothing
, NtSetInformationFile returned %x
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"can't set
nothing
, io.Status is %lx
\n
"
,
io
.
Status
);
memset
(
&
fbi2
,
0
,
sizeof
(
fbi2
));
res
=
pNtQueryInformationFile
(
h
,
&
io
,
&
fbi2
,
sizeof
fbi2
,
FileBasicInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get attributes, res %x
\n
"
,
res
);
ok
(
fbi2
.
LastWriteTime
.
QuadPart
==
fbi
.
LastWriteTime
.
QuadPart
,
"unexpected write time.
\n
"
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get write time 2, res %x
\n
"
,
res
);
ok
(
fbi2
.
LastWriteTime
.
QuadPart
==
fbi
.
LastWriteTime
.
QuadPart
,
"write time changed, %s != %s
\n
"
,
wine_dbgstr_longlong
(
fbi2
.
LastWriteTime
.
QuadPart
),
wine_dbgstr_longlong
(
fbi
.
LastWriteTime
.
QuadPart
)
);
/* Then SYSTEM */
/* Clear fbi to avoid setting times */
...
...
@@ -1392,7 +1398,7 @@ static void test_file_basic_information(void)
memset
(
&
fbi
,
0
,
sizeof
(
fbi
));
res
=
pNtQueryInformationFile
(
h
,
&
io
,
&
fbi
,
sizeof
fbi
,
FileBasicInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get
attributes
\n
"
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get
system attribute
\n
"
);
ok
(
(
fbi
.
FileAttributes
&
attrib_mask
)
==
FILE_ATTRIBUTE_SYSTEM
,
"attribute %lx not FILE_ATTRIBUTE_SYSTEM
\n
"
,
fbi
.
FileAttributes
);
/* Then HIDDEN */
...
...
@@ -1400,12 +1406,12 @@ static void test_file_basic_information(void)
fbi
.
FileAttributes
=
FILE_ATTRIBUTE_HIDDEN
;
io
.
Status
=
0xdeadbeef
;
res
=
pNtSetInformationFile
(
h
,
&
io
,
&
fbi
,
sizeof
fbi
,
FileBasicInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"can't set
system
attribute, NtSetInformationFile returned %x
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"can't set
system
attribute, io.Status is %lx
\n
"
,
io
.
Status
);
ok
(
res
==
STATUS_SUCCESS
,
"can't set
hidden
attribute, NtSetInformationFile returned %x
\n
"
,
res
);
ok
(
io
.
Status
==
STATUS_SUCCESS
,
"can't set
hidden
attribute, io.Status is %lx
\n
"
,
io
.
Status
);
memset
(
&
fbi
,
0
,
sizeof
(
fbi
));
res
=
pNtQueryInformationFile
(
h
,
&
io
,
&
fbi
,
sizeof
fbi
,
FileBasicInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get
attributes
\n
"
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get
hidden attribute
\n
"
);
ok
(
(
fbi
.
FileAttributes
&
attrib_mask
)
==
FILE_ATTRIBUTE_HIDDEN
,
"attribute %lx not FILE_ATTRIBUTE_HIDDEN
\n
"
,
fbi
.
FileAttributes
);
/* Check NORMAL last of all (to make sure we can clear attributes) */
...
...
@@ -1418,7 +1424,7 @@ static void test_file_basic_information(void)
memset
(
&
fbi
,
0
,
sizeof
(
fbi
));
res
=
pNtQueryInformationFile
(
h
,
&
io
,
&
fbi
,
sizeof
fbi
,
FileBasicInformation
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get
attributes
\n
"
);
ok
(
res
==
STATUS_SUCCESS
,
"can't get
normal attribute
\n
"
);
todo_wine
ok
(
(
fbi
.
FileAttributes
&
attrib_mask
)
==
FILE_ATTRIBUTE_NORMAL
,
"attribute %lx not 0
\n
"
,
fbi
.
FileAttributes
);
CloseHandle
(
h
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment