This is an automated email from the ASF dual-hosted git repository.
isapego pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 842e1e3997 IGNITE-20147 Fix ODBC timestamp-related tests (#2606)
842e1e3997 is described below
commit 842e1e399775522c18d9721cfedaefa158f0aa55
Author: Igor Sapego <[email protected]>
AuthorDate: Tue Sep 19 16:11:16 2023 +0400
IGNITE-20147 Fix ODBC timestamp-related tests (#2606)
---
.../cpp/ignite/odbc/app/application_data_buffer.cpp | 3 +--
.../ignite/odbc/app/application_data_buffer_test.cpp | 17 +++++++++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/modules/platforms/cpp/ignite/odbc/app/application_data_buffer.cpp
b/modules/platforms/cpp/ignite/odbc/app/application_data_buffer.cpp
index a744b5afa2..4f652d34a5 100644
--- a/modules/platforms/cpp/ignite/odbc/app/application_data_buffer.cpp
+++ b/modules/platforms/cpp/ignite/odbc/app/application_data_buffer.cpp
@@ -1144,8 +1144,7 @@ T application_data_buffer::get_num() const {
converter << str;
- // Workaround for char types which are recognised as
- // symbolyc types and not numeric types.
+ // Workaround for char types which are recognized as symbolic
types and not numeric types.
if (sizeof(T) == 1) {
short tmp;
diff --git
a/modules/platforms/cpp/ignite/odbc/app/application_data_buffer_test.cpp
b/modules/platforms/cpp/ignite/odbc/app/application_data_buffer_test.cpp
index 24e0a315e3..357057055d 100644
--- a/modules/platforms/cpp/ignite/odbc/app/application_data_buffer_test.cpp
+++ b/modules/platforms/cpp/ignite/odbc/app/application_data_buffer_test.cpp
@@ -925,7 +925,12 @@ TEST_F(application_data_buffer_test,
get_timestamp_from_date) {
auto ts = app_buf.get_timestamp();
- EXPECT_EQ(454449600, ts.get_epoch_second());
+ tm tm_time{};
+ tm_time.tm_year = 84;
+ tm_time.tm_mon = 4;
+ tm_time.tm_mday = 27;
+
+ EXPECT_EQ(mktime(&tm_time), ts.get_epoch_second());
EXPECT_EQ(0, ts.get_nano());
}
@@ -984,7 +989,15 @@ TEST_F(application_data_buffer_test,
get_timestamp_from_timestamp) {
auto ts = app_buf.get_timestamp();
- EXPECT_EQ(1092450891, ts.get_epoch_second());
+ tm tm_time{};
+ tm_time.tm_year = 104;
+ tm_time.tm_mon = 7;
+ tm_time.tm_mday = 14;
+ tm_time.tm_hour = 6;
+ tm_time.tm_min = 34;
+ tm_time.tm_sec = 51;
+
+ EXPECT_EQ(mktime(&tm_time), ts.get_epoch_second());
EXPECT_EQ(573948623, ts.get_nano());
}