Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UniValue: fix major bug, add unit tests #4730

Merged
merged 4 commits into from Aug 21, 2014

Conversation

jgarzik
Copy link
Contributor

@jgarzik jgarzik commented Aug 19, 2014

All numbers were broken, due to lack of an underscore. No wonder my all-tree conversion to UniValue was failing its tests.

@jgarzik jgarzik added Bug and removed Priority Low labels Aug 19, 2014
BOOST_CHECK_EQUAL(v3.getValStr(), "foo");

UniValue numTest;
bool rc = numTest.setNumStr("82");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd write this as CHECK(numTest.SetNumStr("82"));

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/p4730_dc271fc025d219c18428a4d36dbc372c8e457908/ for binaries and test log.
This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/
Contact BlueMatt on freenode if something looks broken.

@TheBlueMatt
Copy link
Contributor

ut ACK.


BOOST_CHECK(v.setNull());
BOOST_CHECK(v.isNull());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems most of these checks assume pretty sane input. It'd be nice to see some exotic and/or blatantly wrong set's here, in order to test that they work or fail as anticipated.
for ex:
setInt(INT_MAX+1LL);
setNumStr("-2147483647")
setNumStr("1.1");
setStr("2") && isStr()/isNum()
etc.

For those, I really don't know what the expected results would be, so I suppose it'd serve as some poor-man's documentation as well.

@jgarzik jgarzik merged commit dc271fc into bitcoin:master Aug 21, 2014
jgarzik pushed a commit that referenced this pull request Aug 21, 2014
@jgarzik jgarzik deleted the 2014_univ_tests branch August 24, 2014 04:21
laanwj added a commit that referenced this pull request Dec 20, 2017
2862b56 [tests] remove redundant univalue_tests.cpp (John Newbery)

Pull request description:

  univalue unit tests were added in #4730 , and exist at `/src/test/univalue_tests.cpp` (outside the univalue tree). That test was brought into the univalue repository in bitcoin-core/univalue-subtree#4 , which was pulled into the github repository in #11420.

  That means that the univalue test exists in two places:
  1. `/src/test/univalue_tests.cpp`
  2. `/src/univalue/test/object.cpp`

  (2) is a strict superset of (1). It adds some macros to work around boost not being a univalue dependency, and adds a few extra lines of test.

  Therefore remove `/src/test/univalue_tests.cpp`

Tree-SHA512: 3747b10bbf62e9f12363905488b29945ad559ddca68c5c03d8a362de612a51f408f41a04d3712c6889bfc1632fb1a5fa0d7df0fbf02c322b3981a6d698f501b0
PastaPastaPasta referenced this pull request in PastaPastaPasta/dash Jan 17, 2020
2862b56 [tests] remove redundant univalue_tests.cpp (John Newbery)

Pull request description:

  univalue unit tests were added in dashpay#4730 , and exist at `/src/test/univalue_tests.cpp` (outside the univalue tree). That test was brought into the univalue repository in bitcoin-core/univalue-subtree#4 , which was pulled into the github repository in bitcoin#11420.

  That means that the univalue test exists in two places:
  1. `/src/test/univalue_tests.cpp`
  2. `/src/univalue/test/object.cpp`

  (2) is a strict superset of (1). It adds some macros to work around boost not being a univalue dependency, and adds a few extra lines of test.

  Therefore remove `/src/test/univalue_tests.cpp`

Tree-SHA512: 3747b10bbf62e9f12363905488b29945ad559ddca68c5c03d8a362de612a51f408f41a04d3712c6889bfc1632fb1a5fa0d7df0fbf02c322b3981a6d698f501b0
PastaPastaPasta referenced this pull request in PastaPastaPasta/dash Jan 22, 2020
2862b56 [tests] remove redundant univalue_tests.cpp (John Newbery)

Pull request description:

  univalue unit tests were added in dashpay#4730 , and exist at `/src/test/univalue_tests.cpp` (outside the univalue tree). That test was brought into the univalue repository in bitcoin-core/univalue-subtree#4 , which was pulled into the github repository in bitcoin#11420.

  That means that the univalue test exists in two places:
  1. `/src/test/univalue_tests.cpp`
  2. `/src/univalue/test/object.cpp`

  (2) is a strict superset of (1). It adds some macros to work around boost not being a univalue dependency, and adds a few extra lines of test.

  Therefore remove `/src/test/univalue_tests.cpp`

Tree-SHA512: 3747b10bbf62e9f12363905488b29945ad559ddca68c5c03d8a362de612a51f408f41a04d3712c6889bfc1632fb1a5fa0d7df0fbf02c322b3981a6d698f501b0
PastaPastaPasta referenced this pull request in PastaPastaPasta/dash Jan 22, 2020
2862b56 [tests] remove redundant univalue_tests.cpp (John Newbery)

