You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/09/01 22:17:05 UTC

[lucy-commits] [17/24] git commit: refs/heads/cfish-string-prep1 - Convert TestUtils_random_string to CharBuf

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 <we...@aevum.de>
Authored: Sun Sep 1 18:51:40 2013 +0200
Committer: Nick Wellnhofer <we...@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;
 }