aboutsummaryrefslogtreecommitdiff
path: root/src/unit/taf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit/taf.cpp')
-rw-r--r--src/unit/taf.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/unit/taf.cpp b/src/unit/taf.cpp
index 0813444..3bf7cc6 100644
--- a/src/unit/taf.cpp
+++ b/src/unit/taf.cpp
@@ -21,7 +21,8 @@ public:
21 { 21 {
22 setName("taf"); 22 setName("taf");
23 addTest( Unit::read1 ); 23 addTest( Unit::read1 );
24 addTest( Unit::encode ); 24 addTest( Unit::encode1 );
25 addTest( Unit::emptyStr1 );
25 } 26 }
26 27
27 virtual ~Unit() 28 virtual ~Unit()
@@ -50,7 +51,7 @@ public:
50#undef FN_TMP 51#undef FN_TMP
51 } 52 }
52 53
53 void encode() 54 void encode1()
54 { 55 {
55 Bu::MemBuf mb; 56 Bu::MemBuf mb;
56 Bu::TafWriter tw( mb ); 57 Bu::TafWriter tw( mb );
@@ -93,6 +94,20 @@ public:
93 unitTest( rg->getProperty("Encoded") == sData ); 94 unitTest( rg->getProperty("Encoded") == sData );
94 delete rg; 95 delete rg;
95 } 96 }
97
98 void emptyStr1()
99 {
100 Bu::MemBuf mb;
101 Bu::TafWriter tw( mb );
102
103 Bu::TafGroup g("Test Group");
104 Bu::FString sVal;
105 g.addChild( new Bu::TafProperty("Lame", sVal) );
106 tw.writeGroup( &g );
107
108 unitTest(
109 mb.getString() == "{\"Test Group\":\n \"Lame\"=\"\"\n}\n" );
110 }
96}; 111};
97 112
98int main( int argc, char *argv[] ) 113int main( int argc, char *argv[] )