Mercurial > hg > orthanc-databases
comparison Framework/Plugins/IndexUnitTests.h @ 311:5f0d5f849944
fix unit tests if resuning the same database
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 14 Jul 2021 09:30:49 +0200 |
parents | d192bfd0e752 |
children | 117cf247c086 |
comparison
equal
deleted
inserted
replaced
310:f3eac614b32e | 311:5f0d5f849944 |
---|---|
86 ASSERT_STREQ(expectedAttachment->compressedHash, attachment.compressedHash); | 86 ASSERT_STREQ(expectedAttachment->compressedHash, attachment.compressedHash); |
87 } | 87 } |
88 | 88 |
89 static void CheckExportedResource(const OrthancPluginExportedResource& exported) | 89 static void CheckExportedResource(const OrthancPluginExportedResource& exported) |
90 { | 90 { |
91 ASSERT_EQ(expectedExported->seq, exported.seq); | 91 // ASSERT_EQ(expectedExported->seq, exported.seq); |
92 ASSERT_EQ(expectedExported->resourceType, exported.resourceType); | 92 ASSERT_EQ(expectedExported->resourceType, exported.resourceType); |
93 ASSERT_STREQ(expectedExported->publicId, exported.publicId); | 93 ASSERT_STREQ(expectedExported->publicId, exported.publicId); |
94 ASSERT_STREQ(expectedExported->modality, exported.modality); | 94 ASSERT_STREQ(expectedExported->modality, exported.modality); |
95 ASSERT_STREQ(expectedExported->date, exported.date); | 95 ASSERT_STREQ(expectedExported->date, exported.date); |
96 ASSERT_STREQ(expectedExported->patientId, exported.patientId); | 96 ASSERT_STREQ(expectedExported->patientId, exported.patientId); |
226 | 226 |
227 std::string s; | 227 std::string s; |
228 ASSERT_TRUE(db.LookupGlobalProperty(s, *manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseSchemaVersion)); | 228 ASSERT_TRUE(db.LookupGlobalProperty(s, *manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseSchemaVersion)); |
229 ASSERT_EQ("6", s); | 229 ASSERT_EQ("6", s); |
230 | 230 |
231 ASSERT_FALSE(db.LookupGlobalProperty(s, *manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseInternal9)); | |
232 db.SetGlobalProperty(*manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseInternal9, "Hello"); | 231 db.SetGlobalProperty(*manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseInternal9, "Hello"); |
233 ASSERT_TRUE(db.LookupGlobalProperty(s, *manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseInternal9)); | 232 ASSERT_TRUE(db.LookupGlobalProperty(s, *manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseInternal9)); |
234 ASSERT_EQ("Hello", s); | 233 ASSERT_EQ("Hello", s); |
235 db.SetGlobalProperty(*manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseInternal9, "HelloWorld"); | 234 db.SetGlobalProperty(*manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseInternal9, "HelloWorld"); |
236 ASSERT_TRUE(db.LookupGlobalProperty(s, *manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseInternal9)); | 235 ASSERT_TRUE(db.LookupGlobalProperty(s, *manager, MISSING_SERVER_IDENTIFIER, Orthanc::GlobalProperty_DatabaseInternal9)); |
489 exp.sopInstanceUid = "instance"; | 488 exp.sopInstanceUid = "instance"; |
490 db.LogExportedResource(*manager, exp); | 489 db.LogExportedResource(*manager, exp); |
491 | 490 |
492 expectedExported.reset(new OrthancPluginExportedResource()); | 491 expectedExported.reset(new OrthancPluginExportedResource()); |
493 *expectedExported = exp; | 492 *expectedExported = exp; |
494 expectedExported->seq = 1; | |
495 | 493 |
496 bool done; | 494 bool done; |
497 db.GetExportedResources(*output, done, *manager, 0, 10); | 495 db.GetExportedResources(*output, done, *manager, 0, 10); |
498 | 496 |
499 | 497 |