|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r65180 - sandbox/endian_ext/libs/integer/test
From: vicente.botet_at_[hidden]
Date: 2010-09-01 15:56:58
Author: viboes
Date: 2010-09-01 15:56:57 EDT (Wed, 01 Sep 2010)
New Revision: 65180
URL: http://svn.boost.org/trac/boost/changeset/65180
Log:
cleanup
Text files modified:
sandbox/endian_ext/libs/integer/test/endian_binary_stream_test.cpp | 15 ++++++++++++++-
sandbox/endian_ext/libs/integer/test/endian_convert_test.cpp | 15 +++++++++++++--
2 files changed, 27 insertions(+), 3 deletions(-)
Modified: sandbox/endian_ext/libs/integer/test/endian_binary_stream_test.cpp
==============================================================================
--- sandbox/endian_ext/libs/integer/test/endian_binary_stream_test.cpp (original)
+++ sandbox/endian_ext/libs/integer/test/endian_binary_stream_test.cpp 2010-09-01 15:56:57 EDT (Wed, 01 Sep 2010)
@@ -5,7 +5,9 @@
// Distributed under the Boost Software License, Version 1.0.
// See http://www.boost.org/LICENSE_1_0.txt
+#include <boost/integer/endian.hpp>
#include <boost/integer/endian_binary_stream.hpp>
+#include <boost/binary_stream.hpp>
#include <iostream>
#include <sstream>
@@ -44,7 +46,17 @@
ss >= big16_t_2;
BOOST_VERIFY( big16_t_1 == big16_t_2 );
- big24_t big24_t_1(0x010203L), big24_t_2;
+ big24_t big24_t_1(0x313233L), big24_t_2;
+ std::cout << '*' ;
+ std::cout <= big24_t_1;
+ std::cout << std::endl;
+ little24_t little24_t_133(big24_t_1);
+ little24_t little24_t_134;
+ //~ little24_t_134=big24_t_1;
+ std::cout << '*' ;
+ std::cout <= little24_t_133;
+ std::cout << std::endl;
+
ss <= big24_t_1;
ss >= big24_t_2;
BOOST_VERIFY( big24_t_1 == big24_t_2 );
@@ -286,4 +298,5 @@
cout << errors << " error(s) detected\n";
return errors;
+ //~ return 1;
}
Modified: sandbox/endian_ext/libs/integer/test/endian_convert_test.cpp
==============================================================================
--- sandbox/endian_ext/libs/integer/test/endian_convert_test.cpp (original)
+++ sandbox/endian_ext/libs/integer/test/endian_convert_test.cpp 2010-09-01 15:56:57 EDT (Wed, 01 Sep 2010)
@@ -31,6 +31,14 @@
#include <boost/mpl/front.hpp>
#include <boost/static_assert.hpp>
+//~ #include <netinet/in.h>
+
+#define htons(nValue) \
+ ((((nValue)>> 8)) | ((nValue) << 8));
+
+#define htonl(nLongNumber) \
+ ((((nLongNumber)&0x000000FF)<<24)+(((nLongNumber)&0x0000FF00)<<8)+ \
+ (((nLongNumber)&0x00FF0000)>>8)+(((nLongNumber)&0xFF000000)>>24))
using namespace std; // Not the best programming practice, but I
using namespace boost; // want to verify this combination of using
@@ -157,6 +165,7 @@
namespace
{
X::mixed_c m;
+ //~ Y::mixed_c m2;
void check_endian_send()
{
@@ -168,15 +177,17 @@
//~ std::cout << std::hex << m.b.b << std::endl;
//~ integer::convert_from<network>(m.a);
+ //~ m.a.a=htonl(m.a.a);
+ //~ m.a.b=htons(m.a.b);
//~ integer::convert_from<network>(m.b);
convert<from<network>, to<native_endian> >(m);
- convert_from<network>(m);
+ //~ convert_from<network>(m);
//~ std::cout << std::hex << m.a.a << std::endl;
//~ std::cout << std::hex << m.a.b << std::endl;
//~ std::cout << std::hex << m.b.a << std::endl;
//~ std::cout << std::hex << m.b.b << std::endl;
- convert_to<network>(m);
+ //~ convert_to<network>(m);
//~ std::cout << std::hex << m.a.a << std::endl;
//~ std::cout << std::hex << m.a.b << std::endl;
//~ std::cout << std::hex << m.b.a << std::endl;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk