diff options
author | Carl Hetherington <carl@carlh.net> | 2012-03-21 01:07:05 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-03-21 01:07:05 +0000 |
commit | 4c0b104db5518df931610089dae31849bc8d9cbb (patch) | |
tree | 8e3f9fa280ed85e19eb6289449946cbdb3f66539 /libs/pbd/test | |
parent | 135c72b085f22d284392a1812f466d6ff57e2d4e (diff) |
Fix test build.
git-svn-id: svn://localhost/ardour2/branches/3.0@11738 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/test')
-rw-r--r-- | libs/pbd/test/xpath.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/pbd/test/xpath.cc b/libs/pbd/test/xpath.cc index 9f31c8f53a..d06bf81c29 100644 --- a/libs/pbd/test/xpath.cc +++ b/libs/pbd/test/xpath.cc @@ -16,7 +16,7 @@ XPathTest::testMisc () cout << "Test 1: RosegardenPatchFile.xml: Find all banks in the file" << endl; XMLTree doc(prefix + "RosegardenPatchFile.xml"); // "//bank" gives as last element an empty element libxml bug???? - boost::shared_ptr<XMLSharedNodeList> result = doc.root()->find("//bank[@name]"); + boost::shared_ptr<XMLSharedNodeList> result = doc.find("//bank[@name]"); cout << "Found " << result->size() << " banks" << endl; assert(result->size() == 8); @@ -33,7 +33,7 @@ XPathTest::testMisc () cout << endl << endl << "Test 2: RosegardenPatchFile.xml: Find all programs whose program name contains 'Latin'" << endl; - result = doc.root()->find("/rosegarden-data/studio/device/bank/program[contains(@name, 'Latin')]"); + result = doc.find("/rosegarden-data/studio/device/bank/program[contains(@name, 'Latin')]"); assert(result->size() == 5); for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { @@ -45,7 +45,7 @@ XPathTest::testMisc () // We have to allocate a new document here, or we get segfaults XMLTree doc2(prefix + "TestSession.ardour"); - result = doc2.root()->find("/Session/Sources/Source[contains(@captured-for, 'Guitar')]"); + result = doc2.find("/Session/Sources/Source[contains(@captured-for, 'Guitar')]"); assert(result->size() == 16); for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { @@ -55,7 +55,7 @@ XPathTest::testMisc () cout << endl << endl << "Test 4: TestSession.ardour: Find all elements with an 'id' and 'name' attribute" << endl; - result = doc2.root()->find("//*[@id and @name]"); + result = doc2.find("//*[@id and @name]"); for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { assert((*i)->property("id")); @@ -69,12 +69,12 @@ XPathTest::testMisc () // We have to allocate a new document here, or we get segfaults XMLTree doc3(prefix + "ProtoolsPatchFile.midnam"); - result = doc3.root()->find("/MIDINameDocument/MasterDeviceNames/ChannelNameSet[@Name='Name Set 1']/PatchBank"); + result = doc3.find("/MIDINameDocument/MasterDeviceNames/ChannelNameSet[@Name='Name Set 1']/PatchBank"); assert(result->size() == 16); for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { // cout << "\t found Patchbank " << (*i)->property("Name")->value() << endl; - boost::shared_ptr<XMLSharedNodeList> patches = (*i)->find("//Patch[@Name]"); + boost::shared_ptr<XMLSharedNodeList> patches = doc3.find ("//Patch[@Name]", i->get()); for(XMLSharedNodeList::const_iterator p = patches->begin(); p != patches->end(); ++p) { // cout << "\t\t found patch number " << (*p)->property("Number")->value() // << " with name: " << (*p)->property("Name")->value() << endl; @@ -82,7 +82,7 @@ XPathTest::testMisc () } cout << endl << endl << "Test 5: ProtoolsPatchFile.midnam: Find attribute nodes" << endl; - result = doc3.root()->find("//@Value"); + result = doc3.find("//@Value"); for(XMLSharedNodeList::const_iterator i = result->begin(); i != result->end(); ++i) { boost::shared_ptr<XMLNode> node = (*i); @@ -91,7 +91,7 @@ XPathTest::testMisc () } cout << endl << endl << "Test 6: ProtoolsPatchFile.midnam: Find available channels on 'Name Set 1'" << endl; - result = doc3.root()->find( + result = doc3.find( "//ChannelNameSet[@Name = 'Name Set 1']//AvailableChannel[@Available = 'true']/@Channel"); assert(result->size() == 15); |