2020-10-08 13:38:31 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-10-08 13:38:31 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <AK/TestSuite.h>
|
|
|
|
|
|
|
|
#include <AK/Endian.h>
|
|
|
|
|
|
|
|
static_assert(BigEndian<u32> {} == 0, "Big endian values should be default constructed in a constexpr context.");
|
|
|
|
|
|
|
|
static_assert(BigEndian<u32> { 42 } == 42, "Big endian values should be value constructed in a constexpr context.");
|
|
|
|
|
|
|
|
static_assert(LittleEndian<u32> {} == 0, "Little endian values should be default constructed in a constexpr context.");
|
|
|
|
|
|
|
|
static_assert(LittleEndian<u32> { 42 } == 42, "Little endian values should be value constructed in a constexpr context.");
|
|
|
|
|
|
|
|
TEST_MAIN(Endian);
|