Skip to content

Commit 8ed30f4

Browse files
authored
[v4.1] CXX-3302 Update bsoncxx validation examples with offsets (#1416) (#1460)
Cherry-pick bf7554c
1 parent 6d5ad05 commit 8ed30f4

File tree

8 files changed

+24
-22
lines changed

8 files changed

+24
-22
lines changed

.evergreen/generated_configs/functions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ functions:
506506
type: setup
507507
params:
508508
updates:
509-
- { key: mongoc_version_minimum, value: 2.0.0 }
509+
- { key: mongoc_version_minimum, value: 2.0.2 }
510510
- command: subprocess.exec
511511
type: setup
512512
params:

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ Changes prior to 3.9.0 are documented as [release notes on GitHub](https://githu
99

1010
## 4.1.3 [Unreleased]
1111

12-
<!-- Will contain entries for the next patch release. -->
12+
### Changed
13+
14+
- Bump the auto-downloaded C Driver version to [2.0.2](https://github.com/mongodb/mongo-c-driver/releases/tag/2.0.2).
1315

1416
## 4.1.2
1517

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ endif()
4747
# Also update etc/purls.txt.
4848
set(BSON_REQUIRED_VERSION 2.0.0)
4949
set(MONGOC_REQUIRED_VERSION 2.0.0)
50-
set(MONGOC_DOWNLOAD_VERSION 2.0.0)
50+
set(MONGOC_DOWNLOAD_VERSION 2.0.2)
5151

5252
# All of our target compilers support the deprecated
5353
# attribute. Normally, we would just let the GenerateExportHeader

etc/augmented.sbom.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"components": [
33
{
4-
"bom-ref": "pkg:github/mongodb/mongo-c-driver@v2.0.0",
4+
"bom-ref": "pkg:github/mongodb/mongo-c-driver@v2.0.2",
55
"copyright": "Copyright 2009-present MongoDB, Inc.",
66
"externalReferences": [
77
{
88
"type": "distribution",
9-
"url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/v2.0.0.tar.gz"
9+
"url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/v2.0.2.tar.gz"
1010
},
1111
{
1212
"type": "website",
13-
"url": "https://github.com/mongodb/mongo-c-driver/tree/v2.0.0"
13+
"url": "https://github.com/mongodb/mongo-c-driver/tree/v2.0.2"
1414
}
1515
],
1616
"group": "mongodb",
@@ -22,18 +22,18 @@
2222
}
2323
],
2424
"name": "mongo-c-driver",
25-
"purl": "pkg:github/mongodb/mongo-c-driver@v2.0.0",
25+
"purl": "pkg:github/mongodb/mongo-c-driver@v2.0.2",
2626
"type": "library",
27-
"version": "v2.0.0"
27+
"version": "v2.0.2"
2828
}
2929
],
3030
"dependencies": [
3131
{
32-
"ref": "pkg:github/mongodb/mongo-c-driver@v2.0.0"
32+
"ref": "pkg:github/mongodb/mongo-c-driver@v2.0.2"
3333
}
3434
],
3535
"metadata": {
36-
"timestamp": "2025-05-01T19:59:22.023435+00:00",
36+
"timestamp": "2025-09-16T15:16:51.915650+00:00",
3737
"tools": [
3838
{
3939
"externalReferences": [

etc/cyclonedx.sbom.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"components": [
33
{
4-
"bom-ref": "pkg:github/mongodb/mongo-c-driver@v2.0.0",
4+
"bom-ref": "pkg:github/mongodb/mongo-c-driver@v2.0.2",
55
"copyright": "Copyright 2009-present MongoDB, Inc.",
66
"externalReferences": [
77
{
88
"type": "distribution",
9-
"url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/v2.0.0.tar.gz"
9+
"url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/v2.0.2.tar.gz"
1010
},
1111
{
1212
"type": "website",
13-
"url": "https://github.com/mongodb/mongo-c-driver/tree/v2.0.0"
13+
"url": "https://github.com/mongodb/mongo-c-driver/tree/v2.0.2"
1414
}
1515
],
1616
"group": "mongodb",
@@ -22,18 +22,18 @@
2222
}
2323
],
2424
"name": "mongo-c-driver",
25-
"purl": "pkg:github/mongodb/mongo-c-driver@v2.0.0",
25+
"purl": "pkg:github/mongodb/mongo-c-driver@v2.0.2",
2626
"type": "library",
27-
"version": "v2.0.0"
27+
"version": "v2.0.2"
2828
}
2929
],
3030
"dependencies": [
3131
{
32-
"ref": "pkg:github/mongodb/mongo-c-driver@v2.0.0"
32+
"ref": "pkg:github/mongodb/mongo-c-driver@v2.0.2"
3333
}
3434
],
3535
"metadata": {
36-
"timestamp": "2025-05-01T19:59:22.023435+00:00",
36+
"timestamp": "2025-09-16T15:16:51.915650+00:00",
3737
"tools": [
3838
{
3939
"externalReferences": [

etc/purls.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# re-generate the SBOM JSON file!
77

88
# bson and mongoc may be obtained via cmake/FetchMongoC.cmake.
9-
pkg:github/mongodb/mongo-c-driver@v2.0.0
9+
pkg:github/mongodb/mongo-c-driver@v2.0.2

examples/api/bsoncxx/examples/validation/basic_usage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ void example() {
6161

6262
EXPECT(bsoncxx::validate(data, length) == bsoncxx::validate(data, length, options, &offset));
6363

64-
// Not set when valid.
65-
EXPECT(offset == 123u);
64+
// Set to 0 when valid.
65+
EXPECT(offset == 0u);
6666
}
6767
}
6868
// [Example]

examples/api/bsoncxx/examples/validation/validator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ void example(std::uint8_t const* bytes, std::size_t length) {
7777

7878
EXPECT(!bsoncxx::validate(bytes, length, options, &offset));
7979

80-
// Offset of `"$numberInt": "123"` relative to start of the sub-document. (CDRIVER-5710)
81-
EXPECT(offset == 4u);
80+
// Offset of `"$numberInt": "123"` relative to start of the document.
81+
EXPECT(offset == 31u);
8282
}
8383
}
8484
// [Example]

0 commit comments

Comments
 (0)