Mercurial > hg > orthanc
comparison UnitTestsSources/MultiThreadingTests.cpp @ 3958:596912ebab5f c-get
integration mainline->c-get
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 20 May 2020 17:03:24 +0200 |
parents | ef696db8426f |
children |
comparison
equal
deleted
inserted
replaced
3955:66879215cbf3 | 3958:596912ebab5f |
---|---|
1547 OrthancPeerStoreJob& tmp = dynamic_cast<OrthancPeerStoreJob&>(*job); | 1547 OrthancPeerStoreJob& tmp = dynamic_cast<OrthancPeerStoreJob&>(*job); |
1548 ASSERT_EQ("http://localhost/", tmp.GetPeer().GetUrl()); | 1548 ASSERT_EQ("http://localhost/", tmp.GetPeer().GetUrl()); |
1549 ASSERT_EQ("username", tmp.GetPeer().GetUsername()); | 1549 ASSERT_EQ("username", tmp.GetPeer().GetUsername()); |
1550 ASSERT_EQ("password", tmp.GetPeer().GetPassword()); | 1550 ASSERT_EQ("password", tmp.GetPeer().GetPassword()); |
1551 ASSERT_TRUE(tmp.GetPeer().IsPkcs11Enabled()); | 1551 ASSERT_TRUE(tmp.GetPeer().IsPkcs11Enabled()); |
1552 ASSERT_FALSE(tmp.IsTranscode()); | |
1553 ASSERT_THROW(tmp.GetTransferSyntax(), OrthancException); | |
1554 } | |
1555 | |
1556 { | |
1557 OrthancPeerStoreJob job(GetContext()); | |
1558 ASSERT_THROW(job.SetTranscode("nope"), OrthancException); | |
1559 job.SetTranscode("1.2.840.10008.1.2.4.50"); | |
1560 | |
1561 ASSERT_TRUE(CheckIdempotentSetOfInstances(unserializer, job)); | |
1562 ASSERT_TRUE(job.Serialize(s)); | |
1563 } | |
1564 | |
1565 { | |
1566 std::unique_ptr<IJob> job; | |
1567 job.reset(unserializer.UnserializeJob(s)); | |
1568 | |
1569 OrthancPeerStoreJob& tmp = dynamic_cast<OrthancPeerStoreJob&>(*job); | |
1570 ASSERT_EQ("http://127.0.0.1:8042/", tmp.GetPeer().GetUrl()); | |
1571 ASSERT_EQ("", tmp.GetPeer().GetUsername()); | |
1572 ASSERT_EQ("", tmp.GetPeer().GetPassword()); | |
1573 ASSERT_FALSE(tmp.GetPeer().IsPkcs11Enabled()); | |
1574 ASSERT_TRUE(tmp.IsTranscode()); | |
1575 ASSERT_EQ(DicomTransferSyntax_JPEGProcess1, tmp.GetTransferSyntax()); | |
1552 } | 1576 } |
1553 | 1577 |
1554 // ResourceModificationJob | 1578 // ResourceModificationJob |
1555 | 1579 |
1556 { | 1580 { |
1558 modification->SetupAnonymization(DicomVersion_2008); | 1582 modification->SetupAnonymization(DicomVersion_2008); |
1559 | 1583 |
1560 ResourceModificationJob job(GetContext()); | 1584 ResourceModificationJob job(GetContext()); |
1561 job.SetModification(modification.release(), ResourceType_Patient, true); | 1585 job.SetModification(modification.release(), ResourceType_Patient, true); |
1562 job.SetOrigin(DicomInstanceOrigin::FromLua()); | 1586 job.SetOrigin(DicomInstanceOrigin::FromLua()); |
1563 | 1587 |
1588 job.AddTrailingStep(); // Necessary since 1.7.0 | |
1564 ASSERT_TRUE(CheckIdempotentSetOfInstances(unserializer, job)); | 1589 ASSERT_TRUE(CheckIdempotentSetOfInstances(unserializer, job)); |
1565 ASSERT_TRUE(job.Serialize(s)); | 1590 ASSERT_TRUE(job.Serialize(s)); |
1566 } | 1591 } |
1567 | 1592 |
1568 { | 1593 { |
1569 std::unique_ptr<IJob> job; | 1594 std::unique_ptr<IJob> job; |
1570 job.reset(unserializer.UnserializeJob(s)); | 1595 job.reset(unserializer.UnserializeJob(s)); |
1571 | 1596 |
1572 ResourceModificationJob& tmp = dynamic_cast<ResourceModificationJob&>(*job); | 1597 ResourceModificationJob& tmp = dynamic_cast<ResourceModificationJob&>(*job); |
1573 ASSERT_TRUE(tmp.IsAnonymization()); | 1598 ASSERT_TRUE(tmp.IsAnonymization()); |
1599 ASSERT_FALSE(tmp.IsTranscode()); | |
1600 ASSERT_THROW(tmp.GetTransferSyntax(), OrthancException); | |
1574 ASSERT_EQ(RequestOrigin_Lua, tmp.GetOrigin().GetRequestOrigin()); | 1601 ASSERT_EQ(RequestOrigin_Lua, tmp.GetOrigin().GetRequestOrigin()); |
1575 ASSERT_TRUE(tmp.GetModification().IsRemoved(DICOM_TAG_STUDY_DESCRIPTION)); | 1602 ASSERT_TRUE(tmp.GetModification().IsRemoved(DICOM_TAG_STUDY_DESCRIPTION)); |
1603 } | |
1604 | |
1605 { | |
1606 ResourceModificationJob job(GetContext()); | |
1607 ASSERT_THROW(job.SetTranscode("nope"), OrthancException); | |
1608 job.SetTranscode(DicomTransferSyntax_JPEGProcess1); | |
1609 | |
1610 job.AddTrailingStep(); // Necessary since 1.7.0 | |
1611 ASSERT_TRUE(CheckIdempotentSetOfInstances(unserializer, job)); | |
1612 ASSERT_TRUE(job.Serialize(s)); | |
1613 } | |
1614 | |
1615 { | |
1616 std::unique_ptr<IJob> job; | |
1617 job.reset(unserializer.UnserializeJob(s)); | |
1618 | |
1619 ResourceModificationJob& tmp = dynamic_cast<ResourceModificationJob&>(*job); | |
1620 ASSERT_FALSE(tmp.IsAnonymization()); | |
1621 ASSERT_TRUE(tmp.IsTranscode()); | |
1622 ASSERT_EQ(DicomTransferSyntax_JPEGProcess1, tmp.GetTransferSyntax()); | |
1623 ASSERT_EQ(RequestOrigin_Unknown, tmp.GetOrigin().GetRequestOrigin()); | |
1576 } | 1624 } |
1577 | 1625 |
1578 // SplitStudyJob | 1626 // SplitStudyJob |
1579 | 1627 |
1580 std::string instance; | 1628 std::string instance; |