Partager via


Registry API and Functionality Test (Compact 2013)

3/26/2014

The Registry Build Verification Test uncovers common API and functionality problems with the registry and the file system.

The test suite covers the following registry methods:

* RegCreateKeyEx

* RegDeleteKey

* RegEnumKeyEx

* RegEnumVal

* RegOpenKeyEx

* RegSetValueEx

* RegDeleteValue

* RegQueryInfoKey

* RegQueryValueEx

You may want to run this test each time you make a custom build, to uncover any registry-related issues caused by regressions.

Test Prerequisites

Your device must meet the following requirements before you run this test.

There are no hardware requirements for the Registry API and Functionality Test.

The following table shows the software requirements for the Registry API and Functionality Test.

Requirement

Description

Tux.exe

Test harness, required for executing the test.

Kato.dll

Logging engine, required for logging test data.

Regtst.dll

Test library.

NoteThere must be at least 10 megabytes (MB) of free space in the root directory of the target device. If there is not sufficient space in the root directory of the target device, the test cannot run properly.

Subtests

The table below lists the subtests included in this test.

SubTest ID

Description

1001

Tests RegCreateKeyEx API. Tests creating keys and sub-keys to the depth limit (16 levels). Tests boundary conditions (tries to exceed the depth limit).

1002

Tests the RegCreateKeyEx API. Tests creating keys with various naming schemes (different length, contents, and path).

1003

Tests the RegCreateKeyEx API with invalid parameters. The function call should not succeed.

1004

Stress tests the RegCreateKeyEx API. Creates and deletes 2000 keys on the following registry roots:

* HKEY_LOCAL_MACHINE

* HKEY_CURRENT_USER

* HKEY_CLASSES_ROOT

* HKEY_USERS

2001

Tests the RegDeleteKey API. Creates and deletes various registry trees.

2002

Tests the RegDeleteKey API. Tests deleting various subkeys (valid and invalid schemes). Tries to delete a registry root, non-existent key, etc.

2003

Tests the RegDeleteKey API with invalid parameters. The function call should not succeed.

2004

Miscellaneous tests for the RegDeleteKey API.

2005

Test to verify deleting invalid subkey that is open.

3001

Tests the RegEnumKeyEx API. Create 30 keys and enumerates through all created keys.

3002

Tests the RegEnumKeyEx API. Tests enumerating the registry roots and enumerating using invalid handles.

3003

Test RegEnumKeyEx API. Test enumerating registry keys, varying the index parameter.

3004

Test RegEnumKeyEx API. Tests various naming schemes for keys, classes and sizes (valid and invalid schemes). Some tests will generate exceptions in the file system level (this is expected).

3005

Miscellaneous tests for the RegEnumKeyEx API, such as out of range index, non existent subkeys, etc.

4001

Tests the RegEnumValue API. Tests enumerating values on the roots, regular keys and invalid keys.

4002

Tests the RegEnumValue API. Tests enumerating values with various indexes. Tests enumerating a large amount of values (4096) on each registry root.

"Note": On some hive-based systems with a small amount of memory, this test case might fail the first time it runs. The system needs to grow the system and user hive registry files dynamically. On a limited memory environment, the system might not grow it fast enough. When this happens, you could either try to re-run the test case or increase the default system and user hive file sizes.

4003

Tests the RegEnumValue API with invalid parameters. The function call should not succeed.

4004

Tests the RegEnumValue API with various registry types (string, DWORD, binary, etc.)

4005

Tests the RegEnumValue API with various buffer byte counts.

5001

Tests the RegOpenKeyEx API. Create registry keys and tests opening them (valid and invalid cases).

5002

Tests the RegOpenKeyEx API with various parameters (valid and invalid schemes).

6001

Tests the RegQueryInfoKey API with various class lengths.

6002

Tests the RegQueryInfoKey API on various sub-keys.

6003

Tests boundary conditions (size) of the RegQueryInfoKey API.

6004

Tests the RegQueryInfoKey API with various value names and sizes.

6005

Retrieves registry key information and verifies it.

6006

verifies the error handling functionality of the CeRegGetInfo API.

7001

Tests the RegSetValueEx API with various registry types, naming schemes, and different lengths.

7002

Tests the RegSetValueEx API. Tests case-insensitivity, various value types/names.

7003

Tests the RegSetValueEx API. Tests setting, getting, and deleting a large number of registry values (4096).

7004

Tests the RegSetValueEx API with non-null terminated strings, multi-strings, and unaligned multi-strings

7005

Tests the RegSetValueEx API with invalid parameters. The function call should not succeed.

8001

Tests the RegDeleteValue API. Tests basic registry-delete functionality.

8002

Tests the RegDeleteValue API with various naming schemes.

8003

Stress tests the RegDeleteValue API. Tests deleting many registry values. This test case will print out the memory information before and after the process. You can find out if there is any indication of memory leaks in the system by inspecting the logs on this test case.

8004

Tests the RegDeleteValue API with invalid parameters. The function call should not succeed.

9001

Tests the RegQueryValueEx API with valid and invalid key handles.

9002

Tests the RegQueryValueEx API on a non-existent value, NULL value, empty value, and non-null terminated value.

9003

Tests the RegQueryValueEx API on various registry types (string, DWORD, binary, etc.)

9004

Tests the RegQueryValueEx API with buffers with various count bytes. Tests a buffer overflow situation.

Setting Up the Test

This test has no additional requirements, beyond the standard test environment setup.

Running the Test

COMMAND LINE PARAMETERS

The Registry Build Verification Test executes the tux -o -d regtst command line on default execution.

The following table shows the optional command line parameters for the Registry API and Functionality Test.

Command Line Parameter

Description

-volatile

Runs test in volatile mode. Test cases 4002 and 7003 should not be run using this flag due to volatile registry space limitations.

Verifying the Test

When the test completes running, verify that "PASS" appears in the test log for all sub-tests.

Troubleshooting the Test

On some hive-based systems with a small amount of memory, test case 4002 might fail the first time it runs. The system needs to grow the system and user hive registry files dynamically. On a limited memory environment, the system might not grow it fast enough. When this happens, you could either try to re-run the test case or increase the default system and user hive file sizes.

See Also

Other Resources

File System Tests