Test Cases for the RTC Real-Time Functions Test (Windows Embedded CE 6.0)

1/6/2010

The following table shows the test cases for the RTC Real-Time Functions Test.

Note

Do not run test cases 1260, 1270, 1280, or 1290 on OS images that have SYSGEN_POOM set. These tests continuously write to the RTC, and this causes calendar notification to run continuously which blocks the test.

Note

If a tested clock does not run accurately, the expected duration of a test case shown in the following table might not be accurate.

Test case Description

1

Timer Test Usage Message

Prints out the usage message for the OAL Timer Tests. Tells the user what the tests do and specifies the input if any that the user needs to provide to the tests.

1260

Real-Time Clock Range

Finds the range of years supported by the RTC in the OAL code. The test looks for the range beginning with the minimum possible FILETIME (FILETIME 0 is the start of Jan 1st 1601) and end with maximum possible FILETIME (Max FILETIME is the maximum 64-bit value).

The test begins by setting a time. While OEMSetRealTime returns FALSE, it increments the time and sets it again, and does this until OEMSetRealTime returns TRUE and the start of the range is found. It then increments the time again and sets it until OEMSetRealTime returns a FALSE. This marks the end of the range.

The test case uses SetLocalTime and GetLocalTime functions to access the OAL functions OEMSetRealTime and OEMGetRealTime respectively.

It is possible that the end of range may not be found and the FILETIME overflow value is reached. In this case, the end of range may not exist; for the purpose of testing, the test case uses the maximum 64-bit ULONGLONG value; in other words, the maximum FILETIME value as the end of range.

This test case assumes that the supported range of years is always contiguous. The test case fails if the supported range is less than 100 years.

This test case sets the RTC back to the value it had at the beginning of the test if it completes successfully.

1270

OEMGetRealTime and OEMSetRealTime Functions

Verifies that the OEMSetRealTime and OEMGetRealTime functions correctly set and get the real-time clock values.

The test case sets various valid times (within the supported time range) and invalid times (out of the supported range). It verifies that the valid times are set and invalid times are not set. The time read back should match the value that was set if it was a valid time, and should match the value before the time was set if it was an invalid time.

The test case uses SetLocalTime and GetLocalTime functions to access the OAL functions OEMSetRealTime and OEMGetRealTime respectively.

You can optionally supply your own date and time for testing using -c "–dateAndTime mm/dd/yyyyhh:mm:ss, where mm/dd/yyyyhh:mm:ss is the date and time you want to test.

This test case sets the RTC back to the value it had at the beginning of the test if it completes successfully.

1280

Rollover of RTC

Verifies that the RTC rolls over correctly when transitioning between years, months, days, hours, minutes and seconds.

The test case sets a time, sleeps for 5 seconds, then gets the time and verifies if the time is as expected.

The test case uses SetLocalTime and GetLocalTime functions to access the OAL functions OEMSetRealTime and OEMGetRealTime respectively.

This test case sets the RTC back to the value it had at the beginning of the test if it completes successfully.

1290

Reentrance of OEMGetRealTime and OEMSetRealTime

Verifies that the real-time functions OEMSetRealTime and OEMGetRealTime are reentrant.

The test case creates a number of threads that run simultaneously calling OEMSetRealTime, followed by OEMGetRealTime. Each thread keeps setting a unique time value that falls within the supported range. The time read back in each thread should be the time set by that thread or a time set by one of the other threads. If the test reads back a time value that is different from any of the times being set by the various threads, it means that the time values were not set correctly or that they were not read back correctly, and the test fails. The threads are set to run for a quantum of 1 ms.

The test case uses SetLocalTime and GetLocalTime functions to access the OAL functions OEMSetRealTime and OEMGetRealTime respectively.

You can optionally specify the number of threads to run and/or the run time for the test using -c "-numberOfThreads number -reentranceRunTime seconds", where number is the number of threads you want to spawn and seconds is the run time in seconds. The default values are 50 threads and a run time of 10 minutes.

This test case sets the RTC back to the value it had at the beginning of the test if it completes successfully.

See Also

Other Resources

RTC Real-Time Functions Test