lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [17/24] git commit: refs/heads/cfish-string-prep1 - Convert TestUtils_random_string to CharBuf
Date Sun, 01 Sep 2013 20:17:05 GMT
Convert TestUtils_random_string to CharBuf


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/e374703e
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/e374703e
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/e374703e

Branch: refs/heads/cfish-string-prep1
Commit: e374703edccd8b065c5ff1be4d986e794d4f4621
Parents: e2f2ce5
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Sun Sep 1 18:51:40 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Sun Sep 1 22:05:02 2013 +0200

----------------------------------------------------------------------
 clownfish/runtime/core/Clownfish/TestHarness/TestUtils.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/e374703e/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.c b/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.c
index a1fc417..c7af57e 100644
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.c
+++ b/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.c
@@ -24,6 +24,7 @@
 
 #include "Clownfish/TestHarness/TestUtils.h"
 
+#include "Clownfish/CharBuf.h"
 #include "Clownfish/String.h"
 #include "Clownfish/Util/Memory.h"
 
@@ -102,10 +103,12 @@ S_random_code_point(void) {
 
 String*
 TestUtils_random_string(size_t length) {
-    String *string = Str_new(length);
+    CharBuf *buf = CB_new(length);
     while (length--) {
-        Str_Cat_Char(string, S_random_code_point());
+        CB_Cat_Char(buf, S_random_code_point());
     }
+    String *string = CB_Yield_String(buf);
+    DECREF(buf);
     return string;
 }
 


Mime
View raw message