mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
Implemented C++1Y proposal N3620
This commit is contained in:
parent
3fb83e0fbe
commit
634bd89d9e
6 changed files with 176 additions and 1 deletions
|
@ -1,2 +1,2 @@
|
|||
subdirs( algorithm array bitset cstring optional random string tuple utility variant weed )
|
||||
subdirs( algorithm array bitset cstring net optional random string tuple utility variant weed )
|
||||
#subdirs( algorithm array bitset cstring optional random )
|
||||
|
|
1
libs/net/CMakeLists.txt
Normal file
1
libs/net/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
|||
subdirs( test )
|
3
libs/net/test/CMakeLists.txt
Normal file
3
libs/net/test/CMakeLists.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
add_executable( libs_net_test_endian endian.cpp )
|
||||
set_target_properties( libs_net_test_endian PROPERTIES OUTPUT_NAME "endian" )
|
||||
add_test( libs_net_test_endian endian )
|
37
libs/net/test/endian.cpp
Normal file
37
libs/net/test/endian.cpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*=============================================================================
|
||||
Copyright (c) 2011-2014 Bolero MURAKAMI
|
||||
https://github.com/bolero-MURAKAMI/Sprout
|
||||
|
||||
Copyright (c) 2014 Chris KAY
|
||||
https://github.com/cjkay-cpp-utils/Sprout
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
#ifndef SPROUT_LIBS_NET_TEST_ENDIAN_CPP
|
||||
#define SPROUT_LIBS_NET_TEST_ENDIAN_CPP
|
||||
|
||||
#include <sprout/net/endian.hpp>
|
||||
#include <testspr/tools.hpp>
|
||||
#include <iostream>
|
||||
|
||||
namespace testspr {
|
||||
static void endian_test() {
|
||||
using namespace sprout;
|
||||
|
||||
{
|
||||
TESTSPR_ASSERT(sprout::net::detail::reverse(0xDEADBEEF) == 0xEFBEADDE);
|
||||
TESTSPR_ASSERT(sprout::net::detail::reverse(0xEFBEADDE) == 0xDEADBEEF);
|
||||
|
||||
TESTSPR_ASSERT(sprout::net::detail::reverse_words(0xDEADBEEF) == 0xADDEEFBE);
|
||||
TESTSPR_ASSERT(sprout::net::detail::reverse_words(0xADDEEFBE) == 0xDEADBEEF);
|
||||
}
|
||||
}
|
||||
} // namespace testspr
|
||||
|
||||
#ifndef TESTSPR_CPP_INCLUDE
|
||||
# define TESTSPR_TEST_FUNCTION testspr::endian_test
|
||||
# include <testspr/include_main.hpp>
|
||||
#endif
|
||||
|
||||
#endif // #ifndef SPROUT_LIBS_NET_TEST_ENDIAN_CPP
|
Loading…
Add table
Add a link
Reference in a new issue