comctl32: datetime: initial tests for date and time picker

Mike McCormack mike at codeweavers.com
Thu Feb 8 18:52:43 CST 2007


Kanit Therdsteerasukdi wrote:

> I'm a student at UCLA taking CS130: Software Engineering.  For CS130, we
> are writing conformance tests for Common Controls (comctl32).  I will be
> working on the Date and Time Picker.  Attached is an initial test,
> testing the getters and setters.

Looks like good work.

> +#include <stdio.h>

This is possibly not needed.

> +static HINSTANCE g_hinst;

You should be able to use NULL instead of the hinst when creating the 
window, which would eliminate the need for g_hinst.

> +  assert(hWndDateTime!=NULL);
> +  return hWndDateTime;

Maybe it would be nicer to check hWndDateTime with an ok() macro in 
test_datetime_control() then use skip() if it's NULL.  This way the test 
will fail without crashing in the case that Window creation fails, for 
example, when there's no X display available.  When tests crash, make 
doesn't detect that they failed.

> +  return;
> +}

The return is redundant, and probably better off removed.

> +  r = SendMessage(hWndDateTime, DTM_SETRANGE, GDTR_MIN | GDTR_MAX, (LPARAM)st);
> +  ok(r != 0, "Expected nonzero, got %ld\n", r);

MSDN does say "returns nonzero if successful", but it's probably better 
to check the exact value that it does return, in case there's a program 
out there that does the same. ie.

ok(r == 1, "Expected nonzero, got %ld\n", r);

Mike



More information about the wine-devel mailing list