Change tests - binary keys

the new code requires bucket listing to be on binary keys not just
binary buckets.  As this is only intended for use within Riak (where
all keys are buckets are binaries), this constraint seems OK.

A test needed changing to ensure it had a binary key in the bucket.
This commit is contained in:
Martin Sumner 2017-05-23 15:54:11 +01:00
parent 0d8ab0899e
commit 96a548e17a

View file

@ -97,7 +97,7 @@ small_load_with2i(_Config) ->
IdxQ1 = {index_query,
"Bucket",
{fun testutil:foldkeysfun/3, []},
{"idx1_bin", "#", "~"},
{"idx1_bin", "#", "|"},
{true, undefined}},
{async, IdxFolder} = leveled_bookie:book_returnfolder(Bookie1, IdxQ1),
KeyList1 = lists:usort(IdxFolder()),
@ -106,7 +106,7 @@ small_load_with2i(_Config) ->
IdxQ2 = {index_query,
{"Bucket", LastKey},
{fun testutil:foldkeysfun/3, []},
{"idx1_bin", LastTerm, "~"},
{"idx1_bin", LastTerm, "|"},
{false, undefined}},
{async, IdxFolderLK} = leveled_bookie:book_returnfolder(Bookie1, IdxQ2),
KeyList2 = lists:usort(IdxFolderLK()),
@ -141,7 +141,7 @@ small_load_with2i(_Config) ->
?RIAK_TAG,
"Bucket",
{"idx1_bin",
"#", "~"},
"#", "|"},
FoldObjectsFun}),
KeyHashList3 = HTreeF3(),
true = 9901 == length(KeyHashList1), % also includes the test object
@ -186,7 +186,7 @@ query_count(_Config) ->
testutil:sync_strategy()),
BucketBin = list_to_binary("Bucket"),
{TestObject, TestSpec} = testutil:generate_testobject(BucketBin,
"Key1",
term_to_binary("Key1"),
"Value1",
[],
[{"MDK1", "MDV1"}]),
@ -269,7 +269,7 @@ query_count(_Config) ->
Query1 = {index_query,
BucketBin,
{fun testutil:foldkeysfun/3, []},
{"idx2_bin", "2000", "2000~"},
{"idx2_bin", "2000", "2000|"},
{false, RegMia}},
{async,
Mia2KFolder1} = leveled_bookie:book_returnfolder(Book2, Query1),
@ -397,7 +397,6 @@ query_count(_Config) ->
[timer:now_diff(os:timestamp(), SW_QA)]),
true = sets:size(BucketSet1) == 1,
true = sets:is_element(list_to_binary("Bucket"), BucketSet1),
ObjList10A = testutil:generate_objects(5000,
binary_uuid,