GCC Code Coverage Report


Directory: libimgdoc2/
File: libimgdoc2/src/db/sqlite/sqlite_DbFactory.cpp
Date: 2025-02-03 12:41:04
Exec Total Coverage
Lines: 4 4 100.0%
Functions: 2 2 100.0%
Branches: 7 12 58.3%

Line Branch Exec Source
1 // SPDX-FileCopyrightText: 2023 Carl Zeiss Microscopy GmbH
2 //
3 // SPDX-License-Identifier: MIT
4
5 #include <IEnvironment.h>
6 #include <ClassFactory.h>
7 #include "../DbFactory.h"
8 #include "sqlite_DbConnection.h"
9
10 using namespace std;
11
12 268 /*static*/std::shared_ptr<IDbConnection> DbFactory::SqliteCreateNewDatabase(const char* filename, std::shared_ptr<imgdoc2::IHostingEnvironment> environment)
13 {
14 return SqliteDbConnection::SqliteCreateNewDatabase(
15 filename,
16
4/6
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 266 times.
✓ Branch 5 taken 266 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 268 times.
✗ Branch 9 not taken.
268 environment ? environment : imgdoc2::ClassFactory::CreateNullHostingEnvironment());
17 }
18
19 4 /*static*/std::shared_ptr<IDbConnection> DbFactory::SqliteOpenExistingDatabase(const char* filename, bool readonly, std::shared_ptr<imgdoc2::IHostingEnvironment> environment)
20 {
21 return SqliteDbConnection::SqliteOpenExistingDatabase(
22 filename,
23 readonly,
24
3/6
✗ Branch 1 not taken.
✓ Branch 2 taken 4 times.
✓ Branch 5 taken 4 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
4 environment ? environment : imgdoc2::ClassFactory::CreateNullHostingEnvironment());
25 }
26