aboutsummaryrefslogtreecommitdiff
path: root/src/unit
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit')
-rw-r--r--src/unit/taf.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/unit/taf.cpp b/src/unit/taf.cpp
index 3bf7cc6..e4b3ccc 100644
--- a/src/unit/taf.cpp
+++ b/src/unit/taf.cpp
@@ -23,6 +23,7 @@ public:
23 addTest( Unit::read1 ); 23 addTest( Unit::read1 );
24 addTest( Unit::encode1 ); 24 addTest( Unit::encode1 );
25 addTest( Unit::emptyStr1 ); 25 addTest( Unit::emptyStr1 );
26 addTest( Unit::incomplete1 );
26 } 27 }
27 28
28 virtual ~Unit() 29 virtual ~Unit()
@@ -108,6 +109,21 @@ public:
108 unitTest( 109 unitTest(
109 mb.getString() == "{\"Test Group\":\n \"Lame\"=\"\"\n}\n" ); 110 mb.getString() == "{\"Test Group\":\n \"Lame\"=\"\"\n}\n" );
110 } 111 }
112
113 void incomplete1()
114 {
115 try
116 {
117 Bu::MemBuf mb("{Lame: \"Hello=\"");
118 Bu::TafReader tr( mb );
119 delete tr.readGroup();
120 unitFailed("Should have thrown an exception, didn't.");
121 }
122 catch( Bu::TafException &e )
123 {
124 // Woot
125 }
126 }
111}; 127};
112 128
113int main( int argc, char *argv[] ) 129int main( int argc, char *argv[] )