|
@@ -87,6 +87,14 @@ static void testClear(Test& test) {
|
|
test.checkEqual(String("wusi1234"), s, "clear");
|
|
test.checkEqual(String("wusi1234"), s, "clear");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void testAppendChar(Test& test) {
|
|
|
|
+ StringBuffer<5> s("");
|
|
|
|
+ for(int i = 0; i < 20; i++) {
|
|
|
|
+ s.append('a');
|
|
|
|
+ }
|
|
|
|
+ test.checkEqual(StringBuffer<5>("aaaa"), s, "char append with overflow");
|
|
|
|
+ test.checkEqual(4, s.getLength(), "length after char append with overflow");
|
|
|
|
+}
|
|
|
|
|
|
void StringBufferTests::test() {
|
|
void StringBufferTests::test() {
|
|
Test test("StringBuffer");
|
|
Test test("StringBuffer");
|
|
@@ -102,5 +110,6 @@ void StringBufferTests::test() {
|
|
testFloat(test);
|
|
testFloat(test);
|
|
testBool(test);
|
|
testBool(test);
|
|
testClear(test);
|
|
testClear(test);
|
|
|
|
+ testAppendChar(test);
|
|
test.finalize();
|
|
test.finalize();
|
|
}
|
|
}
|