From 63da8bcd48883e00f3caecf38bedcb45357bfc5d Mon Sep 17 00:00:00 2001 From: SergeyIvanov87 Date: Wed, 25 Oct 2023 09:45:09 +0200 Subject: [PATCH 1/5] Fix clang compilation --- CMakeLists.txt | 4 +++- cmake/FindCURL.cmake | 1 + cmake/FindTXML.cmake | 1 + elasticsearch/books/FB2/fb2_reader.hpp | 1 - .../books/FB2/serializer/book_model_serializer.hpp | 2 +- .../common_model/serializers/schema_serializer.hpp | 14 +++++++------- elasticsearch/service/doc_id/schema_serializer.hpp | 2 +- elasticsearch/utils/strings.cpp | 4 ++-- elasticsearch/utils/zutils.hpp | 2 +- .../v7_10/answer_model/search/object/Query.h | 2 +- .../answer_model/search/object/boolean/Bool.h | 2 +- .../search/object/boolean/filter/elements.hpp | 2 +- .../search/object/boolean/must/elements.hpp | 2 +- .../search/object/geo/GeoBoundingBox.hpp | 2 +- .../answer_model/search/object/range/Range.hpp | 2 +- elasticsearch/v7_10/request/tags/search/utils.hpp | 8 ++++---- tests/books/fb2_pack_unpack_suite.cpp | 2 ++ 17 files changed, 29 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3982988..a136ec8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,9 @@ set (PROC_LIB_NAME "cpp_book_indexer") project(${PROC_NAME} CXX C) -include(CheckCCompilerFlag) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + option(PICKY_COMPILER "Enable picky compiler" OFF) set (BRANCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/cmake/FindCURL.cmake b/cmake/FindCURL.cmake index a77611d..3901cd6 100644 --- a/cmake/FindCURL.cmake +++ b/cmake/FindCURL.cmake @@ -47,3 +47,4 @@ if(WITH_CURL) list (APPEND COMPILE_DEFS -DWITH_CURL) endif() endif() +message("CURL has been bootstrapped and the package resides in: ${TEMPLATE_XML_PATH}") diff --git a/cmake/FindTXML.cmake b/cmake/FindTXML.cmake index d87388d..0d25c61 100644 --- a/cmake/FindTXML.cmake +++ b/cmake/FindTXML.cmake @@ -57,3 +57,4 @@ endif() include(${TEMPLATE_XML_PATH}/lib/txml/cmake/FindLibXML2.cmake) target_link_libraries(${TXML_TARGET} INTERFACE ${XML_TARGET}) add_dependencies(${TXML_TARGET} ${XML_TARGET}) +message("TemplateXML has been bootstrapped and the package resides in: ${TEMPLATE_XML_PATH}") diff --git a/elasticsearch/books/FB2/fb2_reader.hpp b/elasticsearch/books/FB2/fb2_reader.hpp index faf7e26..d394079 100644 --- a/elasticsearch/books/FB2/fb2_reader.hpp +++ b/elasticsearch/books/FB2/fb2_reader.hpp @@ -8,7 +8,6 @@ namespace fb2 { -class ShortFictionBook; class packer; class reader : public elasticsearch::book::packer_interface_aggregator { diff --git a/elasticsearch/books/FB2/serializer/book_model_serializer.hpp b/elasticsearch/books/FB2/serializer/book_model_serializer.hpp index 7ee1a22..dbd2af6 100644 --- a/elasticsearch/books/FB2/serializer/book_model_serializer.hpp +++ b/elasticsearch/books/FB2/serializer/book_model_serializer.hpp @@ -29,7 +29,7 @@ struct to_model_data : public txml::FormatSerializerBase - void serialize_impl(const ::fb2::FB2TextElement &val, Tracer tracer) + void serialize_impl(const ::fb2::FB2TextElement &, Tracer) { } diff --git a/elasticsearch/common_model/serializers/schema_serializer.hpp b/elasticsearch/common_model/serializers/schema_serializer.hpp index 416cebb..85eeddd 100644 --- a/elasticsearch/common_model/serializers/schema_serializer.hpp +++ b/elasticsearch/common_model/serializers/schema_serializer.hpp @@ -18,19 +18,19 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO TXML_SCHEMA_SERIALIZER_DISPATCHABLE_OBJECT template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object({{BinaryBlob::class_name(),{{"type", "binary"}}}})); } template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object({{CreationDateTime::class_name(),{{"type", "date"}}}})); } template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object( { @@ -47,7 +47,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO } template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object({{Preview::class_name(),{{"type", "binary"}}}})); } @@ -63,7 +63,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO } template - void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &tracer) + void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &) { //this->json_object_stack_helper->push(nlohmann::json::object({{SerializedItem::class_name(),{{"type", "text"}, decorator::make_keyword()}}})); this->json_object_stack_helper->push(nlohmann::json::object( @@ -81,7 +81,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO } template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object( { @@ -98,7 +98,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO } template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object({{SchemaVersion::class_name(),{{"type", "version"}}}})); } diff --git a/elasticsearch/service/doc_id/schema_serializer.hpp b/elasticsearch/service/doc_id/schema_serializer.hpp index 35f993a..955a21c 100644 --- a/elasticsearch/service/doc_id/schema_serializer.hpp +++ b/elasticsearch/service/doc_id/schema_serializer.hpp @@ -28,7 +28,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO } template - void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &tracer) + void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &) { this->json_object_stack_helper->push(nlohmann::json::object( { diff --git a/elasticsearch/utils/strings.cpp b/elasticsearch/utils/strings.cpp index e53cdb1..df47268 100644 --- a/elasticsearch/utils/strings.cpp +++ b/elasticsearch/utils/strings.cpp @@ -5,8 +5,8 @@ namespace elasticsearch namespace utils { range_descriptor::range_descriptor(value_t && v, bool enclosed) : - value(std::move(v)), - border_included(enclosed) + border_included(enclosed), + value(std::move(v)) { } diff --git a/elasticsearch/utils/zutils.hpp b/elasticsearch/utils/zutils.hpp index c384722..d961b7c 100644 --- a/elasticsearch/utils/zutils.hpp +++ b/elasticsearch/utils/zutils.hpp @@ -23,7 +23,7 @@ class fd_guard int release(); private: int m_fd; -; + fd_guard(const fd_guard &) = delete; fd_guard& operator= (const fd_guard& ) = delete; }; diff --git a/elasticsearch/v7_10/answer_model/search/object/Query.h b/elasticsearch/v7_10/answer_model/search/object/Query.h index 77a19d6..b9730a2 100644 --- a/elasticsearch/v7_10/answer_model/search/object/Query.h +++ b/elasticsearch/v7_10/answer_model/search/object/Query.h @@ -37,7 +37,7 @@ class Query: public txml::XMLNode, TXML_DECLARE_SERIALIZER_AGGREGATOR_CLASS(aggregator_serializer_type, serializer_parted_type, - typename Params::serializer_parted_type...) + typename Params::template serializer_parted_type...) { TXML_SERIALIZER_AGGREGATOR_OBJECT }; diff --git a/elasticsearch/v7_10/answer_model/search/object/boolean/Bool.h b/elasticsearch/v7_10/answer_model/search/object/boolean/Bool.h index 4abadd6..86c16ac 100644 --- a/elasticsearch/v7_10/answer_model/search/object/boolean/Bool.h +++ b/elasticsearch/v7_10/answer_model/search/object/boolean/Bool.h @@ -37,7 +37,7 @@ class Boolean : public txml::XMLNode, TXML_DECLARE_SERIALIZER_AGGREGATOR_CLASS(aggregator_serializer_type, serializer_parted_type, - typename SubContexts::serializer_parted_type...) + typename SubContexts::template serializer_parted_type...) { TXML_SERIALIZER_AGGREGATOR_OBJECT }; diff --git a/elasticsearch/v7_10/answer_model/search/object/boolean/filter/elements.hpp b/elasticsearch/v7_10/answer_model/search/object/boolean/filter/elements.hpp index d202406..f910fcf 100644 --- a/elasticsearch/v7_10/answer_model/search/object/boolean/filter/elements.hpp +++ b/elasticsearch/v7_10/answer_model/search/object/boolean/filter/elements.hpp @@ -159,7 +159,7 @@ class Filter: public txml::XMLArray, // standalone serializier TXML_DECLARE_SERIALIZER_AGGREGATOR_CLASS(aggregator_serializer_type, serializer_parted_type, - typename SubContexts::serializer_parted_type...) + typename SubContexts::template serializer_parted_type...) { TXML_SERIALIZER_AGGREGATOR_OBJECT }; diff --git a/elasticsearch/v7_10/answer_model/search/object/boolean/must/elements.hpp b/elasticsearch/v7_10/answer_model/search/object/boolean/must/elements.hpp index 430d076..337037e 100644 --- a/elasticsearch/v7_10/answer_model/search/object/boolean/must/elements.hpp +++ b/elasticsearch/v7_10/answer_model/search/object/boolean/must/elements.hpp @@ -213,7 +213,7 @@ class Must: public txml::XMLArray, // standalone serializier TXML_DECLARE_SERIALIZER_AGGREGATOR_CLASS(aggregator_serializer_type, serializer_parted_type, - typename SubContexts::serializer_parted_type...) + typename SubContexts::template serializer_parted_type...) { TXML_SERIALIZER_AGGREGATOR_OBJECT }; diff --git a/elasticsearch/v7_10/answer_model/search/object/geo/GeoBoundingBox.hpp b/elasticsearch/v7_10/answer_model/search/object/geo/GeoBoundingBox.hpp index b2341cc..3f16255 100644 --- a/elasticsearch/v7_10/answer_model/search/object/geo/GeoBoundingBox.hpp +++ b/elasticsearch/v7_10/answer_model/search/object/geo/GeoBoundingBox.hpp @@ -47,7 +47,7 @@ class GeoBoundingBox : public txml::XMLNode, TXML_DECLARE_SERIALIZER_AGGREGATOR_CLASS(aggregator_serializer_type, serializer_parted_type, - typename element_t::serializer_parted_type) + typename element_t::template serializer_parted_type) { TXML_SERIALIZER_AGGREGATOR_OBJECT }; diff --git a/elasticsearch/v7_10/answer_model/search/object/range/Range.hpp b/elasticsearch/v7_10/answer_model/search/object/range/Range.hpp index ec7c543..508886b 100644 --- a/elasticsearch/v7_10/answer_model/search/object/range/Range.hpp +++ b/elasticsearch/v7_10/answer_model/search/object/range/Range.hpp @@ -53,7 +53,7 @@ class Range : public txml::XMLNode, TXML_DECLARE_SERIALIZER_AGGREGATOR_CLASS(aggregator_serializer_type, serializer_parted_type, - typename range::element::serializer_parted_type...) + typename range::element::template serializer_parted_type...) { TXML_SERIALIZER_AGGREGATOR_OBJECT }; diff --git a/elasticsearch/v7_10/request/tags/search/utils.hpp b/elasticsearch/v7_10/request/tags/search/utils.hpp index 4c535b0..e27ac91 100644 --- a/elasticsearch/v7_10/request/tags/search/utils.hpp +++ b/elasticsearch/v7_10/request/tags/search/utils.hpp @@ -31,16 +31,16 @@ struct NonMappedType template struct table_mapper { - template::value_t, NonMappedType>, int>> + template::template value_t, NonMappedType>, int>> static auto map(const ModelElement &v) { - return typename table::value_t(v); + return typename table::template value_t(v); } - template::value_t, NonMappedType>, char> = 0> + template::template value_t, NonMappedType>, char> = 0> static auto map(const ModelElement &) { - static_assert(!std::is_same_v::value_t, NonMappedType>, + static_assert(!std::is_same_v::template value_t, NonMappedType>, "There are no defined mapping for requested type. " "Please implement 'tag::translation::table' specialization for type if you require it"); return NonMappedType{}; diff --git a/tests/books/fb2_pack_unpack_suite.cpp b/tests/books/fb2_pack_unpack_suite.cpp index 5af9d84..4fb7504 100644 --- a/tests/books/fb2_pack_unpack_suite.cpp +++ b/tests/books/fb2_pack_unpack_suite.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include "elasticsearch/books/FB2/fb2_packer.hpp" #include "elasticsearch/books/FB2/fb2_unpacker.hpp" #include From 2fd0022dee18c86e5160106e7e318568d51ad42e Mon Sep 17 00:00:00 2001 From: SergeyIvanov87 Date: Thu, 26 Oct 2023 06:43:15 +0200 Subject: [PATCH 2/5] Fix linkage & zero XMLNode elements --- bin/es.cpp | 32 +++++++++---------- bin/v7/dispatcher.cpp | 15 ++++----- elasticsearch/books/FB2/fb2_unpacker.hpp | 1 + elasticsearch/books/book_reader.cpp | 1 + .../serializers/schema_serializer.hpp | 2 +- elasticsearch/common_model/BinaryBlob.h | 2 ++ elasticsearch/common_model/OriginalPath.h | 1 + .../serializers/schema_serializer.hpp | 2 +- .../serializers/schema_serializer.hpp | 8 ++--- .../service/doc_id/schema_serializer.hpp | 2 +- .../answer_model/search/object/MatchAll.h | 4 +-- tests/books/book_search_suite.cpp | 2 +- tests/books/fb2_pack_unpack_suite.cpp | 1 + tests/common/Serializers.hpp | 12 +++---- tests/common/settings.hpp | 6 ++-- 15 files changed, 48 insertions(+), 43 deletions(-) diff --git a/bin/es.cpp b/bin/es.cpp index 6f658d8..5b51047 100644 --- a/bin/es.cpp +++ b/bin/es.cpp @@ -140,7 +140,7 @@ namespace documents template std::vector tmp_entry_extractor(std::vector &tmp_entries, std::filesystem::path extract_prefix, - int &error_number, + size_t &error_number, U &&...args); } @@ -234,7 +234,7 @@ int main(int argc, const char* argv[]) } //to form csv - for(const auto ret_data_it : ret_data) + for(const auto &ret_data_it : ret_data) { std::cout << ret_data_it.first << ","; std::cout << std::get<0>(ret_data_it.second) << ","; @@ -312,8 +312,8 @@ int main(int argc, const char* argv[]) std::vector restored_documents; // request for documents - int skipped_err_files = 0; - for (int i = 0; i < requested_doc_num; i += group_size) + size_t skipped_err_files = 0; + for (i = 0; i < requested_doc_num; i += group_size) { size_t requested_document_count = std::min(requested_doc_num - i, group_size); try @@ -323,7 +323,7 @@ int main(int argc, const char* argv[]) catch (const std::exception &ex) { std::cerr << "Cannot get some or more documents:\n" << std::endl; - for (int j = 0; j < requested_document_count; j ++) + for (size_t j = 0; j < requested_document_count; j ++) { std::cerr << *(argv + doc_arg_index + i + j) << std::endl; } @@ -336,7 +336,7 @@ int main(int argc, const char* argv[]) // create temporary files size_t prev_records = restored_documents.size(); restored_documents.reserve(prev_records + ret_data.size()); - for(const auto ret_data_it : ret_data) + for(const auto &ret_data_it : ret_data) { try { @@ -417,9 +417,9 @@ int main(int argc, const char* argv[]) { std::cout << "Available schemas:" << std::endl; std::string list("\t"); - for (const char **s = schema_indices; *s; s++) + for (const char **s_ptr = schema_indices; *s_ptr; s_ptr++) { - list = list + *s + ','; + list = list + *s_ptr + ','; } if (!list.empty()) list.pop_back(); std::cout << list<< std ::endl; @@ -429,21 +429,21 @@ int main(int argc, const char* argv[]) { const char *found_schema = nullptr; size_t argv_len = strlen(argv[1]); - for (const char **s = schema_indices; *s; s++) + for (const char **s_ptr = schema_indices; *s_ptr; s_ptr++) { - size_t s_len = strlen(*s); - if (argv_len == s_len && !strncmp(argv[1], *s, s_len)) + size_t s_len = strlen(*s_ptr); + if (argv_len == s_len && !strncmp(argv[1], *s_ptr, s_len)) { - found_schema = *s; + found_schema = *s_ptr; break; } } if (!found_schema) { std::cout << "Unexpected schema: " << argv[1] << ". Check on list of available schemas:" < std::vector tmp_entry_extractor(std::vector &tmp_entries, std::filesystem::path extract_prefix, - int &error_number, + size_t &error_number, U &&...args) { std::vector copied_files; diff --git a/bin/v7/dispatcher.cpp b/bin/v7/dispatcher.cpp index 66a72e0..b4bba7c 100644 --- a/bin/v7/dispatcher.cpp +++ b/bin/v7/dispatcher.cpp @@ -73,7 +73,7 @@ get_match_elem std::vector> extract_model_records(const std::shared_ptr &search_ptr, Tracer tracer) { - using transaction = SearchRequest; using data = Model; if (!search_ptr) @@ -465,7 +464,7 @@ void request_image_index_mapping_delete(const dispatcher &d, Tracer) } template -void request_rm_data(const dispatcher &d, std::ostream &out, const char *index, const char *doc_path_id, Tracer tracer) +void request_rm_data(const dispatcher &d, std::ostream &out, const char *index, const char *doc_path_id, Tracer) { std::optional ans_ptr; if (!strcmp(index, schema_indices[0])) @@ -527,8 +526,8 @@ void request_put_data(const dispatcher &d, std::ostream &out, bin::data_manipulation::inject_to_model(*book_model_promise, override_model_params); } - catch (const std::exception& ex) { - exception_logging << "Book schema parse failed, reason:\n" << ex.what() << std::endl; + catch (const std::exception& exx) { + exception_logging << "Book schema parse failed, reason:\n" << exx.what() << std::endl; throw std::runtime_error(std::string("unsupported format by path: ") + file_path + ", error: " + exception_logging.str()); } } @@ -595,9 +594,9 @@ void request_put_data(const dispatcher &d, std::ostream &out, template std::map - request_get_data(const dispatcher &d, std::ostream &out, + request_get_data(const dispatcher &d, std::ostream &, const char *index, const char **document_names, size_t document_count, - Tracer tracer) + Tracer) { std::map ret; if (!strcmp(index, schema_indices[0])) @@ -637,7 +636,7 @@ std::map template void request_update_data(dispatcher &d, - std::ostream &out, const char *file_path, const char* document_id, + std::ostream &, const char *file_path, const char* document_id, const std::map& override_model_params, Tracer tracer) { diff --git a/elasticsearch/books/FB2/fb2_unpacker.hpp b/elasticsearch/books/FB2/fb2_unpacker.hpp index dd3c9e2..92d04c3 100644 --- a/elasticsearch/books/FB2/fb2_unpacker.hpp +++ b/elasticsearch/books/FB2/fb2_unpacker.hpp @@ -3,6 +3,7 @@ #include #include +//#include #include "elasticsearch/common_model/BinaryBlob.h" #include "elasticsearch/common_model/OriginalPath.h" diff --git a/elasticsearch/books/book_reader.cpp b/elasticsearch/books/book_reader.cpp index 46c5dd7..6b307f8 100644 --- a/elasticsearch/books/book_reader.cpp +++ b/elasticsearch/books/book_reader.cpp @@ -1,3 +1,4 @@ +#include #include "elasticsearch/books/book_reader.hpp" #include diff --git a/elasticsearch/books/data_model/serializers/schema_serializer.hpp b/elasticsearch/books/data_model/serializers/schema_serializer.hpp index bb030f9..012a845 100644 --- a/elasticsearch/books/data_model/serializers/schema_serializer.hpp +++ b/elasticsearch/books/data_model/serializers/schema_serializer.hpp @@ -29,7 +29,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO } template - void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &tracer) + void serialize_schema_tag_impl(txml::LeafTag&&, Tracer &) { //this->json_object_stack_helper->push(nlohmann::json::object({{SerializedItem::class_name(),{{"type", "text"}}}})); this->json_object_stack_helper->push(nlohmann::json::object( diff --git a/elasticsearch/common_model/BinaryBlob.h b/elasticsearch/common_model/BinaryBlob.h index 59d8d5c..1388632 100644 --- a/elasticsearch/common_model/BinaryBlob.h +++ b/elasticsearch/common_model/BinaryBlob.h @@ -3,6 +3,8 @@ #include #include +#include + #include "elasticsearch/utils/base64.h" namespace elasticsearch diff --git a/elasticsearch/common_model/OriginalPath.h b/elasticsearch/common_model/OriginalPath.h index 68c9027..f3ec510 100644 --- a/elasticsearch/common_model/OriginalPath.h +++ b/elasticsearch/common_model/OriginalPath.h @@ -2,6 +2,7 @@ #define COMMON_MODEL_ORIGINAL_PATH_H #include +#include namespace elasticsearch { diff --git a/elasticsearch/common_model/serializers/schema_serializer.hpp b/elasticsearch/common_model/serializers/schema_serializer.hpp index 85eeddd..d17bd97 100644 --- a/elasticsearch/common_model/serializers/schema_serializer.hpp +++ b/elasticsearch/common_model/serializers/schema_serializer.hpp @@ -63,7 +63,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO } template - void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &) + void serialize_schema_tag_impl(txml::LeafTag&&, Tracer &) { //this->json_object_stack_helper->push(nlohmann::json::object({{SerializedItem::class_name(),{{"type", "text"}, decorator::make_keyword()}}})); this->json_object_stack_helper->push(nlohmann::json::object( diff --git a/elasticsearch/images/data_model/serializers/schema_serializer.hpp b/elasticsearch/images/data_model/serializers/schema_serializer.hpp index f554dbd..1bd6123 100644 --- a/elasticsearch/images/data_model/serializers/schema_serializer.hpp +++ b/elasticsearch/images/data_model/serializers/schema_serializer.hpp @@ -20,13 +20,13 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO TXML_SCHEMA_SERIALIZER_DISPATCHABLE_OBJECT template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object({{element::Location::class_name().data(),{{"type", "geo_point"}}}})); } template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object( {{element::OriginalTime::class_name().data(), @@ -34,7 +34,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO } template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object( {{elasticsearch::image::model::element::DigitizeTime::class_name().data(), @@ -52,7 +52,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO } template - void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &tracer) + void serialize_schema_tag_impl(txml::LeafTag&&, Tracer &) {/* this->json_object_stack_helper->push(nlohmann::json::object({ {SerializedItem::class_name().data(),{ diff --git a/elasticsearch/service/doc_id/schema_serializer.hpp b/elasticsearch/service/doc_id/schema_serializer.hpp index 955a21c..a16b802 100644 --- a/elasticsearch/service/doc_id/schema_serializer.hpp +++ b/elasticsearch/service/doc_id/schema_serializer.hpp @@ -28,7 +28,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(to_schema, Parent, SchemaToJSO } template - void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &) + void serialize_schema_tag_impl(txml::LeafTag&&, Tracer &) { this->json_object_stack_helper->push(nlohmann::json::object( { diff --git a/elasticsearch/v7_10/answer_model/search/object/MatchAll.h b/elasticsearch/v7_10/answer_model/search/object/MatchAll.h index 033f967..0937819 100644 --- a/elasticsearch/v7_10/answer_model/search/object/MatchAll.h +++ b/elasticsearch/v7_10/answer_model/search/object/MatchAll.h @@ -8,10 +8,10 @@ namespace model class EmptyModel {}; struct EmptyParam {using value_type = EmptyParam; }; -class MatchAll : public txml::XMLNode +class MatchAll : public txml::XMLNodeLeafNoData { public: - using base_t = txml::XMLNode; + using base_t = txml::XMLNodeLeafNoData; static constexpr std::string_view class_name() { diff --git a/tests/books/book_search_suite.cpp b/tests/books/book_search_suite.cpp index 19b187b..8f42e60 100644 --- a/tests/books/book_search_suite.cpp +++ b/tests/books/book_search_suite.cpp @@ -203,6 +203,7 @@ class BookMultipleCreateSearchFixture : public ::testing::Test, for (const auto& id : generated_item_ids) { // TODO delete + (void)id; } } @@ -256,7 +257,6 @@ TEST_F(BookMultipleCreateSearchFixture_10, create_n_search_pit) ASSERT_FALSE(hits_array.empty()); //std::this_thread::sleep_for(30s); - bool found = false; for (const auto &hit : hits_array) { std::cout << hit->node<::model::_Index>()->value() << std::endl; diff --git a/tests/books/fb2_pack_unpack_suite.cpp b/tests/books/fb2_pack_unpack_suite.cpp index 4fb7504..256c45a 100644 --- a/tests/books/fb2_pack_unpack_suite.cpp +++ b/tests/books/fb2_pack_unpack_suite.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include "elasticsearch/books/FB2/fb2_packer.hpp" diff --git a/tests/common/Serializers.hpp b/tests/common/Serializers.hpp index d2c98c8..209702f 100644 --- a/tests/common/Serializers.hpp +++ b/tests/common/Serializers.hpp @@ -15,7 +15,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(StubLeafNodeSerializer, Parent TXML_SCHEMA_SERIALIZER_DISPATCHABLE_OBJECT template - void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &tracer) + void serialize_schema_tag_impl(txml::LeafTag&&, Tracer &) { this->json_object_stack_helper->push(nlohmann::json::object({{SerializedItem::class_name(),{{"type", "text"}}}})); } @@ -46,7 +46,7 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(StubModelSerializer, Parent, S TXML_SCHEMA_SERIALIZER_DISPATCHABLE_OBJECT template - void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &tracer) + void serialize_schema_tag_impl(txml::LeafTag&&, Tracer &) { this->json_object_stack_helper->push(nlohmann::json::object({{SerializedItem::class_name(),{{"type", "text"}}}})); } @@ -78,14 +78,14 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(CustomModelSerializer, Parent, } template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object({{CustomNode::class_name(),{{"type", "date"}}}})); } template - void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &tracer) + void serialize_schema_tag_impl(txml::LeafTag&&, Tracer &) { this->json_object_stack_helper->push(nlohmann::json::object( { @@ -131,13 +131,13 @@ TXML_PREPARE_SCHEMA_SERIALIZER_DISPATCHABLE_CLASS(CustomModelToAddSerializer, Pa } template - void serialize_schema_impl(txml::details::SchemaTag, Tracer tracer) + void serialize_schema_impl(txml::details::SchemaTag, Tracer) { this->json_object_stack_helper->push(nlohmann::json::object({{CustomNodeToAdd::class_name(),{{"type", "date"}}}})); } template - void serialize_schema_tag_impl(txml::LeafTag&& t, Tracer &tracer) + void serialize_schema_tag_impl(txml::LeafTag&&, Tracer &) { this->json_object_stack_helper->push(nlohmann::json::object( { diff --git a/tests/common/settings.hpp b/tests/common/settings.hpp index 7c65af4..7917fb0 100644 --- a/tests/common/settings.hpp +++ b/tests/common/settings.hpp @@ -18,15 +18,15 @@ struct Settings } std::string set_index(std::string new_index) { - std::swap(new_index, index); + std::swap(new_index, es_index); return new_index; } const std::string get_host() const { return host; } - const std::string get_index() const { return index; } + const std::string get_index() const { return es_index; } bool curl_verbose() const { return curl_verbose_flag; } private: - std::string index {"stub_index"}; + std::string es_index {"stub_index"}; std::string host {"http://localhost:9200/"}; bool curl_verbose_flag {true}; }; From 9e522ac37234dd907b208fbd31cd308a0f383812 Mon Sep 17 00:00:00 2001 From: SergeyIvanov87 Date: Thu, 26 Oct 2023 07:49:00 +0200 Subject: [PATCH 3/5] Remove Wind from workflows and add a proper es image version --- .github/workflows/cmake-multi-platform.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index c72f948..9f0093c 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -23,26 +23,17 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] build_type: [Release] - c_compiler: [gcc, clang, cl] + c_compiler: [gcc, clang] include: - - os: windows-latest - c_compiler: cl - cpp_compiler: cl - os: ubuntu-latest c_compiler: gcc cpp_compiler: g++ - os: ubuntu-latest c_compiler: clang cpp_compiler: clang++ - exclude: - - os: windows-latest - c_compiler: gcc - - os: windows-latest - c_compiler: clang - - os: ubuntu-latest - c_compiler: cl + # exclude: steps: - uses: actions/checkout@v3 @@ -74,7 +65,7 @@ jobs: uses: everpcpc/elasticsearch-action@v2 with: # The version of the Elasticsearch you want to run - version: 7.10 + version: 7.10.0-amd64 # Plugins to install before start #plugins: From e65254ddb9058f9aca9fd36094428ffd0bfe7e88 Mon Sep 17 00:00:00 2001 From: SergeyIvanov87 Date: Thu, 26 Oct 2023 08:08:13 +0200 Subject: [PATCH 4/5] Fix set -> export in workflow CTEST --- .github/workflows/cmake-multi-platform.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 9f0093c..2e05017 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -73,4 +73,4 @@ jobs: working-directory: ${{ steps.strings.outputs.build-output-dir }} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: SET UT_HOST_ADDR=http://es1:9200 ctest --build-config ${{ matrix.build_type }} + run: export UT_HOST_ADDR=http://es1:9200 ctest --build-config ${{ matrix.build_type }} From 1055d7e9a1afd27314cfb2149c76f8f4afe402ca Mon Sep 17 00:00:00 2001 From: SergeyIvanov87 Date: Thu, 26 Oct 2023 08:23:27 +0200 Subject: [PATCH 5/5] Fix ctest --- .github/workflows/cmake-multi-platform.yml | 2 +- cmake/FindCURL.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 2e05017..346aa8a 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -73,4 +73,4 @@ jobs: working-directory: ${{ steps.strings.outputs.build-output-dir }} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: export UT_HOST_ADDR=http://es1:9200 ctest --build-config ${{ matrix.build_type }} + run: export UT_HOST_ADDR=http://es1:9200 && ctest --build-config ${{ matrix.build_type }} diff --git a/cmake/FindCURL.cmake b/cmake/FindCURL.cmake index 3901cd6..04c2838 100644 --- a/cmake/FindCURL.cmake +++ b/cmake/FindCURL.cmake @@ -47,4 +47,4 @@ if(WITH_CURL) list (APPEND COMPILE_DEFS -DWITH_CURL) endif() endif() -message("CURL has been bootstrapped and the package resides in: ${TEMPLATE_XML_PATH}") +message("CURL has been bootstrapped and the package resides in: ${CURL_INSTALLED_PATH}")