Skip to content

Fix mongo-c-driver version compatibility check tests #1417

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

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

eramongodb
Copy link
Contributor

@eramongodb eramongodb commented Jun 12, 2025

Followup to #1379 and #1416.

Despite #1379 including comments implying the patch version number is only checked when the minor version numbers are equal following a suggestion describing exactly this scenario, the CHECKED_IF conditions do not actually do as described. This bug is exposed by #1416 (2.1.0-dev vs. 2.0.2):

src/bsoncxx/test/private/bson_version.cpp:62: FAILED:
  CHECK( bson_get_micro_version() >= expect[2] )
with expansion:
  0 >= 2
with message:
  expect_str := "2.0.2"

This PR fixes the version compat test cases to actually only compare the patch version numbers when the minor version numbers compare equal. The "mongoc version numbers" test case was also incorrectly calling bson_get_micro_version instead of mongoc_get_micro_version.

src/bsoncxx/test/private/bson_version.cpp:63: FAILED - but was ok:
  CHECKED_IF( minor == expect[1] )
with expansion:
  1 == 0
with message:
  expect_str := "2.0.2"

@eramongodb eramongodb requested a review from kevinAlbs June 12, 2025 21:48
@eramongodb eramongodb self-assigned this Jun 12, 2025
@eramongodb eramongodb requested a review from a team as a code owner June 12, 2025 21:48
@eramongodb eramongodb merged commit a3c2376 into mongodb:master Jun 16, 2025
21 checks passed
@eramongodb eramongodb deleted the cxx-cdriver-version branch June 16, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants