Share via


Test Cases for the Storage Device Block Driver Read/Write Test (Windows Embedded CE 6.0)

1/6/2010

The following table shows the test cases for the Storage Device Block Driver Read/Write Test.

Test cases Description

1001

Two threads, 1000 writes/thread, 1 sector/thread, starting sector: 100

Verifies that a device driver is able to correctly handle multiple, simultaneous requests for service. The test case creates two threads and assigns each thread a block of sectors to write, starting at sector 100. Each thread attempts to write to its block of sectors multiple times. Each thread makes 1000 writes to its sector.

The test displays information such as the number of threads, number of writes per thread, number of sectors per write, and the starting sector. The test also displays a progress indicator for each thread. The test fails if an error occurs. The test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

1002

Three threads

Verifies that a device driver is able to correctly handle multiple, simultaneous requests for service. The test case creates three threads and assigns each thread a block of sectors to write, starting at sector 100. Each thread attempts to write to its block of sectors multiple times. Each thread makes 1000 writes to its sector.

The test displays information such as the number of threads, number of writes per thread, number of sectors per write, and the starting sector. The test also displays a progress indicator for each thread. The test fails if an error occurs. The test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

1003

Four threads

Verifies that a device driver is able to correctly handle multiple, simultaneous requests for service. The test case creates four threads and assigns each thread a block of sectors to write, starting at sector 100. Each thread attempts to write to its block of sectors multiple times. Each thread makes 1000 writes to its sector.

The test displays information such as the number of threads, number of writes per thread, number of sectors per write, and the starting sector. The test also displays a progress indicator for each thread. The test fails if an error occurs. The test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

2001

Buffer Sizes: 512

Verifies that the block device driver can correctly handle scatter/gather buffers that are 512 bytes in size. This test verifies that the device driver does not return an error and that the data is valid. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

2002

Buffer Sizes: 512, 512

Verifies that the block device driver can correctly handle two scatter/gather buffers that are 1024 bytes in size. This test verifies that the device driver does not return an error and that the data is valid. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

2003

Buffer Sizes: 1024, 1024, 1024, 1024

Verifies that the block device driver can correctly handle four scatter/gather buffers that are 1024 bytes in size. This test verifies that the device driver does not return an error and that the data is valid. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

2004

Buffer Sizes: 65536

Verifies that the block device driver can correctly handle scatter/gather buffers that are 65536 bytes in size. This test verifies that the device driver does not return an error and that the data is valid. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

3001

R/W Sectors 0, 1 and 2

Assesses the behavior of read and write operations at boundary sectors 0, 1, and 2, where errors often occur. This test case provides a detailed description of the number and location of each DeviceIoControl function. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

3002

R/W Around (Total Sectors / 2)

Assesses the behavior of read and write operations at boundary sectors where errors often occur. This test case provides a detailed description of the number and location of each DeviceIoControl function. If an error occurs, the test displays the type of error, such as a driver error or corrupt data, and the source of the error, such as a driver or memory location.

Test cases 2001-2004 assume a sector size of 512 bytes. If the device driver uses a different sector size, you must change the source code for the test to reflect the correct sector size.

Test cases 2001-2004 fill in the SG_BUF and SG_REQ structures and pass pointers to the device driver through the DeviceIoControl function. The following code example shows the syntax for these structures.

typedef struct _SG_BUF {

PUCHAR sb_buf; // pointer to buffer

DWORD sb_len; // length of buffer

} SG_BUF, *PSG_BUF;

typedef struct _SG_REQ {

DWORD sr_start; // starting sector number

DWORD sr_num_sec; // number of sectors

DWORD sr_num_sg; // number of scatter/gather buffers

DWORD sr_status; // request status

PFN_REQDONE sr_callback; // request completion callback function

SG_BUF sr_sglist[1]; // first scatter/gather buffer

} SG_REQ, * PSG_REQ;

Test cases 2001-2004 may fill in additional sr_sglist entries, according to the value of sr_num_sg.

See Also

Other Resources

Storage Device Block Driver Read/Write Test