From d10e6a5ca0905f0ef2836cd98aebfb48e7f1e8a3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 20 Apr 2022 11:14:47 -0700 Subject: ArchiveBase/Archive renamed. More to come. --- src/unit/archive.unit | 20 ++++++++++---------- src/unit/myriad.unit | 16 ++++++++-------- 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/unit') diff --git a/src/unit/archive.unit b/src/unit/archive.unit index 58f7d2b..6b975ac 100644 --- a/src/unit/archive.unit +++ b/src/unit/archive.unit @@ -8,17 +8,17 @@ #include "bu/membuf.h" #include "bu/array.h" -#include "bu/archive.h" +#include "bu/archivebinary.h" using namespace Bu; -suite Archive +suite ArchiveBinary { test primitives { MemBuf mb; { - Archive ar( mb, Archive::save ); + ArchiveBinary ar( mb, ArchiveBinary::save ); ar << (int8_t)1; ar << (uint8_t)2; ar << (int16_t)3; @@ -41,7 +41,7 @@ suite Archive } mb.setPos( 0 ); { - Archive ar( mb, Archive::load ); + ArchiveBinary ar( mb, ArchiveBinary::load ); int8_t p1; uint8_t p2; int16_t p3; @@ -104,7 +104,7 @@ suite Archive { MemBuf mb; { - Archive ar( mb, Archive::save ); + ArchiveBinary ar( mb, ArchiveBinary::save ); String sStr("This is a test string."); List lList; lList.append( 10 ); @@ -117,7 +117,7 @@ suite Archive } mb.setPos( 0 ); { - Archive ar( mb, Archive::load ); + ArchiveBinary ar( mb, ArchiveBinary::load ); String sStr; List lList; ar >> sStr; @@ -137,7 +137,7 @@ suite Archive { MemBuf mb; { - Archive ar( mb, Archive::save ); + ArchiveBinary ar( mb, ArchiveBinary::save ); String sStr("This is a test string."); Array lArray; lArray.append( 10 ); @@ -150,7 +150,7 @@ suite Archive } mb.setPos( 0 ); { - Archive ar( mb, Archive::load ); + ArchiveBinary ar( mb, ArchiveBinary::load ); String sStr; Array lArray; ar >> sStr; @@ -170,7 +170,7 @@ suite Archive { MemBuf mb; { - Archive ar( mb, Archive::save ); + ArchiveBinary ar( mb, ArchiveBinary::save ); Array lArray; lArray.append( "10" ); lArray.append( "20" ); @@ -181,7 +181,7 @@ suite Archive } mb.setPos( 0 ); { - Archive ar( mb, Archive::load ); + ArchiveBinary ar( mb, ArchiveBinary::load ); Array lArray; ar >> lArray; unitTest( lArray.getSize() == 4 ); diff --git a/src/unit/myriad.unit b/src/unit/myriad.unit index 91a89c9..09d92a3 100644 --- a/src/unit/myriad.unit +++ b/src/unit/myriad.unit @@ -13,7 +13,7 @@ #include "bu/array.h" #include "bu/sio.h" -#include "bu/archive.h" +#include "bu/archivebinary.h" #include "bu/md5.h" #include "bu/unitsuite.h" @@ -23,8 +23,8 @@ using namespace Bu; class VerifyObject { -friend Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const VerifyObject &vo ); -friend Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, VerifyObject &vo ); +friend Bu::Archive &operator<<( Bu::Archive &ar, const VerifyObject &vo ); +friend Bu::Archive &operator>>( Bu::Archive &ar, VerifyObject &vo ); public: VerifyObject( int iUnits ) : iUnits( iUnits ), @@ -46,7 +46,7 @@ private: mutable int iBytesWritten; }; -Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const VerifyObject &vo ) +Bu::Archive &operator<<( Bu::Archive &ar, const VerifyObject &vo ) { Md5 sum; ar << vo.iUnits; @@ -70,7 +70,7 @@ Bu::ArchiveBase &operator<<( Bu::ArchiveBase &ar, const VerifyObject &vo ) return ar; } -Bu::ArchiveBase &operator>>( Bu::ArchiveBase &ar, VerifyObject &vo ) +Bu::Archive &operator>>( Bu::Archive &ar, VerifyObject &vo ) { Md5 sum; ar >> vo.iUnits; @@ -347,7 +347,7 @@ suite Myriad VerifyObject vo( random()%1024 ); { MyriadStream ms = m.openStream( iStream ); - Archive ar( ms, Archive::save ); + ArchiveBinary ar( ms, ArchiveBinary::save ); ar << vo; unitTest( ms.tell() == vo.getBytesWritten() ); ms.setSize( ms.tell() ); @@ -366,12 +366,12 @@ suite Myriad VerifyObject vo( random()%1024 ); { MyriadStream ms = m.openStream( *i ); - Archive ar( ms, Archive::load ); + ArchiveBinary ar( ms, ArchiveBinary::load ); ar >> vo; } { MyriadStream ms = m.openStream( *i ); - Archive ar( ms, Archive::save ); + ArchiveBinary ar( ms, ArchiveBinary::save ); ar << vo; unitTest( ms.tell() == vo.getBytesWritten() ); ms.setSize( ms.tell() ); -- cgit v1.2.3