-
Notifications
You must be signed in to change notification settings - Fork 0
Tests
Mykhailo Sobko edited this page Sep 3, 2022
·
5 revisions
libmtds
uses GoogleTest for executing 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:- Four out of each five operations are
push
es, and the remaining arepop
s - All
pop
s
- Four out of each five operations are
-
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_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 ;)
GoogleTest:
- Source code: https://github.com/google/googletest
- Generic build instructions: https://github.com/google/googletest/blob/main/googletest/README.md#generic-build-instructions
- Use with CMake: https://google.github.io/googletest/quickstart-cmake.html
- User guide: https://google.github.io/googletest/primer.html