]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/test-std.cc
* flower/SConscript: Unit test rules.
[lilypond.git] / flower / test-std.cc
index ebf212e29bcb90c64389302204f0309feaff0d83..ed317f7f631a13c4850ed307118a859bb2d7c276 100644 (file)
@@ -18,6 +18,7 @@
 
 using namespace std;
 using boost::unit_test::test_suite;
+using namespace boost::unit_test;
 
 template<typename T>
 void
@@ -84,7 +85,8 @@ BOOST_AUTO_UNIT_TEST (vector_sorting)
 #if VECTOR_SORT
   v.sort (default_compare);
 #else
-  vector_sort (v, default_compare);
+  //sort (v.begin (), v.end ());
+  vector_sort (v, less<int> ());
 #endif
   BOOST_CHECK_EQUAL (v[0], 0);
   BOOST_CHECK_EQUAL (v[1], 1);
@@ -161,7 +163,7 @@ BOOST_AUTO_UNIT_TEST (parray_uniq)
   v.push_back (0);
   v.push_back (1);
   v.push_back (0);
-  vector_sort (v, default_compare);
+  vector_sort (v, less<int> ());
   uniq (v);
   BOOST_CHECK_EQUAL (v.size (), vsize (2));
 }
@@ -172,7 +174,7 @@ BOOST_AUTO_UNIT_TEST (vector_search)
   v.push_back (0);
   v.push_back (1);
   v.push_back (2);
-  vsize i = binary_search (v, 1, &default_compare);
+  vsize i = binary_search (v, 1, less<int> ());
   BOOST_CHECK_EQUAL (i, vsize (1));
 }
 
@@ -204,20 +206,26 @@ BOOST_AUTO_UNIT_TEST (mingw_slashify)
 void mingw_slashify ();
 void file_find ();
 
+#include <boost/test/results_reporter.hpp>
+#include <boost/test/framework.hpp>
+#include <boost/test/detail/unit_test_parameters.hpp>
+
 test_suite*
 init_unit_test_suite (int, char**)
 {
   vsize i = 0;
   vsize j = 0;
   vector<int> v;
-  binary_search_bounds (v, 1, &default_compare, &i, &j);
+  binary_search (v, 1, less<int> (), i, j);
   //binary_search_bounds (v, 1, &default_compare, 0, 0);
   
   //Link_array<char> w;
   vector<char*> w;
-  binary_search_bounds (w, (char*)1, &default_compare, &i, &j);
+  binary_search (w, (char*)1, less<char*> (), i, j);
   
   test_suite *test = BOOST_TEST_SUITE("Flower");
+
+
   test->add (BOOST_TEST_CASE (vector_erase));
   test->add (BOOST_TEST_CASE (vector_slice));
   test->add (BOOST_TEST_CASE (vector_sorting));
@@ -227,5 +235,6 @@ init_unit_test_suite (int, char**)
   test->add (BOOST_TEST_CASE (vector_search));
   test->add (BOOST_TEST_CASE (mingw_slashify));
   test->add (BOOST_TEST_CASE (file_find));
+
   return test;
 }