~s-cecilio/lomse/master

« back to all changes in this revision

Viewing changes to src/tests/lomse_test_model_builder.cpp

  • Committer: cecilios
  • Date: 2010-10-10 13:35:19 UTC
  • Revision ID: git-v1:2b333198c3033525d15763b84eaf79dac9fdab80
Preparing to use CMake. Updating with new code and missing files. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
//  You should have received a copy of the GNU General Public License along
14
14
//  with Lomse; if not, see <http://www.gnu.org/licenses/>.
15
15
//
16
 
//
17
 
//
18
16
//  For any comment, suggestion or feature request, please contact the manager of
19
17
//  the project at cecilios@users.sourceforge.net
20
18
//
21
19
//-------------------------------------------------------------------------------------
22
20
 
23
 
#ifdef _LM_DEBUG_
 
21
#ifdef _LOMSE_DEBUG
24
22
 
25
23
#include <UnitTest++.h>
26
24
#include <sstream>
63
61
SUITE(ModelBuilderTest)
64
62
{
65
63
 
 
64
    //This just checks that the score has an associated ColStaffObjs
66
65
    TEST_FIXTURE(ModelBuilderTestFixture, ModelBuilderScore)
67
66
    {
68
67
        DocumentScope documentScope(cout);
70
69
        Analyser* analyser = Injector::inject_Analyser(*m_pLibraryScope, documentScope);
71
70
        ModelBuilder* builder = Injector::inject_ModelBuilder(documentScope);
72
71
        LdpCompiler compiler(parser, analyser, builder, documentScope.id_assigner());
73
 
        ImoDocument* pDoc = compiler.compile_string("(lenmusdoc (vers 0.0) (content (score (vers 1.6) (instrument (musicData (n c4 q) (barline simple))))))" );
 
72
        InternalModel* pIModel = compiler.compile_string("(lenmusdoc (vers 0.0) (content (score (vers 1.6) (instrument (musicData (n c4 q) (barline simple))))))" );
 
73
        ImoDocument* pDoc = dynamic_cast<ImoDocument*>(pIModel->get_root());
74
74
        ImoScore* pScore = dynamic_cast<ImoScore*>( pDoc->get_content_item(0) );
75
75
        CHECK( pScore != NULL );
76
76
        CHECK( pScore->get_num_instruments() == 1 );
77
77
        CHECK( pScore->get_staffobjs_table() != NULL );
 
78
 
 
79
        delete pIModel;
78
80
    }
79
81
 
80
82
}
81
83
 
82
84
 
83
 
#endif  // _LM_DEBUG_
 
85
#endif  // _LOMSE_DEBUG
84
86