Fix test after Shuffler changes.
authorCarl Hetherington <cth@carlh.net>
Wed, 13 Feb 2019 09:57:09 +0000 (09:57 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 13 Feb 2019 09:57:09 +0000 (09:57 +0000)
src/lib/shuffler.h
test/shuffler_test.cc

index 7ac300b478335a9c8e3d24c6708c650944e0626a..80754a5e0b2854f7058e29aa8e7cf02bf5de3252 100644 (file)
@@ -22,6 +22,8 @@
 #include "content_video.h"
 #include <boost/signals2.hpp>
 
+struct shuffler_test5;
+
 class Piece;
 
 class Shuffler
@@ -36,6 +38,8 @@ public:
        typedef std::pair<boost::weak_ptr<Piece>, ContentVideo> Store;
 
 private:
+       friend struct ::shuffler_test5;
+
        std::list<Store> _store;
        boost::optional<ContentVideo> _last;
        static int const _max_size;
index a8b45930fd8123ed16f7da602a059b4cd7d73b6e..6d90ba27d99092f32dc3d850bb49c882fe7f1043 100644 (file)
@@ -132,7 +132,7 @@ BOOST_AUTO_TEST_CASE (shuffler_test5)
        check (0, EYES_LEFT, __LINE__);
 
        /* More lefts should be kept in the shuffler in the hope that some rights arrive */
-       for (int i = 0; i < 8; ++i) {
+       for (int i = 0; i < s._max_size; ++i) {
                push (s, i + 1, EYES_LEFT);
        }
        BOOST_CHECK (pending_cv.empty ());
@@ -140,7 +140,7 @@ BOOST_AUTO_TEST_CASE (shuffler_test5)
        /* If enough lefts come the shuffler should conclude that there's no rights and start
           giving out the lefts.
        */
-       push (s, 9, EYES_LEFT);
+       push (s, s._max_size + 1, EYES_LEFT);
        check (1, EYES_LEFT, __LINE__);
 }