Skip to content
Mykhailo Sobko edited this page Sep 3, 2022 · 5 revisions

libmtds uses GoogleTest for executing tests.

Container tests

container_tests.cpp contains generic container tests, which are later used for each separate data structure.

There are two types of tests: endurance and producer-consumer:

  • endurance_test gradually fills the queue and empties it in 2 phases:
    1. Four out of each five operations are pushes, and the remaining are pops
    2. All pops
  • producer_consumer_test simultaneously fills the queue and empties it. It is a more realistic representation of containers' workload

The above tests use std::this_thread::sleep_for for a random duration after each operation to simulate a realistic environment.

Tagged pointer tests

tagged_ptr_test.cpp checks whether TaggedPtr constructor and ptr and tag getters work correctly. It is easy to shoot yourself in the foot with such bitwise operations ;)

Related sources:

GoogleTest:

Clone this wiki locally