Skip to content

Commit 85a74af

Browse files
author
Alexander Diehm
committed
Merge branch 'feature_wt' of https://github.com/xosh/sdsl-lite into feature_wt
2 parents 448e7c6 + 650b060 commit 85a74af

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

test/WtIntTest.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -256,29 +256,29 @@ TYPED_TEST(WtIntLexOrdered, LoadAndLexCount)
256256
auto dice = bind(distribution, rng);
257257
for (size_type idx=0; idx < iv.size();) {
258258
size_type i = idx, j = std::min(wt.size(),i+dice());
259-
size_type smaller_c1=0,greater_c1=0,smaller_c2=0,greater_c2=0;
260-
int_vector<>::value_type c1=iv[i],c2=dice_symbol();
259+
size_type smaller_c1=0, greater_c1=0, smaller_c2=0, greater_c2=0;
260+
int_vector<>::value_type c1=iv[i], c2=dice_symbol();
261261
for (; idx<j; ++idx) {
262262
if (iv[idx]<c1) ++smaller_c1;
263263
if (iv[idx]>c1) ++greater_c1;
264264
if (iv[idx]<c2) ++smaller_c2;
265265
if (iv[idx]>c2) ++greater_c2;
266266

267267
}
268-
auto res1 = wt.lex_count(i,j,c1);
269-
ASSERT_EQ(wt.rank(i,c1),std::get<0>(res1));
270-
ASSERT_EQ(smaller_c1,std::get<1>(res1));
271-
ASSERT_EQ(greater_c1,std::get<2>(res1));
272-
273-
auto res2 = wt.lex_count(i,j,c2);
274-
ASSERT_EQ(wt.rank(i,c2),std::get<0>(res2));
275-
ASSERT_EQ(smaller_c2,std::get<1>(res2));
276-
ASSERT_EQ(greater_c2,std::get<2>(res2));
277-
278-
auto res3 = wt.lex_count(i,j,max+1+dice_symbol());
279-
ASSERT_EQ(0,std::get<0>(res3));
280-
ASSERT_EQ(j-i,std::get<1>(res3));
281-
ASSERT_EQ(0,std::get<2>(res3));
268+
auto res1 = wt.lex_count(i, j, c1);
269+
ASSERT_EQ(wt.rank(i, c1), std::get<0>(res1));
270+
ASSERT_EQ(smaller_c1, std::get<1>(res1));
271+
ASSERT_EQ(greater_c1, std::get<2>(res1));
272+
273+
auto res2 = wt.lex_count(i, j, c2);
274+
ASSERT_EQ(wt.rank(i, c2), std::get<0>(res2));
275+
ASSERT_EQ(smaller_c2, std::get<1>(res2));
276+
ASSERT_EQ(greater_c2, std::get<2>(res2));
277+
278+
auto res3 = wt.lex_count(i, j, max+1+dice_symbol());
279+
ASSERT_EQ(0ULL, std::get<0>(res3));
280+
ASSERT_EQ(j-i, std::get<1>(res3));
281+
ASSERT_EQ(0ULL, std::get<2>(res3));
282282
}
283283
}
284284
}
@@ -306,10 +306,10 @@ TYPED_TEST(WtIntLexOrdered, LoadAndLexSmallerCount)
306306
chars[2] = max+1+dice_symbol();
307307

308308
for (uint64_t i = 0; i<chars.size(); ++i) {
309-
auto exp = wt.lex_count(0,idx,chars[i]);
310-
auto res = wt.lex_smaller_count(idx,chars[i]);
311-
ASSERT_EQ(idx-std::get<2>(exp)-std::get<1>(exp),std::get<0>(res));
312-
ASSERT_EQ(std::get<1>(exp),std::get<1>(res));
309+
auto exp = wt.lex_count(0, idx, chars[i]);
310+
auto res = wt.lex_smaller_count(idx, chars[i]);
311+
ASSERT_EQ(idx-std::get<2>(exp)-std::get<1>(exp), std::get<0>(res));
312+
ASSERT_EQ(std::get<1>(exp), std::get<1>(res));
313313
}
314314
}
315315
}

0 commit comments

Comments
 (0)