Skip to content

Commit d29583a

Browse files
committed
Squashed 'src/univalue/' changes from 16a1f7f..a44caf65f
a44caf65f Merge bitcoin-core/univalue-subtree#28: Import fixes for sanitizer reported issues 135254331 Import fixes for sanitizer reported issues d5fb86940 refactor: use c++11 range based for loop in checkObject ff9c37930 refactor: Use nullptr (c++11) instead of NULL 08a99754d build: use ax_cxx_compile_stdcxx.m4 to check for C++11 support 66d3713ce Merge bitcoin-core/univalue-subtree#29: ci: travis -> cirrus 808d48729 ci: travis -> cirrus c390ac375 Merge bitcoin-core/univalue-subtree#19: Split sources for easier buildsystem integration 4a5b0a1c6 build: Move source entries out to sources.mk 6c7d94b33 build: cleanup wonky gen usage a222637 Merge dogecoin#23: Merge changes from jgarzik/univalue@1ae6a23 98fadc0 Merge dogecoin#24: Push bool into array correctly 5f03f1f Push bool into array correctly f77d0f7 Merge commit '1ae6a231a0169938eb3972c1d48dd17cba5947e1' into HEAD 98261b1 Merge dogecoin#22: Clamp JSON object depth to PHP limit 54c4015 Clamp JSON object depth to PHP limit 5a58a46 Merge dogecoin#21: Remove hand-coded UniValue destructor. b4cdfc4 Remove hand-coded UniValue destructor. 1ae6a23 Merge pull request dogecoin#57 from MarcoFalke/test_fix 92bdd11 univalue_write: remove unneeded sstream.h include ffb621c Merge pull request dogecoin#56 from drodil/remove_sstream_header f33acf9 Merge commit '7890db9~' into HEAD 7fba60b Merge dogecoin#17: [docs] Update readme 4577454 Merge #13: Fix typo 66e0ade Remove unnecessary sstream header from univalue.h ac7e73c [docs] Update readme 7890db9 Merge #11: Remove deprecated std pair wrappers 88967f6 Version 1.0.4 40e3485 Merge #14: Cleaned up namespace imports to reduce symbol collisions 1dc113d Merge pull request dogecoin#50 from luke-jr/pushKV_bool 72392fb [tests] test pushKV for boolean values c23132b Pushing boolean value to univalue correctly 4a49647 Fix typo 85052a4 Remove deprecated std::pair wrappers 81faab2 Merge pull request dogecoin#48 from fwolfst/47-UPDATE_MIT_LINK_TO_HTTPS b17634e Update URLs to MIT license. 51d3ab3 Merge #10: Add pushKV(key, boolean) function (replaces #5) 129bad9 [tests] test pushKV for boolean values b3c44c9 Pushing boolean value to univalue correctly 07947ff Merge #9: [tests] Fix BOOST_CHECK_THROW macro ec849d9 [tests] Fix BOOST_CHECK_THROW macro 88ab64f Merge pull request dogecoin#46 from jasonbcox/master 35ed96d Merge pull request dogecoin#44 from MarcoFalke/Mf1709-univalue-cherrypick-explicit 420c226 Merge pull request dogecoin#45 from MarcoFalke/Mf1710-univalue-revert-test d208f98 Cleaned up namespace imports to reduce symbol collisions 31bc9f5 Merge #8: Remove unused Homebrew workaround fa04209 Remove HomeBrew workaround a523e08 Merge #7: Declare single-argument (non-converting) constructors "explicit" a9e53b3 Merge #4: Pull upstream fe805ea Declare single-argument (non-converting) constructors "explicit" 8a2d6f1 Merge pull request dogecoin#41 from jgarzik/get-obj-map ba341a2 Add getObjMap() helper method. Also, constify checkObject(). ceb1194 Handle .pushKV() and .checkObject() edge cases. 107db98 Add ::push_back(double) method for feature parity. d415300 Move one-line implementation of UniValue::read() to header. 52e85b3 Move exception-throwing get_* methods into separate implementation module. dac5296 README.md: update code quotes 3e31dcf README.md: close code quote d09b842 Update README.md f1b86ed Convert README to markdown style. 1dfe464 Import UniValue class unit tests from bitcoin project. 0d3e74d operator[] takes size_t index parameter (versus unsigned int) 640158f Private findKey() method becomes size_t clean, and returns bool on failure. 7099135 Merge pull request dogecoin#36 from ryanofsky/pr/end-str a31231b Version 1.0.3 4fd5444 Reject unterminated strings 81eba33 Merge pull request dogecoin#26 from isle2983/pushBackHelpers 3640541 Merge PR dogecoin#32 from branch 'nul-not-special' of git://github.com/ryanofsky/univalue into merge 89bb073 Merge pull request dogecoin#31 from ryanofsky/raw-literals 511008c Merge pull request dogecoin#30 from ryanofsky/test-driver 77974f3 Merge pull request dogecoin#34 from paveljanik/20161116_Wshadow_codepoint a38fcd3 Do not shadow member variable codepoint. fd32d1a Don't require nul-terminated string inputs 0bb1439 Support parsing raw literals in UniValue 28876d0 Merge pull request dogecoin#29 from btcdrak/exportspace 839ccd7 Add test driver for JSONTestSuite 26ef3ff Remove trailing whitespace from JSON export cfa0384 Convenience wrappers for push_back-ing integer types git-subtree-dir: src/univalue git-subtree-split: a44caf65fe55b9dd8ddb08f04c0f70409efd53b3
1 parent 2ca7faa commit d29583a

