@@ -125,9 +125,15 @@ TEST_CASE("Spec Prose Tests") {
125
125
auto coll = db[" coll" ];
126
126
coll.drop ();
127
127
128
+ read_concern rc_majority;
129
+ rc_majority.acknowledge_level (read_concern::level::k_majority);
130
+
128
131
write_concern wc_majority;
129
132
wc_majority.majority (std::chrono::seconds (30 ));
130
133
134
+ coll.read_concern (rc_majority);
135
+ coll.write_concern (wc_majority);
136
+
131
137
// As a sanity check, we implement the first prose test. The behavior tested
132
138
// by the prose tests is implemented and tested by the C driver, so we won't
133
139
// replicate the full suite of prose tests here.
@@ -136,28 +142,25 @@ TEST_CASE("Spec Prose Tests") {
136
142
// Set the batch size to 1 so we read 1 doc at a time.
137
143
options::change_stream opts;
138
144
opts.batch_size (1 );
139
- auto cs = client .watch (std::move (opts));
145
+ auto cs = coll .watch (std::move (opts));
140
146
141
147
// With WC majority, insert some documents to listen for.
142
148
auto doc1 = make_document (kvp (" a" , 1 ));
143
149
auto doc2 = make_document (kvp (" b" , 2 ));
144
150
auto doc3 = make_document (kvp (" c" , 3 ));
145
151
146
- options::insert insert_opts{};
147
- insert_opts.write_concern (wc_majority);
148
-
149
152
{
150
- auto res = coll.insert_one (doc1.view (), insert_opts );
153
+ auto res = coll.insert_one (doc1.view ());
151
154
REQUIRE (res);
152
155
REQUIRE (res->result ().inserted_count () == 1 );
153
156
}
154
157
{
155
- auto res = coll.insert_one (doc2.view (), insert_opts );
158
+ auto res = coll.insert_one (doc2.view ());
156
159
REQUIRE (res);
157
160
REQUIRE (res->result ().inserted_count () == 1 );
158
161
}
159
162
{
160
- auto res = coll.insert_one (doc3.view (), insert_opts );
163
+ auto res = coll.insert_one (doc3.view ());
161
164
REQUIRE (res);
162
165
REQUIRE (res->result ().inserted_count () == 1 );
163
166
}
0 commit comments