15 EXPECT_EQ(
static_cast<uintptr_t
>(42), v.
fetch_add(1));
16 EXPECT_EQ(
static_cast<uintptr_t
>(43), v);
21 EXPECT_EQ(
static_cast<uintptr_t
>(42), v.
fetch_sub(1));
22 EXPECT_EQ(
static_cast<uintptr_t
>(41), v);
27 EXPECT_EQ(
static_cast<intptr_t
>(-42), v.
fetch_add(1));
28 EXPECT_EQ(
static_cast<intptr_t
>(-41), v);
33 EXPECT_EQ(
static_cast<intptr_t
>(-42), v.
fetch_sub(1));
34 EXPECT_EQ(
static_cast<intptr_t
>(-43), v);
40 EXPECT_EQ(
static_cast<intptr_t
>(142), v);
46 EXPECT_EQ(
static_cast<intptr_t
>(1), v);
52 EXPECT_EQ(
static_cast<uint32_t
>(42), previous);
53 EXPECT_EQ(
static_cast<uint32_t
>(43), v);
59 EXPECT_EQ(
static_cast<uint32_t
>(42), previous);
60 EXPECT_EQ(
static_cast<uint32_t
>(2), v);
65 EXPECT_EQ(
static_cast<uword>(42), v.
load());
71 uword new_value = 100;
73 EXPECT_EQ(
true, success);
74 EXPECT_EQ(
static_cast<uword>(42), old_value);
78 EXPECT_EQ(
false, success);
79 EXPECT_EQ(
static_cast<uword>(100), old_value);
83 uint32_t old_value = 42;
85 uint32_t new_value = 100;
87 EXPECT_EQ(
true, success);
88 EXPECT_EQ(
static_cast<uword>(42), old_value);
92 EXPECT_EQ(
false, success);
93 EXPECT_EQ(
static_cast<uword>(100), old_value);
T load(std::memory_order order=std::memory_order_relaxed) const
bool compare_exchange_strong(T &expected, T desired, std::memory_order order=std::memory_order_relaxed)
T fetch_add(T arg, std::memory_order order=std::memory_order_relaxed)
T fetch_and(T arg, std::memory_order order=std::memory_order_relaxed)
T fetch_or(T arg, std::memory_order order=std::memory_order_relaxed)
T fetch_sub(T arg, std::memory_order order=std::memory_order_relaxed)
static T LoadRelaxed(const T *ptr)
TEST_CASE(DirectoryCurrent)
VM_UNIT_TEST_CASE(DirectoryCurrentNoScope)