[CDRIVER-2225] BSON corpus Decimal128 parse error tests are not properly executed Created: 26/Jul/17  Updated: 28/Oct/23  Resolved: 27/Jul/17

Status: Closed
Project: C Driver
Component/s: libbson
Affects Version/s: None
Fix Version/s: 1.7.0

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Jeremy Mikola
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CDRIVER-2128 Support revised Extended JSON spec Closed

 Description   

Since d7406f5 (for CDRIVER-2128), Decimal128 parse tests from the BSON corpus have been executed using bson_new_from_json() instead of bson_decimal128_from_string(). The test failures likely were not caught because the input strings just so happen to be invalid extended JSON.



 Comments   
Comment by Ramon Fernandez Marina [ 12/Sep/17 ]

Author:

{'username': u'jmikola', 'name': u'Jeremy Mikola', 'email': u'jmikola@gmail.com'}

Message:CDRIVER-2225: Execute BSON corpus Decimal128 parse error tests

Since d7406f5dc010f4eb223c9eef8c144aa6efc33504, all parse error tests were
executing with bson_new_from_json(), which is only appropriate for type 0x00.

This commit also restructures the corpus test runner so that callbacks may be
provided for decode and parse error tests as they are for valid tests. This
change will make it easier to skip tests of any type, which will be necessary
for CDRIVER-2223.
Branch:r1.7
https://github.com/mongodb/libbson/commit/df2e61bd0bcf14b5e3b11ca7a74d509e08c72676

Comment by Jeremy Mikola [ 27/Jul/17 ]

Cherry-picked to r1.7: https://github.com/mongodb/libbson/commit/df2e61bd0bcf14b5e3b11ca7a74d509e08c72676

Comment by Githook User [ 27/Jul/17 ]

Author:

{'email': 'jmikola@gmail.com', 'username': 'jmikola', 'name': 'Jeremy Mikola'}

Message: CDRIVER-2225: Execute BSON corpus Decimal128 parse error tests

Since d7406f5dc010f4eb223c9eef8c144aa6efc33504, all parse error tests were
executing with bson_new_from_json(), which is only appropriate for type 0x00.

This commit also restructures the corpus test runner so that callbacks may be
provided for decode and parse error tests as they are for valid tests. This
change will make it easier to skip tests of any type, which will be necessary
for CDRIVER-2223.
Branch: master
https://github.com/mongodb/libbson/commit/eaeb976736c0cbf290299dc6777f68a9ac2670c0

Comment by A. Jesse Jiryu Davis [ 27/Jul/17 ]

Nice catch.

Generated at Wed Feb 07 21:14:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.