add test: some algorithms

This commit is contained in:
bolero-MURAKAMI 2013-01-11 03:17:06 +09:00
parent e2b207d3be
commit 830fc27394
8 changed files with 176 additions and 12 deletions

View file

@ -29,6 +29,46 @@ namespace testspr {
);
TESTSPR_BOTH_ASSERT(!result);
}
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::binary_search(
testspr::reduct_forward(sprout::begin(arr1)),
testspr::reduct_forward(sprout::end(arr1)),
7
);
TESTSPR_BOTH_ASSERT(result);
}
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::binary_search(
testspr::reduct_forward(sprout::begin(arr1)),
testspr::reduct_forward(sprout::begin(arr1) + 5),
7,
testspr::less<int>()
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
#if defined(__clang__)
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::binary_search(
testspr::reduct_random_access(sprout::begin(arr1)),
testspr::reduct_random_access(sprout::end(arr1)),
7
);
TESTSPR_BOTH_ASSERT(result);
}
{
SPROUT_STATIC_CONSTEXPR auto result = sprout::binary_search(
testspr::reduct_random_access(sprout::begin(arr1)),
testspr::reduct_random_access(sprout::begin(arr1) + 5),
7,
testspr::less<int>()
);
TESTSPR_BOTH_ASSERT(!result);
}
#endif
}
}
} // namespace testspr