blob: 6edab093830b5b9a38a14f45da2c0d22529b512c [file] [log] [blame]
// Part of the Crubit project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "support/internal/memswap.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
namespace {
TEST(MemSwapTest, Basic) {
int a = 123;
int b = 456;
crubit::MemSwap(a, b);
EXPECT_EQ(a, 456);
EXPECT_EQ(b, 123);
}
TEST(MemSwapTest, Aliasing) {
int a = 123;
crubit::MemSwap(a, a);
EXPECT_EQ(a, 123);
}
} // namespace