From 2297bcd78dfe8df23d63cdc035454859144c2a65 Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 13 Jun 2015 05:44:33 +0000 Subject: [PATCH] .autotest git-svn-id: svn://ultimatepp.org/upp/trunk@8533 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- autotest/Algo/Algo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autotest/Algo/Algo.cpp b/autotest/Algo/Algo.cpp index d1491079d..c3f254329 100644 --- a/autotest/Algo/Algo.cpp +++ b/autotest/Algo/Algo.cpp @@ -14,4 +14,12 @@ CONSOLE_APP_MAIN Check(FindMax(x, 2, 3), 2); Check(FindMax(x, 2, 4), 5); Check(FindMin(x, 2, 4), 4); + + Sort(x); + Check(FindBinaryIter(x.Begin(), x.End(), 1) - x.Begin(), 0); + Check(FindBinaryIter(x.Begin(), x.End(), 2) - x.Begin(), 1); + Check(FindBinaryIter(x.Begin(), x.End(), 7), NULL); + Check(FindBinaryIter(x.Begin(), x.End(), 0), NULL); + Check(FindBinaryIter(x.Begin(), x.End(), 11), NULL); + Check(FindBinaryIter(x.Begin(), x.End(), 10) - x.Begin(), 5); }