Commit 125f6eb8 authored by Davis King's avatar Davis King

Added a few more tests to this for good measure

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403425
parent aa74346e
...@@ -63,6 +63,9 @@ namespace ...@@ -63,6 +63,9 @@ namespace
void test_random_subset_selector2 () void test_random_subset_selector2 ()
{ {
random_subset_selector<double> rand_set; random_subset_selector<double> rand_set;
DLIB_TEST(rand_set.next_add_accepts() == false);
DLIB_TEST(rand_set.size() == 0);
DLIB_TEST(rand_set.max_size() == 0);
for (int j = 0; j < 30; ++j) for (int j = 0; j < 30; ++j)
{ {
...@@ -71,6 +74,7 @@ namespace ...@@ -71,6 +74,7 @@ namespace
running_stats<double> rs, rs2; running_stats<double> rs, rs2;
rand_set.set_max_size(1000); rand_set.set_max_size(1000);
DLIB_TEST(rand_set.next_add_accepts() == true);
for (double i = 0; i < 100000; ++i) for (double i = 0; i < 100000; ++i)
{ {
...@@ -81,6 +85,8 @@ namespace ...@@ -81,6 +85,8 @@ namespace
rand_set.add(); rand_set.add();
} }
DLIB_TEST(rand_set.size() == 1000);
DLIB_TEST(rand_set.max_size() == 1000);
for (unsigned long i = 0; i < rand_set.size(); ++i) for (unsigned long i = 0; i < rand_set.size(); ++i)
rs2.add(rand_set[i]); rs2.add(rand_set[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment