aboutsummaryrefslogtreecommitdiff
path: root/src/xmlfilereader.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-05-26 14:36:57 +0000
committerMike Buland <eichlan@xagasoft.com>2006-05-26 14:36:57 +0000
commita820665eea71a64b40e74ed24afeaf07a7a99db4 (patch)
tree515af31ac2ed78aa92ce7e90e478bdb452e6e438 /src/xmlfilereader.cpp
parentbd5bb1ca60a6a97b110cbf221b3625e6e6200141 (diff)
downloadlibbu++-a820665eea71a64b40e74ed24afeaf07a7a99db4.tar.gz
libbu++-a820665eea71a64b40e74ed24afeaf07a7a99db4.tar.bz2
libbu++-a820665eea71a64b40e74ed24afeaf07a7a99db4.tar.xz
libbu++-a820665eea71a64b40e74ed24afeaf07a7a99db4.zip
Added the first of many unit tests. For now the unit tests are just built with
everything else in the all target of the makefile, which is fine, but relies on CppTest, which can be found at http://cpptest.sf.net Also fixed some things I've been meaning to get to for a while in the xml system, including a few bugs that will make coping with malformed data not hang other programs, and do the error reporting in a nice way.
Diffstat (limited to '')
-rw-r--r--src/xmlfilereader.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/xmlfilereader.cpp b/src/xmlfilereader.cpp
index 216c08a..dd4bc82 100644
--- a/src/xmlfilereader.cpp
+++ b/src/xmlfilereader.cpp
@@ -1,4 +1,5 @@
1#include "xmlfilereader.h" 1#include "xmlfilereader.h"
2#include "xmlexception.h"
2#include <string.h> 3#include <string.h>
3 4
4XmlFileReader::XmlFileReader( const char *sFile, bool bStrip ) 5XmlFileReader::XmlFileReader( const char *sFile, bool bStrip )
@@ -8,7 +9,7 @@ XmlFileReader::XmlFileReader( const char *sFile, bool bStrip )
8 9
9 if( fh == NULL ) 10 if( fh == NULL )
10 { 11 {
11 reportError("Couldn't open file."); 12 throw XmlException("Couldn't open file: %s", sFile );
12 //nError = 1; 13 //nError = 1;
13 } 14 }
14 else 15 else
@@ -50,7 +51,7 @@ char XmlFileReader::getChar( int nIndex )
50 } 51 }
51 else 52 else
52 { 53 {
53 return '\0'; 54 throw XmlException("End of XML stream read.");
54 } 55 }
55} 56}
56 57