Mercurial > hg > orthanc-databases
comparison Framework/Plugins/IndexUnitTests.h @ 261:34e2b93a7ac1
implementing interface for revisions in attachments
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 19 Apr 2021 18:47:50 +0200 |
parents | e184dcadf163 |
children | b0c65094b299 |
comparison
equal
deleted
inserted
replaced
260:793bbbe11287 | 261:34e2b93a7ac1 |
---|---|
352 a2.uncompressedHash = "md5_2"; | 352 a2.uncompressedHash = "md5_2"; |
353 a2.compressionType = Orthanc::CompressionType_None; | 353 a2.compressionType = Orthanc::CompressionType_None; |
354 a2.compressedSize = 4242; | 354 a2.compressedSize = 4242; |
355 a2.compressedHash = "md5_2"; | 355 a2.compressedHash = "md5_2"; |
356 | 356 |
357 db.AddAttachment(*manager, a, a1); | 357 db.AddAttachment(*manager, a, a1, 42); |
358 db.ListAvailableAttachments(fc, *manager, a); | 358 db.ListAvailableAttachments(fc, *manager, a); |
359 ASSERT_EQ(1u, fc.size()); | 359 ASSERT_EQ(1u, fc.size()); |
360 ASSERT_EQ(Orthanc::FileContentType_Dicom, fc.front()); | 360 ASSERT_EQ(Orthanc::FileContentType_Dicom, fc.front()); |
361 db.AddAttachment(*manager, a, a2); | 361 db.AddAttachment(*manager, a, a2, 43); |
362 db.ListAvailableAttachments(fc, *manager, a); | 362 db.ListAvailableAttachments(fc, *manager, a); |
363 ASSERT_EQ(2u, fc.size()); | 363 ASSERT_EQ(2u, fc.size()); |
364 ASSERT_FALSE(db.LookupAttachment(*output, *manager, b, Orthanc::FileContentType_Dicom)); | 364 ASSERT_FALSE(db.LookupAttachment(*output, revision, *manager, b, Orthanc::FileContentType_Dicom)); |
365 | 365 |
366 ASSERT_EQ(4284u, db.GetTotalCompressedSize(*manager)); | 366 ASSERT_EQ(4284u, db.GetTotalCompressedSize(*manager)); |
367 ASSERT_EQ(4284u, db.GetTotalUncompressedSize(*manager)); | 367 ASSERT_EQ(4284u, db.GetTotalUncompressedSize(*manager)); |
368 | 368 |
369 expectedAttachment.reset(new OrthancPluginAttachment); | 369 expectedAttachment.reset(new OrthancPluginAttachment); |
372 expectedAttachment->uncompressedSize = 42; | 372 expectedAttachment->uncompressedSize = 42; |
373 expectedAttachment->uncompressedHash = "md5_1"; | 373 expectedAttachment->uncompressedHash = "md5_1"; |
374 expectedAttachment->compressionType = Orthanc::CompressionType_None; | 374 expectedAttachment->compressionType = Orthanc::CompressionType_None; |
375 expectedAttachment->compressedSize = 42; | 375 expectedAttachment->compressedSize = 42; |
376 expectedAttachment->compressedHash = "md5_1"; | 376 expectedAttachment->compressedHash = "md5_1"; |
377 ASSERT_TRUE(db.LookupAttachment(*output, *manager, a, Orthanc::FileContentType_Dicom)); | 377 ASSERT_TRUE(db.LookupAttachment(*output, revision, *manager, a, Orthanc::FileContentType_Dicom)); |
378 ASSERT_EQ(0, revision); // TODO - REVISIONS | |
378 | 379 |
379 expectedAttachment.reset(new OrthancPluginAttachment); | 380 expectedAttachment.reset(new OrthancPluginAttachment); |
380 expectedAttachment->uuid = "uuid2"; | 381 expectedAttachment->uuid = "uuid2"; |
381 expectedAttachment->contentType = Orthanc::FileContentType_DicomAsJson; | 382 expectedAttachment->contentType = Orthanc::FileContentType_DicomAsJson; |
382 expectedAttachment->uncompressedSize = 4242; | 383 expectedAttachment->uncompressedSize = 4242; |
383 expectedAttachment->uncompressedHash = "md5_2"; | 384 expectedAttachment->uncompressedHash = "md5_2"; |
384 expectedAttachment->compressionType = Orthanc::CompressionType_None; | 385 expectedAttachment->compressionType = Orthanc::CompressionType_None; |
385 expectedAttachment->compressedSize = 4242; | 386 expectedAttachment->compressedSize = 4242; |
386 expectedAttachment->compressedHash = "md5_2"; | 387 expectedAttachment->compressedHash = "md5_2"; |
387 ASSERT_TRUE(db.LookupAttachment(*output, *manager, a, Orthanc::FileContentType_DicomAsJson)); | 388 revision = -1; |
389 ASSERT_TRUE(db.LookupAttachment(*output, revision, *manager, a, Orthanc::FileContentType_DicomAsJson)); | |
390 ASSERT_EQ(0, revision); // TODO - REVISIONS | |
388 | 391 |
389 db.ListAvailableAttachments(fc, *manager, b); | 392 db.ListAvailableAttachments(fc, *manager, b); |
390 ASSERT_EQ(0u, fc.size()); | 393 ASSERT_EQ(0u, fc.size()); |
391 db.DeleteAttachment(*output, *manager, a, Orthanc::FileContentType_Dicom); | 394 db.DeleteAttachment(*output, *manager, a, Orthanc::FileContentType_Dicom); |
392 db.ListAvailableAttachments(fc, *manager, a); | 395 db.ListAvailableAttachments(fc, *manager, a); |