Skip to content
Snippets Groups Projects
Verified Commit 4059f544 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: test for f-int64

parent 6c217189
No related branches found
No related tags found
1 merge request!14Tests for f-int64
Pipeline #12863 failed
...@@ -701,7 +701,7 @@ TEST_F(test_transaction, test_query) { ...@@ -701,7 +701,7 @@ TEST_F(test_transaction, test_query) {
* Test numeric values (template). * Test numeric values (template).
*/ */
template <typename T> template <typename T>
auto test_numeric_values_impl(AtomicDataType a_type) -> void { auto test_numeric_values_impl(AtomicDataType a_type, bool cast_to_int64) -> void {
const auto &connection = const auto &connection =
caosdb::connection::ConnectionManager::GetDefaultConnection(); caosdb::connection::ConnectionManager::GetDefaultConnection();
...@@ -718,7 +718,11 @@ auto test_numeric_values_impl(AtomicDataType a_type) -> void { ...@@ -718,7 +718,11 @@ auto test_numeric_values_impl(AtomicDataType a_type) -> void {
prop.SetName(name); prop.SetName(name);
prop.SetDataType(a_type); prop.SetDataType(a_type);
std::cout << "Setting value " << value << std::endl; std::cout << "Setting value " << value << std::endl;
prop.SetValue(value); if(cast_to_int64) {
prop.SetValue(static_cast<int64_t>(value));
} else {
prop.SetValue(value);
}
props_orig.push_back(prop); props_orig.push_back(prop);
auto i_stat = insert_transaction->InsertEntity(&prop); auto i_stat = insert_transaction->InsertEntity(&prop);
EXPECT_EQ(i_stat, StatusCode::READY); EXPECT_EQ(i_stat, StatusCode::READY);
...@@ -757,13 +761,13 @@ auto test_numeric_values_impl(AtomicDataType a_type) -> void { ...@@ -757,13 +761,13 @@ auto test_numeric_values_impl(AtomicDataType a_type) -> void {
* Test numeric values (wrapper for types). * Test numeric values (wrapper for types).
*/ */
TEST_F(test_transaction, test_numeric_values) { TEST_F(test_transaction, test_numeric_values) {
test_numeric_values_impl<double>(AtomicDataType::DOUBLE); test_numeric_values_impl<double>(AtomicDataType::DOUBLE, false);
test_transaction::DeleteEntities(); test_transaction::DeleteEntities();
test_numeric_values_impl<int32_t>(AtomicDataType::INTEGER); test_numeric_values_impl<int32_t>(AtomicDataType::INTEGER, true);
test_transaction::DeleteEntities(); test_transaction::DeleteEntities();
test_numeric_values_impl<bool>(AtomicDataType::BOOLEAN); test_numeric_values_impl<bool>(AtomicDataType::BOOLEAN, false);
test_transaction::DeleteEntities(); test_transaction::DeleteEntities();
test_numeric_values_impl<int64_t>(AtomicDataType::INTEGER); test_numeric_values_impl<int64_t>(AtomicDataType::INTEGER, false);
} }
// /* // /*
...@@ -1078,7 +1082,7 @@ TEST_F(test_transaction, test_full_workflow) { ...@@ -1078,7 +1082,7 @@ TEST_F(test_transaction, test_full_workflow) {
experiment_rec.AppendProperty(volt_for_rt); experiment_rec.AppendProperty(volt_for_rt);
notes_for_rt2.SetValue("This is important!"); notes_for_rt2.SetValue("This is important!");
experiment_rec.AppendProperty(notes_for_rt2); experiment_rec.AppendProperty(notes_for_rt2);
part_for_rt3.SetValue(6); part_for_rt3.SetValue(static_cast<int64_t>(6));
experiment_rec.AppendProperty(part_for_rt3); experiment_rec.AppendProperty(part_for_rt3);
succ_for_rt.SetValue(true); succ_for_rt.SetValue(true);
experiment_rec.AppendProperty(succ_for_rt); experiment_rec.AppendProperty(succ_for_rt);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment