Logo
Explore Help
Register Sign In
Firehawk52-backup/dolphin
28
0
Fork 0
You've already forked dolphin
mirror of https://github.com/dolphin-emu/dolphin.git synced 2026-01-16 08:53:16 -03:00
Code Issues Actions Packages Projects Releases Wiki Activity
Files
ebdcddfcd033b1069dc1010f233c19c419680674
dolphin/Source/UnitTests/Common/SwapTest.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
406 B
C++
Raw Normal View History

Common: Move byte swapping utilities into their own header This moves all the byte swapping utilities into a header named Swap.h. A dedicated header is much more preferable here due to the size of the code itself. In general usage throughout the codebase, CommonFuncs.h was generally only included for these functions anyway. These being in their own header avoids dumping the lesser used utilities into scope. As well as providing a localized area for more utilities related to byte swapping in the future (should they be needed). This also makes it nicer to identify which files depend on the byte swapping utilities in particular. Since this is a completely new header, moving the code uncovered a few indirect includes, as well as making some other inclusions unnecessary.
2017-03-03 14:43:52 -05:00
// 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));
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.3 Page: 107ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API