31 files changed

+2194
-687
lines changed

.cirrus.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
env:
2+
MAKEJOBS: "-j4"
3+
RUN_TESTS: "true"
4+
BASE_OUTDIR: "$CIRRUS_WORKING_DIR/out_dir_base"
5+
DEBIAN_FRONTEND: "noninteractive"
6+
7+
task:
8+
container:
9+
image: ubuntu:focal
10+
cpu: 1
11+
memory: 1G
12+
greedy: true # https://medium.com/cirruslabs/introducing-greedy-container-instances-29aad06dc2b4
13+
14+
matrix:
15+
- name: "gcc"
16+
env:
17+
CC: "gcc"
18+
CXX: "g++"
19+
APT_PKGS: "gcc"
20+
- name: "clang"
21+
env:
22+
CC: "clang"
23+
CXX: "clang++"
24+
APT_PKGS: "clang"
25+
- name: "mingw"
26+
env:
27+
CC: ""
28+
CXX: ""
29+
UNIVALUE_CONFIG: "--host=x86_64-w64-mingw32"
30+
APT_PKGS: "g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64"
31+
RUN_TESTS: "false"
32+
33+
install_script:
34+
- apt update
35+
- apt install -y pkg-config build-essential libtool autotools-dev automake bsdmainutils
36+
- apt install -y $APT_PKGS
37+
autogen_script:
38+
- ./autogen.sh
39+
configure_script:
40+
- ./configure --cache-file=config.cache --bindir=$BASE_OUTDIR/bin --libdir=$BASE_OUTDIR/lib $UNIVALUE_CONFIG
41+
make_script:
42+
- make $MAKEJOBS V=1
43+
test_script:
44+
- if [ "$RUN_TESTS" = "true" ]; then make $MAKEJOBS distcheck; fi

.travis.yml

-52
This file was deleted.

Makefile.am

+29-64
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1+
include sources.mk
12
ACLOCAL_AMFLAGS = -I build-aux/m4
2-
.PHONY: gen
3+
.PHONY: gen FORCE
34
.INTERMEDIATE: $(GENBIN)
45

5-
include_HEADERS = include/univalue.h
6-
noinst_HEADERS = lib/univalue_escapes.h lib/univalue_utffilter.h
6+
include_HEADERS = $(UNIVALUE_DIST_HEADERS_INT)
7+
noinst_HEADERS = $(UNIVALUE_LIB_HEADERS_INT)
78

89
lib_LTLIBRARIES = libunivalue.la
910

1011
pkgconfigdir = $(libdir)/pkgconfig
1112
pkgconfig_DATA = pc/libunivalue.pc
1213

13-
libunivalue_la_SOURCES = \
14-
lib/univalue.cpp \
15-
lib/univalue_read.cpp \
16-
lib/univalue_write.cpp
14+
libunivalue_la_SOURCES = $(UNIVALUE_LIB_SOURCES_INT)
1715

1816
libunivalue_la_LDFLAGS = \
1917
-version-info $(LIBUNIVALUE_CURRENT):$(LIBUNIVALUE_REVISION):$(LIBUNIVALUE_AGE) \
2018
-no-undefined
2119
libunivalue_la_CXXFLAGS = -I$(top_srcdir)/include
2220

23-
TESTS = test/unitester
21+
TESTS = test/object test/unitester test/no_nul
2422

2523
GENBIN = gen/gen$(BUILD_EXEEXT)
2624
GEN_SRCS = gen/gen.cpp
@@ -29,65 +27,32 @@ $(GENBIN): $(GEN_SRCS)
2927
@echo Building $@
3028
$(AM_V_at)c++ -I$(top_srcdir)/include -o $@ $<
3129

32-
gen: lib/univalue_escapes.h $(GENBIN)
33-
@echo Updating $<
30+
gen: $(GENBIN) FORCE
31+
@echo Updating lib/univalue_escapes.h
3432
$(AM_V_at)$(GENBIN) > lib/univalue_escapes.h
3533

36-
noinst_PROGRAMS = $(TESTS)
34+
noinst_PROGRAMS = $(TESTS) test/test_json
3735

38-
TEST_DATA_DIR=test
39-
40-
test_unitester_SOURCES = test/unitester.cpp
36+
test_unitester_SOURCES = $(UNIVALUE_TEST_UNITESTER_INT)
4137
test_unitester_LDADD = libunivalue.la
42-
test_unitester_CXXFLAGS = -I$(top_srcdir)/include -DJSON_TEST_SRC=\"$(srcdir)/$(TEST_DATA_DIR)\"
38+
test_unitester_CXXFLAGS = -I$(top_srcdir)/include -DJSON_TEST_SRC=\"$(srcdir)/$(UNIVALUE_TEST_DATA_DIR_INT)\"
4339
test_unitester_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS)
4440

