summaryrefslogtreecommitdiff
path: root/Source/UnitTests/Common/SwapTest.cpp
blob: b44a6efa50214a20ac950ba83625739346e54311 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.

#include <gtest/gtest.h>

#include "Common/Swap.h"

TEST(Swap, SwapByValue)
{
  EXPECT_EQ(0xf0, Common::swap8(0xf0));
  EXPECT_EQ(0x1234, Common::swap16(0x3412));
  EXPECT_EQ(0x12345678u, Common::swap32(0x78563412));
  EXPECT_EQ(0x123456789abcdef0ull, Common::swap64(0xf0debc9a78563412ull));
}