Mercurial > hg > orthanc-databases
comparison PostgreSQL/UnitTests/UnitTestsMain.cpp @ 417:15bfd9a76f8d pg-transactions
merge
author | Alain Mazy <am@osimis.io> |
---|---|
date | Fri, 23 Jun 2023 14:26:58 +0200 |
parents | 91124cc8a8c7 |
children | ecd0b719cff5 |
comparison
equal
deleted
inserted
replaced
370:d2b5d9c92214 | 417:15bfd9a76f8d |
---|---|
1 /** | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
4 * Department, University Hospital of Liege, Belgium | 4 * Department, University Hospital of Liege, Belgium |
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium | 5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | 6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
7 * | 7 * |
8 * This program is free software: you can redistribute it and/or | 8 * This program is free software: you can redistribute it and/or |
9 * modify it under the terms of the GNU Affero General Public License | 9 * modify it under the terms of the GNU Affero General Public License |
10 * as published by the Free Software Foundation, either version 3 of | 10 * as published by the Free Software Foundation, either version 3 of |
11 * the License, or (at your option) any later version. | 11 * the License, or (at your option) any later version. |
93 lock.SetLock(true); | 93 lock.SetLock(true); |
94 | 94 |
95 OrthancDatabases::PostgreSQLIndex db1(NULL, noLock); | 95 OrthancDatabases::PostgreSQLIndex db1(NULL, noLock); |
96 db1.SetClearAll(true); | 96 db1.SetClearAll(true); |
97 | 97 |
98 std::unique_ptr<OrthancDatabases::DatabaseManager> manager1(OrthancDatabases::IndexBackend::CreateSingleDatabaseManager(db1)); | 98 std::list<OrthancDatabases::IdentifierTag> identifierTags; |
99 std::unique_ptr<OrthancDatabases::DatabaseManager> manager1(OrthancDatabases::IndexBackend::CreateSingleDatabaseManager(db1, false, identifierTags)); | |
99 | 100 |
100 { | 101 { |
101 OrthancDatabases::PostgreSQLIndex db2(NULL, lock); | 102 OrthancDatabases::PostgreSQLIndex db2(NULL, lock); |
102 std::unique_ptr<OrthancDatabases::DatabaseManager> manager2(OrthancDatabases::IndexBackend::CreateSingleDatabaseManager(db2)); | 103 std::unique_ptr<OrthancDatabases::DatabaseManager> manager2(OrthancDatabases::IndexBackend::CreateSingleDatabaseManager(db2, false, identifierTags)); |
103 | 104 |
104 OrthancDatabases::PostgreSQLIndex db3(NULL, lock); | 105 OrthancDatabases::PostgreSQLIndex db3(NULL, lock); |
105 ASSERT_THROW(OrthancDatabases::IndexBackend::CreateSingleDatabaseManager(db3), Orthanc::OrthancException); | 106 ASSERT_THROW(OrthancDatabases::IndexBackend::CreateSingleDatabaseManager(db3, false, identifierTags), Orthanc::OrthancException); |
106 } | 107 } |
107 | 108 |
108 OrthancDatabases::PostgreSQLIndex db4(NULL, lock); | 109 OrthancDatabases::PostgreSQLIndex db4(NULL, lock); |
109 std::unique_ptr<OrthancDatabases::DatabaseManager> manager4(OrthancDatabases::IndexBackend::CreateSingleDatabaseManager(db4)); | 110 std::unique_ptr<OrthancDatabases::DatabaseManager> manager4(OrthancDatabases::IndexBackend::CreateSingleDatabaseManager(db4, false, identifierTags)); |
110 } | 111 } |
111 | 112 |
112 | 113 |
113 int main(int argc, char **argv) | 114 int main(int argc, char **argv) |
114 { | 115 { |