From 674274ed06dfdf9488e7f3bc9e3b45b9f7f4fb18 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 28 May 2010 19:23:45 +0000 Subject: More myriad testing and unit test features, not unit tests that may take a while are welcome to provide progress info with some builtin functions. The Bu::Archive class now throws an exception if reading is interrupted by EOS --- src/archive.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/archive.cpp') diff --git a/src/archive.cpp b/src/archive.cpp index d5f77c5..f29895c 100644 --- a/src/archive.cpp +++ b/src/archive.cpp @@ -33,7 +33,8 @@ void Bu::Archive::read( void *pData, int32_t nSize ) if( nSize == 0 || pData == NULL ) return; - rStream.read( (char *)pData, nSize ); + if( rStream.read( (char *)pData, nSize ) < nSize ) + throw Bu::ExceptionBase("Insufficient data to unarchive object."); } void Bu::Archive::close() -- cgit v1.2.3