@@ -571,31 +571,28 @@ get_topology_type (mongoc_client_t *client)
571
571
static void
572
572
check_schema_version (test_file_t * test_file )
573
573
{
574
- const char * supported_version_strs [] = {
575
- "1.8" , /* fully supported through this version */
576
- "1.12" , /* partially supported (expectedError.errorResponse assertions) */
577
- "1.18" /* partially supported (additional properties in kmsProviders) */
578
- "1.20" /* partially supported (expectedError.writeErrors and
579
- expectedError.writeConcernErrors) */
580
- };
581
- int i ;
582
-
583
- for (i = 0 ; i < sizeof (supported_version_strs ) / sizeof (supported_version_strs [0 ]); i ++ ) {
584
- semver_t supported_version ;
585
-
586
- semver_parse (supported_version_strs [i ], & supported_version );
587
- if (supported_version .major != test_file -> schema_version .major ) {
588
- continue ;
589
- }
590
- if (!supported_version .has_minor ) {
591
- /* All minor versions for this major version are supported. */
592
- return ;
593
- }
594
- if (supported_version .minor >= test_file -> schema_version .minor ) {
595
- return ;
596
- }
574
+ // `schema_version` is the latest schema version the test runner will try to run.
575
+ // 1.8 is fully supported. Later minor versions are partially supported.
576
+ // 1.12 is partially supported (expectedError.errorResponse assertions)
577
+ // 1.18 is partially supported (additional properties in kmsProviders)
578
+ // 1.20 is partially supported (expectedError.writeErrors and expectedError.writeConcernErrors)
579
+ semver_t schema_version ;
580
+ semver_parse ("1.20" , & schema_version );
581
+
582
+ if (schema_version .major != test_file -> schema_version .major ) {
583
+ goto fail ;
584
+ }
585
+
586
+ if (!schema_version .has_minor ) {
587
+ /* All minor versions for this major version are supported. */
588
+ return ;
589
+ }
590
+
591
+ if (schema_version .minor >= test_file -> schema_version .minor ) {
592
+ return ;
597
593
}
598
594
595
+ fail :
599
596
test_error ("Unsupported schema version: %s" , semver_to_string (& test_file -> schema_version ));
600
597
}
601
598
0 commit comments