Pull request description:

  univalue unit tests were added in dashpay#4730 , and exist at `/src/test/univalue_tests.cpp` (outside the univalue tree). That test was brought into the univalue repository in bitcoin-core/univalue-subtree#4 , which was pulled into the github repository in bitcoin#11420.

  That means that the univalue test exists in two places:
  1. `/src/test/univalue_tests.cpp`
  2. `/src/univalue/test/object.cpp`

  (2) is a strict superset of (1). It adds some macros to work around boost not being a univalue dependency, and adds a few extra lines of test.

  Therefore remove `/src/test/univalue_tests.cpp`

Tree-SHA512: 3747b10bbf62e9f12363905488b29945ad559ddca68c5c03d8a362de612a51f408f41a04d3712c6889bfc1632fb1a5fa0d7df0fbf02c322b3981a6d698f501b0
PastaPastaPasta referenced this pull request in PastaPastaPasta/dash Jan 29, 2020
2862b56 [tests] remove redundant univalue_tests.cpp (John Newbery)

Pull request description:

  univalue unit tests were added in dashpay#4730 , and exist at `/src/test/univalue_tests.cpp` (outside the univalue tree). That test was brought into the univalue repository in bitcoin-core/univalue-subtree#4 , which was pulled into the github repository in bitcoin#11420.

  That means that the univalue test exists in two places:
  1. `/src/test/univalue_tests.cpp`
  2. `/src/univalue/test/object.cpp`

  (2) is a strict superset of (1). It adds some macros to work around boost not being a univalue dependency, and adds a few extra lines of test.

  Therefore remove `/src/test/univalue_tests.cpp`

Tree-SHA512: 3747b10bbf62e9f12363905488b29945ad559ddca68c5c03d8a362de612a51f408f41a04d3712c6889bfc1632fb1a5fa0d7df0fbf02c322b3981a6d698f501b0
PastaPastaPasta referenced this pull request in PastaPastaPasta/dash Jan 29, 2020
2862b56 [tests] remove redundant univalue_tests.cpp (John Newbery)

Pull request description:

  univalue unit tests were added in dashpay#4730 , and exist at `/src/test/univalue_tests.cpp` (outside the univalue tree). That test was brought into the univalue repository in bitcoin-core/univalue-subtree#4 , which was pulled into the github repository in bitcoin#11420.

  That means that the univalue test exists in two places:
  1. `/src/test/univalue_tests.cpp`
  2. `/src/univalue/test/object.cpp`

  (2) is a strict superset of (1). It adds some macros to work around boost not being a univalue dependency, and adds a few extra lines of test.

  Therefore remove `/src/test/univalue_tests.cpp`

Tree-SHA512: 3747b10bbf62e9f12363905488b29945ad559ddca68c5c03d8a362de612a51f408f41a04d3712c6889bfc1632fb1a5fa0d7df0fbf02c322b3981a6d698f501b0
PastaPastaPasta referenced this pull request in PastaPastaPasta/dash Jan 29, 2020
2862b56 [tests] remove redundant univalue_tests.cpp (John Newbery)

Pull request description:

  univalue unit tests were added in dashpay#4730 , and exist at `/src/test/univalue_tests.cpp` (outside the univalue tree). That test was brought into the univalue repository in bitcoin-core/univalue-subtree#4 , which was pulled into the github repository in bitcoin#11420.

  That means that the univalue test exists in two places:
  1. `/src/test/univalue_tests.cpp`
  2. `/src/univalue/test/object.cpp`

  (2) is a strict superset of (1). It adds some macros to work around boost not being a univalue dependency, and adds a few extra lines of test.

  Therefore remove `/src/test/univalue_tests.cpp`

Tree-SHA512: 3747b10bbf62e9f12363905488b29945ad559ddca68c5c03d8a362de612a51f408f41a04d3712c6889bfc1632fb1a5fa0d7df0fbf02c322b3981a6d698f501b0
PastaPastaPasta referenced this pull request in PastaPastaPasta/dash Jan 31, 2020
2862b56 [tests] remove redundant univalue_tests.cpp (John Newbery)

Pull request description:

  univalue unit tests were added in dashpay#4730 , and exist at `/src/test/univalue_tests.cpp` (outside the univalue tree). That test was brought into the univalue repository in bitcoin-core/univalue-subtree#4 , which was pulled into the github repository in bitcoin#11420.

  That means that the univalue test exists in two places:
  1. `/src/test/univalue_tests.cpp`
  2. `/src/univalue/test/object.cpp`

  (2) is a strict superset of (1). It adds some macros to work around boost not being a univalue dependency, and adds a few extra lines of test.

  Therefore remove `/src/test/univalue_tests.cpp`

Tree-SHA512: 3747b10bbf62e9f12363905488b29945ad559ddca68c5c03d8a362de612a51f408f41a04d3712c6889bfc1632fb1a5fa0d7df0fbf02c322b3981a6d698f501b0
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants