comparison UnitTestsSources/DicomMapTests.cpp @ 1492:9f66a12eb8fc

fix warnings for gcc 5
author jodogne
date Tue, 04 Aug 2015 14:47:35 +0200
parents b22ba8c5edbe
children d2268c7a7ede
comparison
equal deleted inserted replaced
1491:e460341872dc 1492:9f66a12eb8fc
85 { 85 {
86 std::set<DicomTag> s; 86 std::set<DicomTag> s;
87 87
88 DicomMap m; 88 DicomMap m;
89 m.GetTags(s); 89 m.GetTags(s);
90 ASSERT_EQ(0, s.size()); 90 ASSERT_EQ(0u, s.size());
91 91
92 ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_NAME)); 92 ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_NAME));
93 ASSERT_FALSE(m.HasTag(0x0010, 0x0010)); 93 ASSERT_FALSE(m.HasTag(0x0010, 0x0010));
94 m.SetValue(0x0010, 0x0010, "PatientName"); 94 m.SetValue(0x0010, 0x0010, "PatientName");
95 ASSERT_TRUE(m.HasTag(DICOM_TAG_PATIENT_NAME)); 95 ASSERT_TRUE(m.HasTag(DICOM_TAG_PATIENT_NAME));
96 ASSERT_TRUE(m.HasTag(0x0010, 0x0010)); 96 ASSERT_TRUE(m.HasTag(0x0010, 0x0010));
97 97
98 m.GetTags(s); 98 m.GetTags(s);
99 ASSERT_EQ(1, s.size()); 99 ASSERT_EQ(1u, s.size());
100 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, *s.begin()); 100 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, *s.begin());
101 101
102 ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_ID)); 102 ASSERT_FALSE(m.HasTag(DICOM_TAG_PATIENT_ID));
103 m.SetValue(DICOM_TAG_PATIENT_ID, "PatientID"); 103 m.SetValue(DICOM_TAG_PATIENT_ID, "PatientID");
104 ASSERT_TRUE(m.HasTag(0x0010, 0x0020)); 104 ASSERT_TRUE(m.HasTag(0x0010, 0x0020));
105 m.SetValue(DICOM_TAG_PATIENT_ID, "PatientID2"); 105 m.SetValue(DICOM_TAG_PATIENT_ID, "PatientID2");
106 ASSERT_EQ("PatientID2", m.GetValue(0x0010, 0x0020).AsString()); 106 ASSERT_EQ("PatientID2", m.GetValue(0x0010, 0x0020).AsString());
107 107
108 m.GetTags(s); 108 m.GetTags(s);
109 ASSERT_EQ(2, s.size()); 109 ASSERT_EQ(2u, s.size());
110 110
111 m.Remove(DICOM_TAG_PATIENT_ID); 111 m.Remove(DICOM_TAG_PATIENT_ID);
112 ASSERT_THROW(m.GetValue(0x0010, 0x0020), OrthancException); 112 ASSERT_THROW(m.GetValue(0x0010, 0x0020), OrthancException);
113 113
114 m.GetTags(s); 114 m.GetTags(s);
115 ASSERT_EQ(1, s.size()); 115 ASSERT_EQ(1u, s.size());
116 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, *s.begin()); 116 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, *s.begin());
117 117
118 std::auto_ptr<DicomMap> mm(m.Clone()); 118 std::auto_ptr<DicomMap> mm(m.Clone());
119 ASSERT_EQ("PatientName", mm->GetValue(DICOM_TAG_PATIENT_NAME).AsString()); 119 ASSERT_EQ("PatientName", mm->GetValue(DICOM_TAG_PATIENT_NAME).AsString());
120 120