Compartilhar via


Best Practices for the OAL Cache Test (Windows CE 5.0)

Send Feedback

When you use the OAL Cache Test to assess the cache and memory subsystem of a Windows CE–based device, consider the following best practices:

  • Run the Print Cache Info test case and verify that the return value of the CeGetCacheInfo function is valid and expected.

    Compare the return value of the CeGetCacheInfo function to the hardware specifications.

  • Run the OAL Cache Test on more than one target device.

    Testing multiple target devices can help you to identify random flaws in memory chips and other hardware problems. Even if you can reproduce a problem on multiple target devices, the source of the problem might be hardware.

    Each test case walks memory in a deterministic way. If a test case is faulty, it most likely fails at the same array index during each subsequent run, unless a stray pointer incorrectly changes memory values. The existence of a stray pointer is unlikely because the OAL Cache Test does not use pointers extensively. If a problem occurs at different array indexes during subsequent runs, most likely the test is working correctly and there is something wrong with the target device.

  • Observe the physical address values displayed in the debug output to determine in which memory blocks faults occur.

    If the same memory block consistently causes a fault, most likely the cache incorrectly stores data for the block or there is something physically wrong with the memory at that location.

  • Use a hash function that is less complex, if you cannot discern a pattern in the output of the test.

    A complex hash function can hide patterns in the output of the test. For more information, see the CacheTest.cpp file in the %_WINCEROOT%\Private\Test\Pqoal\Caches directory. For more information about CETK source code, see Source Code for CETK Tests. The OAL Cache Test does not use less complex hash functions by default because a less complex hash function is less likely to find an error.

  • If a test case fails because it cannot allocate memory, reduce the array length or free memory on the target device.

    Each test case allocates a contiguous chunk of memory and fails if a contiguous chunk of memory is not allocated.

  • On an SHx CPU or MIPS CPU, you can achieve full testing coverage by running a subset of test cases for the OAL Cache Test.

    On an SHx CPU, the behavior of a test case with no caching is identical to the behavior of the same test case in write-through cache mode and write-back cache mode. On a MIPS CPU, the behavior of a test case in write-through cache mode is identical to the behavior of the same test case in write-back cache mode.

See Also

OAL Cache Test | Test Cases for the OAL Cache Test

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.