Debian Codegraph @

src/mpt/crc/tests/tests_crc.hpp

raw
1 /* SPDX-License-Identifier: BSL-1.0 OR BSD-3-Clause */
2
3 #ifndef MPT_BASE_TESTS_CRC_HPP
4 #define MPT_BASE_TESTS_CRC_HPP
5
6
7
8 #include "mpt/base/detect_compiler.hpp"
9 #include "mpt/base/namespace.hpp"
10 #include "mpt/crc/crc.hpp"
11 #include "mpt/test/test.hpp"
12 #include "mpt/test/test_macros.hpp"
13
14 #include <string>
15
16
17
18 namespace mpt {
19 inline namespace MPT_INLINE_NS {
20
21
22
23 namespace tests {
24 namespace crc {
25
26 #if MPT_COMPILER_CLANG
27 #pragma clang diagnostic push
28 #pragma clang diagnostic ignored "-Wglobal-constructors"
29 #endif
30 MPT_TEST_GROUP_INLINE("mpt/crc")
31 #if MPT_COMPILER_CLANG
32 #pragma clang diagnostic pop
33 #endif
34 {
35 MPT_TEST_EXPECT_EQUAL(mpt::crc32(std::string("123456789")), 0xCBF43926u);
36 MPT_TEST_EXPECT_EQUAL(mpt::crc32_ogg(std::string("123456789")), 0x89a1897fu);
37 }
38
39 } // namespace crc
40 } // namespace tests
41
42
43
44 } // namespace MPT_INLINE_NS
45 } // namespace mpt
46
47
48
49 #endif // MPT_BASE_TESTS_CRC_HPP