2020-10-08 10:38:31 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-10-08 10:38:31 -03:00
|
|
|
*/
|
|
|
|
|
|
2021-04-25 02:53:23 -03:00
|
|
|
#include <LibTest/TestCase.h>
|
2020-10-08 10:38:31 -03:00
|
|
|
|
|
|
|
|
#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.");
|