45-
TEST_FILES = \
46-
$(TEST_DATA_DIR)/fail10.json \
47-
$(TEST_DATA_DIR)/fail11.json \
48-
$(TEST_DATA_DIR)/fail12.json \
49-
$(TEST_DATA_DIR)/fail13.json \
50-
$(TEST_DATA_DIR)/fail14.json \
51-
$(TEST_DATA_DIR)/fail15.json \
52-
$(TEST_DATA_DIR)/fail16.json \
53-
$(TEST_DATA_DIR)/fail17.json \
54-
$(TEST_DATA_DIR)/fail18.json \
55-
$(TEST_DATA_DIR)/fail19.json \
56-
$(TEST_DATA_DIR)/fail1.json \
57-
$(TEST_DATA_DIR)/fail20.json \
58-
$(TEST_DATA_DIR)/fail21.json \
59-
$(TEST_DATA_DIR)/fail22.json \
60-
$(TEST_DATA_DIR)/fail23.json \
61-
$(TEST_DATA_DIR)/fail24.json \
62-
$(TEST_DATA_DIR)/fail25.json \
63-
$(TEST_DATA_DIR)/fail26.json \
64-
$(TEST_DATA_DIR)/fail27.json \
65-
$(TEST_DATA_DIR)/fail28.json \
66-
$(TEST_DATA_DIR)/fail29.json \
67-
$(TEST_DATA_DIR)/fail2.json \
68-
$(TEST_DATA_DIR)/fail30.json \
69-
$(TEST_DATA_DIR)/fail31.json \
70-
$(TEST_DATA_DIR)/fail32.json \
71-
$(TEST_DATA_DIR)/fail33.json \
72-
$(TEST_DATA_DIR)/fail34.json \
73-
$(TEST_DATA_DIR)/fail35.json \
74-
$(TEST_DATA_DIR)/fail36.json \
75-
$(TEST_DATA_DIR)/fail37.json \
76-
$(TEST_DATA_DIR)/fail38.json \
77-
$(TEST_DATA_DIR)/fail39.json \
78-
$(TEST_DATA_DIR)/fail40.json \
79-
$(TEST_DATA_DIR)/fail41.json \
80-
$(TEST_DATA_DIR)/fail3.json \
81-
$(TEST_DATA_DIR)/fail4.json \
82-
$(TEST_DATA_DIR)/fail5.json \
83-
$(TEST_DATA_DIR)/fail6.json \
84-
$(TEST_DATA_DIR)/fail7.json \
85-
$(TEST_DATA_DIR)/fail8.json \
86-
$(TEST_DATA_DIR)/fail9.json \
87-
$(TEST_DATA_DIR)/pass1.json \
88-
$(TEST_DATA_DIR)/pass2.json \
89-
$(TEST_DATA_DIR)/pass3.json \
90-
$(TEST_DATA_DIR)/round1.json \
91-
$(TEST_DATA_DIR)/round2.json
92-
93-
EXTRA_DIST=$(TEST_FILES) $(GEN_SRCS)
41+
test_test_json_SOURCES = $(UNIVALUE_TEST_JSON_INT)
42+
test_test_json_LDADD = libunivalue.la
43+
test_test_json_CXXFLAGS = -I$(top_srcdir)/include
44+
test_test_json_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS)
45+
46+
test_no_nul_SOURCES = $(UNIVALUE_TEST_NO_NUL_INT)
47+
test_no_nul_LDADD = libunivalue.la
48+
test_no_nul_CXXFLAGS = -I$(top_srcdir)/include
49+
test_no_nul_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS)
50+
51+
test_object_SOURCES = $(UNIVALUE_TEST_OBJECT_INT)
52+
test_object_LDADD = libunivalue.la
53+
test_object_CXXFLAGS = -I$(top_srcdir)/include
54+
test_object_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS)
55+
56+
TEST_FILES = $(UNIVALUE_TEST_FILES_INT)
57+
58+
EXTRA_DIST=$(UNIVALUE_TEST_FILES_INT) $(GEN_SRCS)

README

-7
This file was deleted.

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
# UniValue
3+
4+
## Summary
5+
6+
A universal value class, with JSON encoding and decoding.
7+
8+
UniValue is an abstract data type that may be a null, boolean, string,
9+
number, array container, or a key/value dictionary container, nested to
10+
an arbitrary depth.
11+
12+
This class is aligned with the JSON standard, [RFC
13+
7159](https://tools.ietf.org/html/rfc7159.html).
14+
15+
## Library usage
16+
17+
This is a fork of univalue used by Bitcoin Core. It is not maintained for usage
18+
by other projects. Notably, the API may break in non-backward-compatible ways.
19+
20+
Other projects looking for a maintained library should use the upstream
21+
univalue at https://github.com/jgarzik/univalue.

0 commit comments

Comments
 (0)