isapego commented on code in PR #1891: URL: https://github.com/apache/ignite-3/pull/1891#discussion_r1156953381
########## modules/platforms/cpp/tests/client-test/record_view_test.cpp: ########## @@ -0,0 +1,956 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ignite_runner_suite.h" +#include "tests/test-common/test_utils.h" + +#include "ignite/client/ignite_client.h" +#include "ignite/client/ignite_client_configuration.h" + +#include <gtest/gtest.h> + +#include <chrono> + +using namespace ignite; + +/** + * Test table type mapping (@see ignite_runner_suite::TABLE_1). + */ +struct test_type { + test_type() = default; + explicit test_type(std::int64_t key) : key(key) {} + explicit test_type(std::string val) : val(std::move(val)) {} + explicit test_type(std::int64_t key, std::string val) : key(key), val(std::move(val)) {} + + std::int64_t key{0}; + std::string val; +}; + +namespace ignite { + +template<> +ignite_tuple convert_to_tuple(test_type &&value) { + ignite_tuple tuple; + + tuple.set("key", value.key); + tuple.set("val", value.val); + + return tuple; +} + +template<> +test_type convert_from_tuple(ignite_tuple&& value) { + test_type res; + + res.key = value.get<std::int64_t>("key"); Review Comment: There is going to be a serialization error. I'll add a test for this case. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
