1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fix comments

This commit is contained in:
bolero-MURAKAMI 2016-04-05 18:21:13 +09:00
parent a0060119ab
commit 8dc640a6e2
23 changed files with 136 additions and 134 deletions

View file

@ -16,31 +16,31 @@
#include <testspr/tools.hpp>
namespace testspr {
static void endian_test() {
using namespace sprout;
static void endian_test() {
using namespace sprout;
{ // 16
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint16_t(0x0A1B)) == std::uint16_t(0x1B0A));
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint16_t(0x1B0A)) == std::uint16_t(0x0A1B));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint16_t(0x0A1B)) == std::uint16_t(0x1B0A));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint16_t(0x1B0A)) == std::uint16_t(0x0A1B));
}
{ // 16
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint16_t(0x0A1B)) == std::uint16_t(0x1B0A));
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint16_t(0x1B0A)) == std::uint16_t(0x0A1B));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint16_t(0x0A1B)) == std::uint16_t(0x1B0A));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint16_t(0x1B0A)) == std::uint16_t(0x0A1B));
}
{ // 32
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint32_t(0x0A1B2C3D)) == std::uint32_t(0x3D2C1B0A));
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint32_t(0x3D2C1B0A)) == std::uint32_t(0x0A1B2C3D));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint32_t(0x0A1B2C3D)) == std::uint32_t(0x1B0A3D2C));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint32_t(0x1B0A3D2C)) == std::uint32_t(0x0A1B2C3D));
}
{ // 32
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint32_t(0x0A1B2C3D)) == std::uint32_t(0x3D2C1B0A));
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint32_t(0x3D2C1B0A)) == std::uint32_t(0x0A1B2C3D));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint32_t(0x0A1B2C3D)) == std::uint32_t(0x1B0A3D2C));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint32_t(0x1B0A3D2C)) == std::uint32_t(0x0A1B2C3D));
}
{ // 64
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint64_t(0x0A1B2C3D4E5F6A7B)) == std::uint64_t(0x7B6A5F4E3D2C1B0A));
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint64_t(0x7B6A5F4E3D2C1B0A)) == std::uint64_t(0x0A1B2C3D4E5F6A7B));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint64_t(0x0A1B2C3D4E5F6A7B)) == std::uint64_t(0x1B0A3D2C5F4E7B6A));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint64_t(0x1B0A3D2C5F4E7B6A)) == std::uint64_t(0x0A1B2C3D4E5F6A7B));
}
}
} // namespace testspr
{ // 64
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint64_t(0x0A1B2C3D4E5F6A7B)) == std::uint64_t(0x7B6A5F4E3D2C1B0A));
TESTSPR_ASSERT(sprout::net::detail::reverse(std::uint64_t(0x7B6A5F4E3D2C1B0A)) == std::uint64_t(0x0A1B2C3D4E5F6A7B));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint64_t(0x0A1B2C3D4E5F6A7B)) == std::uint64_t(0x1B0A3D2C5F4E7B6A));
TESTSPR_ASSERT(sprout::net::detail::reverse_words(std::uint64_t(0x1B0A3D2C5F4E7B6A)) == std::uint64_t(0x0A1B2C3D4E5F6A7B));
}
}
} // namespace testspr
#ifndef TESTSPR_CPP_INCLUDE
# define TESTSPR_TEST_FUNCTION testspr::endian_test

View file

@ -17,7 +17,7 @@
int
main(){
//
// String literal to Sprout.String
//
@ -30,7 +30,7 @@ main(){
static_assert(str2 == L"ほむほむ", "");
static_assert(std::is_same<decltype(str2), sprout::wstring<4> const>{}, "");
}
//
// Integer literal to Sprout.String
//
@ -38,7 +38,7 @@ main(){
static constexpr auto str = sprout::to_string(42);
static_assert(str == "42", "");
}
//
// Float literal to Sprout.String
//

View file

@ -28,7 +28,7 @@ main(){
// __TIME__ to Sprout.String
//
static constexpr auto time = sprout::to_string(__TIME__);
// static constexpr auto time = sprout::to_string("23:22:45");
// static constexpr auto time = sprout::to_string("23:22:45");
//
@ -43,13 +43,13 @@ main(){
// get result
//
static constexpr sprout::array<long long int, 3> result_attr = result.attr();
static constexpr auto hour = result_attr[0];
static constexpr auto hour = result_attr[0];
static constexpr auto minute = result_attr[1];
static constexpr auto second = result_attr[2];
static constexpr auto second = result_attr[2];
// static_assert(hour == 23, "");
// static_assert(minute == 22, "");
// static_assert(second == 45, "");
// static_assert(hour == 23, "");
// static_assert(minute == 22, "");
// static_assert(second == 45, "");
std::cout << hour << std::endl;
std::cout << minute << std::endl;