|
79 | 79 | return; \
|
80 | 80 | }
|
81 | 81 |
|
82 |
| -#define SKIP_TEST_VERSION(server_version_string, version_string) \ |
83 |
| - SKIP_TEST("Unsupported for Apache Cassandra Version " \ |
84 |
| - << server_version_string << ": Server version " << version_string << "+ is required") |
| 82 | +#define SKIP_TEST_MESSAGE(server_version_string, comparison, version_string) \ |
| 83 | + "Unsupported for Apache Cassandra Version " << server_version_string << ": Server version is " \ |
| 84 | + << comparison << " the specified version " << version_string |
| 85 | + |
| 86 | +/* Maintain existing behaviour; default message indicates server < specified */ |
| 87 | +#define SKIP_TEST_VERSION(server_version_string, version_string) \ |
| 88 | + SKIP_TEST(SKIP_TEST_MESSAGE(server_version_string, '<', version_string)) |
85 | 89 |
|
86 | 90 | #define CHECK_VERSION(version) \
|
87 | 91 | do { \
|
|
94 | 98 | } \
|
95 | 99 | } while (0)
|
96 | 100 |
|
| 101 | +/* CPP-967 Skip test iff server version matches major.minor of specified version but |
| 102 | + patch version is >= the specified patch level of the specified version. This |
| 103 | + enables the concise expression of a single constraint based on multiple Cassandra |
| 104 | + server versions. |
| 105 | +
|
| 106 | + Also note that the sense of the comaprison is inverted from what we get in |
| 107 | + CHECK_VERSION. There we want to make sure we have a version greater than what's |
| 108 | + specified in the constraint. Here we want to make sure we have something less than |
| 109 | + what's specified (since the behaviour under test is fixed in later versions of |
| 110 | + Cassandra) */ |
| 111 | +#define CHECK_VERSIONS(version_string) \ |
| 112 | + do { \ |
| 113 | + CCM::CassVersion cass_version = this->server_version_; \ |
| 114 | + if (!Options::is_cassandra()) { \ |
| 115 | + cass_version = static_cast<CCM::DseVersion>(cass_version).get_cass_version(); \ |
| 116 | + } \ |
| 117 | + std::vector<std::string> versions = Utils::explode(version_string,','); \ |
| 118 | + for (unsigned int i = 0; i < versions.size(); i++) { \ |
| 119 | + CCM::CassVersion version = CCM::CassVersion(versions[i]); \ |
| 120 | + if (cass_version.major_version == version.major_version && \ |
| 121 | + cass_version.minor_version == version.minor_version && \ |
| 122 | + cass_version.patch_version >= version.patch_version) { \ |
| 123 | + SKIP_TEST( \ |
| 124 | + SKIP_TEST_MESSAGE( \ |
| 125 | + cass_version.to_string(), ">=", version.to_string())) \ |
| 126 | + } \ |
| 127 | + } \ |
| 128 | + } while (0) |
| 129 | + |
97 | 130 | #define CHECK_PROTOCOL_VERSION(version) \
|
98 | 131 | do { \
|
99 | 132 | int proto_version = this->protocol_version_; \
|
|
0 commit comments