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 2022/09/09 20:00:44 UTC
[ignite-3] 03/17: IGNITE-17424 Basic test stub
This is an automated email from the ASF dual-hosted git repository.
isapego pushed a commit to branch ignite-17424
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 51fb15c7f03e3e1e8d3bd1656e9a7d703b1c4a41
Author: Igor Sapego <is...@apache.org>
AuthorDate: Sun Aug 28 18:30:12 2022 +0400
IGNITE-17424 Basic test stub
---
modules/platforms/cpp/CMakeLists.txt | 9 +++--
modules/platforms/cpp/client-test/CMakeLists.txt | 2 +-
.../cpp/client-test/src/ignite_client_test.cpp | 41 ++++++++++++++++++++++
modules/platforms/cpp/client/CMakeLists.txt | 2 +-
modules/platforms/cpp/conanfile.txt | 5 ++-
.../platforms/cpp/schema/BinaryTupleBuilder.cpp | 2 +-
6 files changed, 53 insertions(+), 8 deletions(-)
diff --git a/modules/platforms/cpp/CMakeLists.txt b/modules/platforms/cpp/CMakeLists.txt
index fd36bf09ab..436c8e847e 100644
--- a/modules/platforms/cpp/CMakeLists.txt
+++ b/modules/platforms/cpp/CMakeLists.txt
@@ -23,6 +23,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_PROJECT_VERSION ${PROJECT_VERSION})
+include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
+conan_basic_setup()
+
#include(GNUInstallDirs)
set(INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/ignite)
@@ -64,6 +67,8 @@ if (${ENABLE_CLIENT})
endif()
if (${ENABLE_TESTS})
- add_subdirectory(test-common)
- add_subdirectory(client-test)
+ if (${ENABLE_CLIENT})
+ add_subdirectory(test-common)
+ add_subdirectory(client-test)
+ endif()
endif()
diff --git a/modules/platforms/cpp/client-test/CMakeLists.txt b/modules/platforms/cpp/client-test/CMakeLists.txt
index 33601b2175..40c4d0df40 100644
--- a/modules/platforms/cpp/client-test/CMakeLists.txt
+++ b/modules/platforms/cpp/client-test/CMakeLists.txt
@@ -31,7 +31,7 @@ set(SOURCES
add_executable(${TARGET} ${SOURCES})
-target_link_libraries(${TARGET} ignite-test-common ignite-client ${GTEST_LIBRARY_DEBUG} ${GTEST_MAIN_LIBRARY_DEBUG})
+target_link_libraries(${TARGET} ignite-test-common ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
set(TEST_TARGET IgniteClientTest)
add_test(NAME ${TEST_TARGET} COMMAND ${TARGET})
diff --git a/modules/platforms/cpp/client-test/src/ignite_client_test.cpp b/modules/platforms/cpp/client-test/src/ignite_client_test.cpp
index e69de29bb2..416ca4af6b 100644
--- a/modules/platforms/cpp/client-test/src/ignite_client_test.cpp
+++ b/modules/platforms/cpp/client-test/src/ignite_client_test.cpp
@@ -0,0 +1,41 @@
+/*
+ * 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 <gtest/gtest.h>
+
+class ClientTest : public ::testing::Test {
+protected:
+ ClientTest() = default;
+ ~ClientTest() = default;
+
+ void SetUp() override
+ {
+ // Code here will be called immediately after the constructor (right
+ // before each test).
+ }
+
+ void TearDown() override
+ {
+ // Code here will be called immediately after each test (right
+ // before the destructor).
+ }
+};
+
+TEST_F(ClientTest, TestTest)
+{
+ EXPECT_EQ(1, 1);
+}
\ No newline at end of file
diff --git a/modules/platforms/cpp/client/CMakeLists.txt b/modules/platforms/cpp/client/CMakeLists.txt
index 06cce53656..b060a9b051 100644
--- a/modules/platforms/cpp/client/CMakeLists.txt
+++ b/modules/platforms/cpp/client/CMakeLists.txt
@@ -30,7 +30,7 @@ add_library(${TARGET} SHARED ${SOURCES})
set_target_properties(${TARGET} PROPERTIES VERSION ${CMAKE_PROJECT_VERSION})
if (WIN32)
- set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite.client")
+ set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME "ignite-client")
endif()
target_link_libraries(${TARGET} ignite-common)
diff --git a/modules/platforms/cpp/conanfile.txt b/modules/platforms/cpp/conanfile.txt
index facca55edf..48b519d8a1 100644
--- a/modules/platforms/cpp/conanfile.txt
+++ b/modules/platforms/cpp/conanfile.txt
@@ -1,7 +1,6 @@
[requires]
-msgpack/3.3.0
+msgpack-cxx/4.1.1
gtest/1.12.1
[generators]
-CMakeDeps
-CMakeToolchain
\ No newline at end of file
+cmake
\ No newline at end of file
diff --git a/modules/platforms/cpp/schema/BinaryTupleBuilder.cpp b/modules/platforms/cpp/schema/BinaryTupleBuilder.cpp
index 07cf16dde3..e93d6c2f53 100644
--- a/modules/platforms/cpp/schema/BinaryTupleBuilder.cpp
+++ b/modules/platforms/cpp/schema/BinaryTupleBuilder.cpp
@@ -141,7 +141,7 @@ void BinaryTupleBuilder::putDouble(BytesView bytes) {
if (size != sizeof(float)) {
putBytes(BytesView{bytes.data(), size});
} else {
- float floatValue = value;
+ float floatValue = static_cast<float>(value);
putBytes(BytesView{reinterpret_cast<std::byte*>(&floatValue), sizeof(float)});
}
}