comparison SQLite/UnitTests/UnitTestsMain.cpp @ 201:42990b2dd51b

create IDatabaseBackendOutput only if needed
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 18 Mar 2021 16:51:51 +0100
parents 3236894320d6
children b40b30075c51
comparison
equal deleted inserted replaced
200:30b210616f4f 201:42990b2dd51b
34 34
35 TEST(SQLiteIndex, Lock) 35 TEST(SQLiteIndex, Lock)
36 { 36 {
37 { 37 {
38 // No locking if using memory backend 38 // No locking if using memory backend
39 OrthancDatabases::SQLiteIndex db1; 39 OrthancDatabases::SQLiteIndex db1(NULL);
40 OrthancDatabases::SQLiteIndex db2; 40 OrthancDatabases::SQLiteIndex db2(NULL);
41 41
42 db1.Open(); 42 db1.Open();
43 db2.Open(); 43 db2.Open();
44 } 44 }
45 45
46 Orthanc::SystemToolbox::RemoveFile("index.db"); 46 Orthanc::SystemToolbox::RemoveFile("index.db");
47 47
48 { 48 {
49 OrthancDatabases::SQLiteIndex db1("index.db"); 49 OrthancDatabases::SQLiteIndex db1(NULL, "index.db");
50 OrthancDatabases::SQLiteIndex db2("index.db"); 50 OrthancDatabases::SQLiteIndex db2(NULL, "index.db");
51 51
52 db1.Open(); 52 db1.Open();
53 ASSERT_THROW(db2.Open(), Orthanc::OrthancException); 53 ASSERT_THROW(db2.Open(), Orthanc::OrthancException);
54 } 54 }
55 55
56 { 56 {
57 OrthancDatabases::SQLiteIndex db3("index.db"); 57 OrthancDatabases::SQLiteIndex db3(NULL, "index.db");
58 db3.Open(); 58 db3.Open();
59 } 59 }
60 } 60 }
61 61
62 62