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
300140e2
Commit
300140e2
authored
Mar 08, 2012
by
Owen Rudge
Committed by
Alexandre Julliard
Mar 12, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Add test for DTM_SETSYSTEMTIME outside range limit.
parent
72f17419
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
0 deletions
+62
-0
datetime.c
dlls/comctl32/tests/datetime.c
+62
-0
No files found.
dlls/comctl32/tests/datetime.c
View file @
300140e2
...
@@ -121,6 +121,18 @@ static const struct message test_dtm_set_and_get_system_time_seq[] = {
...
@@ -121,6 +121,18 @@ static const struct message test_dtm_set_and_get_system_time_seq[] = {
{
0
}
{
0
}
};
};
static
const
struct
message
test_dtm_set_and_get_systime_with_limits
[]
=
{
{
DTM_SETRANGE
,
sent
|
wparam
,
GDTR_MIN
|
GDTR_MAX
},
{
DTM_GETRANGE
,
sent
|
wparam
,
0
},
{
DTM_SETSYSTEMTIME
,
sent
|
wparam
,
0
},
{
DTM_GETSYSTEMTIME
,
sent
|
wparam
,
0
},
{
DTM_SETSYSTEMTIME
,
sent
|
wparam
,
0
},
{
DTM_GETSYSTEMTIME
,
sent
|
wparam
,
0
},
{
DTM_SETSYSTEMTIME
,
sent
|
wparam
,
0
},
{
DTM_GETSYSTEMTIME
,
sent
|
wparam
,
0
},
{
0
}
};
static
LRESULT
WINAPI
datetime_subclass_proc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
static
LRESULT
WINAPI
datetime_subclass_proc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
{
WNDPROC
oldproc
=
(
WNDPROC
)
GetWindowLongPtrA
(
hwnd
,
GWLP_USERDATA
);
WNDPROC
oldproc
=
(
WNDPROC
)
GetWindowLongPtrA
(
hwnd
,
GWLP_USERDATA
);
...
@@ -660,6 +672,55 @@ static void test_dtm_set_and_get_system_time(void)
...
@@ -660,6 +672,55 @@ static void test_dtm_set_and_get_system_time(void)
expect
(
4
,
(
LRESULT
)
getSt
.
wDayOfWeek
);
expect
(
4
,
(
LRESULT
)
getSt
.
wDayOfWeek
);
st
.
wDayOfWeek
=
4
;
st
.
wDayOfWeek
=
4
;
expect_systime
(
&
st
,
&
getSt
);
expect_systime
(
&
st
,
&
getSt
);
}
static
void
test_dtm_set_and_get_systemtime_with_limits
(
void
)
{
LRESULT
r
;
SYSTEMTIME
st
[
2
],
getSt
[
2
],
refSt
;
HWND
hWnd
;
hWnd
=
create_datetime_control
(
DTS_SHOWNONE
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
/* set range */
fill_systime_struct
(
&
st
[
0
],
1980
,
1
,
3
,
23
,
14
,
34
,
37
,
465
);
fill_systime_struct
(
&
st
[
1
],
2007
,
3
,
2
,
31
,
23
,
59
,
59
,
999
);
r
=
SendMessage
(
hWnd
,
DTM_SETRANGE
,
GDTR_MIN
|
GDTR_MAX
,
(
LPARAM
)
st
);
expect
(
1
,
r
);
r
=
SendMessage
(
hWnd
,
DTM_GETRANGE
,
0
,
(
LPARAM
)
getSt
);
ok
(
r
==
(
GDTR_MIN
|
GDTR_MAX
),
"Expected %x, not %x(GDTR_MIN) or %x(GDTR_MAX), got %lx
\n
"
,
(
GDTR_MIN
|
GDTR_MAX
),
GDTR_MIN
,
GDTR_MAX
,
r
);
expect_systime
(
&
st
[
0
],
&
getSt
[
0
]);
expect_systime
(
&
st
[
1
],
&
getSt
[
1
]);
/* Initially set a valid time */
fill_systime_struct
(
&
refSt
,
1999
,
9
,
4
,
9
,
19
,
9
,
9
,
999
);
r
=
SendMessage
(
hWnd
,
DTM_SETSYSTEMTIME
,
GDT_VALID
,
(
LPARAM
)
&
refSt
);
expect
(
1
,
r
);
r
=
SendMessage
(
hWnd
,
DTM_GETSYSTEMTIME
,
0
,
(
LPARAM
)
&
getSt
[
0
]);
ok
(
r
==
GDT_VALID
,
"Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld
\n
"
,
GDT_VALID
,
GDT_NONE
,
GDT_ERROR
,
r
);
expect_systime
(
&
refSt
,
&
getSt
[
0
]);
/* Now set an out-of-bounds time */
fill_systime_struct
(
&
st
[
0
],
2010
,
1
,
0
,
1
,
0
,
0
,
0
,
0
);
r
=
SendMessage
(
hWnd
,
DTM_SETSYSTEMTIME
,
GDT_VALID
,
(
LPARAM
)
&
st
[
0
]);
expect
(
1
,
r
);
r
=
SendMessage
(
hWnd
,
DTM_GETSYSTEMTIME
,
0
,
(
LPARAM
)
&
getSt
[
0
]);
ok
(
r
==
GDT_VALID
,
"Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld
\n
"
,
GDT_VALID
,
GDT_NONE
,
GDT_ERROR
,
r
);
todo_wine
expect_systime
(
&
refSt
,
&
getSt
[
0
]);
fill_systime_struct
(
&
st
[
0
],
1977
,
1
,
0
,
1
,
0
,
0
,
0
,
0
);
r
=
SendMessage
(
hWnd
,
DTM_SETSYSTEMTIME
,
GDT_VALID
,
(
LPARAM
)
&
st
[
0
]);
expect
(
1
,
r
);
r
=
SendMessage
(
hWnd
,
DTM_GETSYSTEMTIME
,
0
,
(
LPARAM
)
&
getSt
[
0
]);
ok
(
r
==
GDT_VALID
,
"Expected %d, not %d(GDT_NONE) or %d(GDT_ERROR), got %ld
\n
"
,
GDT_VALID
,
GDT_NONE
,
GDT_ERROR
,
r
);
todo_wine
expect_systime
(
&
refSt
,
&
getSt
[
0
]);
ok_sequence
(
sequences
,
DATETIME_SEQ_INDEX
,
test_dtm_set_and_get_systime_with_limits
,
"test_dtm_set_and_get_systime_with_limits"
,
FALSE
);
DestroyWindow
(
hWnd
);
DestroyWindow
(
hWnd
);
}
}
...
@@ -749,6 +810,7 @@ START_TEST(datetime)
...
@@ -749,6 +810,7 @@ START_TEST(datetime)
test_dtm_set_and_get_range
();
test_dtm_set_and_get_range
();
test_dtm_set_range_swap_min_max
();
test_dtm_set_range_swap_min_max
();
test_dtm_set_and_get_system_time
();
test_dtm_set_and_get_system_time
();
test_dtm_set_and_get_systemtime_with_limits
();
test_wm_set_get_text
();
test_wm_set_get_text
();
test_dts_shownone
();
test_dts_shownone
();
}
}
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