Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a70df444
Commit
a70df444
authored
May 03, 2007
by
Bill Medland
Committed by
Alexandre Julliard
May 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Boundary test cases for SystemTimeToFileTime and GetDateFormat.
parent
b7019a7a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
locale.c
dlls/kernel32/tests/locale.c
+28
-0
time.c
dlls/kernel32/tests/time.c
+28
-0
No files found.
dlls/kernel32/tests/locale.c
View file @
a70df444
...
...
@@ -424,6 +424,34 @@ static void test_GetDateFormatW(void)
STRINGSW
(
"dddd d MMMM yyyy"
,
"Wednesday 23 October 2002"
);
/* Incorrect DOW and time */
ret
=
GetDateFormatW
(
lcid
,
0
,
&
curtime
,
input
,
buffer
,
COUNTOF
(
buffer
));
EXPECT_VALID
;
EXPECT_LENW
;
EXPECT_EQW
;
/* Limit tests */
curtime
.
wYear
=
1601
;
curtime
.
wMonth
=
1
;
curtime
.
wDay
=
1
;
curtime
.
wDayOfWeek
=
0
;
/* Irrelevant */
curtime
.
wHour
=
0
;
curtime
.
wMinute
=
0
;
curtime
.
wSecond
=
0
;
curtime
.
wMilliseconds
=
0
;
STRINGSW
(
"dddd d MMMM yyyy"
,
"Monday 1 January 1601"
);
SetLastError
(
0xdeadbeef
);
ret
=
GetDateFormatW
(
lcid
,
0
,
&
curtime
,
input
,
buffer
,
COUNTOF
(
buffer
));
EXPECT_VALID
;
EXPECT_LENW
;
EXPECT_EQW
;
curtime
.
wYear
=
1600
;
curtime
.
wMonth
=
12
;
curtime
.
wDay
=
31
;
curtime
.
wDayOfWeek
=
0
;
/* Irrelevant */
curtime
.
wHour
=
23
;
curtime
.
wMinute
=
59
;
curtime
.
wSecond
=
59
;
curtime
.
wMilliseconds
=
999
;
STRINGSW
(
"dddd d MMMM yyyy"
,
"Friday 31 December 1600"
);
SetLastError
(
0xdeadbeef
);
ret
=
GetDateFormatW
(
lcid
,
0
,
&
curtime
,
input
,
buffer
,
COUNTOF
(
buffer
));
EXPECT_INVALID
;
}
...
...
dlls/kernel32/tests/time.c
View file @
a70df444
...
...
@@ -73,6 +73,23 @@
(st).wSecond = 32; \
(st).wMilliseconds = 123;
#define SETUP_ZEROTIME(st) \
(st).wYear = 1601; \
(st).wMonth = 1; \
(st).wDay = 1; \
(st).wHour = 0; \
(st).wMinute = 0; \
(st).wSecond = 0; \
(st).wMilliseconds = 0;
#define SETUP_EARLY(st) \
(st).wYear = 1600; \
(st).wMonth = 12; \
(st).wDay = 31; \
(st).wHour = 23; \
(st).wMinute = 59; \
(st).wSecond = 59; \
(st).wMilliseconds = 999;
static
void
test_conversions
(
void
)
...
...
@@ -82,6 +99,17 @@ static void test_conversions(void)
memset
(
&
ft
,
0
,
sizeof
ft
);
SETUP_EARLY
(
st
)
ok
(
!
SystemTimeToFileTime
(
&
st
,
&
ft
),
"Conversion succeeded EARLY
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"EARLY should be INVALID
\n
"
);
SETUP_ZEROTIME
(
st
)
ok
(
SystemTimeToFileTime
(
&
st
,
&
ft
),
"Conversion failed ZERO_TIME
\n
"
);
ok
(
(
!
((
ft
.
dwHighDateTime
!=
0
)
||
(
ft
.
dwLowDateTime
!=
0
))),
"Wrong time for ATIME: %08x %08x (correct %08x %08x)
\n
"
,
ft
.
dwLowDateTime
,
ft
.
dwHighDateTime
,
0
,
0
);
SETUP_ATIME
(
st
)
ok
(
SystemTimeToFileTime
(
&
st
,
&
ft
),
"Conversion Failed ATIME
\n
"
);
ok
(
(
!
((
ft
.
dwHighDateTime
!=
ATIME_HI
)
||
(
ft
.
dwLowDateTime
!=
ATIME_LOW
))),
...
...
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