You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by is...@apache.org on 2023/08/22 14:28:28 UTC
[ignite-3] 02/03: IGNITE-19983 Table tests
This is an automated email from the ASF dual-hosted git repository.
isapego pushed a commit to branch ignite-19983
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 54d95cf07aa88266bef48ea3a361b56c56cd150d
Author: Igor Sapego <is...@apache.org>
AuthorDate: Tue Aug 22 18:19:22 2023 +0400
IGNITE-19983 Table tests
---
modules/platforms/cpp/tests/client-test/all_fields_type.h | 3 +++
modules/platforms/cpp/tests/client-test/key_value_binary_view_test.cpp | 1 +
modules/platforms/cpp/tests/client-test/key_value_view_test.cpp | 2 ++
modules/platforms/cpp/tests/client-test/record_binary_view_test.cpp | 1 +
modules/platforms/cpp/tests/client-test/record_view_test.cpp | 2 ++
5 files changed, 9 insertions(+)
diff --git a/modules/platforms/cpp/tests/client-test/all_fields_type.h b/modules/platforms/cpp/tests/client-test/all_fields_type.h
index e5cb2c313e..d1b808a39d 100644
--- a/modules/platforms/cpp/tests/client-test/all_fields_type.h
+++ b/modules/platforms/cpp/tests/client-test/all_fields_type.h
@@ -59,6 +59,7 @@ struct all_fields_type {
ignite::ignite_timestamp m_timestamp2;
std::vector<std::byte> m_blob;
ignite::big_decimal m_decimal;
+ bool m_boolean{false};
};
namespace ignite {
@@ -86,6 +87,7 @@ inline ignite_tuple convert_to_tuple(all_fields_type &&value) {
tuple.set("timestamp2", value.m_timestamp2);
tuple.set("blob", value.m_blob);
tuple.set("decimal", value.m_decimal);
+ tuple.set("boolean", value.m_boolean);
return tuple;
}
@@ -115,6 +117,7 @@ inline all_fields_type convert_from_tuple(ignite_tuple &&value) {
res.m_timestamp2 = value.get<ignite_timestamp>("timestamp2");
res.m_blob = value.get<std::vector<std::byte>>("blob");
res.m_decimal = value.get<big_decimal>("decimal");
+ res.m_boolean = value.get<bool>("boolean");
}
return res;
diff --git a/modules/platforms/cpp/tests/client-test/key_value_binary_view_test.cpp b/modules/platforms/cpp/tests/client-test/key_value_binary_view_test.cpp
index 30930c8066..43fe96213f 100644
--- a/modules/platforms/cpp/tests/client-test/key_value_binary_view_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/key_value_binary_view_test.cpp
@@ -959,6 +959,7 @@ TEST_F(key_value_binary_view_test, types_test) {
{"timestamp2", ignite_timestamp(3875238472, 248760634)},
{"blob", std::vector<std::byte>{std::byte(1), std::byte(2), std::byte(42)}},
{"decimal", big_decimal(123456789098765)},
+ {"boolean", true},
};
kv_view.put(nullptr, get_tuple(42), inserted);
diff --git a/modules/platforms/cpp/tests/client-test/key_value_view_test.cpp b/modules/platforms/cpp/tests/client-test/key_value_view_test.cpp
index 46101841d8..3d0c5d4bc9 100644
--- a/modules/platforms/cpp/tests/client-test/key_value_view_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/key_value_view_test.cpp
@@ -811,6 +811,7 @@ TEST_F(key_value_view_test, types_test) {
inserted.m_timestamp2 = {3875238472, 248760634};
inserted.m_blob = {std::byte(1), std::byte(2), std::byte(42)};
inserted.m_decimal = big_decimal{123456789098765};
+ inserted.m_boolean = true;
kv_view.put(nullptr, test_key_type(42), inserted);
auto res = kv_view.get(nullptr, test_key_type(42));
@@ -833,6 +834,7 @@ TEST_F(key_value_view_test, types_test) {
EXPECT_EQ(inserted.m_timestamp, res->m_timestamp);
EXPECT_EQ(inserted.m_blob, res->m_blob);
EXPECT_EQ(inserted.m_decimal, res->m_decimal);
+ EXPECT_EQ(inserted.m_boolean, res->m_boolean);
EXPECT_EQ(ignite_time(17, 4, 12), res->m_time2);
EXPECT_EQ(ignite_date_time({2020, 7, 28}, {2, 15, 52, 6000000}), res->m_datetime2);
diff --git a/modules/platforms/cpp/tests/client-test/record_binary_view_test.cpp b/modules/platforms/cpp/tests/client-test/record_binary_view_test.cpp
index b2376df3c1..d9e29325dc 100644
--- a/modules/platforms/cpp/tests/client-test/record_binary_view_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/record_binary_view_test.cpp
@@ -967,6 +967,7 @@ TEST_F(record_binary_view_test, types_test) {
{"timestamp2", ignite_timestamp(3875238472, 248760634)},
{"blob", std::vector<std::byte>{std::byte(1), std::byte(2), std::byte(42)}},
{"decimal", big_decimal(123456789098765)},
+ {"boolean", true},
};
tuple_view.upsert(nullptr, inserted);
diff --git a/modules/platforms/cpp/tests/client-test/record_view_test.cpp b/modules/platforms/cpp/tests/client-test/record_view_test.cpp
index e3062a675c..995b2b052b 100644
--- a/modules/platforms/cpp/tests/client-test/record_view_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/record_view_test.cpp
@@ -988,6 +988,7 @@ TEST_F(record_view_test, types_test) {
inserted.m_timestamp2 = {3875238472, 248760634};
inserted.m_blob = {std::byte(1), std::byte(2), std::byte(42)};
inserted.m_decimal = big_decimal{123456789098765};
+ inserted.m_boolean = true;
view2.upsert(nullptr, inserted);
auto res = view2.get(nullptr, all_fields_type{42});
@@ -1010,6 +1011,7 @@ TEST_F(record_view_test, types_test) {
EXPECT_EQ(inserted.m_timestamp, res->m_timestamp);
EXPECT_EQ(inserted.m_blob, res->m_blob);
EXPECT_EQ(inserted.m_decimal, res->m_decimal);
+ EXPECT_EQ(inserted.m_boolean, res->m_boolean);
EXPECT_EQ(ignite_time(17, 4, 12), res->m_time2);
EXPECT_EQ(ignite_date_time({2020, 7, 28}, {2, 15, 52, 6000000}), res->m_datetime2);