Mercurial > hg > orthanc-databases
comparison Framework/Plugins/IndexUnitTests.h @ 262:b0c65094b299
adding support for revisions in attachments
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 20 Apr 2021 14:46:42 +0200 |
parents | 34e2b93a7ac1 |
children | cc7af42d4f23 |
comparison
equal
deleted
inserted
replaced
261:34e2b93a7ac1 | 262:b0c65094b299 |
---|---|
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, revision, *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 #if ORTHANC_ENABLE_SQLITE == 1 | |
380 ASSERT_EQ(42, revision); // Only SQLite implements revisions so far | |
381 #else | |
382 ASSERT_EQ(0, revision); | |
383 #endif | |
379 | 384 |
380 expectedAttachment.reset(new OrthancPluginAttachment); | 385 expectedAttachment.reset(new OrthancPluginAttachment); |
381 expectedAttachment->uuid = "uuid2"; | 386 expectedAttachment->uuid = "uuid2"; |
382 expectedAttachment->contentType = Orthanc::FileContentType_DicomAsJson; | 387 expectedAttachment->contentType = Orthanc::FileContentType_DicomAsJson; |
383 expectedAttachment->uncompressedSize = 4242; | 388 expectedAttachment->uncompressedSize = 4242; |
385 expectedAttachment->compressionType = Orthanc::CompressionType_None; | 390 expectedAttachment->compressionType = Orthanc::CompressionType_None; |
386 expectedAttachment->compressedSize = 4242; | 391 expectedAttachment->compressedSize = 4242; |
387 expectedAttachment->compressedHash = "md5_2"; | 392 expectedAttachment->compressedHash = "md5_2"; |
388 revision = -1; | 393 revision = -1; |
389 ASSERT_TRUE(db.LookupAttachment(*output, revision, *manager, a, Orthanc::FileContentType_DicomAsJson)); | 394 ASSERT_TRUE(db.LookupAttachment(*output, revision, *manager, a, Orthanc::FileContentType_DicomAsJson)); |
390 ASSERT_EQ(0, revision); // TODO - REVISIONS | 395 |
396 #if ORTHANC_ENABLE_SQLITE == 1 | |
397 ASSERT_EQ(43, revision); // Only SQLite implements revisions so far | |
398 #else | |
399 ASSERT_EQ(0, revision); | |
400 #endif | |
391 | 401 |
392 db.ListAvailableAttachments(fc, *manager, b); | 402 db.ListAvailableAttachments(fc, *manager, b); |
393 ASSERT_EQ(0u, fc.size()); | 403 ASSERT_EQ(0u, fc.size()); |
394 db.DeleteAttachment(*output, *manager, a, Orthanc::FileContentType_Dicom); | 404 db.DeleteAttachment(*output, *manager, a, Orthanc::FileContentType_Dicom); |
395 db.ListAvailableAttachments(fc, *manager, a); | 405 db.ListAvailableAttachments(fc, *manager, a); |