diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-22 12:00:02 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-02-22 12:00:02 -0800 |
commit | 376e199ebb562672f415e548c9d127b24117f905 (patch) | |
tree | 9f433eaec84d8b0987aa0c455c4f7585fb26273b /fish_tests.cpp | |
parent | a837a27b347e5c6b1669bbf83f7f0c0ce1c523df (diff) |
Removed a lot of string_buffer_t
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r-- | fish_tests.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp index 21f5ded2..bf77cf17 100644 --- a/fish_tests.cpp +++ b/fish_tests.cpp @@ -115,22 +115,20 @@ static void err( const wchar_t *blah, ... ) static void test_escape() { int i; - string_buffer_t sb; + wcstring sb; say( L"Testing escaping and unescaping" ); - - sb_init( &sb ); for( i=0; i<ESCAPE_TEST_COUNT; i++ ) { - wchar_t *o, *e, *u; + const wchar_t *o, *e, *u; - sb_clear( &sb ); + sb.clear(); while( rand() % ESCAPE_TEST_LENGTH ) { - sb_append_char( &sb, (rand() %ESCAPE_TEST_CHAR) +1 ); + sb.push_back((rand() %ESCAPE_TEST_CHAR) +1 ); } - o = (wchar_t *)sb.buff; + o = (const wchar_t *)sb.c_str(); e = escape(o, 1); u = unescape( e, 0 ); if( !o || !e || !u ) @@ -146,8 +144,8 @@ static void test_escape() } - free( e ); - free( u ); + free( (void *)e ); + free( (void *)u ); } |