Skip to content

Commit d71da37

Browse files
committed
Squashed 'src/univalue/' changes from 2740c4f..a44caf65fe
a44caf65fe Merge bitcoin-core/univalue-subtree#28: Import fixes for sanitizer reported issues 135254331e Import fixes for sanitizer reported issues d5fb86940e refactor: use c++11 range based for loop in checkObject ff9c379304 refactor: Use nullptr (c++11) instead of NULL 08a99754d5 build: use ax_cxx_compile_stdcxx.m4 to check for C++11 support 66d3713ce7 Merge bitcoin-core/univalue-subtree#29: ci: travis -> cirrus 808d487292 ci: travis -> cirrus c390ac375f Merge bitcoin-core/univalue-subtree#19: Split sources for easier buildsystem integration 4a5b0a1c65 build: Move source entries out to sources.mk 6c7d94b33c build: cleanup wonky gen usage a222637c6d Merge dashpay#23: Merge changes from jgarzik/univalue@1ae6a23 98fadc0909 Merge dashpay#24: Push bool into array correctly 5f03f1f39a Push bool into array correctly f77d0f718d Merge commit '1ae6a231a0169938eb3972c1d48dd17cba5947e1' into HEAD 98261b1 Merge dashpay#22: Clamp JSON object depth to PHP limit 54c4015 Clamp JSON object depth to PHP limit 5a58a46 Merge dashpay#21: Remove hand-coded UniValue destructor. b4cdfc4 Remove hand-coded UniValue destructor. 1ae6a231a0 Merge pull request dashpay#57 from MarcoFalke/test_fix 92bdd11f0b univalue_write: remove unneeded sstream.h include ffb621c130 Merge pull request dashpay#56 from drodil/remove_sstream_header f33acf9fe8 Merge commit '7890db9~' into HEAD 7fba60b Merge dashpay#17: [docs] Update readme 4577454 Merge dashpay#13: Fix typo 66e0adec4d Remove unnecessary sstream header from univalue.h ac7e73c [docs] Update readme 7890db9 Merge dashpay#11: Remove deprecated std pair wrappers 88967f6586 Version 1.0.4 40e3485 Merge dashpay#14: Cleaned up namespace imports to reduce symbol collisions 1dc113dbef Merge pull request dashpay#50 from luke-jr/pushKV_bool 72392fb227 [tests] test pushKV for boolean values c23132bcf4 Pushing boolean value to univalue correctly 4a49647 Fix typo 85052a4 Remove deprecated std::pair wrappers 81faab26a1 Merge pull request dashpay#48 from fwolfst/47-UPDATE_MIT_LINK_TO_HTTPS b17634ef24 Update URLs to MIT license. 51d3ab3 Merge dashpay#10: Add pushKV(key, boolean) function (replaces dashpay#5) 129bad9 [tests] test pushKV for boolean values b3c44c9 Pushing boolean value to univalue correctly 07947ff Merge dashpay#9: [tests] Fix BOOST_CHECK_THROW macro ec849d9 [tests] Fix BOOST_CHECK_THROW macro 88ab64f6b5 Merge pull request dashpay#46 from jasonbcox/master 35ed96da31 Merge pull request dashpay#44 from MarcoFalke/Mf1709-univalue-cherrypick-explicit 420c226290 Merge pull request dashpay#45 from MarcoFalke/Mf1710-univalue-revert-test d208f98 Cleaned up namespace imports to reduce symbol collisions 31bc9f5 Merge dashpay#8: Remove unused Homebrew workaround fa04209 Remove HomeBrew workaround a523e08 Merge dashpay#7: Declare single-argument (non-converting) constructors "explicit" a9e53b3 Merge dashpay#4: Pull upstream fe805ea Declare single-argument (non-converting) constructors "explicit" 8a2d6f1 Merge pull request dashpay#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 dashpay#36 from ryanofsky/pr/end-str a31231b Version 1.0.3 4fd5444 Reject unterminated strings 81eba33 Merge pull request dashpay#26 from isle2983/pushBackHelpers 3640541 Merge PR dashpay#32 from branch 'nul-not-special' of git://github.com/ryanofsky/univalue into merge 89bb073 Merge pull request dashpay#31 from ryanofsky/raw-literals 511008c Merge pull request dashpay#30 from ryanofsky/test-driver 77974f3 Merge pull request dashpay#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 dashpay#29 from btcdrak/exportspace 839ccd7 Add test driver for JSONTestSuite 26ef3ff Remove trailing whitespace from JSON export 16a1f7f Merge dashpay#3: Pull upstream 3f03bfd Merge pull request dashpay#27 from laanwj/2016_09_const_refs 5668ca3 Return const references from getKeys, getValues, get_str cedda14 Merge pull request dashpay#28 from MarcoFalke/patch-1 9f0b997 [travis] Work around osx libtool issue daf1285 Merge pull request dashpay#2 from jgarzik/master cfa0384 Convenience wrappers for push_back-ing integer types d9e62d3 Merge pull request dashpay#24 from MarcoFalke/Mf1608-cleanup faf260f Rem unused vars and prefer prefix operator for non-primitive type 09a2693 Merge pull request dashpay#22 from laanwj/2016_04_unicode c74a04c Merge pull request dashpay#23 from paveljanik/20160527_Wshadow f32df99 Merge branch '2016_04_unicode' into bitcoin 280b191 Merge remote-tracking branch 'jgarzik/master' into bitcoin fceb4f8 Do not shadow variables c9a716c Handle UTF-8 bed8dd9 Version 1.0.2. 5e7985a Merge pull request dashpay#14 from laanwj/2015_11_escape_plan git-subtree-dir: src/univalue git-subtree-split: a44caf65fe55b9dd8ddb08f04c0f70409efd53b3
1 parent 9827091 commit d71da37

36 files changed

+2365
-717
lines changed

.cirrus.yml

Lines changed: 44 additions & 0 deletions
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

Lines changed: 0 additions & 52 deletions
This file was deleted.

Makefile.am

Lines changed: 29 additions & 59 deletions
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
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,60 +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)/fail3.json \
77-
$(TEST_DATA_DIR)/fail4.json \
78-
$(TEST_DATA_DIR)/fail5.json \
79-
$(TEST_DATA_DIR)/fail6.json \
80-
$(TEST_DATA_DIR)/fail7.json \
81-
$(TEST_DATA_DIR)/fail8.json \
82-
$(TEST_DATA_DIR)/fail9.json \
83-
$(TEST_DATA_DIR)/pass1.json \
84-
$(TEST_DATA_DIR)/pass2.json \
85-
$(TEST_DATA_DIR)/pass3.json \
86-
$(TEST_DATA_DIR)/round1.json
87-
88-
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

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 21 additions & 0 deletions
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)