lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [10/15] git commit: refs/heads/cfish-string-prep1 - Convert TestSortSpec to CharBuf
Date Mon, 02 Sep 2013 19:16:41 GMT
Convert TestSortSpec to CharBuf


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

Branch: refs/heads/cfish-string-prep1
Commit: 0f0ec865e25d0ff553c616aa529456759ea262e6
Parents: f028d09
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Mon Sep 2 20:17:31 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Mon Sep 2 21:12:30 2013 +0200

----------------------------------------------------------------------
 core/Lucy/Test/Search/TestSortSpec.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/0f0ec865/core/Lucy/Test/Search/TestSortSpec.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSortSpec.c b/core/Lucy/Test/Search/TestSortSpec.c
index 3961a5e..ead2c3f 100644
--- a/core/Lucy/Test/Search/TestSortSpec.c
+++ b/core/Lucy/Test/Search/TestSortSpec.c
@@ -28,6 +28,7 @@
 #include "Lucy/Test/TestUtils.h"
 #include "Lucy/Search/SortSpec.h"
 
+#include "Clownfish/CharBuf.h"
 #include "Lucy/Analysis/StandardTokenizer.h"
 #include "Lucy/Document/Doc.h"
 #include "Lucy/Document/HitDoc.h"
@@ -269,11 +270,13 @@ typedef Obj* (*random_generator_t)();
 static Obj*
 S_random_string() {
     size_t length = 1 + rand() % 10;
-    String *string = Str_new(length);
+    CharBuf *buf = CB_new(length);
     while (length--) {
         uint32_t code_point = 'a' + rand() % ('z' - 'a' + 1);
-        Str_Cat_Char(string, code_point);
+        CB_Cat_Char(buf, code_point);
     }
+    String *string = CB_Yield_String(buf);
+    DECREF(buf);
     return (Obj*)string;
 }
 


Mime
View raw message