comparison OrthancFramework/UnitTestsSources/FromDcmtkTests.cpp @ 4700:863383e7e582

fix warnings in unit tests
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Jun 2021 17:54:55 +0200
parents dd6274412ff4
children 4e2247df6327
comparison
equal deleted inserted replaced
4699:facea16b055b 4700:863383e7e582
2293 path = DicomPath::Parse("(0008,1111)[0].PatientName"); 2293 path = DicomPath::Parse("(0008,1111)[0].PatientName");
2294 ASSERT_FALSE(path.HasUniversal()); 2294 ASSERT_FALSE(path.HasUniversal());
2295 ASSERT_EQ(1u, path.GetPrefixLength()); 2295 ASSERT_EQ(1u, path.GetPrefixLength());
2296 ASSERT_EQ(DICOM_TAG_REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE, path.GetPrefixTag(0)); 2296 ASSERT_EQ(DICOM_TAG_REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE, path.GetPrefixTag(0));
2297 ASSERT_FALSE(path.IsPrefixUniversal(0)); 2297 ASSERT_FALSE(path.IsPrefixUniversal(0));
2298 ASSERT_EQ(0, path.GetPrefixIndex(0)); 2298 ASSERT_EQ(0u, path.GetPrefixIndex(0));
2299 ASSERT_THROW(path.GetPrefixTag(1), OrthancException); 2299 ASSERT_THROW(path.GetPrefixTag(1), OrthancException);
2300 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, path.GetFinalTag()); 2300 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, path.GetFinalTag());
2301 2301
2302 path = DicomPath::Parse("(0008,1111)[1].(0008,1111)[2].(0010,0010)"); 2302 path = DicomPath::Parse("(0008,1111)[1].(0008,1111)[2].(0010,0010)");
2303 ASSERT_FALSE(path.HasUniversal()); 2303 ASSERT_FALSE(path.HasUniversal());
2304 ASSERT_EQ(2u, path.GetPrefixLength()); 2304 ASSERT_EQ(2u, path.GetPrefixLength());
2305 ASSERT_EQ(DICOM_TAG_REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE, path.GetPrefixTag(0)); 2305 ASSERT_EQ(DICOM_TAG_REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE, path.GetPrefixTag(0));
2306 ASSERT_FALSE(path.IsPrefixUniversal(0)); 2306 ASSERT_FALSE(path.IsPrefixUniversal(0));
2307 ASSERT_EQ(1, path.GetPrefixIndex(0)); 2307 ASSERT_EQ(1u, path.GetPrefixIndex(0));
2308 ASSERT_EQ(DICOM_TAG_REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE, path.GetPrefixTag(1)); 2308 ASSERT_EQ(DICOM_TAG_REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE, path.GetPrefixTag(1));
2309 ASSERT_FALSE(path.IsPrefixUniversal(1)); 2309 ASSERT_FALSE(path.IsPrefixUniversal(1));
2310 ASSERT_EQ(2, path.GetPrefixIndex(1)); 2310 ASSERT_EQ(2u, path.GetPrefixIndex(1));
2311 ASSERT_THROW(path.GetPrefixTag(2), OrthancException); 2311 ASSERT_THROW(path.GetPrefixTag(2), OrthancException);
2312 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, path.GetFinalTag()); 2312 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, path.GetFinalTag());
2313 2313
2314 path = DicomPath::Parse("(0008,1111)[*].PatientName"); 2314 path = DicomPath::Parse("(0008,1111)[*].PatientName");
2315 ASSERT_TRUE(path.HasUniversal()); 2315 ASSERT_TRUE(path.HasUniversal());
2324 path = DicomPath::Parse("(0008,1111)[1].(0008,1111)[*].(0010,0010)"); 2324 path = DicomPath::Parse("(0008,1111)[1].(0008,1111)[*].(0010,0010)");
2325 ASSERT_TRUE(path.HasUniversal()); 2325 ASSERT_TRUE(path.HasUniversal());
2326 ASSERT_EQ(2u, path.GetPrefixLength()); 2326 ASSERT_EQ(2u, path.GetPrefixLength());
2327 ASSERT_EQ(DICOM_TAG_REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE, path.GetPrefixTag(0)); 2327 ASSERT_EQ(DICOM_TAG_REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE, path.GetPrefixTag(0));
2328 ASSERT_FALSE(path.IsPrefixUniversal(0)); 2328 ASSERT_FALSE(path.IsPrefixUniversal(0));
2329 ASSERT_EQ(1, path.GetPrefixIndex(0)); 2329 ASSERT_EQ(1u, path.GetPrefixIndex(0));
2330 ASSERT_EQ(DICOM_TAG_REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE, path.GetPrefixTag(0)); 2330 ASSERT_EQ(DICOM_TAG_REFERENCED_PERFORMED_PROCEDURE_STEP_SEQUENCE, path.GetPrefixTag(0));
2331 ASSERT_TRUE(path.IsPrefixUniversal(1)); 2331 ASSERT_TRUE(path.IsPrefixUniversal(1));
2332 ASSERT_THROW(path.GetPrefixIndex(1), OrthancException); 2332 ASSERT_THROW(path.GetPrefixIndex(1), OrthancException);
2333 ASSERT_THROW(path.GetPrefixTag(2), OrthancException); 2333 ASSERT_THROW(path.GetPrefixTag(2), OrthancException);
2334 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, path.GetFinalTag()); 2334 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, path.GetFinalTag());
2336 path = DicomPath::Parse("PatientID[1].PatientName"); 2336 path = DicomPath::Parse("PatientID[1].PatientName");
2337 ASSERT_FALSE(path.HasUniversal()); 2337 ASSERT_FALSE(path.HasUniversal());
2338 ASSERT_EQ(1u, path.GetPrefixLength()); 2338 ASSERT_EQ(1u, path.GetPrefixLength());
2339 ASSERT_EQ(DICOM_TAG_PATIENT_ID, path.GetPrefixTag(0)); 2339 ASSERT_EQ(DICOM_TAG_PATIENT_ID, path.GetPrefixTag(0));
2340 ASSERT_FALSE(path.IsPrefixUniversal(0)); 2340 ASSERT_FALSE(path.IsPrefixUniversal(0));
2341 ASSERT_EQ(1, path.GetPrefixIndex(0)); 2341 ASSERT_EQ(1u, path.GetPrefixIndex(0));
2342 ASSERT_THROW(path.GetPrefixTag(1), OrthancException); 2342 ASSERT_THROW(path.GetPrefixTag(1), OrthancException);
2343 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, path.GetFinalTag()); 2343 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, path.GetFinalTag());
2344 2344
2345 path = DicomPath::Parse(" PatientID [ 42 ] . PatientName "); 2345 path = DicomPath::Parse(" PatientID [ 42 ] . PatientName ");
2346 ASSERT_FALSE(path.HasUniversal()); 2346 ASSERT_FALSE(path.HasUniversal());
2347 ASSERT_EQ(1u, path.GetPrefixLength()); 2347 ASSERT_EQ(1u, path.GetPrefixLength());
2348 ASSERT_EQ(DICOM_TAG_PATIENT_ID, path.GetPrefixTag(0)); 2348 ASSERT_EQ(DICOM_TAG_PATIENT_ID, path.GetPrefixTag(0));
2349 ASSERT_FALSE(path.IsPrefixUniversal(0)); 2349 ASSERT_FALSE(path.IsPrefixUniversal(0));
2350 ASSERT_EQ(42, path.GetPrefixIndex(0)); 2350 ASSERT_EQ(42u, path.GetPrefixIndex(0));
2351 ASSERT_THROW(path.GetPrefixTag(1), OrthancException); 2351 ASSERT_THROW(path.GetPrefixTag(1), OrthancException);
2352 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, path.GetFinalTag()); 2352 ASSERT_EQ(DICOM_TAG_PATIENT_NAME, path.GetFinalTag());
2353 ASSERT_EQ("(0010,0020)[42].(0010,0010)", path.Format()); 2353 ASSERT_EQ("(0010,0020)[42].(0010,0010)", path.Format());
2354 2354
2355 ASSERT_THROW(path.SetPrefixIndex(1, 44), OrthancException); 2355 ASSERT_THROW(path.SetPrefixIndex(1, 44), OrthancException);