aboutsummaryrefslogtreecommitdiff
path: root/src/unit/string.unit
diff options
context:
space:
mode:
Diffstat (limited to 'src/unit/string.unit')
-rw-r--r--src/unit/string.unit33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/unit/string.unit b/src/unit/string.unit
index 872dbed..d38aa54 100644
--- a/src/unit/string.unit
+++ b/src/unit/string.unit
@@ -376,4 +376,37 @@ suite String
376 b = a; 376 b = a;
377 a.clear(); 377 a.clear();
378 } 378 }
379
380 test append
381 {
382 // This is the byte sequence that caused += to die
383 // 03 F0 9C A4 F5 8A C8 CA 0E
384 uint8_t b;
385 Bu::String m1;
386 b = 0x03; m1 += (char)b;
387 b = 0xF0; m1 += (char)b;
388 b = 0x9C; m1 += (char)b;
389 b = 0xA4; m1 += (char)b;
390 b = 0xF5; m1 += (char)b;
391 b = 0x8A; m1 += (char)b;
392 b = 0xC8; m1 += (char)b;
393 b = 0xCA; m1 += (char)b;
394 b = 0x0E; m1 += (char)b;
395
396 Bu::String m2;
397 b = 0x03; m2.append( (const char *)&b, 1 );
398 b = 0xF0; m2.append( (const char *)&b, 1 );
399 b = 0x9C; m2.append( (const char *)&b, 1 );
400 b = 0xA4; m2.append( (const char *)&b, 1 );
401 b = 0xF5; m2.append( (const char *)&b, 1 );
402 b = 0x8A; m2.append( (const char *)&b, 1 );
403 b = 0xC8; m2.append( (const char *)&b, 1 );
404 b = 0xCA; m2.append( (const char *)&b, 1 );
405 b = 0x0E; m2.append( (const char *)&b, 1 );
406
407 unitTest( m1 == m2 );
408 unitTest( m1 == "\x03\xF0\x9C\xA4\xF5\x8A\xC8\xCA\x0E" );
409 }
379} 410}
411// 03F09CA4F58AC8CA0E80F0D9D409D0A60700A192270004BC3A99E91D0001034F544603362E35013103313130019CA4F58AC8CA0E0002830800002C4200008AC200EBF7D9D4090127BB010000E3
412//