Skip to content

Commit

Permalink
Remove debug code in SQLiteProcedures
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Jul 23, 2024
1 parent 83d7cf3 commit 48eb2eb
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/EnergyPlus/SQLiteProcedures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2607,21 +2607,11 @@ SQLiteProcedures::SQLiteProcedures(std::shared_ptr<std::ostream> const &errorStr
fs::path const &errorFilePath)
: m_writeOutputToSQLite(writeOutputToSQLite), m_errorStream(errorStream)
{
constexpr bool debug = true;

sqlite3 *m_connection = nullptr;
if (m_writeOutputToSQLite) {
int rc = -1;
bool ok = true;

if constexpr (debug) {
// std::cout << "errorStream=" << errorStream << ", dbName=" << dbName << std::endl;
// std::cout << "dbName.string()=" << dbName.string() << std::endl;
// std::cout << "dbName.generic_string()=" << dbName.generic_string() << std::endl;
std::wcout << "dbName.generic_wstring()=" << dbName.generic_wstring() << std::endl;
std::cout << "narrow(dbName.generic_wstring())=" << FileSystem::toGenericString(dbName) << std::endl;
}

std::string const dbName_utf8 = FileSystem::toGenericString(dbName);

// Test if we can write to the sqlite error file
Expand All @@ -2631,9 +2621,6 @@ SQLiteProcedures::SQLiteProcedures(std::shared_ptr<std::ostream> const &errorStr
} else {
ok = false;
}
if constexpr (debug) {
std::cout << "m_errorStream: " << std::boolalpha << ok << std::endl;
}

// Test if we can create a new file named dbName
if (ok && dbName != ":memory:") {
Expand All @@ -2644,9 +2631,6 @@ SQLiteProcedures::SQLiteProcedures(std::shared_ptr<std::ostream> const &errorStr
ok = false;
}
}
if constexpr (debug) {
std::cout << "ofstream dbName: " << std::boolalpha << ok << std::endl;
}

// Test if we can write to the database
// If we can't then there are probably locks on the database
Expand All @@ -2656,14 +2640,8 @@ SQLiteProcedures::SQLiteProcedures(std::shared_ptr<std::ostream> const &errorStr
if (rc) {
*m_errorStream << "SQLite3 message, can't get exclusive lock to open database: " << sqlite3_errmsg(m_connection) << std::endl;
ok = false;
if constexpr (debug) {
std::cout << "sqlite3_open_v2: " << std::boolalpha << ok << ' ' << sqlite3_errmsg(m_connection) << std::endl;
}
}
}
if constexpr (debug) {
std::cout << "sqlite3_open_v2: " << std::boolalpha << ok << std::endl;
}

if (ok) {
char *zErrMsg = nullptr;
Expand Down

5 comments on commit 48eb2eb

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10487_Windows_NonASCII_paths (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3685 of 3685 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10487_Windows_NonASCII_paths (jmarrec) - Win64-Windows-10-VisualStudio-16: OK (2852 of 2852 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10487_Windows_NonASCII_paths (jmarrec) - x86_64-MacOS-10.18-clang-15.0.0: OK (3644 of 3644 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10487_Windows_NonASCII_paths (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2060 of 2060 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10487_Windows_NonASCII_paths (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (795 of 795 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.