More stuff and tests integrated
This commit is contained in:
parent
ccd7cc30ef
commit
b9d77922ed
16 changed files with 92 additions and 119 deletions
|
@ -2,11 +2,11 @@
|
||||||
/* FILES **********************************************************************/
|
/* FILES **********************************************************************/
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
#ifndef _H_LW_LIB_FILES
|
#ifndef _H_EBCL_FILES
|
||||||
#define _H_LW_LIB_FILES
|
#define _H_EBCL_FILES
|
||||||
#include <lw/lib/Streams.hh>
|
#include <ebcl/Streams.hh>
|
||||||
#include <lw/lib/Strings.hh>
|
#include <ebcl/Strings.hh>
|
||||||
namespace lw {
|
namespace ebcl {
|
||||||
|
|
||||||
|
|
||||||
/*= FILE ACCESS ==============================================================*/
|
/*= FILE ACCESS ==============================================================*/
|
||||||
|
@ -183,5 +183,5 @@ M_CLASS_POINTERS( FileOutputStream );
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif // _H_LW_LIB_FILES
|
#endif // _H_EBCL_FILES
|
||||||
#include <lw/lib/inline/Files.hh>
|
#include <ebcl/inline/Files.hh>
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
/* MEMORY STREAMS *************************************************************/
|
/* MEMORY STREAMS *************************************************************/
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
#pragma once
|
#ifndef _H_EBCL_MEMORYSTREAMS
|
||||||
#include <lw/lib/Streams.hh>
|
#define _H_EBCL_MEMORYSTREAMS
|
||||||
namespace lw {
|
#include <ebcl/Streams.hh>
|
||||||
|
namespace ebcl {
|
||||||
|
|
||||||
|
|
||||||
class T_MemoryInputStream final : public A_InputStream
|
class T_MemoryInputStream final : public A_InputStream
|
||||||
|
@ -59,4 +60,5 @@ M_CLASS_POINTERS( MemoryOutputStream );
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
#include <lw/lib/inline/MemoryStreams.hh>
|
#include <ebcl/inline/MemoryStreams.hh>
|
||||||
|
#endif // _H_EBCL_MEMORYSTREAMS
|
||||||
|
|
|
@ -232,7 +232,7 @@ template< typename T >
|
||||||
|
|
||||||
// M_DEFINE_SWAP( Type ) - Define the swap function for a given type
|
// M_DEFINE_SWAP( Type ) - Define the swap function for a given type
|
||||||
#define M_DEFINE_SWAP( Type ) \
|
#define M_DEFINE_SWAP( Type ) \
|
||||||
void lw::swap( Type& lhs , Type& rhs ) noexcept
|
void swap( Type& lhs , Type& rhs ) noexcept
|
||||||
|
|
||||||
|
|
||||||
/*= ENDIAN DETECTION =========================================================*/
|
/*= ENDIAN DETECTION =========================================================*/
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
/* FILES - INLINE CODE ********************************************************/
|
/* FILES - INLINE CODE ********************************************************/
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
#ifndef _H_LW_LIB_INLINE_FILES
|
#ifndef _H_EBCL_INLINE_FILES
|
||||||
#define _H_LW_LIB_INLINE_FILES
|
#define _H_EBCL_INLINE_FILES
|
||||||
#include <lw/lib/Files.hh>
|
#include <ebcl/Files.hh>
|
||||||
namespace lw {
|
namespace ebcl {
|
||||||
|
|
||||||
|
|
||||||
/*= T_File ===================================================================*/
|
/*= T_File ===================================================================*/
|
||||||
|
@ -96,4 +96,4 @@ inline size_t T_FileOutputStream::offset( ) const noexcept
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
#endif // _H_LW_LIB_INLINE_FILES
|
#endif // _H_EBCL_INLINE_FILES
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
/* MEMORY STREAMS - INLINE CODE ***********************************************/
|
/* MEMORY STREAMS - INLINE CODE ***********************************************/
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
#pragma once
|
#ifndef _H_EBCL_INLINE_MEMORYSTREAMS
|
||||||
#include <lw/lib/MemoryStreams.hh>
|
#define _H_EBCL_INLINE_MEMORYSTREAMS
|
||||||
namespace lw {
|
#include <ebcl/MemoryStreams.hh>
|
||||||
|
namespace ebcl {
|
||||||
|
|
||||||
|
|
||||||
/*= T_MemoryInputStream ======================================================*/
|
/*= T_MemoryInputStream ======================================================*/
|
||||||
|
@ -41,3 +42,4 @@ inline T_MemoryOutputStream::T_MemoryOutputStream( T_Buffer< T >& buffer )
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
#endif // _H_EBCL_INLINE_MEMORYSTREAMS
|
||||||
|
|
29
src/Files.cc
29
src/Files.cc
|
@ -3,8 +3,8 @@
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include <lw/lib/Files.hh>
|
#include <ebcl/Files.hh>
|
||||||
using namespace lw;
|
using namespace ebcl;
|
||||||
|
|
||||||
|
|
||||||
/*= T_File ==================================================================*/
|
/*= T_File ==================================================================*/
|
||||||
|
@ -41,20 +41,17 @@ void T_File::open( )
|
||||||
const T_Buffer< char > path( path_.toOSString( ) );
|
const T_Buffer< char > path( path_.toOSString( ) );
|
||||||
|
|
||||||
// Select the right mode
|
// Select the right mode
|
||||||
char const* mode;
|
char const* const mode( ([this]() {
|
||||||
switch ( mode_ ) {
|
switch ( mode_ ) {
|
||||||
case E_FileMode::READ_ONLY:
|
case E_FileMode::READ_ONLY:
|
||||||
mode = "rb";
|
return "rb";
|
||||||
break;
|
case E_FileMode::READ_WRITE:
|
||||||
|
return "rb+";
|
||||||
case E_FileMode::READ_WRITE:
|
case E_FileMode::OVERWRITE:
|
||||||
mode = "rb+";
|
return "wb+";
|
||||||
break;
|
}
|
||||||
|
std::abort( );
|
||||||
case E_FileMode::OVERWRITE:
|
})( ) );
|
||||||
mode = "wb+";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Open the file
|
// Open the file
|
||||||
#ifdef WIN32_
|
#ifdef WIN32_
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
/* MEMORY STREAMS *************************************************************/
|
/* MEMORY STREAMS *************************************************************/
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
#include <lw/lib/MemoryStreams.hh>
|
#include <ebcl/MemoryStreams.hh>
|
||||||
using namespace lw;
|
using namespace ebcl;
|
||||||
|
|
||||||
|
|
||||||
/*= T_MemoryInputStream ======================================================*/
|
/*= T_MemoryInputStream ======================================================*/
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
LIB_SOURCES = \
|
LIB_SOURCES = \
|
||||||
|
src/Files.cc \
|
||||||
src/HashIndex.cc \
|
src/HashIndex.cc \
|
||||||
|
src/MemoryStreams.cc \
|
||||||
src/Pointers.cc \
|
src/Pointers.cc \
|
||||||
src/Streams.cc \
|
src/Streams.cc \
|
||||||
src/Strings.cc \
|
src/Strings.cc \
|
||||||
|
@ -8,8 +10,6 @@ LIB_SOURCES = \
|
||||||
# END
|
# END
|
||||||
|
|
||||||
#
|
#
|
||||||
# src/Files.cc \
|
|
||||||
# src/MemoryStreams.cc \
|
|
||||||
# src/SRDBinary.cc \
|
# src/SRDBinary.cc \
|
||||||
# src/SRDData.cc \
|
# src/SRDData.cc \
|
||||||
# src/SRDDefinitions.cc \
|
# src/SRDDefinitions.cc \
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
#include <lw/lib/BinaryStreams.hh>
|
#include <ebcl/BinaryStreams.hh>
|
||||||
#include <lw/lib/MemoryStreams.hh>
|
#include <ebcl/MemoryStreams.hh>
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
using namespace lw;
|
using namespace ebcl;
|
||||||
|
|
||||||
|
|
||||||
/* - StreamReaderTest ---------------------------------------------------{{{-*/
|
/* - StreamReaderTest -------------------------------------------------------*/
|
||||||
|
|
||||||
class StreamReaderTest : public CppUnit::TestFixture
|
class StreamReaderTest : public CppUnit::TestFixture
|
||||||
{
|
{
|
||||||
CPPUNIT_TEST_SUITE( StreamReaderTest );
|
CPPUNIT_TEST_SUITE( StreamReaderTest );
|
||||||
|
@ -40,7 +41,7 @@ public:
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION( StreamReaderTest );
|
CPPUNIT_TEST_SUITE_REGISTRATION( StreamReaderTest );
|
||||||
|
|
||||||
void StreamReaderTest::testNumericBigEndian8( ) // {{{
|
void StreamReaderTest::testNumericBigEndian8( )
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0x12 };
|
const uint8_t data[] = { 0x12 };
|
||||||
T_MemoryInputStream ms( data , sizeof( data ) );
|
T_MemoryInputStream ms( data , sizeof( data ) );
|
||||||
|
@ -49,8 +50,7 @@ void StreamReaderTest::testNumericBigEndian8( ) // {{{
|
||||||
rd.readNumericBigEndian< uint8_t >( ) );
|
rd.readNumericBigEndian< uint8_t >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericLittleEndian8( )
|
||||||
void StreamReaderTest::testNumericLittleEndian8( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0x12 };
|
const uint8_t data[] = { 0x12 };
|
||||||
T_MemoryInputStream ms( data , sizeof( data ) );
|
T_MemoryInputStream ms( data , sizeof( data ) );
|
||||||
|
@ -59,8 +59,7 @@ void StreamReaderTest::testNumericLittleEndian8( ) // {{{
|
||||||
rd.readNumericLittleEndian< uint8_t >( ) );
|
rd.readNumericLittleEndian< uint8_t >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericBigEndian16( )
|
||||||
void StreamReaderTest::testNumericBigEndian16( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0xbe , 0xef };
|
const uint8_t data[] = { 0xbe , 0xef };
|
||||||
T_MemoryInputStream ms( data , sizeof( data ) );
|
T_MemoryInputStream ms( data , sizeof( data ) );
|
||||||
|
@ -69,8 +68,7 @@ void StreamReaderTest::testNumericBigEndian16( ) // {{{
|
||||||
rd.readNumericBigEndian< uint16_t >( ) );
|
rd.readNumericBigEndian< uint16_t >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericLittleEndian16( )
|
||||||
void StreamReaderTest::testNumericLittleEndian16( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0xbe , 0xef };
|
const uint8_t data[] = { 0xbe , 0xef };
|
||||||
T_MemoryInputStream ms( data , sizeof( data ) );
|
T_MemoryInputStream ms( data , sizeof( data ) );
|
||||||
|
@ -79,8 +77,7 @@ void StreamReaderTest::testNumericLittleEndian16( ) // {{{
|
||||||
rd.readNumericLittleEndian< uint16_t >( ) );
|
rd.readNumericLittleEndian< uint16_t >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericBigEndian32( )
|
||||||
void StreamReaderTest::testNumericBigEndian32( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0xde , 0xad , 0xbe , 0xef };
|
const uint8_t data[] = { 0xde , 0xad , 0xbe , 0xef };
|
||||||
T_MemoryInputStream ms( data , sizeof( data ) );
|
T_MemoryInputStream ms( data , sizeof( data ) );
|
||||||
|
@ -89,8 +86,7 @@ void StreamReaderTest::testNumericBigEndian32( ) // {{{
|
||||||
rd.readNumericBigEndian< uint32_t >( ) );
|
rd.readNumericBigEndian< uint32_t >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericLittleEndian32( )
|
||||||
void StreamReaderTest::testNumericLittleEndian32( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0xde , 0xad , 0xbe , 0xef };
|
const uint8_t data[] = { 0xde , 0xad , 0xbe , 0xef };
|
||||||
T_MemoryInputStream ms( data , sizeof( data ) );
|
T_MemoryInputStream ms( data , sizeof( data ) );
|
||||||
|
@ -99,8 +95,7 @@ void StreamReaderTest::testNumericLittleEndian32( ) // {{{
|
||||||
rd.readNumericLittleEndian< uint32_t >( ) );
|
rd.readNumericLittleEndian< uint32_t >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericBigEndian32f( )
|
||||||
void StreamReaderTest::testNumericBigEndian32f( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0x3f , 0x80 , 0x00 , 0x00 };
|
const uint8_t data[] = { 0x3f , 0x80 , 0x00 , 0x00 };
|
||||||
T_MemoryInputStream ms( data , sizeof( data ) );
|
T_MemoryInputStream ms( data , sizeof( data ) );
|
||||||
|
@ -108,8 +103,7 @@ void StreamReaderTest::testNumericBigEndian32f( ) // {{{
|
||||||
CPPUNIT_ASSERT_EQUAL( 1.0f , rd.readNumericBigEndian< float >( ) );
|
CPPUNIT_ASSERT_EQUAL( 1.0f , rd.readNumericBigEndian< float >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericLittleEndian32f( )
|
||||||
void StreamReaderTest::testNumericLittleEndian32f( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0x00 , 0x00 , 0x80 , 0x3f };
|
const uint8_t data[] = { 0x00 , 0x00 , 0x80 , 0x3f };
|
||||||
T_MemoryInputStream ms( data , sizeof( data ) );
|
T_MemoryInputStream ms( data , sizeof( data ) );
|
||||||
|
@ -117,8 +111,7 @@ void StreamReaderTest::testNumericLittleEndian32f( ) // {{{
|
||||||
CPPUNIT_ASSERT_EQUAL( 1.0f , rd.readNumericLittleEndian< float >( ) );
|
CPPUNIT_ASSERT_EQUAL( 1.0f , rd.readNumericLittleEndian< float >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericBigEndian64( )
|
||||||
void StreamReaderTest::testNumericBigEndian64( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = {
|
const uint8_t data[] = {
|
||||||
0xba , 0xdb , 0xa7 , 0x5e , 0xa7 , 0xba , 0xb1 , 0x35
|
0xba , 0xdb , 0xa7 , 0x5e , 0xa7 , 0xba , 0xb1 , 0x35
|
||||||
|
@ -129,8 +122,7 @@ void StreamReaderTest::testNumericBigEndian64( ) // {{{
|
||||||
rd.readNumericBigEndian< uint64_t >( ) );
|
rd.readNumericBigEndian< uint64_t >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericLittleEndian64( )
|
||||||
void StreamReaderTest::testNumericLittleEndian64( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = {
|
const uint8_t data[] = {
|
||||||
0x35 , 0xb1 , 0xba , 0xa7 , 0x5e , 0xa7 , 0xdb , 0xba ,
|
0x35 , 0xb1 , 0xba , 0xa7 , 0x5e , 0xa7 , 0xdb , 0xba ,
|
||||||
|
@ -141,8 +133,7 @@ void StreamReaderTest::testNumericLittleEndian64( ) // {{{
|
||||||
rd.readNumericLittleEndian< uint64_t >( ) );
|
rd.readNumericLittleEndian< uint64_t >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericBigEndian64f( )
|
||||||
void StreamReaderTest::testNumericBigEndian64f( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0x3f , 0xf0 , 0 , 0 , 0 , 0 , 0 , 0 };
|
const uint8_t data[] = { 0x3f , 0xf0 , 0 , 0 , 0 , 0 , 0 , 0 };
|
||||||
T_MemoryInputStream ms( data , sizeof( data ) );
|
T_MemoryInputStream ms( data , sizeof( data ) );
|
||||||
|
@ -150,15 +141,10 @@ void StreamReaderTest::testNumericBigEndian64f( ) // {{{
|
||||||
CPPUNIT_ASSERT_EQUAL( 1.0 , rd.readNumericBigEndian< double >( ) );
|
CPPUNIT_ASSERT_EQUAL( 1.0 , rd.readNumericBigEndian< double >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void StreamReaderTest::testNumericLittleEndian64f( )
|
||||||
void StreamReaderTest::testNumericLittleEndian64f( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0 , 0 , 0 , 0 , 0 , 0 , 0xf0 , 0x3f };
|
const uint8_t data[] = { 0 , 0 , 0 , 0 , 0 , 0 , 0xf0 , 0x3f };
|
||||||
T_MemoryInputStream ms( data , sizeof( data ) );
|
T_MemoryInputStream ms( data , sizeof( data ) );
|
||||||
T_BinaryReader rd( ms );
|
T_BinaryReader rd( ms );
|
||||||
CPPUNIT_ASSERT_EQUAL( 1.0 , rd.readNumericLittleEndian< double >( ) );
|
CPPUNIT_ASSERT_EQUAL( 1.0 , rd.readNumericLittleEndian< double >( ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------}}}-*/
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
#include <lw/lib/BinaryStreams.hh>
|
#include <ebcl/BinaryStreams.hh>
|
||||||
#include <lw/lib/MemoryStreams.hh>
|
#include <ebcl/MemoryStreams.hh>
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
using namespace lw;
|
using namespace ebcl;
|
||||||
|
|
||||||
|
|
||||||
/* - BinaryWriterTest ---------------------------------------------------{{{-*/
|
/* - BinaryWriterTest -------------------------------------------------------*/
|
||||||
|
|
||||||
class BinaryWriterTest : public CppUnit::TestFixture
|
class BinaryWriterTest : public CppUnit::TestFixture
|
||||||
{
|
{
|
||||||
CPPUNIT_TEST_SUITE( BinaryWriterTest );
|
CPPUNIT_TEST_SUITE( BinaryWriterTest );
|
||||||
|
@ -40,7 +41,7 @@ public:
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE_REGISTRATION( BinaryWriterTest );
|
CPPUNIT_TEST_SUITE_REGISTRATION( BinaryWriterTest );
|
||||||
|
|
||||||
void BinaryWriterTest::testNumericBigEndian8( ) // {{{
|
void BinaryWriterTest::testNumericBigEndian8( )
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0x12 };
|
const uint8_t data[] = { 0x12 };
|
||||||
T_Buffer< uint8_t > buffer;
|
T_Buffer< uint8_t > buffer;
|
||||||
|
@ -54,8 +55,7 @@ void BinaryWriterTest::testNumericBigEndian8( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericLittleEndian8( )
|
||||||
void BinaryWriterTest::testNumericLittleEndian8( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0x12 };
|
const uint8_t data[] = { 0x12 };
|
||||||
T_Buffer< uint8_t > buffer;
|
T_Buffer< uint8_t > buffer;
|
||||||
|
@ -69,8 +69,7 @@ void BinaryWriterTest::testNumericLittleEndian8( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericBigEndian16( )
|
||||||
void BinaryWriterTest::testNumericBigEndian16( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0xbe , 0xef };
|
const uint8_t data[] = { 0xbe , 0xef };
|
||||||
T_Buffer< uint8_t > buffer;
|
T_Buffer< uint8_t > buffer;
|
||||||
|
@ -84,8 +83,7 @@ void BinaryWriterTest::testNumericBigEndian16( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericLittleEndian16( )
|
||||||
void BinaryWriterTest::testNumericLittleEndian16( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0xbe , 0xef };
|
const uint8_t data[] = { 0xbe , 0xef };
|
||||||
T_Buffer< uint8_t > buffer;
|
T_Buffer< uint8_t > buffer;
|
||||||
|
@ -99,8 +97,7 @@ void BinaryWriterTest::testNumericLittleEndian16( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericBigEndian32( )
|
||||||
void BinaryWriterTest::testNumericBigEndian32( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0xde , 0xad , 0xbe , 0xef };
|
const uint8_t data[] = { 0xde , 0xad , 0xbe , 0xef };
|
||||||
T_Buffer< uint8_t > buffer;
|
T_Buffer< uint8_t > buffer;
|
||||||
|
@ -114,8 +111,7 @@ void BinaryWriterTest::testNumericBigEndian32( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericLittleEndian32( )
|
||||||
void BinaryWriterTest::testNumericLittleEndian32( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0xde , 0xad , 0xbe , 0xef };
|
const uint8_t data[] = { 0xde , 0xad , 0xbe , 0xef };
|
||||||
T_Buffer< uint8_t > buffer;
|
T_Buffer< uint8_t > buffer;
|
||||||
|
@ -129,8 +125,7 @@ void BinaryWriterTest::testNumericLittleEndian32( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericBigEndian32f( )
|
||||||
void BinaryWriterTest::testNumericBigEndian32f( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0x3f , 0x80 , 0x00 , 0x00 };
|
const uint8_t data[] = { 0x3f , 0x80 , 0x00 , 0x00 };
|
||||||
T_Buffer< uint8_t > buffer;
|
T_Buffer< uint8_t > buffer;
|
||||||
|
@ -144,8 +139,7 @@ void BinaryWriterTest::testNumericBigEndian32f( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericLittleEndian32f( )
|
||||||
void BinaryWriterTest::testNumericLittleEndian32f( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0x00 , 0x00 , 0x80 , 0x3f };
|
const uint8_t data[] = { 0x00 , 0x00 , 0x80 , 0x3f };
|
||||||
T_Buffer< uint8_t > buffer;
|
T_Buffer< uint8_t > buffer;
|
||||||
|
@ -159,8 +153,7 @@ void BinaryWriterTest::testNumericLittleEndian32f( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericBigEndian64( )
|
||||||
void BinaryWriterTest::testNumericBigEndian64( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = {
|
const uint8_t data[] = {
|
||||||
0xba , 0xdb , 0xa7 , 0x5e , 0xa7 , 0xba , 0xb1 , 0x35
|
0xba , 0xdb , 0xa7 , 0x5e , 0xa7 , 0xba , 0xb1 , 0x35
|
||||||
|
@ -176,8 +169,7 @@ void BinaryWriterTest::testNumericBigEndian64( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericLittleEndian64( )
|
||||||
void BinaryWriterTest::testNumericLittleEndian64( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = {
|
const uint8_t data[] = {
|
||||||
0x35 , 0xb1 , 0xba , 0xa7 , 0x5e , 0xa7 , 0xdb , 0xba ,
|
0x35 , 0xb1 , 0xba , 0xa7 , 0x5e , 0xa7 , 0xdb , 0xba ,
|
||||||
|
@ -193,8 +185,7 @@ void BinaryWriterTest::testNumericLittleEndian64( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericBigEndian64f( )
|
||||||
void BinaryWriterTest::testNumericBigEndian64f( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0x3f , 0xf0 , 0 , 0 , 0 , 0 , 0 , 0 };
|
const uint8_t data[] = { 0x3f , 0xf0 , 0 , 0 , 0 , 0 , 0 , 0 };
|
||||||
T_Buffer< uint8_t > buffer;
|
T_Buffer< uint8_t > buffer;
|
||||||
|
@ -208,8 +199,7 @@ void BinaryWriterTest::testNumericBigEndian64f( ) // {{{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
void BinaryWriterTest::testNumericLittleEndian64f( )
|
||||||
void BinaryWriterTest::testNumericLittleEndian64f( ) // {{{
|
|
||||||
{
|
{
|
||||||
const uint8_t data[] = { 0 , 0 , 0 , 0 , 0 , 0 , 0xf0 , 0x3f };
|
const uint8_t data[] = { 0 , 0 , 0 , 0 , 0 , 0 , 0xf0 , 0x3f };
|
||||||
T_Buffer< uint8_t > buffer;
|
T_Buffer< uint8_t > buffer;
|
||||||
|
@ -222,7 +212,3 @@ void BinaryWriterTest::testNumericLittleEndian64f( ) // {{{
|
||||||
CPPUNIT_ASSERT_EQUAL( data[ i ] , buffer[ i ] );
|
CPPUNIT_ASSERT_EQUAL( data[ i ] , buffer[ i ] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------}}}-*/
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <lw/lib/Buffers.hh>
|
#include <ebcl/Buffers.hh>
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
using namespace lw;
|
using namespace ebcl;
|
||||||
|
|
||||||
|
|
||||||
class FixedBufferTest : public CppUnit::TestFixture
|
class FixedBufferTest : public CppUnit::TestFixture
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
TESTS = \
|
TESTS = \
|
||||||
|
buffers \
|
||||||
ptr-owned \
|
ptr-owned \
|
||||||
ptr-shared \
|
ptr-shared \
|
||||||
ptr-weak \
|
ptr-weak \
|
||||||
|
@ -8,6 +9,12 @@ TESTS = \
|
||||||
arrays-static-objects \
|
arrays-static-objects \
|
||||||
arrays-auto \
|
arrays-auto \
|
||||||
arrays-multi \
|
arrays-multi \
|
||||||
|
strings \
|
||||||
|
strings-iterator \
|
||||||
|
strings-storage \
|
||||||
|
strings-builder \
|
||||||
|
binary-reader \
|
||||||
|
binary-writer \
|
||||||
optional \
|
optional \
|
||||||
union \
|
union \
|
||||||
variant \
|
variant \
|
||||||
|
@ -18,14 +25,7 @@ TESTS = \
|
||||||
|
|
||||||
#TESTS = \
|
#TESTS = \
|
||||||
# alloc-pool \
|
# alloc-pool \
|
||||||
# buffers \
|
|
||||||
# ring-buffer \
|
# ring-buffer \
|
||||||
# strings \
|
|
||||||
# strings-iterator \
|
|
||||||
# strings-storage \
|
|
||||||
# strings-builder \
|
|
||||||
# binary-reader \
|
|
||||||
# binary-writer \
|
|
||||||
# stream-file-input \
|
# stream-file-input \
|
||||||
# srd-bin-reader \
|
# srd-bin-reader \
|
||||||
# srd-bin-writer \
|
# srd-bin-writer \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include <lw/lib/Strings.hh>
|
#include <ebcl/Strings.hh>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
using namespace lw;
|
using namespace ebcl;
|
||||||
|
|
||||||
|
|
||||||
class StringsBuilderTest : public CppUnit::TestFixture
|
class StringsBuilderTest : public CppUnit::TestFixture
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <lw/lib/Strings.hh>
|
#include <ebcl/Strings.hh>
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
using namespace lw;
|
using namespace ebcl;
|
||||||
|
|
||||||
|
|
||||||
class StringsIteratorTest : public CppUnit::TestFixture
|
class StringsIteratorTest : public CppUnit::TestFixture
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <lw/lib/Strings.hh>
|
#include <ebcl/Strings.hh>
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
using namespace lw;
|
using namespace ebcl;
|
||||||
|
|
||||||
|
|
||||||
/*= StringsDynamicTest ========================================================*/
|
/*= StringsDynamicTest ========================================================*/
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include <lw/lib/Strings.hh>
|
#include <ebcl/Strings.hh>
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
using namespace lw;
|
using namespace ebcl;
|
||||||
|
|
||||||
|
|
||||||
class StringsTest : public CppUnit::TestFixture
|
class StringsTest : public CppUnit::TestFixture
|
||||||
|
|
Loading…
Reference in a new issue