[CDRIVER-2730] Remove redundant logic for placeholders in spec tests Created: 09/Jul/18  Updated: 28/Oct/23  Resolved: 26/Oct/18

Status: Closed
Project: C Driver
Component/s: tests
Affects Version/s: 1.13.0
Fix Version/s: 1.14.0

Type: Improvement Priority: Minor - P4
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Most spec tests allow 42 as a placeholder value for cursor ids, error codes, lsids, readConcern.afterClusterTime. So when event callbacks are generated, convert_message_for_test checks these specific fields, converting the actual values to 42 to match what the spec will compare against.

However, in the change stream spec tests (CDRIVER-2670) 42 is allowed as a placeholder for any field. So instead of converting the command monitoring events when they're generated, change streams have a special match context flag, allow_placeholders allowing match_bson_value to interpret the value 42 to mean "match any value".

Consequently there's redundancy between what the allow_placeholders flag and the convert_message_for_test function accomplish.



 Comments   
Comment by Githook User [ 28/Oct/18 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs'}

Message: CDRIVER-2730 fix ubsan
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/9a9321ee1570ad33334881f8fccf4a8e1c074ab0

Comment by Githook User [ 26/Oct/18 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@10gen.com', 'username': 'kevinAlbs'}

Message: CDRIVER-2730 refactor spec test apm checks
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/0987fd6598aaa85acec08d5cd23d4c5531934a1a

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