Revision 58:9f50a5876dd3 test

View differences:

test/TestNoteHypothesis.cpp
53 53

  
54 54
BOOST_AUTO_TEST_CASE(emptyAccept)
55 55
{
56
    // An empty hypothesis should accept any estimate and enter
57
    // provisional state
56
    // An empty hypothesis should accept any estimate with a
57
    // non-negligible confidence, and enter provisional state
58 58
    NoteHypothesis h;
59
    NoteHypothesis::Estimate e;
59
    NoteHypothesis::Estimate e; // default estimate has confidence 1
60 60
    BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::New);
61 61
    BOOST_CHECK(h.accept(e));
62 62
    BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::Provisional);
63 63
}
64

  
65
BOOST_AUTO_TEST_CASE(noConfidence)
66
{
67
    // A hypothesis should reject any estimate that has a negligible
68
    // confidence
69
    NoteHypothesis h;
70
    NoteHypothesis::Estimate e;
71
    e.confidence = 0;
72
    BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::New);
73
    BOOST_CHECK(!h.accept(e));
74
    BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::Rejected);
75
}
64 76
		
65 77
BOOST_AUTO_TEST_CASE(tooSlow)
66 78
{

Also available in: Unified diff