comparison UnitTestsSources/FromDcmtkTests.cpp @ 3298:8711cd9b47c5

fix deprecated call
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 Feb 2019 16:59:08 +0100
parents 9b0e67161600
children f2f8aa6f78aa
comparison
equal deleted inserted replaced
3297:bf77dbfe43b2 3298:8711cd9b47c5
1567 visitor.FormatXml(xml); 1567 visitor.FormatXml(xml);
1568 1568
1569 pugi::xml_document doc; 1569 pugi::xml_document doc;
1570 doc.load_buffer(xml.c_str(), xml.size()); 1570 doc.load_buffer(xml.c_str(), xml.size());
1571 1571
1572 pugi::xpath_node node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00080005\"]/Value"); 1572 pugi::xpath_node node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00080005\"]/Value");
1573 ASSERT_STREQ("ISO_IR 192", node.node().text().as_string()); 1573 ASSERT_STREQ("ISO_IR 192", node.node().text().as_string());
1574 1574
1575 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00080005\"]"); 1575 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00080005\"]");
1576 ASSERT_STREQ("CS", node.node().attribute("vr").value()); 1576 ASSERT_STREQ("CS", node.node().attribute("vr").value());
1577 1577
1578 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]"); 1578 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]");
1579 ASSERT_STREQ("PN", node.node().attribute("vr").value()); 1579 ASSERT_STREQ("PN", node.node().attribute("vr").value());
1580 1580
1581 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Alphabetic/FamilyName"); 1581 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Alphabetic/FamilyName");
1582 ASSERT_STREQ("Hong", node.node().text().as_string()); 1582 ASSERT_STREQ("Hong", node.node().text().as_string());
1583 1583
1584 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Alphabetic/GivenName"); 1584 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Alphabetic/GivenName");
1585 ASSERT_STREQ("Gildong", node.node().text().as_string()); 1585 ASSERT_STREQ("Gildong", node.node().text().as_string());
1586 1586
1587 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Ideographic/FamilyName"); 1587 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Ideographic/FamilyName");
1588 ASSERT_EQ(utf8.substr(13, 3), node.node().text().as_string()); 1588 ASSERT_EQ(utf8.substr(13, 3), node.node().text().as_string());
1589 1589
1590 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Ideographic/GivenName"); 1590 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Ideographic/GivenName");
1591 ASSERT_EQ(utf8.substr(17, 6), node.node().text().as_string()); 1591 ASSERT_EQ(utf8.substr(17, 6), node.node().text().as_string());
1592 1592
1593 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Phonetic/FamilyName"); 1593 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Phonetic/FamilyName");
1594 ASSERT_EQ(utf8.substr(24, 3), node.node().text().as_string()); 1594 ASSERT_EQ(utf8.substr(24, 3), node.node().text().as_string());
1595 1595
1596 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Phonetic/GivenName"); 1596 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Phonetic/GivenName");
1597 ASSERT_EQ(utf8.substr(28), node.node().text().as_string()); 1597 ASSERT_EQ(utf8.substr(28), node.node().text().as_string());
1598 #endif 1598 #endif
1599 } 1599 }
1600 1600
1601 1601
1648 visitor.FormatXml(xml); 1648 visitor.FormatXml(xml);
1649 1649
1650 pugi::xml_document doc; 1650 pugi::xml_document doc;
1651 doc.load_buffer(xml.c_str(), xml.size()); 1651 doc.load_buffer(xml.c_str(), xml.size());
1652 1652
1653 pugi::xpath_node node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00080005\"]/Value"); 1653 pugi::xpath_node node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00080005\"]/Value");
1654 ASSERT_STREQ("ISO_IR 192", node.node().text().as_string()); 1654 ASSERT_STREQ("ISO_IR 192", node.node().text().as_string());
1655 1655
1656 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00080005\"]"); 1656 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00080005\"]");
1657 ASSERT_STREQ("CS", node.node().attribute("vr").value()); 1657 ASSERT_STREQ("CS", node.node().attribute("vr").value());
1658 1658
1659 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]"); 1659 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]");
1660 ASSERT_STREQ("PN", node.node().attribute("vr").value()); 1660 ASSERT_STREQ("PN", node.node().attribute("vr").value());
1661 1661
1662 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Alphabetic/FamilyName"); 1662 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Alphabetic/FamilyName");
1663 ASSERT_STREQ("Yamada", node.node().text().as_string()); 1663 ASSERT_STREQ("Yamada", node.node().text().as_string());
1664 1664
1665 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Alphabetic/GivenName"); 1665 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Alphabetic/GivenName");
1666 ASSERT_STREQ("Tarou", node.node().text().as_string()); 1666 ASSERT_STREQ("Tarou", node.node().text().as_string());
1667 1667
1668 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Ideographic/FamilyName"); 1668 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Ideographic/FamilyName");
1669 ASSERT_EQ(utf8.substr(13, 6), node.node().text().as_string()); 1669 ASSERT_EQ(utf8.substr(13, 6), node.node().text().as_string());
1670 1670
1671 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Ideographic/GivenName"); 1671 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Ideographic/GivenName");
1672 ASSERT_EQ(utf8.substr(20, 6), node.node().text().as_string()); 1672 ASSERT_EQ(utf8.substr(20, 6), node.node().text().as_string());
1673 1673
1674 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Phonetic/FamilyName"); 1674 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Phonetic/FamilyName");
1675 ASSERT_EQ(utf8.substr(27, 9), node.node().text().as_string()); 1675 ASSERT_EQ(utf8.substr(27, 9), node.node().text().as_string());
1676 1676
1677 node = doc.select_single_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Phonetic/GivenName"); 1677 node = doc.select_node("//NativeDicomModel/DicomAttribute[@tag=\"00100010\"]/PersonName/Phonetic/GivenName");
1678 ASSERT_EQ(utf8.substr(37), node.node().text().as_string()); 1678 ASSERT_EQ(utf8.substr(37), node.node().text().as_string());
1679 #endif 1679 #endif
1680 } 1680 }
1681 1681
1682 1682