The library contains a single comprehensive regression test. For a given container type in pb_ds, the test creates an object of the container type and an object of the corresponding STL type (e.g., std::set). It then performs a random sequence of methods with random arguments (e.g., inserts, erases, and so forth) on both objects. At each operation, the test checks the return value of the method, and optionally both compares pb_ds's object with the STL's object as well as performing other consistency checks on pb_ds's object (e.g., order preservation, when applicable, or node invariants, when applicable).
Additionally, the test integrally checks exception safety and resource leaks. This is done as follows. A special allocator type, written for the purpose of the test, both randomly throws an exceptions when allocations are performed, and tracks allocations and de-allocations. The exceptions thrown at allocations simulate memory-allocation failures; the tracking mechanism checks for memory-related bugs (e.g., resource leaks and multiple de-allocations). Both pb_ds's containers and the containers' value-types are configured to use this allocator.
Due to compiler constraints, the test is split into the several sources, each checking only some containers.
The following check all "set" types:
The following check all "map" types: