[CXX-1166] Catch comparison expressions with bsoncxx::document::view operands should pretty-print when test fails Created: 14/Dec/16  Updated: 23/Feb/17  Resolved: 23/Feb/17

Status: Closed
Project: C++ Driver
Component/s: Implementation, Testing
Affects Version/s: None
Fix Version/s: 3.2.0-rc0

Type: Task Priority: Major - P3
Reporter: J Rassi Assignee: Samuel Rossi (Inactive)
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

For document::view variables "a" and "b", a failure of the Catch test statement "REQUIRE(a == b)" results in the following output:

1: /Users/rassi/work/mongo-cxx-driver/src/bsoncxx/test/bson_builder.cpp:938: FAILED:
1:   REQUIRE( a == b )
1: with expansion:
1:   {?} == {?}

Instead of printing a question mark for "a" and "b", their JSON representations should be printed instead.

This may be as simple as providing a "operator<<(std::ostream&, document::view)" overload in the right place which streams the result of to_json().



 Comments   
Comment by Githook User [ 23/Feb/17 ]

Author:

{u'username': u'saghm', u'name': u'Saghm Rossi', u'email': u'saghmrossi@gmail.com'}

Message: CXX-1166 Catch comparison expressions with bsoncxx::document::view operands should pretty-print when test fails
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/c785d9c7519b746e818f2e450b0a00072201c147

Generated at Wed Feb 07 22:01:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.