Revision 60:c06fe5350b34

View differences:

NoteHypothesis.cpp
98 98
        // avoid piling up a lengthy sequence of estimates that are
99 99
        // all acceptable but are in total not enough to cause us to
100 100
        // be satisfied
101
        m_state = Rejected;
101
        if (m_pending.empty()) {
102
            m_state = Rejected;
103
        }
102 104
        return false;
103 105
    }
104 106

  
test/TestNoteHypothesis.cpp
73 73
    BOOST_CHECK(!h.accept(e));
74 74
    BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::Rejected);
75 75
}
76

  
77
BOOST_AUTO_TEST_CASE(noConfidenceIgnore)
78
{
79
    // But if we're already in process we don't go to rejected state,
80
    // we just ignore this hypothesis
81
    NoteHypothesis h;
82
    NoteHypothesis::Estimate e;
83
    BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::New);
84
    BOOST_CHECK(h.accept(e));
85
    BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::Provisional);
86
    e.confidence = 0;
87
    BOOST_CHECK(!h.accept(e));
88
    BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::Provisional);
89
}
76 90
		
77 91
BOOST_AUTO_TEST_CASE(tooSlow)
78 92
{

Also available in: Unified diff