diff options
Diffstat (limited to 'libs/endian/test')
33 files changed, 5764 insertions, 0 deletions
diff --git a/libs/endian/test/Jamfile.v2 b/libs/endian/test/Jamfile.v2 new file mode 100644 index 000000000..16d796ab6 --- /dev/null +++ b/libs/endian/test/Jamfile.v2 @@ -0,0 +1,28 @@ +# Boost Endian Library test Jamfile + +# Copyright Beman Dawes 2006, 2013 + +# Distributed under the Boost Software License, Version 1.0. +# See http://www.boost.org/LICENSE_1_0.txt + +# See library home page at http://www.boost.org/libs/endian + +project + : requirements + <toolset>msvc:<asynch-exceptions>on + ; + + test-suite "endian" + : + [ run buffer_test.cpp # sources + : # command line + : # input files + : # requirements + : # target name + ] + [ run endian_test.cpp ] + [ run endian_operations_test.cpp ] + [ run endian_in_union_test.cpp ] + [ run conversion_test.cpp ] +# [ run floating_point_test.cpp : : : <test-info>always_show_run_output ] + ; diff --git a/libs/endian/test/benchmark.cpp b/libs/endian/test/benchmark.cpp new file mode 100644 index 000000000..d3389cd38 --- /dev/null +++ b/libs/endian/test/benchmark.cpp @@ -0,0 +1,233 @@ +// benchmark.cpp ---------------------------------------------------------------------// + +// Copyright Beman Dawes 2011 + +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +#ifndef _SCL_SECURE_NO_WARNINGS +# define _SCL_SECURE_NO_WARNINGS +#endif + +#ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +#endif + +#include <cstdlib> +#include <boost/endian/conversion.hpp> +#include <boost/random.hpp> +#include <boost/cstdint.hpp> +#include <boost/timer/timer.hpp> +#include <iostream> +#include <string> + +using namespace boost; +using std::cout; +using std::cerr; +using std::endl; +using std::vector; + +namespace +{ + std::string command_args; + long long n_cases; + int places = 2; + bool verbose (false); + +#ifndef BOOST_TWO_ARG + typedef int32_t (*timee_func)(int32_t); +#else + typedef void (*timee_func)(int32_t, int32_t&); +#endif + + typedef boost::timer::nanosecond_type nanosecond_t; + +//--------------------------------------------------------------------------------------// + + nanosecond_t benchmark(timee_func timee, const char* msg, + nanosecond_t overhead = 0) + // Returns: total cpu time (i.e. system time + user time) + { + if (verbose) + cout << "\nRunning benchmark..." << endl; + int64_t sum = 0; + boost::timer::cpu_times times; + nanosecond_t cpu_time; + boost::timer::auto_cpu_timer t(places); + + for (long long i = n_cases; i; --i) + { +# ifndef BOOST_TWO_ARG + sum += timee(static_cast<int32_t>(i)) ; +# else + int32_t y; + timee(static_cast<int32_t>(i), y); + sum += y; +# endif + } + t.stop(); + times = t.elapsed(); + cpu_time = (times.system + times.user) - overhead; + const long double sec = 1000000000.0L; + cout.setf(std::ios_base::fixed, std::ios_base::floatfield); + cout.precision(places); + cout << msg << " " << cpu_time / sec << endl; + + if (verbose) + { + t.report(); + cout << " Benchmark complete\n" + " sum is " << sum << endl; + } + return cpu_time; + } + + void process_command_line(int argc, char * argv[]) + { + for (int a = 0; a < argc; ++a) + { + command_args += argv[a]; + if (a != argc-1) + command_args += ' '; + } + + cout << command_args << '\n';; + + if (argc >=2) +#ifndef _MSC_VER + n_cases = std::atoll(argv[1]); +#else + n_cases = _atoi64(argv[1]); +#endif + + for (; argc > 2; ++argv, --argc) + { + if ( *(argv[2]+1) == 'p' ) + places = atoi( argv[2]+2 ); + else if ( *(argv[2]+1) == 'v' ) + verbose = true; + else + { + cout << "Error - unknown option: " << argv[2] << "\n\n"; + argc = -1; + break; + } + } + + if (argc < 2) + { + cout << "Usage: benchmark n [Options]\n" + " The argument n specifies the number of test cases to run\n" + " Options:\n" + " -v Verbose messages\n" + " -p# Decimal places for times; default -p" << places << "\n"; + return std::exit(1); + } + } + + inline void inplace(int32_t& x) + { + x = (static_cast<uint32_t>(x) << 24) + | ((static_cast<uint32_t>(x) << 8) & 0x00ff0000) + | ((static_cast<uint32_t>(x) >> 8) & 0x0000ff00) + | (static_cast<uint32_t>(x) >> 24); + } + + inline int32_t by_return(int32_t x) + { + return (static_cast<uint32_t>(x) << 24) + | ((static_cast<uint32_t>(x) << 8) & 0x00ff0000) + | ((static_cast<uint32_t>(x) >> 8) & 0x0000ff00) + | (static_cast<uint32_t>(x) >> 24); + } + + inline int32_t by_return_intrinsic(int32_t x) + { + return BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(static_cast<uint32_t>(x)); + } + + inline int32_t by_return_pyry(int32_t x) + { + uint32_t step16; + step16 = static_cast<uint32_t>(x) << 16 | static_cast<uint32_t>(x) >> 16; + return + ((static_cast<uint32_t>(step16) << 8) & 0xff00ff00) + | ((static_cast<uint32_t>(step16) >> 8) & 0x00ff00ff); + } + + inline int32_t two_operand(int32_t x, int32_t& y) + { + return y = ((x << 24) & 0xff000000) | ((x << 8) & 0x00ff0000) | ((x >> 24) & 0x000000ff) + | ((x >> 8) & 0x0000ff00); + } + + inline int32_t modify_noop(int32_t x) + { + int32_t v(x); + return v; + } + + inline int32_t modify_inplace(int32_t x) + { + int32_t v(x); + inplace(v); + return v; + } + + inline int32_t modify_by_return(int32_t x) + { + int32_t v(x); + return by_return(v); + } + + inline int32_t modify_by_return_pyry(int32_t x) + { + int32_t v(x); + return by_return_pyry(v); + } + + inline int32_t modify_by_return_intrinsic(int32_t x) + { + int32_t v(x); + return by_return_intrinsic(v); + } + + inline void non_modify_assign(int32_t x, int32_t& y) + { + y = x; + } + + inline void non_modify_two_operand(int32_t x, int32_t& y) + { + two_operand(x, y); + } + + inline void non_modify_by_return(int32_t x, int32_t& y) + { + y = by_return(x); + } + +} // unnamed namespace + +//-------------------------------------- main() ---------------------------------------// + +int main(int argc, char * argv[]) +{ + process_command_line(argc, argv); + + nanosecond_t overhead; + +#ifndef BOOST_TWO_ARG + overhead = benchmark(modify_noop, "modify no-op"); + benchmark(modify_inplace, "modify in place"/*, overhead*/); + benchmark(modify_by_return, "modify by return"/*, overhead*/); + benchmark(modify_by_return_pyry, "modify by return_pyry"/*, overhead*/); + benchmark(modify_by_return_intrinsic, "modify by return_intrinsic"/*, overhead*/); +#else + overhead = benchmark(non_modify_assign, "non_modify_assign "); + benchmark(non_modify_two_operand, "non_modify_two_operand", overhead); + benchmark(non_modify_by_return, "non_modify_by_return ", overhead); +#endif + + return 0; +} diff --git a/libs/endian/test/buffer_test.cpp b/libs/endian/test/buffer_test.cpp new file mode 100644 index 000000000..a04396ee3 --- /dev/null +++ b/libs/endian/test/buffer_test.cpp @@ -0,0 +1,183 @@ +// buffer_test.cpp -------------------------------------------------------------------// + +// Copyright Beman Dawes 2014 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +// See library home page at http://www.boost.org/libs/endian + +//--------------------------------------------------------------------------------------// + +#include <boost/endian/detail/disable_warnings.hpp> + +//#define BOOST_ENDIAN_LOG +#include <boost/endian/buffers.hpp> +#include <boost/detail/lightweight_main.hpp> +#include <boost/core/lightweight_test.hpp> +#include <boost/cstdint.hpp> +#include <iostream> +#include <sstream> + +using namespace boost::endian; +using std::cout; +using std::endl; + +namespace +{ + + // check_size ------------------------------------------------------------// + + void check_size() + { + + BOOST_TEST_EQ(sizeof(big_int8_buf_t), 1u); + BOOST_TEST_EQ(sizeof(big_int16_buf_t), 2u); + BOOST_TEST_EQ(sizeof(big_int24_buf_t), 3u); + BOOST_TEST_EQ(sizeof(big_int32_buf_t), 4u); + BOOST_TEST_EQ(sizeof(big_int40_buf_t), 5u); + BOOST_TEST_EQ(sizeof(big_int48_buf_t), 6u); + BOOST_TEST_EQ(sizeof(big_int56_buf_t), 7u); + BOOST_TEST_EQ(sizeof(big_int64_buf_t), 8u); + + BOOST_TEST_EQ(sizeof(big_uint8_buf_t), 1u); + BOOST_TEST_EQ(sizeof(big_uint16_buf_t), 2u); + BOOST_TEST_EQ(sizeof(big_uint24_buf_t), 3u); + BOOST_TEST_EQ(sizeof(big_uint32_buf_t), 4u); + BOOST_TEST_EQ(sizeof(big_uint40_buf_t), 5u); + BOOST_TEST_EQ(sizeof(big_uint48_buf_t), 6u); + BOOST_TEST_EQ(sizeof(big_uint56_buf_t), 7u); + BOOST_TEST_EQ(sizeof(big_uint64_buf_t), 8u); + + BOOST_TEST_EQ(sizeof(little_int8_buf_t), 1u); + BOOST_TEST_EQ(sizeof(little_int16_buf_t), 2u); + BOOST_TEST_EQ(sizeof(little_int24_buf_t), 3u); + BOOST_TEST_EQ(sizeof(little_int32_buf_t), 4u); + BOOST_TEST_EQ(sizeof(little_int40_buf_t), 5u); + BOOST_TEST_EQ(sizeof(little_int48_buf_t), 6u); + BOOST_TEST_EQ(sizeof(little_int56_buf_t), 7u); + BOOST_TEST_EQ(sizeof(little_int64_buf_t), 8u); + + BOOST_TEST_EQ(sizeof(little_uint8_buf_t), 1u); + BOOST_TEST_EQ(sizeof(little_uint16_buf_t), 2u); + BOOST_TEST_EQ(sizeof(little_uint24_buf_t), 3u); + BOOST_TEST_EQ(sizeof(little_uint32_buf_t), 4u); + BOOST_TEST_EQ(sizeof(little_uint40_buf_t), 5u); + BOOST_TEST_EQ(sizeof(little_uint48_buf_t), 6u); + BOOST_TEST_EQ(sizeof(little_uint56_buf_t), 7u); + BOOST_TEST_EQ(sizeof(little_uint64_buf_t), 8u); + + BOOST_TEST_EQ(sizeof(native_int8_buf_t), 1u); + BOOST_TEST_EQ(sizeof(native_int16_buf_t), 2u); + BOOST_TEST_EQ(sizeof(native_int24_buf_t), 3u); + BOOST_TEST_EQ(sizeof(native_int32_buf_t), 4u); + BOOST_TEST_EQ(sizeof(native_int40_buf_t), 5u); + BOOST_TEST_EQ(sizeof(native_int48_buf_t), 6u); + BOOST_TEST_EQ(sizeof(native_int56_buf_t), 7u); + BOOST_TEST_EQ(sizeof(native_int64_buf_t), 8u); + + BOOST_TEST_EQ(sizeof(native_uint8_buf_t), 1u); + BOOST_TEST_EQ(sizeof(native_uint16_buf_t), 2u); + BOOST_TEST_EQ(sizeof(native_uint24_buf_t), 3u); + BOOST_TEST_EQ(sizeof(native_uint32_buf_t), 4u); + BOOST_TEST_EQ(sizeof(native_uint40_buf_t), 5u); + BOOST_TEST_EQ(sizeof(native_uint48_buf_t), 6u); + BOOST_TEST_EQ(sizeof(native_uint56_buf_t), 7u); + BOOST_TEST_EQ(sizeof(native_uint64_buf_t), 8u); + + BOOST_TEST_EQ(sizeof(big_int8_buf_at), 1u); + BOOST_TEST_EQ(sizeof(big_int16_buf_at), 2u); + BOOST_TEST_EQ(sizeof(big_int32_buf_at), 4u); + BOOST_TEST_EQ(sizeof(big_int64_buf_at), 8u); + + BOOST_TEST_EQ(sizeof(big_uint8_buf_at), 1u); + BOOST_TEST_EQ(sizeof(big_uint16_buf_at), 2u); + BOOST_TEST_EQ(sizeof(big_uint32_buf_at), 4u); + BOOST_TEST_EQ(sizeof(big_uint64_buf_at), 8u); + + BOOST_TEST_EQ(sizeof(little_int8_buf_at), 1u); + BOOST_TEST_EQ(sizeof(little_int16_buf_at), 2u); + BOOST_TEST_EQ(sizeof(little_int32_buf_at), 4u); + BOOST_TEST_EQ(sizeof(little_int64_buf_at), 8u); + + BOOST_TEST_EQ(sizeof(little_uint8_buf_at), 1u); + BOOST_TEST_EQ(sizeof(little_uint16_buf_at), 2u); + BOOST_TEST_EQ(sizeof(little_uint32_buf_at), 4u); + BOOST_TEST_EQ(sizeof(little_uint64_buf_at), 8u); + } // check_size + + // test_inserter_and_extractor -----------------------------------------------------// + + void test_inserter_and_extractor() + { + std::cout << "test inserter and extractor..." << std::endl; + + big_uint64_buf_t bu64(0x010203040506070ULL); + little_uint64_buf_t lu64(0x010203040506070ULL); + + boost::uint64_t x; + + std::stringstream ss; + + ss << bu64; + ss >> x; + BOOST_TEST_EQ(x, 0x010203040506070ULL); + + ss.clear(); + ss << lu64; + ss >> x; + BOOST_TEST_EQ(x, 0x010203040506070ULL); + + ss.clear(); + ss << 0x010203040506070ULL; + big_uint64_buf_t bu64z(0); + ss >> bu64z; + BOOST_TEST_EQ(bu64z.value(), bu64.value()); + + ss.clear(); + ss << 0x010203040506070ULL; + little_uint64_buf_t lu64z(0); + ss >> lu64z; + BOOST_TEST_EQ(lu64z.value(), lu64.value()); + + std::cout << "test inserter and extractor complete" << std::endl; + + } + +} // unnamed namespace + +//--------------------------------------------------------------------------------------// + +int cpp_main(int, char *[]) +{ + cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl; + + cout << " construct big endian aligned" << endl; + big_int32_buf_at x(1122334455); + + cout << " assign to buffer from built-in integer" << endl; + x = 1234567890; + + cout << " operator==(buffer.value(), built-in)" << endl; + bool b1(x.value() == 1234567890); + BOOST_TEST(b1); + + cout << " construct little endian unaligned" << endl; + little_int32_buf_t x2(1122334455); + + cout << " assign to buffer from built-in integer" << endl; + x2 = 1234567890; + + cout << " operator==(buffer.value(), built-in)" << endl; + bool b2(x2.value() == 1234567890); + BOOST_TEST(b2); + + check_size(); + test_inserter_and_extractor(); + + cout << " done" << endl; + + return ::boost::report_errors(); +} + +#include <boost/endian/detail/disable_warnings_pop.hpp> diff --git a/libs/endian/test/conversion_test.cpp b/libs/endian/test/conversion_test.cpp new file mode 100644 index 000000000..632bc7960 --- /dev/null +++ b/libs/endian/test/conversion_test.cpp @@ -0,0 +1,371 @@ +// conversion_test.cpp ---------------------------------------------------------------// + +// Copyright Beman Dawes 2010 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +//--------------------------------------------------------------------------------------// + +#include <boost/endian/detail/disable_warnings.hpp> + +#include <boost/endian/conversion.hpp> +#include <boost/detail/lightweight_main.hpp> +#include <boost/core/lightweight_test.hpp> +#include <iostream> +#include <cstring> + +namespace be = boost::endian; +using std::cout; +using std::endl; +using boost::int8_t; +using boost::uint8_t; +using boost::int16_t; +using boost::uint16_t; +using boost::int32_t; +using boost::uint32_t; +using boost::int64_t; +using boost::uint64_t; + +namespace +{ + + // values for tests + + void native_value(int8_t& x) {x = static_cast<int8_t>(0xF0U);} + void native_value(uint8_t& x) {x = static_cast<uint8_t>(0xF0U);} +# ifdef BOOST_BIG_ENDIAN + void big_value(int8_t& x) {x = static_cast<int8_t>(0xF0U);} + void big_value(uint8_t& x) {x = static_cast<uint8_t>(0xF0U);} + void little_value(int8_t& x) {x = static_cast<int8_t>(0xF0U);} + void little_value(uint8_t& x) {x = static_cast<uint8_t>(0xF0U);} +# else + void big_value(int8_t& x) {x = static_cast<int8_t>(0xF0U);} + void big_value(uint8_t& x) {x = static_cast<uint8_t>(0xF0U);} + void little_value(int8_t& x) {x = static_cast<int8_t>(0xF0U);} + void little_value(uint8_t& x) {x = static_cast<uint8_t>(0xF0U);} +# endif + + void native_value(int16_t& x) {x = static_cast<int16_t>(0xF102U);} + void native_value(uint16_t& x) {x = static_cast<uint16_t>(0xF102U);} +# ifdef BOOST_BIG_ENDIAN + void big_value(int16_t& x) {x = static_cast<int16_t>(0xF102U);} + void big_value(uint16_t& x) {x = static_cast<uint16_t>(0xF102U);} + void little_value(int16_t& x) {x = static_cast<int16_t>(0x02F1U);} + void little_value(uint16_t& x) {x = static_cast<uint16_t>(0x02F1U);} +# else + void big_value(int16_t& x) {x = static_cast<int16_t>(0x02F1U);} + void big_value(uint16_t& x) {x = static_cast<uint16_t>(0x02F1U);} + void little_value(int16_t& x) {x = static_cast<int16_t>(0xF102U);} + void little_value(uint16_t& x) {x = static_cast<uint16_t>(0xF102U);} +# endif + + void native_value(int32_t& x) {x = static_cast<int32_t>(0xF1E21304UL);} + void native_value(uint32_t& x) {x = static_cast<uint32_t>(0xF1E21304UL);} +# ifdef BOOST_BIG_ENDIAN + void big_value(int32_t& x) {x = static_cast<int32_t>(0xF1E21304UL);} + void big_value(uint32_t& x) {x = static_cast<uint32_t>(0xF1E21304UL);} + void little_value(int32_t& x) {x = static_cast<int32_t>(0x0413E2F1UL);} + void little_value(uint32_t& x) {x = static_cast<uint32_t>(0x0413E2F1UL);} +# else + void big_value(int32_t& x) {x = static_cast<int32_t>(0x0413E2F1UL);} + void big_value(uint32_t& x) {x = static_cast<uint32_t>(0x0413E2F1UL);} + void little_value(int32_t& x) {x = static_cast<int32_t>(0xF1E21304UL);} + void little_value(uint32_t& x) {x = static_cast<uint32_t>(0xF1E21304UL);} +# endif + + void native_value(int64_t& x) {x = static_cast<int64_t>(0xF1E2D3C444231201ULL);} + void native_value(uint64_t& x) {x = static_cast<uint64_t>(0xF1E2D3C444231201ULL);} +# ifdef BOOST_BIG_ENDIAN + void big_value(int64_t& x) {x = static_cast<int64_t>(0xF1E2D3C444231201ULL);} + void big_value(uint64_t& x) {x = static_cast<uint64_t>(0xF1E2D3C444231201ULL);} + void little_value(int64_t& x) {x = static_cast<int64_t>(0x01122344C4D3E2F1ULL);} + void little_value(uint64_t& x) {x = static_cast<uint64_t>(0x01122344C4D3E2F1ULL);} +# else + void big_value(int64_t& x) {x = static_cast<int64_t>(0x01122344C4D3E2F1ULL);} + void big_value(uint64_t& x) {x = static_cast<uint64_t>(0x01122344C4D3E2F1ULL);} + void little_value(int64_t& x) {x = static_cast<int64_t>(0xF1E2D3C444231201ULL);} + void little_value(uint64_t& x) {x = static_cast<uint64_t>(0xF1E2D3C444231201ULL);} +# endif + + template <class T> + void test() + { + T native; + T big; + T little; + native_value(native); + big_value(big); + little_value(little); + + // validate the values used by the tests below + +# ifdef BOOST_BIG_ENDIAN + BOOST_TEST_EQ(native, big); + BOOST_TEST_EQ(be::detail::std_endian_reverse(native), little); +# else + BOOST_TEST_EQ(be::detail::std_endian_reverse(native), big); + BOOST_TEST_EQ(native, little); +# endif + + // value-by-value tests + + // unconditional reverse + BOOST_TEST_EQ(be::endian_reverse(big), little); + BOOST_TEST_EQ(be::endian_reverse(little), big); + + // conditional reverse + BOOST_TEST_EQ(be::native_to_big(native), big); + BOOST_TEST_EQ(be::native_to_little(native), little); + BOOST_TEST_EQ(be::big_to_native(big), native); + BOOST_TEST_EQ(be::little_to_native(little), native); + + // generic conditional reverse + BOOST_TEST_EQ((be::conditional_reverse<be::order::big, be::order::big>(big)), big); + BOOST_TEST_EQ((be::conditional_reverse<be::order::little, + be::order::little>(little)), little); + BOOST_TEST_EQ((be::conditional_reverse<be::order::native, + be::order::native>(native)), native); + BOOST_TEST_EQ((be::conditional_reverse<be::order::big, + be::order::little>(big)), little); + BOOST_TEST_EQ((be::conditional_reverse<be::order::big, + be::order::native>(big)), native); + BOOST_TEST_EQ((be::conditional_reverse<be::order::little, + be::order::big>(little)), big); + BOOST_TEST_EQ((be::conditional_reverse<be::order::little, + be::order::native>(little)), native); + BOOST_TEST_EQ((be::conditional_reverse<be::order::native, + be::order::big>(native)), big); + BOOST_TEST_EQ((be::conditional_reverse<be::order::native, + be::order::little>(native)), little); + + // runtime conditional reverse + BOOST_TEST_EQ((be::conditional_reverse(big, be::order::big, be::order::big)), + big); + BOOST_TEST_EQ((be::conditional_reverse(little, be::order::little, + be::order::little)), little); + BOOST_TEST_EQ((be::conditional_reverse(native, be::order::native, + be::order::native)), native); + BOOST_TEST_EQ((be::conditional_reverse(big, be::order::big, + be::order::little)), little); + BOOST_TEST_EQ((be::conditional_reverse(big, be::order::big, + be::order::native)), native); + BOOST_TEST_EQ((be::conditional_reverse(little, be::order::little, + be::order::big)), big); + BOOST_TEST_EQ((be::conditional_reverse(little, be::order::little, + be::order::native)), native); + BOOST_TEST_EQ((be::conditional_reverse(native, be::order::native, + be::order::big)), big); + BOOST_TEST_EQ((be::conditional_reverse(native, be::order::native, + be::order::little)), little); + + // modify-in-place tests + + T x; + + // unconditional reverse + x = big; be::endian_reverse_inplace(x); BOOST_TEST_EQ(x, little); + x = little; be::endian_reverse_inplace(x); BOOST_TEST_EQ(x, big); + + // conditional reverse + x = native; be::native_to_big_inplace(x); BOOST_TEST_EQ(x, big); + x = native; be::native_to_little_inplace(x); BOOST_TEST_EQ(x, little); + x = big; be::big_to_native_inplace(x); BOOST_TEST_EQ(x, native); + x = little; be::little_to_native_inplace(x); BOOST_TEST_EQ(x, native); + + // generic conditional reverse + x = big; be::conditional_reverse_inplace<be::order::big, be::order::big>(x); + BOOST_TEST_EQ(x, big); + x = little; be::conditional_reverse_inplace<be::order::little, be::order::little>(x); + BOOST_TEST_EQ(x, little); + x = native; be::conditional_reverse_inplace<be::order::native, be::order::native>(x); + BOOST_TEST_EQ(x, native); + x = big; be::conditional_reverse_inplace<be::order::big, be::order::little>(x); + BOOST_TEST_EQ(x, little); + x = big; be::conditional_reverse_inplace<be::order::big, be::order::native>(x); + BOOST_TEST_EQ(x, native); + x = little; be::conditional_reverse_inplace<be::order::little, be::order::big>(x); + BOOST_TEST_EQ(x, big); + x = little; be::conditional_reverse_inplace<be::order::little, be::order::native>(x); + BOOST_TEST_EQ(x, native); + x = native; be::conditional_reverse_inplace<be::order::native, be::order::big>(x); + BOOST_TEST_EQ(x, big); + x = native; be::conditional_reverse_inplace<be::order::native, be::order::little>(x); + BOOST_TEST_EQ(x, little); + + // runtime conditional reverse + x = big; + be::conditional_reverse_inplace(x, be::order::big, be::order::big); + BOOST_TEST_EQ(x, big); + x = little; + be::conditional_reverse_inplace(x, be::order::little, be::order::little); + BOOST_TEST_EQ(x, little); + x = native; + be::conditional_reverse_inplace(x, be::order::native, be::order::native); + BOOST_TEST_EQ(x, native); + x = big; + be::conditional_reverse_inplace(x, be::order::big, be::order::little); + BOOST_TEST_EQ(x, little); + x = big; + be::conditional_reverse_inplace(x, be::order::big, be::order::native); + BOOST_TEST_EQ(x, native); + x = little; + be::conditional_reverse_inplace(x, be::order::little, be::order::big); + BOOST_TEST_EQ(x, big); + x = little; + be::conditional_reverse_inplace(x, be::order::little, be::order::native); + BOOST_TEST_EQ(x, native); + x = native; + be::conditional_reverse_inplace(x, be::order::native, be::order::big); + BOOST_TEST_EQ(x, big); + x = native; + be::conditional_reverse_inplace(x, be::order::native, be::order::little); + BOOST_TEST_EQ(x, little); + + } + +//--------------------------------------------------------------------------------------// + + template <class UDT> + void udt_test() + { + UDT udt, tmp; + int64_t big; + int64_t little; + int64_t native; + big_value(big); + little_value(little); + native_value(native); + + udt.member1 = big; + udt.member2 = little; + udt.member3 = native; + + tmp = be::conditional_reverse<be::order::big, be::order::little>(udt); + BOOST_TEST_EQ(tmp.member1, be::endian_reverse(big)); + BOOST_TEST_EQ(tmp.member2, be::endian_reverse(little)); + BOOST_TEST_EQ(tmp.member3, be::endian_reverse(native)); + + be::conditional_reverse_inplace<be::order::big, be::order::little>(udt); + BOOST_TEST_EQ(udt.member1, be::endian_reverse(big)); + BOOST_TEST_EQ(udt.member2, be::endian_reverse(little)); + BOOST_TEST_EQ(udt.member3, be::endian_reverse(native)); + + udt.member1 = big; + udt.member2 = little; + udt.member3 = native; + tmp.member1 = tmp.member2 = tmp.member3 = 0; + + tmp = be::conditional_reverse<be::order::big, be::order::big>(udt); + BOOST_TEST_EQ(tmp.member1, big); + BOOST_TEST_EQ(tmp.member2, little); + BOOST_TEST_EQ(tmp.member3, native); + + be::conditional_reverse_inplace<be::order::big, be::order::big>(udt); + BOOST_TEST_EQ(udt.member1, big); + BOOST_TEST_EQ(udt.member2, little); + BOOST_TEST_EQ(udt.member3, native); + } +} // unnamed namespace + +//--------------------------------------------------------------------------------------// + + // User-defined types + + namespace user + { + // UDT1 supplies both endian_reverse and endian_reverse_inplace + struct UDT1 + { + int64_t member1; + int64_t member2; + int64_t member3; + }; + + UDT1 endian_reverse(const UDT1& udt) BOOST_NOEXCEPT + { + UDT1 tmp; + tmp.member1 = boost::endian::endian_reverse(udt.member1); + tmp.member2 = boost::endian::endian_reverse(udt.member2); + tmp.member3 = boost::endian::endian_reverse(udt.member3); + return tmp; + } + + void endian_reverse_inplace(UDT1& udt) BOOST_NOEXCEPT + { + boost::endian::endian_reverse_inplace(udt.member1); + boost::endian::endian_reverse_inplace(udt.member2); + boost::endian::endian_reverse_inplace(udt.member3); + } + + // UDT2 supplies only endian_reverse + struct UDT2 + { + int64_t member1; + int64_t member2; + int64_t member3; + }; + + UDT2 endian_reverse(const UDT2& udt) BOOST_NOEXCEPT + { + UDT2 tmp; + tmp.member1 = boost::endian::endian_reverse(udt.member1); + tmp.member2 = boost::endian::endian_reverse(udt.member2); + tmp.member3 = boost::endian::endian_reverse(udt.member3); + return tmp; + } + + // UDT3 supplies neither endian_reverse nor endian_reverse_inplace, + // so udt_test<UDT3>() should fail to compile + struct UDT3 + { + int64_t member1; + int64_t member2; + int64_t member3; + }; + + } // namespace user + +//--------------------------------------------------------------------------------------// + +int cpp_main(int, char * []) +{ + cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl; + + //std::cerr << std::hex; + + cout << "int8_t" << endl; + test<int8_t>(); + cout << "uint8_t" << endl; + test<uint8_t>(); + + cout << "int16_t" << endl; + test<int16_t>(); + cout << "uint16_t" << endl; + test<uint16_t>(); + + cout << "int32_t" << endl; + test<int32_t>(); + cout << "uint32_t" << endl; + test<uint32_t>(); + + cout << "int64_t" << endl; + test<int64_t>(); + cout << "uint64_t" << endl; + test<uint64_t>(); + + cout << "UDT 1" << endl; + udt_test<user::UDT1>(); + + cout << "UDT 2" << endl; + udt_test<user::UDT2>(); + +#ifdef BOOST_ENDIAN_COMPILE_FAIL + cout << "UDT 3" << endl; + udt_test<user::UDT3>(); // should fail to compile since has not endian_reverse() +#endif + + return ::boost::report_errors(); +} + +#include <boost/endian/detail/disable_warnings_pop.hpp> diff --git a/libs/endian/test/deprecated_test.cpp b/libs/endian/test/deprecated_test.cpp new file mode 100644 index 000000000..e4417f628 --- /dev/null +++ b/libs/endian/test/deprecated_test.cpp @@ -0,0 +1,183 @@ +// deprecated_test.cpp ---------------------------------------------------------------// + +// Copyright Beman Dawes 2014, 2015 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +// See library home page at http://www.boost.org/libs/endian + +//--------------------------------------------------------------------------------------// + +#include <boost/endian/detail/disable_warnings.hpp> + +#define BOOST_ENDIAN_DEPRECATED_NAMES +#include <boost/endian/endian.hpp> +#include <boost/detail/lightweight_main.hpp> +#include <boost/core/lightweight_test.hpp> +#include <iostream> +#include <sstream> + +using namespace boost::endian; +using std::cout; +using std::endl; + +namespace +{ + + // check_size ----------------------------------------------------------------------// + + void check_size() + { + BOOST_TEST_EQ(sizeof(big8_t), 1); + BOOST_TEST_EQ(sizeof(big16_t), 2); + BOOST_TEST_EQ(sizeof(big24_t), 3); + BOOST_TEST_EQ(sizeof(big32_t), 4); + BOOST_TEST_EQ(sizeof(big40_t), 5); + BOOST_TEST_EQ(sizeof(big48_t), 6); + BOOST_TEST_EQ(sizeof(big56_t), 7); + BOOST_TEST_EQ(sizeof(big64_t), 8); + + BOOST_TEST_EQ(sizeof(ubig8_t), 1); + BOOST_TEST_EQ(sizeof(ubig16_t), 2); + BOOST_TEST_EQ(sizeof(ubig24_t), 3); + BOOST_TEST_EQ(sizeof(ubig32_t), 4); + BOOST_TEST_EQ(sizeof(ubig40_t), 5); + BOOST_TEST_EQ(sizeof(ubig48_t), 6); + BOOST_TEST_EQ(sizeof(ubig56_t), 7); + BOOST_TEST_EQ(sizeof(ubig64_t), 8); + + BOOST_TEST_EQ(sizeof(little8_t), 1); + BOOST_TEST_EQ(sizeof(little16_t), 2); + BOOST_TEST_EQ(sizeof(little24_t), 3); + BOOST_TEST_EQ(sizeof(little32_t), 4); + BOOST_TEST_EQ(sizeof(little40_t), 5); + BOOST_TEST_EQ(sizeof(little48_t), 6); + BOOST_TEST_EQ(sizeof(little56_t), 7); + BOOST_TEST_EQ(sizeof(little64_t), 8); + + BOOST_TEST_EQ(sizeof(ulittle8_t), 1); + BOOST_TEST_EQ(sizeof(ulittle16_t), 2); + BOOST_TEST_EQ(sizeof(ulittle24_t), 3); + BOOST_TEST_EQ(sizeof(ulittle32_t), 4); + BOOST_TEST_EQ(sizeof(ulittle40_t), 5); + BOOST_TEST_EQ(sizeof(ulittle48_t), 6); + BOOST_TEST_EQ(sizeof(ulittle56_t), 7); + BOOST_TEST_EQ(sizeof(ulittle64_t), 8); + + BOOST_TEST_EQ(sizeof(native8_t), 1); + BOOST_TEST_EQ(sizeof(native16_t), 2); + BOOST_TEST_EQ(sizeof(native24_t), 3); + BOOST_TEST_EQ(sizeof(native32_t), 4); + BOOST_TEST_EQ(sizeof(native40_t), 5); + BOOST_TEST_EQ(sizeof(native48_t), 6); + BOOST_TEST_EQ(sizeof(native56_t), 7); + BOOST_TEST_EQ(sizeof(native64_t), 8); + + BOOST_TEST_EQ(sizeof(unative8_t), 1); + BOOST_TEST_EQ(sizeof(unative16_t), 2); + BOOST_TEST_EQ(sizeof(unative24_t), 3); + BOOST_TEST_EQ(sizeof(unative32_t), 4); + BOOST_TEST_EQ(sizeof(unative40_t), 5); + BOOST_TEST_EQ(sizeof(unative48_t), 6); + BOOST_TEST_EQ(sizeof(unative56_t), 7); + BOOST_TEST_EQ(sizeof(unative64_t), 8); + + BOOST_TEST_EQ(sizeof(aligned_big16_t), 2); + BOOST_TEST_EQ(sizeof(aligned_big32_t), 4); + BOOST_TEST_EQ(sizeof(aligned_big64_t), 8); + + BOOST_TEST_EQ(sizeof(aligned_ubig16_t), 2); + BOOST_TEST_EQ(sizeof(aligned_ubig32_t), 4); + BOOST_TEST_EQ(sizeof(aligned_ubig64_t), 8); + + BOOST_TEST_EQ(sizeof(aligned_little16_t), 2); + BOOST_TEST_EQ(sizeof(aligned_little32_t), 4); + BOOST_TEST_EQ(sizeof(aligned_little64_t), 8); + + BOOST_TEST_EQ(sizeof(aligned_ulittle16_t), 2); + BOOST_TEST_EQ(sizeof(aligned_ulittle32_t), 4); + BOOST_TEST_EQ(sizeof(aligned_ulittle64_t), 8); + +# ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES + BOOST_TEST_EQ(sizeof(endian<endianness::big, int_least16_t, 16>), 2); + BOOST_TEST_EQ(sizeof(endian<endianness::big, + int_least16_t, 16, alignment::unaligned>), 2); +# endif + } // check_size + + // test_inserter_and_extractor -----------------------------------------------------// + + void test_inserter_and_extractor() + { + std::cout << "test inserter and extractor..." << std::endl; + + ubig64_t bu64(0x010203040506070ULL); + ulittle64_t lu64(0x010203040506070ULL); + + uint64_t x; + + std::stringstream ss; + + ss << bu64; + ss >> x; + BOOST_TEST_EQ(x, 0x010203040506070ULL); + + ss.clear(); + ss << lu64; + ss >> x; + BOOST_TEST_EQ(x, 0x010203040506070ULL); + + ss.clear(); + ss << 0x010203040506070ULL; + ubig64_t bu64z(0); + ss >> bu64z; + BOOST_TEST_EQ(bu64z, bu64); + + ss.clear(); + ss << 0x010203040506070ULL; + ulittle64_t lu64z(0); + ss >> lu64z; + BOOST_TEST_EQ(lu64z, lu64); + + std::cout << "test inserter and extractor complete" << std::endl; + + } + +} // unnamed namespace + + //--------------------------------------------------------------------------------------// + +int cpp_main(int, char *[]) +{ + cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl; + + cout << " construct big endian aligned" << endl; + big32_t x(1122334455); + + cout << " assign to buffer from built-in integer" << endl; + x = 1234567890; + + cout << " operator==(buffer.value(), built-in)" << endl; + bool b1(x == 1234567890); + BOOST_TEST(b1); + + cout << " construct little endian unaligned" << endl; + little32_t x2(1122334455); + + cout << " assign to buffer from built-in integer" << endl; + x2 = 1234567890; + + cout << " operator==(buffer.value(), built-in)" << endl; + bool b2(x2 == 1234567890); + BOOST_TEST(b2); + + check_size(); + test_inserter_and_extractor(); + + cout << " done" << endl; + + return ::boost::report_errors(); +} + +#include <boost/endian/detail/disable_warnings_pop.hpp> diff --git a/libs/endian/test/endian_in_union_test.cpp b/libs/endian/test/endian_in_union_test.cpp new file mode 100644 index 000000000..d82bb3fbc --- /dev/null +++ b/libs/endian/test/endian_in_union_test.cpp @@ -0,0 +1,86 @@ +// endian_in_union_test.cpp -------------------------------------------------// + +// Copyright Beman Dawes 2008 + +// 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) + +// See library home page at http://www.boost.org/libs/endian + +//----------------------------------------------------------------------------// + +#define BOOST_ENDIAN_FORCE_PODNESS + +#include <boost/endian/detail/disable_warnings.hpp> + +#include <boost/endian/arithmetic.hpp> +#include <boost/detail/lightweight_main.hpp> +#include <cassert> + +using namespace boost::endian; + +union U +{ + big_int8_t big_8; + big_int16_t big_16; + big_int24_t big_24; + big_int32_t big_32; + big_int40_t big_40; + big_int48_t big_48; + big_int56_t big_56; + big_int64_t big_64; + + big_uint8_t big_u8; + big_uint16_t big_u16; + big_uint24_t big_u24; + big_uint32_t big_u32; + big_uint40_t big_u40; + big_uint48_t big_u48; + big_uint56_t big_u56; + big_uint64_t big_u64; + + little_int8_t little_8; + little_int16_t little_16; + little_int24_t little_24; + little_int32_t little_32; + little_int40_t little_40; + little_int48_t little_48; + little_int56_t little_56; + little_int64_t little_64; + + little_uint8_t little_u8; + little_uint16_t little_u16; + little_uint24_t little_u24; + little_uint32_t little_u32; + little_uint40_t little_u40; + little_uint48_t little_u48; + little_uint56_t little_u56; + little_uint64_t little_u64; + + native_int8_t native_8; + native_int16_t native_16; + native_int24_t native_24; + native_int32_t native_32; + native_int40_t native_40; + native_int48_t native_48; + native_int56_t native_56; + native_int64_t native_64; + + native_uint8_t native_u8; + native_uint16_t native_u16; + native_uint24_t native_u24; + native_uint32_t native_u32; + native_uint40_t native_u40; + native_uint48_t native_u48; + native_uint56_t native_u56; + native_uint64_t native_u64; +}; + +U foo; + +int cpp_main(int, char * []) +{ + + return 0; +} + diff --git a/libs/endian/test/endian_operations_test.cpp b/libs/endian/test/endian_operations_test.cpp new file mode 100644 index 000000000..3c3c53d1b --- /dev/null +++ b/libs/endian/test/endian_operations_test.cpp @@ -0,0 +1,504 @@ +// endian_operations_test.cpp --------------------------------------------------------// + +// Copyright Beman Dawes 2008 + +// 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) + +// See library home page at http://www.boost.org/libs/endian + +//--------------------------------------------------------------------------------------// + +// This test probes operator overloading, including interaction between +// operand types. + +// See endian_test for tests of endianess correctness, size, and value. + +#define BOOST_ENDIAN_LOG + +#include <boost/endian/detail/disable_warnings.hpp> + +#ifdef _MSC_VER +# pragma warning( disable : 4242 ) // conversion ..., possible loss of data +# pragma warning( disable : 4244 ) // conversion ..., possible loss of data +# pragma warning( disable : 4018 ) // signed/unsigned mismatch +# pragma warning( disable : 4365 ) // signed/unsigned mismatch +# pragma warning( disable : 4389 ) // signed/unsigned mismatch +#elif defined(__GNUC__) +# pragma GCC diagnostic ignored "-Wconversion" +#endif + +#define BOOST_ENDIAN_LOG + +#include <boost/endian/arithmetic.hpp> +#include <boost/type_traits/is_signed.hpp> +#include <boost/core/lightweight_test.hpp> +#include <boost/detail/lightweight_main.hpp> +#include <boost/cstdint.hpp> +#include <cassert> +#include <iostream> +#include <sstream> + +namespace be = boost::endian; + +template <class T> +struct value_type +{ + typedef typename T::value_type type; +}; + +template<> struct value_type<char> { typedef char type; }; +template<> struct value_type<unsigned char> { typedef unsigned char type; }; +template<> struct value_type<signed char> { typedef signed char type; }; +template<> struct value_type<short> { typedef short type; }; +template<> struct value_type<unsigned short> { typedef unsigned short type; }; +template<> struct value_type<int> { typedef int type; }; +template<> struct value_type<unsigned int> { typedef unsigned int type; }; +template<> struct value_type<long> { typedef long type; }; +template<> struct value_type<unsigned long> { typedef unsigned long type; }; +template<> struct value_type<long long> { typedef long long type; }; +template<> struct value_type<unsigned long long> { typedef unsigned long long type; }; + +template <class T1, class T2> +struct default_construct +{ + static void test() + { + T1 o1; + o1 = 1; // quiet warnings + if (o1) return; // quiet warnings + } +}; + +template <class T1, class T2> +struct construct +{ + static void test() + { + T2 o2(1); + T1 o1(static_cast<T1>(o2)); + ++o1; // quiet gcc unused variable warning + } +}; + +template <class T1, class T2> +struct initialize +{ + static void test() + { + T1 o2(2); + T1 o1 = o2; + ++o1; // quiet gcc unused variable warning + } +}; + +template <class T1, class T2> +struct assign +{ + static void test() + { + T2 o2; + o2 = 1; + T1 o1; + o1 = o2; + if (o1) return; // quiet warnings + } +}; + +template <class T1, class T2, bool SameSignedness> +struct do_relational +{ + static void test() + { + T1 o1(1); + T2 o2(2); + BOOST_TEST( !(o1 == o2) ); + BOOST_TEST( o1 != o2 ); + BOOST_TEST( o1 < o2 ); + BOOST_TEST( o1 <= o2 ); + BOOST_TEST( !(o1 > o2) ); + BOOST_TEST( !(o1 >= o2 ) ); + } +}; + +template <class T1, class T2> +struct do_relational<T1, T2, false> +{ + static void test() + { + } +}; + +template <class T1, class T2> +struct relational +{ + static void test() + { + do_relational<T1, T2, + boost::is_signed<typename value_type<T1>::type>::value + == boost::is_signed<typename value_type<T2>::type>::value + >::test(); + // do_relational<T1, T2, true>::test(); + } +}; + +template <class T1, class T2> +struct op_plus +{ + static void test() + { + T1 o1(1); + T2 o2(2); + T1 o3; + + o3 = +o1; + + o3 = o1 + o2; + + o1 += o2; + + if (o3) return; // quiet warnings + } +}; + +template <class T1, class T2> +struct op_star +{ + static void test() + { + T1 o1(1); + T2 o2(2); + T1 o3; + + o3 = o1 * o2; + + o1 *= o2; + + if (o3) return; // quiet warnings + } +}; + +template <template<class, class> class Test, class T1> +void op_test_aux() +{ + Test<T1, char>::test(); + Test<T1, unsigned char>::test(); + Test<T1, signed char>::test(); + Test<T1, short>::test(); + Test<T1, unsigned short>::test(); + Test<T1, int>::test(); + Test<T1, unsigned int>::test(); + Test<T1, long>::test(); + Test<T1, unsigned long>::test(); + Test<T1, long long>::test(); + Test<T1, unsigned long long>::test(); + Test<T1, be::big_int16_at>::test(); + Test<T1, be::big_int32_at>::test(); + Test<T1, be::big_int64_at>::test(); + Test<T1, be::big_uint16_at>::test(); + Test<T1, be::big_uint32_at>::test(); + Test<T1, be::big_uint64_at>::test(); + Test<T1, be::little_int16_at>::test(); + Test<T1, be::little_int32_at>::test(); + Test<T1, be::little_int64_at>::test(); + Test<T1, be::little_uint16_at>::test(); + Test<T1, be::little_uint32_at>::test(); + Test<T1, be::little_uint64_at>::test(); + Test<T1, be::big_int8_t>::test(); + Test<T1, be::big_int16_t>::test(); + Test<T1, be::big_int24_t>::test(); + Test<T1, be::big_int32_t>::test(); + Test<T1, be::big_int40_t>::test(); + Test<T1, be::big_int48_t>::test(); + Test<T1, be::big_int56_t>::test(); + Test<T1, be::big_int64_t>::test(); + Test<T1, be::big_uint8_t>::test(); + Test<T1, be::big_uint16_t>::test(); + Test<T1, be::big_uint24_t>::test(); + Test<T1, be::big_uint32_t>::test(); + Test<T1, be::big_uint40_t>::test(); + Test<T1, be::big_uint64_t>::test(); + Test<T1, be::little_int16_t>::test(); + Test<T1, be::little_int24_t>::test(); + Test<T1, be::little_int32_t>::test(); + Test<T1, be::little_int64_t>::test(); + Test<T1, be::little_uint16_t>::test(); + Test<T1, be::little_uint32_t>::test(); + Test<T1, be::little_uint56_t>::test(); + Test<T1, be::little_uint64_t>::test(); + Test<T1, be::native_int16_t>::test(); + Test<T1, be::native_int24_t>::test(); + Test<T1, be::native_int32_t>::test(); + Test<T1, be::native_int64_t>::test(); +#ifdef BOOST_LONG_ENDIAN_TEST + Test<T1, be::native_uint16_t>::test(); + Test<T1, be::native_uint24_t>::test(); + Test<T1, be::native_uint32_t>::test(); + Test<T1, be::native_uint48_t>::test(); + Test<T1, be::native_uint64_t>::test(); + Test<T1, be::big_uint48_t>::test(); + Test<T1, be::big_uint56_t>::test(); + Test<T1, be::little_int8_t>::test(); + Test<T1, be::little_int56_t>::test(); + Test<T1, be::little_int40_t>::test(); + Test<T1, be::little_int48_t>::test(); + Test<T1, be::little_uint8_t>::test(); + Test<T1, be::little_uint24_t>::test(); + Test<T1, be::little_uint40_t>::test(); + Test<T1, be::little_uint48_t>::test(); + Test<T1, be::native_int8_t>::test(); + Test<T1, be::native_int40_t>::test(); + Test<T1, be::native_int48_t>::test(); + Test<T1, be::native_int56_t>::test(); + Test<T1, be::native_uint8_t>::test(); + Test<T1, be::native_uint40_t>::test(); + Test<T1, be::native_uint56_t>::test(); +#endif +} + +template <template<class, class> class Test> +void op_test() +{ + op_test_aux<Test, char>(); + op_test_aux<Test, unsigned char>(); + op_test_aux<Test, signed char>(); + op_test_aux<Test, short>(); + op_test_aux<Test, unsigned short>(); + op_test_aux<Test, int>(); + op_test_aux<Test, unsigned int>(); + op_test_aux<Test, long>(); + op_test_aux<Test, unsigned long>(); + op_test_aux<Test, long long>(); + op_test_aux<Test, unsigned long long>(); + op_test_aux<Test, be::big_int16_at>(); + op_test_aux<Test, be::big_int32_at>(); + op_test_aux<Test, be::big_int64_at>(); + op_test_aux<Test, be::little_int16_at>(); + op_test_aux<Test, be::little_int32_at>(); + op_test_aux<Test, be::little_int64_at>(); +#ifdef BOOST_LONG_ENDIAN_TEST + op_test_aux<Test, be::big_int8_t>(); + op_test_aux<Test, be::big_int16_t>(); + op_test_aux<Test, be::big_int24_t>(); + op_test_aux<Test, be::big_int32_t>(); + op_test_aux<Test, be::big_int40_t>(); + op_test_aux<Test, be::big_int48_t>(); + op_test_aux<Test, be::big_int56_t>(); + op_test_aux<Test, be::big_int64_t>(); + op_test_aux<Test, be::big_uint8_t>(); + op_test_aux<Test, be::big_uint16_t>(); + op_test_aux<Test, be::big_uint24_t>(); + op_test_aux<Test, be::big_uint32_t>(); + op_test_aux<Test, be::big_uint40_t>(); + op_test_aux<Test, be::big_uint48_t>(); + op_test_aux<Test, be::big_uint56_t>(); + op_test_aux<Test, be::big_uint64_t>(); + op_test_aux<Test, be::little_int8_t>(); + op_test_aux<Test, be::little_int16_t>(); + op_test_aux<Test, be::little_int24_t>(); + op_test_aux<Test, be::little_int32_t>(); + op_test_aux<Test, be::little_int40_t>(); + op_test_aux<Test, be::little_int48_t>(); + op_test_aux<Test, be::little_int56_t>(); + op_test_aux<Test, be::little_int64_t>(); + op_test_aux<Test, be::little_uint8_t>(); + op_test_aux<Test, be::little_uint16_t>(); + op_test_aux<Test, be::little_uint24_t>(); + op_test_aux<Test, be::little_uint32_t>(); + op_test_aux<Test, be::little_uint40_t>(); + op_test_aux<Test, be::little_uint48_t>(); + op_test_aux<Test, be::little_uint56_t>(); + op_test_aux<Test, be::little_uint64_t>(); + op_test_aux<Test, be::native_int8_t>(); + op_test_aux<Test, be::native_int16_t>(); + op_test_aux<Test, be::native_int24_t>(); + op_test_aux<Test, be::native_int32_t>(); + op_test_aux<Test, be::native_int40_t>(); + op_test_aux<Test, be::native_int48_t>(); + op_test_aux<Test, be::native_int56_t>(); + op_test_aux<Test, be::native_int64_t>(); + op_test_aux<Test, be::native_uint8_t>(); + op_test_aux<Test, be::native_uint16_t>(); + op_test_aux<Test, be::native_uint24_t>(); + op_test_aux<Test, be::native_uint32_t>(); + op_test_aux<Test, be::native_uint40_t>(); + op_test_aux<Test, be::native_uint48_t>(); + op_test_aux<Test, be::native_uint56_t>(); + op_test_aux<Test, be::native_uint64_t>(); +#endif +} + +// test_inserter_and_extractor -----------------------------------------------------// + +void test_inserter_and_extractor() +{ + std::cout << "test inserter and extractor..." << std::endl; + + be::big_uint64_t bu64(0x010203040506070ULL); + be::little_uint64_t lu64(0x010203040506070ULL); + + boost::uint64_t x; + + std::stringstream ss; + + ss << bu64; + ss >> x; + BOOST_TEST_EQ(x, 0x010203040506070ULL); + + ss.clear(); + ss << lu64; + ss >> x; + BOOST_TEST_EQ(x, 0x010203040506070ULL); + + ss.clear(); + ss << 0x010203040506070ULL; + be::big_uint64_t bu64z(0); + ss >> bu64z; + BOOST_TEST_EQ(bu64z, bu64); + + ss.clear(); + ss << 0x010203040506070ULL; + be::little_uint64_t lu64z(0); + ss >> lu64z; + BOOST_TEST_EQ(lu64z, lu64); + + std::cout << "test inserter and extractor complete" << std::endl; + +} + +void f_big_int32_ut(be::big_int32_t) {} + +// main ------------------------------------------------------------------------------// + +int cpp_main(int, char * []) +{ + be::endian_log = false; + + // make sure some simple things work + + be::big_int32_t o1(1); + be::big_int32_t o2(2L); + be::big_int32_t o3(3LL); + be::big_int64_t o4(1); + + // use cases; if BOOST_ENDIAN_LOG is defined, will output to clog info on + // what overloads and conversions are actually being performed. + + be::endian_log = true; + + std::clog << "set up test values\n"; + be::big_int32_t big(12345); + be::little_uint16_t little_u(10); + be::big_int64_t result; + + // this is the use case that is so irritating that it caused the endian + // constructors to be made non-explicit + std::clog << "\nf(1234) where f(big_int32_t)\n"; + f_big_int32_ut(1234); + + std::clog << "\nresult = big\n"; + result = big; + + std::clog << "\nresult = +big\n"; + result = +big; + + std::clog << "\nresult = -big\n"; + result = -big; + + std::clog << "\n++big\n"; + ++big; + + std::clog << "\nresult = big++\n"; + result = big++; + + std::clog << "\n--big\n"; + --big; + + std::clog << "\nbig--\n"; + big--; + + std::clog << "\nresult = big * big\n"; + result = big * big; + + std::clog << "\nresult = big * big\n"; + result = big * big; + + std::clog << "\nresult = big * little_u\n"; + result = big * little_u; + + std::clog << "\nbig *= little_u\n"; + big *= little_u; + + std::clog << "\nresult = little_u * big\n"; + result = little_u * big; + + std::clog << "\nresult = big * 5\n"; + result = big * 5; + + std::clog << "\nbig *= 5\n"; + big *= 5; + + std::clog << "\nresult = 5 * big\n"; + result = 5 * big; + + std::clog << "\nresult = little_u * 5\n"; + result = little_u * 5; + + std::clog << "\nresult = 5 * little_u\n"; + result = 5 * little_u; + + std::clog << "\nresult = 5 * 10\n"; + result = 5 * 10; + std::clog << "\n"; + + // test from Roland Schwarz that detected ambiguities; these ambiguities + // were eliminated by BOOST_ENDIAN_MINIMAL_COVER_OPERATORS + unsigned u; + be::little_uint32_t u1; + be::little_uint32_t u2; + + u = 9; + u1 = 1; + std::clog << "\nu2 = u1 + u\n"; + u2 = u1 + u; + std::clog << "\n"; + + // variations to detect ambiguities + + be::little_uint32_t u3 = u1 + 5; + u3 = u1 + 5u; + + if (u1 == 5) + {} + if (u1 == 5u) + {} + + u1 += 5; + u1 += 5u; + + u2 = u1 + 5; + u2 = u1 + 5u; + + // one more wrinkle + be::little_uint16_t u4(3); + u4 = 3; + std::clog << "\nu2 = u1 + u4\n"; + u2 = u1 + u4; + std::clog << "\n"; + + be::endian_log = false; + + test_inserter_and_extractor(); + + // perform the indicated test on ~60*60 operand types + + op_test<default_construct>(); + op_test<construct>(); // includes copy construction + op_test<initialize>(); + op_test<assign>(); + op_test<relational>(); + op_test<op_plus>(); + op_test<op_star>(); + + return boost::report_errors(); +} diff --git a/libs/endian/test/endian_test.cpp b/libs/endian/test/endian_test.cpp new file mode 100644 index 000000000..82f2092df --- /dev/null +++ b/libs/endian/test/endian_test.cpp @@ -0,0 +1,812 @@ +// endian_test.cpp ---------------------------------------------------------// + +// Copyright Beman Dawes 1999-2008 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +// See library home page at http://www.boost.org/libs/endian + +//----------------------------------------------------------------------------// + +// This test probes for correct endianess, size, and value. + +// See endian_operations_test for tests of operator correctness and interaction +// between operand types. + +//----------------------------------------------------------------------------// + +#include <boost/endian/detail/disable_warnings.hpp> + +#include <boost/endian/arithmetic.hpp> +#include <boost/cstdint.hpp> +#include <boost/detail/lightweight_main.hpp> + +#include <iostream> +#include <limits> +#include <climits> +#include <cstdlib> // for atoi(), exit() +#include <cstring> // for memcmp() + +using namespace std; // Not the best programming practice, but I +using namespace boost; // want to verify this combination of using +using namespace boost::endian; // namespaces works. See endian_operations_test +// // for tests that don't do "using namespace". + +#define VERIFY(predicate) verify( predicate, __LINE__ ) +#define VERIFY_SIZE(actual, expected) verify_size( actual, expected, __LINE__ ) +#define VERIFY_VALUE_AND_OPS(endian_t,expected_t,expected) verify_value_and_ops<endian_t, expected_t>( expected, __LINE__ ) +#define VERIFY_BIG_REPRESENTATION(t) verify_representation<t>( true, __LINE__ ) +#define VERIFY_LITTLE_REPRESENTATION(t) verify_representation<t>( false, __LINE__ ) +#define VERIFY_NATIVE_REPRESENTATION(t) verify_native_representation<t>( __LINE__ ) + +namespace +{ + int err_count; + + void verify( bool x, int line ) + { + if ( x ) return; + ++err_count; + cout << "Error: verify failed on line " << line << endl; + } + + void verify_size( size_t actual, size_t expected, int line ) + { + if ( actual == expected ) return; + ++err_count; + cout << "Error: verify size failed on line " << line << endl; + cout << " A structure with an expected sizeof() " << expected + << " had an actual sizeof() " << actual + << "\n This will cause uses of endian types to fail\n"; + } + + template <class Endian, class Base> + void verify_value_and_ops( const Base & expected, int line ) + { + Endian v( expected ); + verify( v == expected, line ); + + Endian v2; + v2.operator=( expected ); + verify( v2 == expected, line ); + + ++v; // verify integer_cover_operators being applied to this type - + // will fail to compile if no endian<> specialization is present + + Endian x(static_cast<typename Endian::value_type>(v+v)); + if ( x == x ) // silence warning + return; + } + + const char * big_rep = "\x12\x34\x56\x78\x9A\xBC\xDE\xF0"; + const char * little_rep = "\xF0\xDE\xBC\x9A\x78\x56\x34\x12"; + + template <class Endian> + void verify_representation( bool is_big, int line ) + { + int silence = 0; + Endian x ( static_cast<typename Endian::value_type> + (0x123456789abcdef0LL + silence) ); // will truncate + + if ( is_big ) + verify( memcmp( &x, + reinterpret_cast<const char*>(big_rep)+8-sizeof(Endian), + sizeof(Endian) ) == 0, line ); + else + verify( memcmp( &x, little_rep, sizeof(Endian) ) == 0, line ); + } + + template <class Endian> + inline void verify_native_representation( int line ) + { +# ifdef BOOST_BIG_ENDIAN + verify_representation<Endian>( true, line ); +# else + verify_representation<Endian>( false, line ); +# endif + } + + // detect_order -----------------------------------------------------// + + void detect_order() + { + union View + { + long long i; + unsigned char c[8]; + }; + + View v = { 0x0102030405060708LL }; // initialize v.i + + if ( memcmp( v.c, "\x8\7\6\5\4\3\2\1", 8) == 0 ) + { + cout << "This machine is little-endian.\n"; + # ifndef BOOST_LITTLE_ENDIAN + cout << "yet boost/detail/endian.hpp does not define BOOST_LITTLE_ENDIAN.\n" + "The Boost Endian library must be revised to work correctly on this system.\n" + "Please report this problem to the Boost mailing list.\n"; + exit(1); + # endif + } + else if ( memcmp( v.c, "\1\2\3\4\5\6\7\x8", 8) == 0 ) + { + cout << "This machine is big-endian.\n"; + # ifndef BOOST_BIG_ENDIAN + cout << "yet boost/detail/endian.hpp does not define BOOST_BIG_ENDIAN.\n" + "The Boost Endian library must be revised to work correctly on this system.\n" + "Please report this problem to the Boost mailing list.\n"; + exit(1); + # endif + } + else + { + cout << "This machine is neither strict big-endian nor strict little-endian\n" + "The Boost Endian library must be revised to work correctly on this system.\n" + "Please report this problem to the Boost mailing list.\n"; + exit(1); + } + cout << "That should not matter and is presented for your information only.\n"; + } // detect_order + + // check_data ------------------------------------------------------------// + + void check_data() + { + big_int8_t big_8; + big_int16_t big_16; + big_int24_t big_24; + big_int32_t big_32; + big_int40_t big_40; + big_int48_t big_48; + big_int56_t big_56; + big_int64_t big_64; + + big_uint8_t big_u8; + big_uint16_t big_u16; + big_uint24_t big_u24; + big_uint32_t big_u32; + big_uint40_t big_u40; + big_uint48_t big_u48; + big_uint56_t big_u56; + big_uint64_t big_u64; + + little_int8_t little_8; + little_int16_t little_16; + little_int24_t little_24; + little_int32_t little_32; + little_int40_t little_40; + little_int48_t little_48; + little_int56_t little_56; + little_int64_t little_64; + + little_uint8_t little_u8; + little_uint16_t little_u16; + little_uint24_t little_u24; + little_uint32_t little_u32; + little_uint40_t little_u40; + little_uint48_t little_u48; + little_uint56_t little_u56; + little_uint64_t little_u64; + + native_int8_t native_8; + native_int16_t native_16; + native_int24_t native_24; + native_int32_t native_32; + native_int40_t native_40; + native_int48_t native_48; + native_int56_t native_56; + native_int64_t native_64; + + native_uint8_t native_u8; + native_uint16_t native_u16; + native_uint24_t native_u24; + native_uint32_t native_u32; + native_uint40_t native_u40; + native_uint48_t native_u48; + native_uint56_t native_u56; + native_uint64_t native_u64; + + big_int16_at big_align_int16; + big_int32_at big_align_int32; + big_int64_at big_align_int64; + + big_uint16_at big_align_uint16; + big_uint32_at big_align_uint32; + big_uint64_at big_align_uint64; + + little_int16_at little_align_int16; + little_int32_at little_align_int32; + little_int64_at little_align_int64; + + little_uint16_at little_align_uint16; + little_uint32_at little_align_uint32; + little_uint64_at little_align_uint64; + + VERIFY(big_8.data() == reinterpret_cast<const char *>(&big_8)); + VERIFY(big_16.data() == reinterpret_cast<const char *>(&big_16)); + VERIFY(big_24.data() == reinterpret_cast<const char *>(&big_24)); + VERIFY(big_32.data() == reinterpret_cast<const char *>(&big_32)); + VERIFY(big_40.data() == reinterpret_cast<const char *>(&big_40)); + VERIFY(big_48.data() == reinterpret_cast<const char *>(&big_48)); + VERIFY(big_56.data() == reinterpret_cast<const char *>(&big_56)); + VERIFY(big_64.data() == reinterpret_cast<const char *>(&big_64)); + + VERIFY(big_u8.data() == reinterpret_cast<const char *>(&big_u8)); + VERIFY(big_u16.data() == reinterpret_cast<const char *>(&big_u16)); + VERIFY(big_u24.data() == reinterpret_cast<const char *>(&big_u24)); + VERIFY(big_u32.data() == reinterpret_cast<const char *>(&big_u32)); + VERIFY(big_u40.data() == reinterpret_cast<const char *>(&big_u40)); + VERIFY(big_u48.data() == reinterpret_cast<const char *>(&big_u48)); + VERIFY(big_u56.data() == reinterpret_cast<const char *>(&big_u56)); + VERIFY(big_u64.data() == reinterpret_cast<const char *>(&big_u64)); + + VERIFY(little_8.data() == reinterpret_cast<const char *>(&little_8)); + VERIFY(little_16.data() == reinterpret_cast<const char *>(&little_16)); + VERIFY(little_24.data() == reinterpret_cast<const char *>(&little_24)); + VERIFY(little_32.data() == reinterpret_cast<const char *>(&little_32)); + VERIFY(little_40.data() == reinterpret_cast<const char *>(&little_40)); + VERIFY(little_48.data() == reinterpret_cast<const char *>(&little_48)); + VERIFY(little_56.data() == reinterpret_cast<const char *>(&little_56)); + VERIFY(little_64.data() == reinterpret_cast<const char *>(&little_64)); + + VERIFY(little_u8.data() == reinterpret_cast<const char *>(&little_u8)); + VERIFY(little_u16.data() == reinterpret_cast<const char *>(&little_u16)); + VERIFY(little_u24.data() == reinterpret_cast<const char *>(&little_u24)); + VERIFY(little_u32.data() == reinterpret_cast<const char *>(&little_u32)); + VERIFY(little_u40.data() == reinterpret_cast<const char *>(&little_u40)); + VERIFY(little_u48.data() == reinterpret_cast<const char *>(&little_u48)); + VERIFY(little_u56.data() == reinterpret_cast<const char *>(&little_u56)); + VERIFY(little_u64.data() == reinterpret_cast<const char *>(&little_u64)); + + VERIFY(native_8.data() == reinterpret_cast<const char *>(&native_8)); + VERIFY(native_16.data() == reinterpret_cast<const char *>(&native_16)); + VERIFY(native_24.data() == reinterpret_cast<const char *>(&native_24)); + VERIFY(native_32.data() == reinterpret_cast<const char *>(&native_32)); + VERIFY(native_40.data() == reinterpret_cast<const char *>(&native_40)); + VERIFY(native_48.data() == reinterpret_cast<const char *>(&native_48)); + VERIFY(native_56.data() == reinterpret_cast<const char *>(&native_56)); + VERIFY(native_64.data() == reinterpret_cast<const char *>(&native_64)); + + VERIFY(native_u8.data() == reinterpret_cast<const char *>(&native_u8)); + VERIFY(native_u16.data() == reinterpret_cast<const char *>(&native_u16)); + VERIFY(native_u24.data() == reinterpret_cast<const char *>(&native_u24)); + VERIFY(native_u32.data() == reinterpret_cast<const char *>(&native_u32)); + VERIFY(native_u40.data() == reinterpret_cast<const char *>(&native_u40)); + VERIFY(native_u48.data() == reinterpret_cast<const char *>(&native_u48)); + VERIFY(native_u56.data() == reinterpret_cast<const char *>(&native_u56)); + VERIFY(native_u64.data() == reinterpret_cast<const char *>(&native_u64)); + + VERIFY(big_align_int16.data() == reinterpret_cast<const char *>(&big_align_int16)); + VERIFY(big_align_int32.data() == reinterpret_cast<const char *>(&big_align_int32)); + VERIFY(big_align_int64.data() == reinterpret_cast<const char *>(&big_align_int64)); + + VERIFY(big_align_uint16.data() == reinterpret_cast<const char *>(&big_align_uint16)); + VERIFY(big_align_uint32.data() == reinterpret_cast<const char *>(&big_align_uint32)); + VERIFY(big_align_uint64.data() == reinterpret_cast<const char *>(&big_align_uint64)); + + VERIFY(little_align_int16.data() == reinterpret_cast<const char *>(&little_align_int16)); + VERIFY(little_align_int32.data() == reinterpret_cast<const char *>(&little_align_int32)); + VERIFY(little_align_int64.data() == reinterpret_cast<const char *>(&little_align_int64)); + + VERIFY(little_align_uint16.data() == reinterpret_cast<const char *>(&little_align_uint16)); + VERIFY(little_align_uint32.data() == reinterpret_cast<const char *>(&little_align_uint32)); + VERIFY(little_align_uint64.data() == reinterpret_cast<const char *>(&little_align_uint64)); + + } + + // check_size ------------------------------------------------------------// + + void check_size() + { + VERIFY( numeric_limits<signed char>::digits == 7 ); + VERIFY( numeric_limits<unsigned char>::digits == 8 ); + + VERIFY_SIZE( sizeof( big_int8_t ), 1 ); + VERIFY_SIZE( sizeof( big_int16_t ), 2 ); + VERIFY_SIZE( sizeof( big_int24_t ), 3 ); + VERIFY_SIZE( sizeof( big_int32_t ), 4 ); + VERIFY_SIZE( sizeof( big_int40_t ), 5 ); + VERIFY_SIZE( sizeof( big_int48_t ), 6 ); + VERIFY_SIZE( sizeof( big_int56_t ), 7 ); + VERIFY_SIZE( sizeof( big_int64_t ), 8 ); + + VERIFY_SIZE( sizeof( big_uint8_t ), 1 ); + VERIFY_SIZE( sizeof( big_uint16_t ), 2 ); + VERIFY_SIZE( sizeof( big_uint24_t ), 3 ); + VERIFY_SIZE( sizeof( big_uint32_t ), 4 ); + VERIFY_SIZE( sizeof( big_uint40_t ), 5 ); + VERIFY_SIZE( sizeof( big_uint48_t ), 6 ); + VERIFY_SIZE( sizeof( big_uint56_t ), 7 ); + VERIFY_SIZE( sizeof( big_uint64_t ), 8 ); + + VERIFY_SIZE( sizeof( little_int8_t ), 1 ); + VERIFY_SIZE( sizeof( little_int16_t ), 2 ); + VERIFY_SIZE( sizeof( little_int24_t ), 3 ); + VERIFY_SIZE( sizeof( little_int32_t ), 4 ); + VERIFY_SIZE( sizeof( little_int40_t ), 5 ); + VERIFY_SIZE( sizeof( little_int48_t ), 6 ); + VERIFY_SIZE( sizeof( little_int56_t ), 7 ); + VERIFY_SIZE( sizeof( little_int64_t ), 8 ); + + VERIFY_SIZE( sizeof( little_uint8_t ), 1 ); + VERIFY_SIZE( sizeof( little_uint16_t ), 2 ); + VERIFY_SIZE( sizeof( little_uint24_t ), 3 ); + VERIFY_SIZE( sizeof( little_uint32_t ), 4 ); + VERIFY_SIZE( sizeof( little_uint40_t ), 5 ); + VERIFY_SIZE( sizeof( little_uint48_t ), 6 ); + VERIFY_SIZE( sizeof( little_uint56_t ), 7 ); + VERIFY_SIZE( sizeof( little_uint64_t ), 8 ); + + VERIFY_SIZE( sizeof( native_int8_t ), 1 ); + VERIFY_SIZE( sizeof( native_int16_t ), 2 ); + VERIFY_SIZE( sizeof( native_int24_t ), 3 ); + VERIFY_SIZE( sizeof( native_int32_t ), 4 ); + VERIFY_SIZE( sizeof( native_int40_t ), 5 ); + VERIFY_SIZE( sizeof( native_int48_t ), 6 ); + VERIFY_SIZE( sizeof( native_int56_t ), 7 ); + VERIFY_SIZE( sizeof( native_int64_t ), 8 ); + + VERIFY_SIZE( sizeof( native_uint8_t ), 1 ); + VERIFY_SIZE( sizeof( native_uint16_t ), 2 ); + VERIFY_SIZE( sizeof( native_uint24_t ), 3 ); + VERIFY_SIZE( sizeof( native_uint32_t ), 4 ); + VERIFY_SIZE( sizeof( native_uint40_t ), 5 ); + VERIFY_SIZE( sizeof( native_uint48_t ), 6 ); + VERIFY_SIZE( sizeof( native_uint56_t ), 7 ); + VERIFY_SIZE( sizeof( native_uint64_t ), 8 ); + + VERIFY_SIZE(sizeof(big_int8_at), 1); + VERIFY_SIZE(sizeof(big_int16_at), 2); + VERIFY_SIZE( sizeof( big_int32_at ), 4 ); + VERIFY_SIZE( sizeof( big_int64_at ), 8 ); + + VERIFY_SIZE(sizeof(big_uint8_at), 1); + VERIFY_SIZE(sizeof(big_uint16_at), 2); + VERIFY_SIZE( sizeof( big_uint32_at ), 4 ); + VERIFY_SIZE( sizeof( big_uint64_at ), 8 ); + + VERIFY_SIZE(sizeof(little_int8_at), 1); + VERIFY_SIZE(sizeof(little_int16_at), 2); + VERIFY_SIZE( sizeof( little_int32_at ), 4 ); + VERIFY_SIZE( sizeof( little_int64_at ), 8 ); + + VERIFY_SIZE(sizeof(little_uint8_at), 1); + VERIFY_SIZE(sizeof(little_uint16_at), 2); + VERIFY_SIZE( sizeof( little_uint32_at ), 4 ); + VERIFY_SIZE( sizeof( little_uint64_at ), 8 ); + } // check_size + + // check_alignment -------------------------------------------------------// + + void check_alignment() + { + // structs with offsets % 2 == 1 for type of size > 1 to ensure no alignment + // bytes added for any size > 1 + + struct big_struct + { + big_int8_t v0; + big_int16_t v1; + big_int24_t v3; + char v6; + big_int32_t v7; + big_int40_t v11; + char v16; + big_int48_t v17; + big_int56_t v23; + char v30; + big_int64_t v31; + }; + + struct big_u_struct + { + big_uint8_t v0; + big_uint16_t v1; + big_uint24_t v3; + char v6; + big_uint32_t v7; + big_uint40_t v11; + char v16; + big_uint48_t v17; + big_uint56_t v23; + char v30; + big_uint64_t v31; + }; + + struct little_struct + { + little_int8_t v0; + little_int16_t v1; + little_int24_t v3; + char v6; + little_int32_t v7; + little_int40_t v11; + char v16; + little_int48_t v17; + little_int56_t v23; + char v30; + little_int64_t v31; + }; + + struct little_u_struct + { + little_uint8_t v0; + little_uint16_t v1; + little_uint24_t v3; + char v6; + little_uint32_t v7; + little_uint40_t v11; + char v16; + little_uint48_t v17; + little_uint56_t v23; + char v30; + little_uint64_t v31; + }; + + struct native_struct + { + native_int8_t v0; + native_int16_t v1; + native_int24_t v3; + char v6; + native_int32_t v7; + native_int40_t v11; + char v16; + native_int48_t v17; + native_int56_t v23; + char v30; + native_int64_t v31; + }; + + struct native_u_struct + { + native_uint8_t v0; + native_uint16_t v1; + native_uint24_t v3; + char v6; + native_uint32_t v7; + native_uint40_t v11; + char v16; + native_uint48_t v17; + native_uint56_t v23; + char v30; + native_uint64_t v31; + }; + + // aligned test cases + + struct big_aligned_struct + { + big_int16_at v0; + big_int32_at v1; + char v3; + // on a 32-bit system, the padding here may be 3 rather than 7 bytes + big_int64_at v4; + }; + + struct little_aligned_struct + { + little_int16_at v0; + little_int32_at v1; + char v3; + // on a 32-bit system, the padding here may be 3 rather than 7 bytes + little_int64_at v4; + }; + + int saved_err_count = err_count; + + VERIFY_SIZE( sizeof(big_struct), 39 ); + VERIFY_SIZE( sizeof(big_u_struct), 39 ); + VERIFY_SIZE( sizeof(little_struct), 39 ); + VERIFY_SIZE( sizeof(little_u_struct), 39 ); + VERIFY_SIZE( sizeof(native_struct), 39 ); + VERIFY_SIZE( sizeof(native_u_struct), 39 ); + VERIFY( sizeof(big_aligned_struct) <= 24 ); + VERIFY( sizeof(little_aligned_struct) <= 24 ); + + if ( saved_err_count == err_count ) + { + cout << + "Size and alignment for structures of endian types are as expected.\n"; + } + } // check_alignment + + // check_representation_and_range_and_ops --------------------------------// + + void check_representation_and_range_and_ops() + { + // unaligned integer types + VERIFY_BIG_REPRESENTATION( big_int8_t ); + VERIFY_VALUE_AND_OPS( big_int8_t, int_least8_t, 0x7f ); + VERIFY_VALUE_AND_OPS( big_int8_t, int_least8_t, -0x80 ); + + VERIFY_BIG_REPRESENTATION( big_int16_t ); + VERIFY_VALUE_AND_OPS( big_int16_t, int_least16_t, 0x7fff ); + VERIFY_VALUE_AND_OPS( big_int16_t, int_least16_t, -0x8000 ); + + VERIFY_BIG_REPRESENTATION( big_int24_t ); + VERIFY_VALUE_AND_OPS( big_int24_t, int_least32_t, 0x7fffff ); + VERIFY_VALUE_AND_OPS( big_int24_t, int_least32_t, -0x800000 ); + + VERIFY_BIG_REPRESENTATION( big_int32_t ); + VERIFY_VALUE_AND_OPS( big_int32_t, int_least32_t, 0x7fffffff ); + VERIFY_VALUE_AND_OPS( big_int32_t, int_least32_t, -0x7fffffff-1 ); + + VERIFY_BIG_REPRESENTATION( big_int40_t ); + VERIFY_VALUE_AND_OPS( big_int40_t, int_least64_t, 0x7fffffffffLL ); + VERIFY_VALUE_AND_OPS( big_int40_t, int_least64_t, -0x8000000000LL ); + + VERIFY_BIG_REPRESENTATION( big_int48_t ); + VERIFY_VALUE_AND_OPS( big_int48_t, int_least64_t, 0x7fffffffffffLL ); + VERIFY_VALUE_AND_OPS( big_int48_t, int_least64_t, -0x800000000000LL ); + + VERIFY_BIG_REPRESENTATION( big_int56_t ); + VERIFY_VALUE_AND_OPS( big_int56_t, int_least64_t, 0x7fffffffffffffLL ); + VERIFY_VALUE_AND_OPS( big_int56_t, int_least64_t, -0x80000000000000LL ); + + VERIFY_BIG_REPRESENTATION( big_int64_t ); + VERIFY_VALUE_AND_OPS( big_int64_t, int_least64_t, 0x7fffffffffffffffLL ); + VERIFY_VALUE_AND_OPS( big_int64_t, int_least64_t, -0x7fffffffffffffffLL-1 ); + + VERIFY_BIG_REPRESENTATION( big_uint8_t ); + VERIFY_VALUE_AND_OPS( big_uint8_t, uint_least8_t, 0xff ); + + VERIFY_BIG_REPRESENTATION( big_uint16_t ); + VERIFY_VALUE_AND_OPS( big_uint16_t, uint_least16_t, 0xffff ); + + VERIFY_BIG_REPRESENTATION( big_uint24_t ); + VERIFY_VALUE_AND_OPS( big_uint24_t, uint_least32_t, 0xffffff ); + + VERIFY_BIG_REPRESENTATION( big_uint32_t ); + VERIFY_VALUE_AND_OPS( big_uint32_t, uint_least32_t, 0xffffffff ); + + VERIFY_BIG_REPRESENTATION( big_uint40_t ); + VERIFY_VALUE_AND_OPS( big_uint40_t, uint_least64_t, 0xffffffffffLL ); + + VERIFY_BIG_REPRESENTATION( big_uint48_t ); + VERIFY_VALUE_AND_OPS( big_uint48_t, uint_least64_t, 0xffffffffffffLL ); + + VERIFY_BIG_REPRESENTATION( big_uint56_t ); + VERIFY_VALUE_AND_OPS( big_uint56_t, uint_least64_t, 0xffffffffffffffLL ); + + VERIFY_BIG_REPRESENTATION( big_uint64_t ); + VERIFY_VALUE_AND_OPS( big_uint64_t, uint_least64_t, 0xffffffffffffffffULL ); + + VERIFY_LITTLE_REPRESENTATION( little_int8_t ); + VERIFY_VALUE_AND_OPS( little_int8_t, int_least8_t, 0x7f ); + VERIFY_VALUE_AND_OPS( little_int8_t, int_least8_t, -0x80 ); + + VERIFY_LITTLE_REPRESENTATION( little_int16_t ); + VERIFY_VALUE_AND_OPS( little_int16_t, int_least16_t, 0x7fff ); + VERIFY_VALUE_AND_OPS( little_int16_t, int_least16_t, -0x8000 ); + + VERIFY_LITTLE_REPRESENTATION( little_int24_t ); + VERIFY_VALUE_AND_OPS( little_int24_t, int_least32_t, 0x7fffff ); + VERIFY_VALUE_AND_OPS( little_int24_t, int_least32_t, -0x800000 ); + + VERIFY_LITTLE_REPRESENTATION( little_int32_t ); + VERIFY_VALUE_AND_OPS( little_int32_t, int_least32_t, 0x7fffffff ); + VERIFY_VALUE_AND_OPS( little_int32_t, int_least32_t, -0x7fffffff-1 ); + + VERIFY_LITTLE_REPRESENTATION( little_int40_t ); + VERIFY_VALUE_AND_OPS( little_int40_t, int_least64_t, 0x7fffffffffLL ); + VERIFY_VALUE_AND_OPS( little_int40_t, int_least64_t, -0x8000000000LL ); + + VERIFY_LITTLE_REPRESENTATION( little_int48_t ); + VERIFY_VALUE_AND_OPS( little_int48_t, int_least64_t, 0x7fffffffffffLL ); + VERIFY_VALUE_AND_OPS( little_int48_t, int_least64_t, -0x800000000000LL ); + + VERIFY_LITTLE_REPRESENTATION( little_int56_t ); + VERIFY_VALUE_AND_OPS( little_int56_t, int_least64_t, 0x7fffffffffffffLL ); + VERIFY_VALUE_AND_OPS( little_int56_t, int_least64_t, -0x80000000000000LL ); + + VERIFY_LITTLE_REPRESENTATION( little_int64_t ); + VERIFY_VALUE_AND_OPS( little_int64_t, int_least64_t, 0x7fffffffffffffffLL ); + VERIFY_VALUE_AND_OPS( little_int64_t, int_least64_t, -0x7fffffffffffffffLL-1 ); + + VERIFY_LITTLE_REPRESENTATION( little_uint8_t ); + VERIFY_VALUE_AND_OPS( little_uint8_t, uint_least8_t, 0xff ); + + VERIFY_LITTLE_REPRESENTATION( little_uint16_t ); + VERIFY_VALUE_AND_OPS( little_uint16_t, uint_least16_t, 0xffff ); + + VERIFY_LITTLE_REPRESENTATION( little_uint24_t ); + VERIFY_VALUE_AND_OPS( little_uint24_t, uint_least32_t, 0xffffff ); + + VERIFY_LITTLE_REPRESENTATION( little_uint32_t ); + VERIFY_VALUE_AND_OPS( little_uint32_t, uint_least32_t, 0xffffffff ); + + VERIFY_LITTLE_REPRESENTATION( little_uint40_t ); + VERIFY_VALUE_AND_OPS( little_uint40_t, uint_least64_t, 0xffffffffffLL ); + + VERIFY_LITTLE_REPRESENTATION( little_uint48_t ); + VERIFY_VALUE_AND_OPS( little_uint48_t, uint_least64_t, 0xffffffffffffLL ); + + VERIFY_LITTLE_REPRESENTATION( little_uint56_t ); + VERIFY_VALUE_AND_OPS( little_uint56_t, uint_least64_t, 0xffffffffffffffLL ); + + VERIFY_LITTLE_REPRESENTATION( little_uint64_t ); + VERIFY_VALUE_AND_OPS( little_uint64_t, uint_least64_t, 0xffffffffffffffffULL ); + + VERIFY_NATIVE_REPRESENTATION( native_int8_t ); + VERIFY_VALUE_AND_OPS( native_int8_t, int_least8_t, 0x7f ); + VERIFY_VALUE_AND_OPS( native_int8_t, int_least8_t, -0x80 ); + + VERIFY_NATIVE_REPRESENTATION( native_int16_t ); + VERIFY_VALUE_AND_OPS( native_int16_t, int_least16_t, 0x7fff ); + VERIFY_VALUE_AND_OPS( native_int16_t, int_least16_t, -0x8000 ); + + VERIFY_NATIVE_REPRESENTATION( native_int24_t ); + VERIFY_VALUE_AND_OPS( native_int24_t, int_least32_t, 0x7fffff ); + VERIFY_VALUE_AND_OPS( native_int24_t, int_least32_t, -0x800000 ); + + VERIFY_NATIVE_REPRESENTATION( native_int32_t ); + VERIFY_VALUE_AND_OPS( native_int32_t, int_least32_t, 0x7fffffff ); + VERIFY_VALUE_AND_OPS( native_int32_t, int_least32_t, -0x7fffffff-1 ); + + VERIFY_NATIVE_REPRESENTATION( native_int40_t ); + VERIFY_VALUE_AND_OPS( native_int40_t, int_least64_t, 0x7fffffffffLL ); + VERIFY_VALUE_AND_OPS( native_int40_t, int_least64_t, -0x8000000000LL ); + + VERIFY_NATIVE_REPRESENTATION( native_int48_t ); + VERIFY_VALUE_AND_OPS( native_int48_t, int_least64_t, 0x7fffffffffffLL ); + VERIFY_VALUE_AND_OPS( native_int48_t, int_least64_t, -0x800000000000LL ); + + VERIFY_NATIVE_REPRESENTATION( native_int56_t ); + VERIFY_VALUE_AND_OPS( native_int56_t, int_least64_t, 0x7fffffffffffffLL ); + VERIFY_VALUE_AND_OPS( native_int56_t, int_least64_t, -0x80000000000000LL ); + + VERIFY_NATIVE_REPRESENTATION( native_int64_t ); + VERIFY_VALUE_AND_OPS( native_int64_t, int_least64_t, 0x7fffffffffffffffLL ); + VERIFY_VALUE_AND_OPS( native_int64_t, int_least64_t, -0x7fffffffffffffffLL-1 ); + + VERIFY_NATIVE_REPRESENTATION( native_uint8_t ); + VERIFY_VALUE_AND_OPS( native_uint8_t, uint_least8_t, 0xff ); + + VERIFY_NATIVE_REPRESENTATION( native_uint16_t ); + VERIFY_VALUE_AND_OPS( native_uint16_t, uint_least16_t, 0xffff ); + + VERIFY_NATIVE_REPRESENTATION( native_uint24_t ); + VERIFY_VALUE_AND_OPS( native_uint24_t, uint_least32_t, 0xffffff ); + + VERIFY_NATIVE_REPRESENTATION( native_uint32_t ); + VERIFY_VALUE_AND_OPS( native_uint32_t, uint_least32_t, 0xffffffff ); + + VERIFY_NATIVE_REPRESENTATION( native_uint40_t ); + VERIFY_VALUE_AND_OPS( native_uint40_t, uint_least64_t, 0xffffffffffLL ); + + VERIFY_NATIVE_REPRESENTATION( native_uint48_t ); + VERIFY_VALUE_AND_OPS( native_uint48_t, uint_least64_t, 0xffffffffffffLL ); + + VERIFY_NATIVE_REPRESENTATION( native_uint56_t ); + VERIFY_VALUE_AND_OPS( native_uint56_t, uint_least64_t, 0xffffffffffffffLL ); + + VERIFY_NATIVE_REPRESENTATION( native_uint64_t ); + VERIFY_VALUE_AND_OPS( native_uint64_t, uint_least64_t, 0xffffffffffffffffULL ); + + // aligned integer types + VERIFY_BIG_REPRESENTATION( big_int16_at ); + VERIFY_VALUE_AND_OPS( big_int16_at, int_least16_t, 0x7fff ); + VERIFY_VALUE_AND_OPS( big_int16_at, int_least16_t, -0x8000 ); + + VERIFY_BIG_REPRESENTATION( big_int32_at ); + VERIFY_VALUE_AND_OPS( big_int32_at, int_least32_t, 0x7fffffff ); + VERIFY_VALUE_AND_OPS( big_int32_at, int_least32_t, -0x7fffffff-1 ); + + VERIFY_BIG_REPRESENTATION( big_int64_at ); + VERIFY_VALUE_AND_OPS( big_int64_at, int_least64_t, 0x7fffffffffffffffLL ); + VERIFY_VALUE_AND_OPS( big_int64_at, int_least64_t, -0x7fffffffffffffffLL-1 ); + + VERIFY_BIG_REPRESENTATION( big_uint16_at ); + VERIFY_VALUE_AND_OPS( big_uint16_at, uint_least16_t, 0xffff ); + + VERIFY_BIG_REPRESENTATION( big_uint32_at ); + VERIFY_VALUE_AND_OPS( big_uint32_at, uint_least32_t, 0xffffffff ); + + VERIFY_BIG_REPRESENTATION( big_uint64_at ); + VERIFY_VALUE_AND_OPS( big_uint64_at, uint_least64_t, 0xffffffffffffffffULL ); + + VERIFY_LITTLE_REPRESENTATION( little_int16_at ); + VERIFY_VALUE_AND_OPS( little_int16_at, int_least16_t, 0x7fff ); + VERIFY_VALUE_AND_OPS( little_int16_at, int_least16_t, -0x8000 ); + + VERIFY_LITTLE_REPRESENTATION( little_int32_at ); + VERIFY_VALUE_AND_OPS( little_int32_at, int_least32_t, 0x7fffffff ); + VERIFY_VALUE_AND_OPS( little_int32_at, int_least32_t, -0x7fffffff-1 ); + + VERIFY_LITTLE_REPRESENTATION( little_int64_at ); + VERIFY_VALUE_AND_OPS( little_int64_at, int_least64_t, 0x7fffffffffffffffLL ); + VERIFY_VALUE_AND_OPS( little_int64_at, int_least64_t, -0x7fffffffffffffffLL-1 ); + + VERIFY_LITTLE_REPRESENTATION( little_uint16_at ); + VERIFY_VALUE_AND_OPS( little_uint16_at, uint_least16_t, 0xffff ); + + VERIFY_LITTLE_REPRESENTATION( little_uint32_at ); + VERIFY_VALUE_AND_OPS( little_uint32_at, uint_least32_t, 0xffffffff ); + + VERIFY_LITTLE_REPRESENTATION( little_uint64_at ); + VERIFY_VALUE_AND_OPS( little_uint64_at, uint_least64_t, 0xffffffffffffffffULL ); + + } // check_representation_and_range + + class MyInt + { + int32_t mx; + public: + MyInt(int32_t x) : mx(x) {} + operator int32_t() const {return mx;} + + //friend int32_t operator+(const MyInt& x) {return x;} + }; + + void check_udt() + { + typedef boost::endian::endian_arithmetic< order::big, MyInt, 32 > mybig_int32_ut; + + mybig_int32_ut v(10); + cout << "+v is " << +v << endl; + v += 1; + cout << "v is " << +v << endl; + v -= 2; + cout << "v is " << +v << endl; + v *= 2; + cout << "v is " << +v << endl; + ++v; + cout << "v is " << +v << endl; + --v; + cout << "v is " << +v << endl; +// cout << "v+v is " << +(v+v) << endl; + } + + long iterations = 10000; + + template< class Endian > + Endian timing_test( const char * s) + { + cout << s << " timing test, " << iterations << " iterations: "; +// progress_timer t; + + Endian v = 1; + for ( long i = 0; i < iterations; ++i ) + { + v += 1; + v *= 3; + ++v; + v *= i; + if ( i == 0 ) VERIFY_VALUE_AND_OPS( Endian, typename Endian::value_type, 21 ); + } + return v; + } + +} // unnamed namespace + +// main ------------------------------------------------------------------------------// + +int cpp_main( int argc, char * argv[] ) +{ + cout << "Usage: " + << argv[0] << " [#],\n where # specifies iteration count\n" + " default iteration count is " << iterations << endl; + + if ( argc > 1 ) + iterations = atol( argv[1] ); + if ( iterations < 1 ) iterations = 1; + + detect_order(); + check_size(); + check_alignment(); + check_representation_and_range_and_ops(); + check_data(); + check_udt(); + + //timing_test<big_int32_t> ( "big_int32_t" ); + //timing_test<big_int32_at>( "big_int32_at" ); + //timing_test<little_int32_t> ( "little_int32_t" ); + //timing_test<little_int32_at>( "little_int32_at" ); + + cout << "\n" << err_count << " errors detected\nTest " + << (err_count==0 ? "passed\n\n" : "failed\n\n"); + + return err_count ? 1 : 0; +} // main diff --git a/libs/endian/test/intrinsic_test.cpp b/libs/endian/test/intrinsic_test.cpp new file mode 100644 index 000000000..404210625 --- /dev/null +++ b/libs/endian/test/intrinsic_test.cpp @@ -0,0 +1,27 @@ +// Copyright Beman Dawes 2013 + +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +#include "test.hpp" +#include <iostream> +#include <boost/assert.hpp> + +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long long uint64_t; + +int main() +{ + std::cout << "BOOST_ENDIAN_INTRINSIC_MSG: " BOOST_ENDIAN_INTRINSIC_MSG << std::endl; + +#ifndef BOOST_ENDIAN_NO_INTRINSICS + uint16_t x2 = 0x1122U; + BOOST_ASSERT(BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_2(x2) == 0x2211U); + uint32_t x4 = 0x11223344UL; + BOOST_ASSERT(BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_4(x4) == 0x44332211UL); + uint64_t x8 = 0x1122334455667788U; + BOOST_ASSERT(BOOST_ENDIAN_INTRINSIC_BYTE_SWAP_8(x8) == 0x8877665544332211ULL); +#endif + return 0; +} diff --git a/libs/endian/test/loop_time_test.cpp b/libs/endian/test/loop_time_test.cpp new file mode 100644 index 000000000..f9c3ddfa6 --- /dev/null +++ b/libs/endian/test/loop_time_test.cpp @@ -0,0 +1,316 @@ +// loop_time_test.cpp ----------------------------------------------------------------// + +// Copyright Beman Dawes 2013 + +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +//--------------------------------------------------------------------------------------// + +//#define BOOST_ENDIAN_NO_INTRINSICS +//#define BOOST_ENDIAN_LOG + +#include <boost/endian/detail/disable_warnings.hpp> + +#include <boost/endian/conversion.hpp> +#include <boost/endian/arithmetic.hpp> +#include <boost/cstdint.hpp> +#include <boost/timer/timer.hpp> +#include <iostream> +#include <cstdlib> +#include <string> +#include <boost/detail/lightweight_main.hpp> + +#ifdef _MSC_VER +# pragma warning (push) +# pragma warning (disable : 4459) +#endif +#include <boost/lexical_cast.hpp> +#ifdef _MSC_VER +# pragma warning (pop) +#endif + +using namespace boost; +using namespace boost::endian; + +using std::cout; +using std::endl; + +namespace +{ + typedef boost::timer::nanosecond_type nanosecond_t; + std::string command_args; + uint64_t n; // number of test cases to run + int places = 2; // decimal places for times + bool verbose (false); + bool time_aligned (true); + bool time_unaligned (true); + bool time_16(true); + bool time_32(true); + bool time_64(true); + + void process_command_line(int argc, char * argv[]) + { + for (int a = 0; a < argc; ++a) + { + command_args += argv[a]; + if (a != argc-1) + command_args += ' '; + } + + // cout << command_args << '\n';; + + if (argc >=2) +#ifndef _MSC_VER + n = atoll(argv[1]); +#else + n = _atoi64(argv[1]); +#endif + + for (; argc > 2; ++argv, --argc) + { + if ( *(argv[2]+1) == 'p' ) + places = atoi( argv[2]+2 ); + else if (*(argv[2] + 1) == 'v') + verbose = true; + else if (*(argv[2] + 1) == 'a') + time_unaligned = false; + else if (*(argv[2] + 1) == 'u') + time_aligned = false; + else if (*(argv[2] + 1) == '1') + time_32 = time_64 = false; + else if (*(argv[2] + 1) == '3') + time_16 = time_64 = false; + else if (*(argv[2] + 1) == '6') + time_16 = time_32 = false; + else + { + cout << "Error - unknown option: " << argv[2] << "\n\n"; + argc = -1; + break; + } + } + + if (argc < 2) + { + cout << "Usage: loop_time_test n [Options]\n" + " The argument n specifies the number of test cases to run\n" + " Options:\n" + " -v Verbose messages\n" + " -p# Decimal places for times; default -p" << places << "\n" + " -a Aligned tests only\n" + " -u Unaligned tests only\n" + " -16 16-bit tests only\n" + " -32 32-bit tests only\n" + " -64 64-bit tests only\n" + ; + return std::exit(1); + } + } + + std::string with_digit_separator(int64_t x) + { + std::string s = boost::lexical_cast<std::string>(x); + std::string s2; + + for (std::string::size_type i = 0; i < s.size(); ++i) + { + if (i && ((s.size()-i) % 3) == 0) + s2 += '\''; + s2 += s[i]; + } + return s2; + } + +//--------------------------------------------------------------------------------------// + + template <class T, class EndianT> + void time() + { + T total = 0; + { + // cout << "*************Endian integer approach...\n"; + EndianT x(0); + boost::timer::cpu_timer t; + for (uint64_t i = 0; i < n; ++i) + { + x += static_cast<T>(i); + } + t.stop(); + total += x; + cout << "<td align=\"right\">" << t.format(places, "%t") << " s</td>"; + } + { +// cout << "***************Endian conversion approach...\n"; + T x(0); + boost::timer::cpu_timer t; + native_to_big_inplace(x); + for (uint64_t i = 0; i < n; ++i) + { + x += static_cast<T>(i); + } + big_to_native_inplace(x); + t.stop(); + native_to_big_inplace(x); + if (x != total) + throw std::logic_error("integer approach total != conversion approach total"); + cout << "<td align=\"right\">" << t.format(places, "%t") << " s</td>"; + } + } + + + void test_big_align_int16() + { + cout << "<tr><td>16-bit aligned big endian</td>"; + time<int16_t, big_int16_at>(); + cout << "</tr>\n"; + } + + void test_little_align_int16() + { + cout << "<tr><td>16-bit aligned little endian</td>"; + time<int16_t, little_int16_at>(); + cout << "</tr>\n"; + } + + void test_big_int16() + { + cout << "<tr><td>16-bit unaligned big endian</td>"; + time<int16_t, big_int16_t>(); + cout << "</tr>\n"; + } + + void test_little_int16() + { + cout << "<tr><td>16-bit unaligned little endian</td>"; + time<int16_t, little_int16_t>(); + cout << "</tr>\n"; + } + + void test_big_align_int32() + { + cout << "<tr><td>32-bit aligned big endian</td>"; + time<int32_t, big_int32_at>(); + cout << "</tr>\n"; + } + + void test_little_align_int32() + { + cout << "<tr><td>32-bit aligned little endian</td>"; + time<int32_t, little_int32_at>(); + cout << "</tr>\n"; + } + + void test_big_int32() + { + cout << "<tr><td>32-bit unaligned big endian</td>"; + time<int32_t, big_int32_t>(); + cout << "</tr>\n"; + } + + void test_little_int32() + { + cout << "<tr><td>32-bit unaligned little endian</td>"; + time<int32_t, little_int32_t>(); + cout << "</tr>\n"; + } + + void test_big_align_int64() + { + cout << "<tr><td>64-bit aligned big endian</td>"; + time<int64_t, big_int64_at>(); + cout << "</tr>\n"; + } + + void test_little_align_int64() + { + cout << "<tr><td>64-bit aligned little endian</td>"; + time<int64_t, little_int64_at>(); + cout << "</tr>\n"; + } + + void test_big_int64() + { + cout << "<tr><td>64-bit unaligned big endian</td>"; + time<int64_t, big_int64_t>(); + cout << "</tr>\n"; + } + + void test_little_int64() + { + cout << "<tr><td>64-bit unaligned little endian</td>"; + time<int64_t, little_int64_t>(); + cout << "</tr>\n"; + } + +} // unnamed namespace + +//--------------------------------------------------------------------------------------// + +int cpp_main(int argc, char* argv[]) +{ + process_command_line(argc, argv); + + cout + << "<html>\n<head>\n<title>Endian Loop Time Test</title>\n</head>\n<body>\n" + << "<!-- boost-no-inspect -->\n" + << "<div align=\"center\"> <center>\n" + << "<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\"" + << "style=\"border-collapse: collapse\" bordercolor=\"#111111\">\n" + << "<tr><td colspan=\"6\" align=\"center\"><b>" + << BOOST_COMPILER << "</b></td></tr>\n" + << "<tr><td colspan=\"6\" align=\"center\"><b>" + << " Iterations: " << with_digit_separator(n) + << ", Intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG + << "</b></td></tr>\n" + << "<tr><td><b>Test Case</b></td>\n" + "<td align=\"center\"><b>Endian<br>arithmetic<br>type</b></td>\n" + "<td align=\"center\"><b>Endian<br>conversion<br>function</b></td>\n" + "</tr>\n" + ; + + if (time_aligned) + { + if (time_16) + { + test_big_align_int16(); + test_little_align_int16(); + } + if (time_32) + { + test_big_align_int32(); + test_little_align_int32(); + } + if (time_64) + { + test_big_align_int64(); + test_little_align_int64(); + } + } + + if (time_unaligned) + { + if (time_16) + { + test_big_int16(); + test_little_int16(); + } + if (time_32) + { + test_big_int32(); + test_little_int32(); + } + if (time_64) + { + test_big_int64(); + test_little_int64(); + } + } + + cout << "\n</div> </center>\n" + << "\n</table>\n</body>\n</html>\n"; + + return 0; +} + +#include <boost/endian/detail/disable_warnings_pop.hpp> diff --git a/libs/endian/test/msvc/associated-files/associated-files.vcxproj b/libs/endian/test/msvc/associated-files/associated-files.vcxproj new file mode 100644 index 000000000..b93d78718 --- /dev/null +++ b/libs/endian/test/msvc/associated-files/associated-files.vcxproj @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{D9C80FE0-20A6-4711-A3F4-676019BD5A06}</ProjectGuid> + <RootNamespace>associatedfiles</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup /> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="..\..\..\include\boost\endian\arithmetic.hpp" /> + <ClInclude Include="..\..\..\include\boost\endian\buffers.hpp" /> + <ClInclude Include="..\..\..\include\boost\endian\conversion.hpp" /> + <ClInclude Include="..\..\..\include\boost\endian\detail\config.hpp" /> + <ClInclude Include="..\..\..\include\boost\endian\detail\cover_operators.hpp" /> + <ClInclude Include="..\..\..\include\boost\endian\detail\disable_warnings.hpp" /> + <ClInclude Include="..\..\..\include\boost\endian\detail\disable_warnings_pop.hpp" /> + <ClInclude Include="..\..\..\include\boost\endian\detail\intrinsic.hpp" /> + </ItemGroup> + <ItemGroup> + <None Include="..\..\..\doc\arithmetic.html" /> + <None Include="..\..\..\doc\buffers.html" /> + <None Include="..\..\..\doc\conversion.html" /> + <None Include="..\..\..\doc\index.html" /> + <None Include="..\..\..\doc\mini_review_topics.html" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/associated-files/associated-files.vcxproj.filters b/libs/endian/test/msvc/associated-files/associated-files.vcxproj.filters new file mode 100644 index 000000000..6f7e8a43a --- /dev/null +++ b/libs/endian/test/msvc/associated-files/associated-files.vcxproj.filters @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + <Filter Include="HTML Files"> + <UniqueIdentifier>{f0ee044b-7428-42ef-a455-a9b440bd64d3}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\..\include\boost\endian\arithmetic.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\boost\endian\buffers.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\boost\endian\conversion.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\boost\endian\detail\config.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\boost\endian\detail\cover_operators.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\boost\endian\detail\disable_warnings.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\boost\endian\detail\disable_warnings_pop.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\boost\endian\detail\intrinsic.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <None Include="..\..\..\doc\conversion.html"> + <Filter>HTML Files</Filter> + </None> + <None Include="..\..\..\doc\buffers.html"> + <Filter>HTML Files</Filter> + </None> + <None Include="..\..\..\doc\index.html"> + <Filter>HTML Files</Filter> + </None> + <None Include="..\..\..\doc\mini_review_topics.html"> + <Filter>HTML Files</Filter> + </None> + <None Include="..\..\..\doc\arithmetic.html"> + <Filter>HTML Files</Filter> + </None> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/benchmark/benchmark.vcxproj b/libs/endian/test/msvc/benchmark/benchmark.vcxproj new file mode 100644 index 000000000..ce4c26f35 --- /dev/null +++ b/libs/endian/test/msvc/benchmark/benchmark.vcxproj @@ -0,0 +1,177 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{C9FEAE75-4DD9-44F5-B302-9910559A91BE}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>benchmark</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(SolutionDir)$(Configuration)\</OutDir> + <IntDir>$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(SolutionDir)$(Configuration)\</OutDir> + <IntDir>$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>BOOST_ALL_DYN_LINK;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 10 -v</Command> + <Message>Executing test...</Message> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>BOOST_ALL_DYN_LINK;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 10 -v</Command> + <Message>Executing test...</Message> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>BOOST_ALL_DYN_LINK;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> + <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 10000 -v</Command> + <Message>Executing test...</Message> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>BOOST_ALL_DYN_LINK;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> + <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 10000 -v</Command> + <Message>Executing test...</Message> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\benchmark.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/boost-no-inspect b/libs/endian/test/msvc/boost-no-inspect new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/libs/endian/test/msvc/boost-no-inspect diff --git a/libs/endian/test/msvc/buffer_test/buffer_test.vcxproj b/libs/endian/test/msvc/buffer_test/buffer_test.vcxproj new file mode 100644 index 000000000..2bb1bf247 --- /dev/null +++ b/libs/endian/test/msvc/buffer_test/buffer_test.vcxproj @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>buffer_test</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\buffer_test.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/common.props b/libs/endian/test/msvc/common.props new file mode 100644 index 000000000..8b8b2f04d --- /dev/null +++ b/libs/endian/test/msvc/common.props @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <OutDir>$(SolutionName)\$(Configuration)\</OutDir> + <IntDir>$(SolutionName)\$(ProjectName)\$(Configuration)\</IntDir> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup> + <ClCompile> + <AdditionalIncludeDirectories>..\..\..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <WarningLevel>EnableAllWarnings</WarningLevel> + <PreprocessorDefinitions>BOOST_LIGHTWEIGHT_TEST_OSTREAM=std::cout;BOOST_ALL_DYN_LINK;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <PostBuildEvent> + <Message>Executing test $(TargetName).exe...</Message> + <Command>"$(TargetDir)\$(TargetName).exe"</Command> + </PostBuildEvent> + <Link> + <AdditionalLibraryDirectories>../../../../..\stage\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> + </Link> + </ItemDefinitionGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/conversion_use_case/conversion_use_case.vcxproj b/libs/endian/test/msvc/conversion_use_case/conversion_use_case.vcxproj new file mode 100644 index 000000000..8407ab827 --- /dev/null +++ b/libs/endian/test/msvc/conversion_use_case/conversion_use_case.vcxproj @@ -0,0 +1,157 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{1139E765-DE0F-497A-A7D9-EB2683521DF1}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>conversion_use_case</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\example\conversion_use_case.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/converter_test/converter_test.vcxproj b/libs/endian/test/msvc/converter_test/converter_test.vcxproj new file mode 100644 index 000000000..3fa0723b2 --- /dev/null +++ b/libs/endian/test/msvc/converter_test/converter_test.vcxproj @@ -0,0 +1,169 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\conversion_test.cpp" /> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>converter_test</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(SolutionDir)$(Configuration)\</OutDir> + <IntDir>$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(SolutionDir)$(Configuration)\</OutDir> + <IntDir>$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <PostBuildEvent> + <Message>Executing test...</Message> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <PostBuildEvent> + <Message>Executing test...</Message> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <PostBuildEvent> + <Message>Executing test...</Message> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <PostBuildEvent> + <Message>Executing test...</Message> + </PostBuildEvent> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/deprecated_test/deprecated_test.vcxproj b/libs/endian/test/msvc/deprecated_test/deprecated_test.vcxproj new file mode 100644 index 000000000..7938d7509 --- /dev/null +++ b/libs/endian/test/msvc/deprecated_test/deprecated_test.vcxproj @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{DA4BC67F-9284-4D2C-81D5-407312C31BD7}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>deprecated_test</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\deprecated_test.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/endian.sln b/libs/endian/test/msvc/endian.sln new file mode 100644 index 000000000..5ea8aec8b --- /dev/null +++ b/libs/endian/test/msvc/endian.sln @@ -0,0 +1,160 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.22609.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_test", "endian_test\endian_test.vcxproj", "{74C201F3-8308-40BE-BC0F-24974DEAF405}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_in_union_test", "endian_in_union_test\endian_in_union_test.vcxproj", "{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_operations_test", "endian_operations_test\endian_operations_test.vcxproj", "{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scoped_enum_emulation_test", "scoped_enum_emulation_test\scoped_enum_emulation_test.vcxproj", "{8420E151-B23B-4651-B526-6AB11EF1E278}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "endian_example", "endian_example\endian_example.vcxproj", "{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "benchmark", "benchmark\benchmark.vcxproj", "{C9FEAE75-4DD9-44F5-B302-9910559A91BE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "converter_test", "converter_test\converter_test.vcxproj", "{EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "udt_conversion_example", "udt_conversion_example\udt_conversion_example.vcxproj", "{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "speed_test", "speed_test\speed_test.vcxproj", "{5407AF29-59E9-4DE2-9939-F067576F7868}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loop_time_test", "loop_time_test\loop_time_test.vcxproj", "{541A2D06-B34E-4592-BE47-F87DF47E73D8}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "buffer_test", "buffer_test\buffer_test.vcxproj", "{BFB68CF4-EB92-4E5C-9694-A939496C5CDE}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "conversion_use_case", "conversion_use_case\conversion_use_case.vcxproj", "{1139E765-DE0F-497A-A7D9-EB2683521DF1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "associated-files", "associated-files\associated-files.vcxproj", "{D9C80FE0-20A6-4711-A3F4-676019BD5A06}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "experiment", "experiment\experiment.vcxproj", "{CE9D8719-6E86-41D0-97CA-5BE5272594E9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "deprecated_test", "deprecated_test\deprecated_test.vcxproj", "{DA4BC67F-9284-4D2C-81D5-407312C31BD7}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {74C201F3-8308-40BE-BC0F-24974DEAF405}.Debug|Win32.ActiveCfg = Debug|Win32 + {74C201F3-8308-40BE-BC0F-24974DEAF405}.Debug|Win32.Build.0 = Debug|Win32 + {74C201F3-8308-40BE-BC0F-24974DEAF405}.Debug|x64.ActiveCfg = Debug|x64 + {74C201F3-8308-40BE-BC0F-24974DEAF405}.Debug|x64.Build.0 = Debug|x64 + {74C201F3-8308-40BE-BC0F-24974DEAF405}.Release|Win32.ActiveCfg = Release|Win32 + {74C201F3-8308-40BE-BC0F-24974DEAF405}.Release|Win32.Build.0 = Release|Win32 + {74C201F3-8308-40BE-BC0F-24974DEAF405}.Release|x64.ActiveCfg = Release|x64 + {74C201F3-8308-40BE-BC0F-24974DEAF405}.Release|x64.Build.0 = Release|x64 + {3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Debug|Win32.ActiveCfg = Debug|Win32 + {3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Debug|Win32.Build.0 = Debug|Win32 + {3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Debug|x64.ActiveCfg = Debug|x64 + {3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Debug|x64.Build.0 = Debug|x64 + {3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Release|Win32.ActiveCfg = Release|Win32 + {3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Release|Win32.Build.0 = Release|Win32 + {3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Release|x64.ActiveCfg = Release|x64 + {3926C6DC-9D1E-4227-BEF5-81F5EC621A75}.Release|x64.Build.0 = Release|x64 + {A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Debug|Win32.ActiveCfg = Debug|Win32 + {A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Debug|Win32.Build.0 = Debug|Win32 + {A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Debug|x64.ActiveCfg = Debug|x64 + {A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Debug|x64.Build.0 = Debug|x64 + {A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Release|Win32.ActiveCfg = Release|Win32 + {A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Release|Win32.Build.0 = Release|Win32 + {A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Release|x64.ActiveCfg = Release|x64 + {A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}.Release|x64.Build.0 = Release|x64 + {8420E151-B23B-4651-B526-6AB11EF1E278}.Debug|Win32.ActiveCfg = Debug|Win32 + {8420E151-B23B-4651-B526-6AB11EF1E278}.Debug|x64.ActiveCfg = Debug|x64 + {8420E151-B23B-4651-B526-6AB11EF1E278}.Release|Win32.ActiveCfg = Release|Win32 + {8420E151-B23B-4651-B526-6AB11EF1E278}.Release|x64.ActiveCfg = Release|x64 + {8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Debug|Win32.ActiveCfg = Debug|Win32 + {8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Debug|Win32.Build.0 = Debug|Win32 + {8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Debug|x64.ActiveCfg = Debug|x64 + {8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Debug|x64.Build.0 = Debug|x64 + {8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Release|Win32.ActiveCfg = Release|Win32 + {8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Release|Win32.Build.0 = Release|Win32 + {8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Release|x64.ActiveCfg = Release|x64 + {8638A3D8-D121-40BF-82E5-127F1B1B2CB2}.Release|x64.Build.0 = Release|x64 + {C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Debug|Win32.ActiveCfg = Debug|Win32 + {C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Debug|Win32.Build.0 = Debug|Win32 + {C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Debug|x64.ActiveCfg = Debug|x64 + {C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Debug|x64.Build.0 = Debug|x64 + {C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Release|Win32.ActiveCfg = Release|Win32 + {C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Release|Win32.Build.0 = Release|Win32 + {C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Release|x64.ActiveCfg = Release|x64 + {C9FEAE75-4DD9-44F5-B302-9910559A91BE}.Release|x64.Build.0 = Release|x64 + {EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Debug|Win32.ActiveCfg = Debug|Win32 + {EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Debug|Win32.Build.0 = Debug|Win32 + {EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Debug|x64.ActiveCfg = Debug|x64 + {EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Debug|x64.Build.0 = Debug|x64 + {EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Release|Win32.ActiveCfg = Release|Win32 + {EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Release|Win32.Build.0 = Release|Win32 + {EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Release|x64.ActiveCfg = Release|x64 + {EAE18F4D-AAF2-4C19-86FB-1144B5BD5993}.Release|x64.Build.0 = Release|x64 + {27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Debug|Win32.ActiveCfg = Debug|Win32 + {27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Debug|Win32.Build.0 = Debug|Win32 + {27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Debug|x64.ActiveCfg = Debug|x64 + {27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Debug|x64.Build.0 = Debug|x64 + {27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Release|Win32.ActiveCfg = Release|Win32 + {27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Release|Win32.Build.0 = Release|Win32 + {27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Release|x64.ActiveCfg = Release|x64 + {27A53564-D32B-4A32-8A6E-2F3BD252EEBA}.Release|x64.Build.0 = Release|x64 + {5407AF29-59E9-4DE2-9939-F067576F7868}.Debug|Win32.ActiveCfg = Debug|Win32 + {5407AF29-59E9-4DE2-9939-F067576F7868}.Debug|Win32.Build.0 = Debug|Win32 + {5407AF29-59E9-4DE2-9939-F067576F7868}.Debug|x64.ActiveCfg = Debug|x64 + {5407AF29-59E9-4DE2-9939-F067576F7868}.Debug|x64.Build.0 = Debug|x64 + {5407AF29-59E9-4DE2-9939-F067576F7868}.Release|Win32.ActiveCfg = Release|Win32 + {5407AF29-59E9-4DE2-9939-F067576F7868}.Release|Win32.Build.0 = Release|Win32 + {5407AF29-59E9-4DE2-9939-F067576F7868}.Release|x64.ActiveCfg = Release|x64 + {5407AF29-59E9-4DE2-9939-F067576F7868}.Release|x64.Build.0 = Release|x64 + {541A2D06-B34E-4592-BE47-F87DF47E73D8}.Debug|Win32.ActiveCfg = Debug|Win32 + {541A2D06-B34E-4592-BE47-F87DF47E73D8}.Debug|Win32.Build.0 = Debug|Win32 + {541A2D06-B34E-4592-BE47-F87DF47E73D8}.Debug|x64.ActiveCfg = Debug|x64 + {541A2D06-B34E-4592-BE47-F87DF47E73D8}.Debug|x64.Build.0 = Debug|x64 + {541A2D06-B34E-4592-BE47-F87DF47E73D8}.Release|Win32.ActiveCfg = Release|Win32 + {541A2D06-B34E-4592-BE47-F87DF47E73D8}.Release|Win32.Build.0 = Release|Win32 + {541A2D06-B34E-4592-BE47-F87DF47E73D8}.Release|x64.ActiveCfg = Release|x64 + {541A2D06-B34E-4592-BE47-F87DF47E73D8}.Release|x64.Build.0 = Release|x64 + {BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Debug|Win32.ActiveCfg = Debug|Win32 + {BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Debug|Win32.Build.0 = Debug|Win32 + {BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Debug|x64.ActiveCfg = Debug|x64 + {BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Debug|x64.Build.0 = Debug|x64 + {BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Release|Win32.ActiveCfg = Release|Win32 + {BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Release|Win32.Build.0 = Release|Win32 + {BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Release|x64.ActiveCfg = Release|x64 + {BFB68CF4-EB92-4E5C-9694-A939496C5CDE}.Release|x64.Build.0 = Release|x64 + {1139E765-DE0F-497A-A7D9-EB2683521DF1}.Debug|Win32.ActiveCfg = Debug|Win32 + {1139E765-DE0F-497A-A7D9-EB2683521DF1}.Debug|Win32.Build.0 = Debug|Win32 + {1139E765-DE0F-497A-A7D9-EB2683521DF1}.Debug|x64.ActiveCfg = Debug|x64 + {1139E765-DE0F-497A-A7D9-EB2683521DF1}.Debug|x64.Build.0 = Debug|x64 + {1139E765-DE0F-497A-A7D9-EB2683521DF1}.Release|Win32.ActiveCfg = Release|Win32 + {1139E765-DE0F-497A-A7D9-EB2683521DF1}.Release|Win32.Build.0 = Release|Win32 + {1139E765-DE0F-497A-A7D9-EB2683521DF1}.Release|x64.ActiveCfg = Release|x64 + {1139E765-DE0F-497A-A7D9-EB2683521DF1}.Release|x64.Build.0 = Release|x64 + {D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Debug|Win32.ActiveCfg = Debug|Win32 + {D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Debug|Win32.Build.0 = Debug|Win32 + {D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Debug|x64.ActiveCfg = Debug|x64 + {D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Debug|x64.Build.0 = Debug|x64 + {D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Release|Win32.ActiveCfg = Release|Win32 + {D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Release|Win32.Build.0 = Release|Win32 + {D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Release|x64.ActiveCfg = Release|x64 + {D9C80FE0-20A6-4711-A3F4-676019BD5A06}.Release|x64.Build.0 = Release|x64 + {CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Debug|Win32.ActiveCfg = Debug|Win32 + {CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Debug|Win32.Build.0 = Debug|Win32 + {CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Debug|x64.ActiveCfg = Debug|Win32 + {CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Release|Win32.ActiveCfg = Release|Win32 + {CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Release|Win32.Build.0 = Release|Win32 + {CE9D8719-6E86-41D0-97CA-5BE5272594E9}.Release|x64.ActiveCfg = Release|Win32 + {DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Debug|Win32.ActiveCfg = Debug|Win32 + {DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Debug|Win32.Build.0 = Debug|Win32 + {DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Debug|x64.ActiveCfg = Debug|Win32 + {DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Release|Win32.ActiveCfg = Release|Win32 + {DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Release|Win32.Build.0 = Release|Win32 + {DA4BC67F-9284-4D2C-81D5-407312C31BD7}.Release|x64.ActiveCfg = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/libs/endian/test/msvc/endian_example/endian_example.vcxproj b/libs/endian/test/msvc/endian_example/endian_example.vcxproj new file mode 100644 index 000000000..6227f656a --- /dev/null +++ b/libs/endian/test/msvc/endian_example/endian_example.vcxproj @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{8638A3D8-D121-40BF-82E5-127F1B1B2CB2}</ProjectGuid> + <RootNamespace>endian_example</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\example\endian_example.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/endian_in_union_test/endian_in_union_test.vcxproj b/libs/endian/test/msvc/endian_in_union_test/endian_in_union_test.vcxproj new file mode 100644 index 000000000..8a1fb4292 --- /dev/null +++ b/libs/endian/test/msvc/endian_in_union_test/endian_in_union_test.vcxproj @@ -0,0 +1,169 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{3926C6DC-9D1E-4227-BEF5-81F5EC621A75}</ProjectGuid> + <RootNamespace>endian_in_union_test</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <OutDir>$(SolutionDir)$(Configuration)\</OutDir> + <IntDir>$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\endian_in_union_test.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/endian_operations_test/endian_operations_test.vcxproj b/libs/endian/test/msvc/endian_operations_test/endian_operations_test.vcxproj new file mode 100644 index 000000000..b12158cc7 --- /dev/null +++ b/libs/endian/test/msvc/endian_operations_test/endian_operations_test.vcxproj @@ -0,0 +1,179 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{A0060A5B-673C-4AD8-BD08-A5C643B1A1CB}</ProjectGuid> + <RootNamespace>endian_operations_test</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <OutDir>$(SolutionDir)$(Configuration)\</OutDir> + <IntDir>$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <OutDir>$(SolutionDir)$(Configuration)\</OutDir> + <IntDir>$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessToFile>false</PreprocessToFile> + <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + <DisableSpecificWarnings>4552;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessToFile>false</PreprocessToFile> + <PreprocessSuppressLineNumbers>false</PreprocessSuppressLineNumbers> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <DisableSpecificWarnings>4552;%(DisableSpecificWarnings)</DisableSpecificWarnings> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\endian_operations_test.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/endian_test/endian_test.vcxproj b/libs/endian/test/msvc/endian_test/endian_test.vcxproj new file mode 100644 index 000000000..c8e2975fe --- /dev/null +++ b/libs/endian/test/msvc/endian_test/endian_test.vcxproj @@ -0,0 +1,171 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{74C201F3-8308-40BE-BC0F-24974DEAF405}</ProjectGuid> + <RootNamespace>endian_test</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <OutDir>$(SolutionDir)$(Configuration)\</OutDir> + <IntDir>$(Configuration)\</IntDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\endian_test.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/loop_time_test/loop_time_test.vcxproj b/libs/endian/test/msvc/loop_time_test/loop_time_test.vcxproj new file mode 100644 index 000000000..afcf0717e --- /dev/null +++ b/libs/endian/test/msvc/loop_time_test/loop_time_test.vcxproj @@ -0,0 +1,167 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{541A2D06-B34E-4592-BE47-F87DF47E73D8}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>loop_time_test</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 1234</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 1</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 100000000</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput> + <AssemblerListingLocation>c:/temp/</AssemblerListingLocation> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 1000000000</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\loop_time_test.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/scoped_enum_emulation_test/scoped_enum_emulation_test.vcxproj b/libs/endian/test/msvc/scoped_enum_emulation_test/scoped_enum_emulation_test.vcxproj new file mode 100644 index 000000000..0c03ad598 --- /dev/null +++ b/libs/endian/test/msvc/scoped_enum_emulation_test/scoped_enum_emulation_test.vcxproj @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{8420E151-B23B-4651-B526-6AB11EF1E278}</ProjectGuid> + <RootNamespace>scoped_enum_emulation_test</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v140</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <MinimalRebuild>true</MinimalRebuild> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>EditAndContinue</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <TargetMachine>MachineX86</TargetMachine> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <Optimization>MaxSpeed</Optimization> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <FunctionLevelLinking>true</FunctionLevelLinking> + <PrecompiledHeader> + </PrecompiledHeader> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Console</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\scoped_enum_emulation_test.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/speed_test/speed_test.vcxproj b/libs/endian/test/msvc/speed_test/speed_test.vcxproj new file mode 100644 index 000000000..f46ee7b7f --- /dev/null +++ b/libs/endian/test/msvc/speed_test/speed_test.vcxproj @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{5407AF29-59E9-4DE2-9939-F067576F7868}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>speed_test</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 1000000</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 1000000</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 100000000</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + <PostBuildEvent> + <Command>"$(TargetDir)\$(TargetName).exe" 100000000</Command> + </PostBuildEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\speed_test.cpp" /> + <ClCompile Include="..\..\speed_test_functions.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/udt_conversion_example/udt_conversion_example.vcxproj b/libs/endian/test/msvc/udt_conversion_example/udt_conversion_example.vcxproj new file mode 100644 index 000000000..5515abe1b --- /dev/null +++ b/libs/endian/test/msvc/udt_conversion_example/udt_conversion_example.vcxproj @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{27A53564-D32B-4A32-8A6E-2F3BD252EEBA}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>udt_conversion_example</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\example\udt_conversion_example.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/msvc/uses_cases/uses_cases.vcxproj b/libs/endian/test/msvc/uses_cases/uses_cases.vcxproj new file mode 100644 index 000000000..b775b1277 --- /dev/null +++ b/libs/endian/test/msvc/uses_cases/uses_cases.vcxproj @@ -0,0 +1,157 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{36BF451A-EAEF-4140-92E4-6EA461A26107}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>uses_cases</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + <Import Project="..\common.props" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + <ExecutablePath>..\..\..\..\..\stage\lib;$(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\..\example\use_cases.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/libs/endian/test/scoped_enum_emulation_test.cpp b/libs/endian/test/scoped_enum_emulation_test.cpp new file mode 100644 index 000000000..e50ea7046 --- /dev/null +++ b/libs/endian/test/scoped_enum_emulation_test.cpp @@ -0,0 +1,48 @@ +// scoped_enum_emulation_test.cpp ----------------------------------------------------// + +// Copyright Beman Dawes, 2009 + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +// See documentation at http://www.boost.org/libs/utility/scoped_enum_emulation.html + +// #include <boost/detail/disable_warnings.hpp> +// #include <boost/config/warning_disable.hpp> + + +#include <boost/detail/scoped_enum_emulation.hpp> +#include <boost/assert.hpp> + +BOOST_SCOPED_ENUM_START(traffic_light) { red=0, yellow, green }; BOOST_SCOPED_ENUM_END + +BOOST_SCOPED_ENUM_START(algae) { green=0, red, cyan }; BOOST_SCOPED_ENUM_END + +struct color +{ + BOOST_SCOPED_ENUM_START(value_t) { red, green, blue }; BOOST_SCOPED_ENUM_END + BOOST_SCOPED_ENUM(value_t) value; +}; + +void foo( BOOST_SCOPED_ENUM(algae) arg ) +{ + BOOST_ASSERT( arg == algae::cyan ); +} + +int main() +{ + BOOST_SCOPED_ENUM(traffic_light) signal( traffic_light::red ); + BOOST_SCOPED_ENUM(algae) sample( algae::red ); + + BOOST_ASSERT( signal == traffic_light::red ); + BOOST_ASSERT( sample == algae::red ); + + foo( algae::cyan ); + + color tracker; + tracker.value = color::value_t::blue; + + if (tracker.value == color::value_t::blue) return 0; // quiet warnings + + return 0; +} diff --git a/libs/endian/test/speed_test.cpp b/libs/endian/test/speed_test.cpp new file mode 100644 index 000000000..70fc92b06 --- /dev/null +++ b/libs/endian/test/speed_test.cpp @@ -0,0 +1,195 @@ +// speed_test.cpp --------------------------------------------------------------------// + +// Copyright Beman Dawes 2013 + +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +//--------------------------------------------------------------------------------------// + +//#define BOOST_ENDIAN_NO_INTRINSICS +//#define BOOST_ENDIAN_LOG + +#include <boost/endian/detail/disable_warnings.hpp> + +#include "speed_test_functions.hpp" +#include <boost/endian/conversion.hpp> +#include <boost/endian/arithmetic.hpp> +#include <boost/cstdint.hpp> +#include <boost/timer/timer.hpp> +#include <iostream> +#include <cstdlib> +#include <boost/detail/lightweight_main.hpp> + +using namespace boost; +using namespace boost::endian; + +using std::cout; +using std::endl; + +namespace +{ + typedef boost::timer::nanosecond_type nanosecond_t; + std::string command_args; + uint64_t n; // number of test cases to run + int places = 2; // decimal places for times + bool verbose (false); + + void process_command_line(int argc, char * argv[]) + { + for (int a = 0; a < argc; ++a) + { + command_args += argv[a]; + if (a != argc-1) + command_args += ' '; + } + + // cout << command_args << '\n';; + + if (argc >=2) +#ifndef _MSC_VER + n = atoll(argv[1]); +#else + n = _atoi64(argv[1]); +#endif + + for (; argc > 2; ++argv, --argc) + { + if ( *(argv[2]+1) == 'p' ) + places = atoi( argv[2]+2 ); + else if ( *(argv[2]+1) == 'v' ) + verbose = true; + else + { + cout << "Error - unknown option: " << argv[2] << "\n\n"; + argc = -1; + break; + } + } + + if (argc < 2) + { + cout << "Usage: speed_test n [Options]\n" + " The argument n specifies the number of test cases to run\n" + " Options:\n" + " -v Verbose messages\n" + " -p# Decimal places for times; default -p" << places << "\n"; + return std::exit(1); + } + } + +//--------------------------------------------------------------------------------------// + + template <class T, class EndianT, class Function> + void time(Function f) + { + T x(0); + EndianT y(0); + boost::timer::cpu_timer t; + for (uint64_t i = 0; i < n; ++i) + { + f(x, y); + } + t.stop(); + cout << "<td align=\"right\">" << t.format(places, "%t") << " s</td>"; + } + + void test_big_int16() + { + cout << "<tr><td>16-bit aligned big endian</td>"; + time<int16_t, big_int16_t>(user::return_x_big_int16); + time<int16_t, big_int16_t>(user::return_x_value_big_int16); + time<int16_t, big_int16_t>(user::return_x_inplace_big_int16); + time<int16_t, big_int16_t>(user::return_y_big_int16); + cout << "</tr>\n"; + } + + void test_little_int16() + { + cout << "<tr><td>16-bit aligned little endian</td>"; + time<int16_t, little_int16_t>(user::return_x_little_int16); + time<int16_t, little_int16_t>(user::return_x_value_little_int16); + time<int16_t, little_int16_t>(user::return_x_inplace_little_int16); + time<int16_t, little_int16_t>(user::return_y_little_int16); + cout << "</tr>\n"; + } + + void test_big_int32() + { + cout << "<tr><td>32-bit aligned big endian</td>"; + time<int32_t, big_int32_t>(user::return_x_big_int32); + time<int32_t, big_int32_t>(user::return_x_value_big_int32); + time<int32_t, big_int32_t>(user::return_x_inplace_big_int32); + time<int32_t, big_int32_t>(user::return_y_big_int32); + cout << "</tr>\n"; + } + + void test_little_int32() + { + cout << "<tr><td>32-bit aligned little endian</td>"; + time<int32_t, little_int32_t>(user::return_x_little_int32); + time<int32_t, little_int32_t>(user::return_x_value_little_int32); + time<int32_t, little_int32_t>(user::return_x_inplace_little_int32); + time<int32_t, little_int32_t>(user::return_y_little_int32); + cout << "</tr>\n"; + } + + void test_big_int64() + { + cout << "<tr><td>64-bit aligned big endian</td>"; + time<int64_t, big_int64_t>(user::return_x_big_int64); + time<int64_t, big_int64_t>(user::return_x_value_big_int64); + time<int64_t, big_int64_t>(user::return_x_inplace_big_int64); + time<int64_t, big_int64_t>(user::return_y_big_int64); + cout << "</tr>\n"; + } + + void test_little_int64() + { + cout << "<tr><td>64-bit aligned little endian</td>"; + time<int64_t, little_int64_t>(user::return_x_little_int64); + time<int64_t, little_int64_t>(user::return_x_value_little_int64); + time<int64_t, little_int64_t>(user::return_x_inplace_little_int64); + time<int64_t, little_int64_t>(user::return_y_little_int64); + cout << "</tr>\n"; + } + +} // unnamed namespace + +//--------------------------------------------------------------------------------------// + +int cpp_main(int argc, char* argv[]) +{ + process_command_line(argc, argv); + + cout + << "<html>\n<head>\n<title>Endian Speed Test</title>\n</head>\n<body>\n" + << "<table border=\"1\" cellpadding=\"5\" cellspacing=\"0\"" + << "style=\"border-collapse: collapse\" bordercolor=\"#111111\">\n" + << "<tr><td colspan=\"6\" align=\"center\"><b>" + << BOOST_COMPILER << "</b></td></tr>\n" + << "<tr><td colspan=\"6\" align=\"center\"><b>" + << " Iterations: " << n + << ", Intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG + << "</b></td></tr>\n" + << "<tr><td><b>Test Case</b></td>\n" + "<td align=\"center\"><b>int<br>arg</b></td>\n" + "<td align=\"center\"><b>int<br>value(arg)</b></td>\n" + "<td align=\"center\"><b>int<br>in place(arg)</b></td>\n" + "<td align=\"center\"><b>Endian<br>arg</b></td>\n" + "</tr>\n" + ; + + test_big_int16(); + test_little_int16(); + test_big_int32(); + test_little_int32(); + test_big_int64(); + test_little_int64(); + + cout << "\n</table>\n</body>\n</html>\n"; + + return 0; +} + +#include <boost/endian/detail/disable_warnings_pop.hpp> diff --git a/libs/endian/test/speed_test_functions.cpp b/libs/endian/test/speed_test_functions.cpp new file mode 100644 index 000000000..518962d0c --- /dev/null +++ b/libs/endian/test/speed_test_functions.cpp @@ -0,0 +1,96 @@ +// speed_test_functions.cpp ----------------------------------------------------------// + +// Copyright Beman Dawes 2013 + +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +//--------------------------------------------------------------------------------------// + +// These functions are in a separate compilation unit partially to defeat optimizers +// and partially to create a worst case scenario. They are in a user namespace for +// realism. + +//--------------------------------------------------------------------------------------// + +#ifndef _SCL_SECURE_NO_WARNINGS +# define _SCL_SECURE_NO_WARNINGS +#endif + +#ifndef _CRT_SECURE_NO_WARNINGS +# define _CRT_SECURE_NO_WARNINGS +#endif + +#include "speed_test_functions.hpp" + +namespace user +{ + + int16_t return_x_big_int16(int16_t x, big_int16_t) BOOST_NOEXCEPT { return x; } + int16_t return_x_little_int16(int16_t x, little_int16_t) BOOST_NOEXCEPT { return x; } + int16_t return_x_value_big_int16(int16_t x, big_int16_t) BOOST_NOEXCEPT + { + return conditional_reverse<order::native, order::big>(x); + } + int16_t return_x_value_little_int16(int16_t x, little_int16_t) BOOST_NOEXCEPT + { + return conditional_reverse<order::native, order::little>(x); + } + int16_t return_x_inplace_big_int16(int16_t x, big_int16_t) BOOST_NOEXCEPT + { + conditional_reverse_inplace<order::native, order::big>(x); return x; + } + int16_t return_x_inplace_little_int16(int16_t x, little_int16_t) BOOST_NOEXCEPT + { + conditional_reverse_inplace<order::native, order::little>(x); return x; + } + int16_t return_y_big_int16(int16_t x, big_int16_t y) BOOST_NOEXCEPT { return y; } + int16_t return_y_little_int16(int16_t x, little_int16_t y) BOOST_NOEXCEPT { return y; } + + //------------------------------------------------------------------------------------// + + int32_t return_x_big_int32(int32_t x, big_int32_t) BOOST_NOEXCEPT { return x; } + int32_t return_x_little_int32(int32_t x, little_int32_t) BOOST_NOEXCEPT { return x; } + int32_t return_x_value_big_int32(int32_t x, big_int32_t) BOOST_NOEXCEPT + { + return conditional_reverse<order::native, order::big>(x); + } + int32_t return_x_value_little_int32(int32_t x, little_int32_t) BOOST_NOEXCEPT + { + return conditional_reverse<order::native, order::little>(x); + } + int32_t return_x_inplace_big_int32(int32_t x, big_int32_t) BOOST_NOEXCEPT + { + conditional_reverse_inplace<order::native, order::big>(x); return x; + } + int32_t return_x_inplace_little_int32(int32_t x, little_int32_t) BOOST_NOEXCEPT + { + conditional_reverse_inplace<order::native, order::little>(x); return x; + } + int32_t return_y_big_int32(int32_t x, big_int32_t y) BOOST_NOEXCEPT { return y; } + int32_t return_y_little_int32(int32_t x, little_int32_t y) BOOST_NOEXCEPT { return y; } + + //------------------------------------------------------------------------------------// + + int64_t return_x_big_int64(int64_t x, big_int64_t) BOOST_NOEXCEPT { return x; } + int64_t return_x_little_int64(int64_t x, little_int64_t) BOOST_NOEXCEPT { return x; } + int64_t return_x_value_big_int64(int64_t x, big_int64_t) BOOST_NOEXCEPT + { + return conditional_reverse<order::native, order::big>(x); + } + int64_t return_x_value_little_int64(int64_t x, little_int64_t) BOOST_NOEXCEPT + { + return conditional_reverse<order::native, order::little>(x); + } + int64_t return_x_inplace_big_int64(int64_t x, big_int64_t) BOOST_NOEXCEPT + { + conditional_reverse_inplace<order::native, order::big>(x); return x; + } + int64_t return_x_inplace_little_int64(int64_t x, little_int64_t) BOOST_NOEXCEPT + { + conditional_reverse_inplace<order::native, order::little>(x); return x; + } + int64_t return_y_big_int64(int64_t x, big_int64_t y) BOOST_NOEXCEPT { return y; } + int64_t return_y_little_int64(int64_t x, little_int64_t y) BOOST_NOEXCEPT { return y; } + +} diff --git a/libs/endian/test/speed_test_functions.hpp b/libs/endian/test/speed_test_functions.hpp new file mode 100644 index 000000000..df1634f73 --- /dev/null +++ b/libs/endian/test/speed_test_functions.hpp @@ -0,0 +1,56 @@ +// speed_test_functions.hpp ----------------------------------------------------------// + +// Copyright Beman Dawes 2013 + +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt + +//--------------------------------------------------------------------------------------// + +// These functions are separately compiled partially to defeat optimizers and +// partially to create a worst case scenario. They are in a user namespace for +// a bit of realism. + +//--------------------------------------------------------------------------------------// + +#ifndef BOOST_ENDIAN_SPEED_TEST_FUNCTIONS_HPP +#define BOOST_ENDIAN_SPEED_TEST_FUNCTIONS_HPP + +#include <boost/cstdint.hpp> +#include <boost/endian/arithmetic.hpp> + +namespace user +{ + using namespace boost; + using namespace boost::endian; + + int16_t return_x_big_int16(int16_t x, big_int16_t y) BOOST_NOEXCEPT; + int16_t return_x_little_int16(int16_t x, little_int16_t y) BOOST_NOEXCEPT; + int16_t return_x_value_big_int16(int16_t x, big_int16_t) BOOST_NOEXCEPT; + int16_t return_x_value_little_int16(int16_t x, little_int16_t y) BOOST_NOEXCEPT; + int16_t return_x_inplace_big_int16(int16_t x, big_int16_t y) BOOST_NOEXCEPT; + int16_t return_x_inplace_little_int16(int16_t x, little_int16_t y) BOOST_NOEXCEPT; + int16_t return_y_big_int16(int16_t x, big_int16_t y) BOOST_NOEXCEPT; + int16_t return_y_little_int16(int16_t x, little_int16_t y) BOOST_NOEXCEPT; + + int32_t return_x_big_int32(int32_t x, big_int32_t y) BOOST_NOEXCEPT; + int32_t return_x_little_int32(int32_t x, little_int32_t y) BOOST_NOEXCEPT; + int32_t return_x_value_big_int32(int32_t x, big_int32_t) BOOST_NOEXCEPT; + int32_t return_x_value_little_int32(int32_t x, little_int32_t y) BOOST_NOEXCEPT; + int32_t return_x_inplace_big_int32(int32_t x, big_int32_t y) BOOST_NOEXCEPT; + int32_t return_x_inplace_little_int32(int32_t x, little_int32_t y) BOOST_NOEXCEPT; + int32_t return_y_big_int32(int32_t x, big_int32_t y) BOOST_NOEXCEPT; + int32_t return_y_little_int32(int32_t x, little_int32_t y) BOOST_NOEXCEPT; + + int64_t return_x_big_int64(int64_t x, big_int64_t y) BOOST_NOEXCEPT; + int64_t return_x_little_int64(int64_t x, little_int64_t y) BOOST_NOEXCEPT; + int64_t return_x_value_big_int64(int64_t x, big_int64_t) BOOST_NOEXCEPT; + int64_t return_x_value_little_int64(int64_t x, little_int64_t y) BOOST_NOEXCEPT; + int64_t return_x_inplace_big_int64(int64_t x, big_int64_t y) BOOST_NOEXCEPT; + int64_t return_x_inplace_little_int64(int64_t x, little_int64_t y) BOOST_NOEXCEPT; + int64_t return_y_big_int64(int64_t x, big_int64_t y) BOOST_NOEXCEPT; + int64_t return_y_little_int64(int64_t x, little_int64_t y) BOOST_NOEXCEPT; + +} + +#endif |