Skip to content

Commit

Permalink
remove TODOs (#183)
Browse files Browse the repository at this point in the history
* remove TODOs

* add a line at EOF
  • Loading branch information
yanw-bq authored Sep 1, 2021
1 parent 5948d9b commit 3f7d7dc
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 101 deletions.
4 changes: 2 additions & 2 deletions run_cppcheck.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
::

:: --force: force checks all define combinations (default max is 12)
:: --suppress=objectIndex: seemingly false-positive (TODO: investigate this further)
:: --suppress=objectIndex: seemingly false-positive
:: -iaws-sdk-cpp: avoid checking AWS C++ SDK source files in our repo
cppcheck.exe --force --suppress=objectIndex -iaws-sdk-cpp .\src\ 2> cppcheck-results.log
cppcheck.exe --force --suppress=objectIndex -iaws-sdk-cpp .\src\ 2> cppcheck-results.log
64 changes: 0 additions & 64 deletions src/Tests/Tests/test_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,67 +145,3 @@ TEST(TestGetUserAgent, Success) {
std::string expected = "ts-odbc." TIMESTREAMDRIVERVERSION " [tests]";
EXPECT_EQ(expected, conn.GetUserAgent());
}

// TODO: enable gmock and mock the response from timestream
//class TestTSConnConnectDBStart : public testing::Test {
// protected:
// void SetUp() override {
// }
//
// void TearDown() override {
// m_conn.Disconnect();
// }
//
// public:
// TSCommunication m_conn;
//};
//
//TEST_F(TestTSConnConnectDBStart, ValidParameters) {
// ASSERT_NE(false, m_conn.ConnectionOptions(valid_opt_val));
// EXPECT_EQ(true, m_conn.ConnectDBStart());
// EXPECT_EQ(CONNECTION_OK, m_conn.Status());
//}
//
//TEST_F(TestTSConnConnectDBStart, InvalidParameters) {
// ASSERT_TRUE(
// m_conn.ConnectionOptions(invalid_opt_val));
// EXPECT_EQ(false, m_conn.ConnectDBStart());
// EXPECT_EQ(CONNECTION_BAD, m_conn.Status());
//}
//
//TEST_F(TestTSConnConnectDBStart, MissingParameters) {
// ASSERT_NE(true, m_conn.ConnectionOptions(missing_opt_val));
// EXPECT_EQ(false, m_conn.ConnectDBStart());
// EXPECT_EQ(CONNECTION_BAD, m_conn.Status());
//}
//
//TEST(TestTSConnDropDBConnection, InvalidParameters) {
// TSCommunication conn;
// ASSERT_EQ(CONNECTION_BAD, conn.Status());
// ASSERT_TRUE(
// conn.ConnectionOptions(invalid_opt_val));
// ASSERT_NE(true, conn.ConnectDBStart());
// ASSERT_EQ(CONNECTION_BAD, conn.Status());
// conn.Disconnect();
// EXPECT_EQ(CONNECTION_BAD, conn.Status());
//}
//
//TEST(TestTSConnDropDBConnection, MissingParameters) {
// TSCommunication conn;
// ASSERT_EQ(CONNECTION_BAD, conn.Status());
// ASSERT_NE(true, conn.ConnectionOptions(missing_opt_val));
// ASSERT_NE(true, conn.ConnectDBStart());
// ASSERT_EQ(CONNECTION_BAD, conn.Status());
// conn.Disconnect();
// EXPECT_EQ(CONNECTION_BAD, conn.Status());
//}
//
//TEST(TestTSConnDropDBConnection, ValidParameters) {
// TSCommunication conn;
// ASSERT_NE(false,
// conn.ConnectionOptions(valid_opt_val));
// ASSERT_NE(false, conn.ConnectDBStart());
// ASSERT_EQ(CONNECTION_OK, conn.Status());
// conn.Disconnect();
// EXPECT_EQ(CONNECTION_BAD, conn.Status());
//}
1 change: 0 additions & 1 deletion src/Tests/Tests/test_odbc_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ TEST_F(TestSQLDriverConnect, SqlDriverNoprompt) {
EXPECT_EQ(SQL_SUCCESS, ret);
}

//// TODO - Revisit when parser code
//// This should return SQL_SUCCESS_WITH_INFO (SQLSTATE 01S00 - Invalid
/// connection / string attribute)
TEST_F(TestSQLDriverConnect, UnsupportedKeyword) {
Expand Down
3 changes: 0 additions & 3 deletions src/timestreamsqlodbc/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ char CC_connect(ConnectionClass *self) {
}
}

// TODO #36 - When we fix encoding, we should look into returning a code here.
// This is called in connection.c and the return code isn't checked
void CC_set_locale_encoding(ConnectionClass *self, const char *encoding) {
if (self == NULL)
Expand All @@ -141,14 +140,12 @@ void CC_set_locale_encoding(ConnectionClass *self, const char *encoding) {
free(prev_encoding);
}

// TODO #36 - Add return code - see above function comment
void CC_determine_locale_encoding(ConnectionClass *self) {
// Don't update if it's already set
if ((self == NULL) || (self->locale_encoding != NULL))
return;

// Get current db encoding and derive the locale encoding
// TODO #34 - Investigate locale
CC_set_locale_encoding(self, "UTF8");
}

Expand Down
3 changes: 0 additions & 3 deletions src/timestreamsqlodbc/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ void SetTableTuples(QResultClass *res, const TableResultSet res_type,
std::string catalog("");
bind_tbl[TABLES_CATALOG_NAME]->UpdateData((void *)catalog.c_str(), 0);

// TODO #630 - Revisit logic of adding tuples for SQLTables & SQLColumns
for (size_t i = 0; i < binds.size(); i++) {
// Add tuples for SQLColumns
if (binds.size() > COLUMNS_SQL_DATA_TYPE) {
Expand Down Expand Up @@ -604,7 +603,6 @@ void SetTableTuples(QResultClass *res, const TableResultSet res_type,
}

// Get new tuple and assign index of interest (NULL others)
// TODO #324 (SQL Plugin)- Should these be unique?
TupleField *tuple = QR_AddNew(res);
for (size_t i = 0; i < bind_tbl.size(); i++) {
if (i == idx)
Expand Down Expand Up @@ -659,7 +657,6 @@ void SetupColumnQResInfo(QResultClass *res, EnvironmentClass *unused) {
INFO_VARCHAR_SIZE);
}

// TODO #325 (SQL Plugin)- Fix patterns and escape characters for this
void GenerateColumnQuery(std::string &query, const std::string &table_name,
const std::string &column_name, const bool table_valid,
const bool column_valid, const UWORD flag) {
Expand Down
2 changes: 0 additions & 2 deletions src/timestreamsqlodbc/multibyte.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@ const char *derive_locale_encoding(const char *dbencoding) {
wenc = "WIN1257";
break;
}
#else
// TODO #34 - Investigate locale handling on Mac
#endif /* WIN32 */
return wenc;
}
Expand Down
1 change: 0 additions & 1 deletion src/timestreamsqlodbc/mylog.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ static void MLOG_open() {
char filebuf[1024], errbuf[2048];
BOOL open_error = FALSE;

// TODO (#585): Add option to log to stderr stream
// MLOGFP = stderr;
if (MLOGFP)
return;
Expand Down
1 change: 0 additions & 1 deletion src/timestreamsqlodbc/odbcapiw.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,6 @@ RETCODE SQL_API SQLGetTypeInfoW(SQLHSTMT StatementHandle,
}

/* ODBC 2.x-specific functions */
// TODO (#590): Add implementations for remaining ODBC 2.x function

SQLRETURN SQL_API SQLColAttributesW(SQLHSTMT hstmt, SQLUSMALLINT iCol,
SQLUSMALLINT iField, SQLPOINTER pCharAttr,
Expand Down
25 changes: 1 addition & 24 deletions src/timestreamsqlodbc/parse_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ bool AssignColumnHeaders(QResultClass *q_res,
throw std::runtime_error("Unsupported Timestream type.");
}
}
// TODO Some historic fields needs to be removed, set 0 for now.
CI_set_field_info(QR_get_fields(q_res), (int)i,
column.GetName().c_str(), column_type_id, column_size,
0, 0, 0);
Expand Down Expand Up @@ -423,29 +422,7 @@ bool AssignRowData(const Aws::TimestreamQuery::Model::Row &row,
}
}
}

// TODO Commented out for now, needs refactoring
// If there are more rows than schema suggests, we have Keyset data
/*if (row_size > row_schema_size) {
if (ks == NULL) {
QR_set_rstatus(q_res, PORES_INTERNAL_ERROR);
QR_set_message(q_res,
"Keyset was NULL, but Keyset data was expected.");
return false;
}
auto row_column = row.value_begin() + row_schema_size;
if (sscanf(row_column->str().c_str(), "(%u,%hu)", &ks->blocknum,
&ks->offset)
!= 2) {
QR_set_rstatus(q_res, PORES_INTERNAL_ERROR);
QR_set_message(q_res, "Failed to assign Keyset.");
return false;
}
row_column++;
ks->oid = std::stoul(row_column->str(), nullptr, 10);
}*/


// Increment relevant data
q_res->cursTuple++;
if (q_res->num_fields > 0)
Expand Down

0 comments on commit 3f7d7dc

Please sign in to comment.