Merge branch 'bug/285-error-converting-value-to-string' into 'latest-fc'

#285 error converting value to string

See merge request PBSA/tools-libs/peerplays-fc!24
This commit is contained in:
Vlad Dobromyslov 2022-03-04 22:19:47 +00:00
commit 1cfc0680cf
6 changed files with 47 additions and 6 deletions

View file

@ -2,9 +2,43 @@ include:
- template: Jobs/Code-Quality.gitlab-ci.yml
stages:
- build
- test
- trigger_build_peerplays
build:
stage: build
script:
- rm -rf .git/modules/vendor ./vendor
- git submodule sync
- git submodule update --init --recursive
- rm -rf build
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Release ..
- make -j$(nproc)
artifacts:
untracked: true
paths:
- build/tests/
tags:
- builder-fc
test:
stage: test
dependencies:
- build
script:
- ./build/tests/all_test
tags:
- builder-fc
when:
- manual
trigger_build_peerplays:
stage: test
stage: trigger_build_peerplays
dependencies:
- test
script:
- "curl -X POST -F token=$CI_JOB_TOKEN -F ref=$REF_NAME https://gitlab.com/api/v4/projects/10735589/trigger/pipeline"

View file

@ -3,7 +3,12 @@
#define FC_PACK_MAX_DEPTH 1000
#endif
#ifndef FC_MAX_STRING_OBJECT_DEPTH
// how many levels of nested objects are proceed for string functions
#define FC_MAX_STRING_OBJECT_DEPTH 200
#endif
#ifndef FC_MAX_LOG_OBJECT_DEPTH
// how many levels of nested objects are displayed in log messages
#define FC_MAX_LOG_OBJECT_DEPTH 200
#define FC_MAX_LOG_OBJECT_DEPTH 1000
#endif

View file

@ -15,7 +15,7 @@ namespace fc
{
string endpoint = "127.0.0.1:12201";
string host = "fc"; // the name of the host, source or application that sent this message (just passed through to GELF server)
uint32_t max_object_depth;
uint32_t max_object_depth = FC_MAX_LOG_OBJECT_DEPTH;
};
gelf_appender(const variant& args);

View file

@ -2,6 +2,7 @@
#include <fc/utility.hpp>
#include <fc/fwd.hpp>
#include <fc/optional.hpp>
#include <fc/config.hpp>
#ifndef USE_FC_STRING
#include <string>
@ -25,7 +26,7 @@ namespace fc
typedef fc::optional<fc::string> ostring;
class variant_object;
fc::string format_string( const fc::string&, const variant_object&, uint32_t max_object_depth = 200 );
fc::string format_string( const fc::string&, const variant_object&, uint32_t max_object_depth = FC_MAX_STRING_OBJECT_DEPTH );
fc::string trim( const fc::string& );
fc::string to_lower( const fc::string& );
string trim_and_normalize_spaces( const string& s );

View file

@ -168,7 +168,8 @@ namespace fc {
filename(p),
flush(true),
rotate(false),
rotation_compression(false)
rotation_compression(false),
max_object_depth(FC_MAX_LOG_OBJECT_DEPTH)
{}
file_appender::file_appender( const variant& args ) :

View file

@ -335,7 +335,7 @@ BOOST_AUTO_TEST_CASE(recursion_test)
BOOST_AUTO_TEST_CASE(rethrow_test)
{
fc::variants biggie;
for( int i = 0; i < 250; i++ )
for( int i = 0; i < 1010; i++ )
{
fc::variant tmp( std::move(biggie) );
biggie.reserve(1);