mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
20 lines
529 B
C++
20 lines
529 B
C++
#include "storm/Atomic.hpp"
|
|
#include "test/Test.hpp"
|
|
|
|
TEST_CASE("SInterlockedDecrement", "[atomic]") {
|
|
SECTION("decrements value") {
|
|
ATOMIC32 value = 1;
|
|
auto decremented = SInterlockedDecrement(&value);
|
|
CHECK(value == 0);
|
|
CHECK(decremented == 0);
|
|
}
|
|
}
|
|
|
|
TEST_CASE("SInterlockedIncrement", "[atomic]") {
|
|
SECTION("increments value") {
|
|
ATOMIC32 value = 1;
|
|
auto incremented = SInterlockedIncrement(&value);
|
|
CHECK(value == 2);
|
|
CHECK(incremented == 2);
|
|
}
|
|
}
|