diff --git a/test/boost/UUID_test.cc b/test/boost/UUID_test.cc index 0a53aa6965..b7303137af 100644 --- a/test/boost/UUID_test.cc +++ b/test/boost/UUID_test.cc @@ -39,7 +39,7 @@ BOOST_AUTO_TEST_CASE(test_UUID_comparison) { } BOOST_AUTO_TEST_CASE(test_from_string) { - auto check = [] (sstring_view sv) { + auto check = [] (std::string_view sv) { auto uuid = UUID(sv); BOOST_CHECK_EQUAL(uuid.version(), 4); BOOST_CHECK_EQUAL(fmt::to_string(uuid), sv); diff --git a/test/boost/hint_test.cc b/test/boost/hint_test.cc index 1c3aee0403..9a19658b43 100644 --- a/test/boost/hint_test.cc +++ b/test/boost/hint_test.cc @@ -58,7 +58,7 @@ std::ostream& operator<<(std::ostream& out, const sync_point& sp) { static constexpr size_t version_size = sizeof(uint8_t); static constexpr size_t checksum_size = sizeof(uint64_t); -static uint64_t calculate_checksum(const sstring_view s) { +static uint64_t calculate_checksum(const std::string_view s) { xx_hasher h; h.update(s.data(), s.size()); return h.finalize_uint64(); @@ -121,7 +121,7 @@ sstring encode_v1_or_v2(const sync_point& sp, encode_version v) { ser::serializer::write(out, v2); if (v == encode_version::v2) { - sstring_view serialized_s(reinterpret_cast(serialized.data()), version_size + measure.size()); + std::string_view serialized_s(reinterpret_cast(serialized.data()), version_size + measure.size()); uint64_t checksum = calculate_checksum(serialized_s); ser::serializer::write(out, checksum); } diff --git a/test/boost/query_processor_test.cc b/test/boost/query_processor_test.cc index 1be650e3ea..6a56f90c26 100644 --- a/test/boost/query_processor_test.cc +++ b/test/boost/query_processor_test.cc @@ -218,7 +218,7 @@ SEASTAR_TEST_CASE(test_query_counters) { }; // Executes a batch of (modifying) statements and waits for it to complete. - auto process_batch = [&e](const std::vector& queries, clevel cl) mutable { + auto process_batch = [&e](const std::vector& queries, clevel cl) mutable { e.execute_batch(queries, make_options(cl)).get(); }; diff --git a/test/boost/restrictions_test.cc b/test/boost/restrictions_test.cc index e95252bdbc..60574682f9 100644 --- a/test/boost/restrictions_test.cc +++ b/test/boost/restrictions_test.cc @@ -28,7 +28,7 @@ using boost::adaptors::transformed; std::unique_ptr to_options( const cql3::cql_config& cfg, - std::optional> names, + std::optional> names, std::vector values) { static auto& d = cql3::query_options::DEFAULT; return std::make_unique( @@ -40,7 +40,7 @@ std::unique_ptr to_options( /// Asserts that e.execute_prepared(id, values) contains expected rows, in any order. void require_rows(cql_test_env& e, cql3::prepared_cache_key_type id, - std::optional> names, + std::optional> names, const std::vector& values, const std::vector>& expected, const seastar::compat::source_location& loc = source_location::current()) { diff --git a/test/boost/sstable_3_x_test.cc b/test/boost/sstable_3_x_test.cc index 8f26a8fd63..418849a3fb 100644 --- a/test/boost/sstable_3_x_test.cc +++ b/test/boost/sstable_3_x_test.cc @@ -1308,7 +1308,7 @@ SEASTAR_TEST_CASE(test_uncompressed_compound_static_row_read) { auto val_cdef = UNCOMPRESSED_COMPOUND_STATIC_ROW_SCHEMA->get_column_definition(to_bytes("val")); BOOST_REQUIRE(val_cdef); - auto generate = [&] (int int_val, sstring_view text_val, sstring_view inet_val) { + auto generate = [&] (int int_val, std::string_view text_val, std::string_view inet_val) { std::vector columns; columns.push_back({s_int_cdef, int32_type->decompose(int_val)}); @@ -1669,8 +1669,8 @@ static future<> test_partition_key_with_values_of_different_types_read(const sst BOOST_REQUIRE(text_cdef); auto generate = [&] (bool bool_val, double double_val, float float_val, int int_val, long long_val, - sstring_view timestamp_val, sstring_view timeuuid_val, sstring_view uuid_val, - sstring_view text_val) { + std::string_view timestamp_val, std::string_view timeuuid_val, std::string_view uuid_val, + std::string_view text_val) { std::vector columns; columns.push_back({bool_cdef, boolean_type->decompose(bool_val)}); @@ -1906,8 +1906,8 @@ SEASTAR_TEST_CASE(test_uncompressed_subset_of_columns_read) { auto generate = [&] (std::optional bool_val, std::optional double_val, std::optional float_val, std::optional int_val, std::optional long_val, - std::optional timestamp_val, std::optional timeuuid_val, - std::optional uuid_val, std::optional text_val) { + std::optional timestamp_val, std::optional timeuuid_val, + std::optional uuid_val, std::optional text_val) { std::vector columns; if (bool_val) { diff --git a/test/boost/statement_restrictions_test.cc b/test/boost/statement_restrictions_test.cc index 37c5329b4a..6826167bc0 100644 --- a/test/boost/statement_restrictions_test.cc +++ b/test/boost/statement_restrictions_test.cc @@ -46,7 +46,7 @@ query::clustering_row_ranges slice( /// Overload that parses the WHERE clause from string. Named differently to disambiguate when where_clause is /// brace-initialized. query::clustering_row_ranges slice_parse( - sstring_view where_clause, cql_test_env& env, + std::string_view where_clause, cql_test_env& env, const sstring& table_name = "t", const sstring& keyspace_name = "ks") { return slice(boolean_factors(cql3::util::where_clause_to_relations(where_clause, cql3::dialect{})), env, table_name, keyspace_name); } diff --git a/test/boost/transport_test.cc b/test/boost/transport_test.cc index a3dc4398e3..f181646173 100644 --- a/test/boost/transport_test.cc +++ b/test/boost/transport_test.cc @@ -121,13 +121,13 @@ SEASTAR_THREAD_TEST_CASE(test_response_request_reader) { BOOST_CHECK(v2.unset); BOOST_CHECK_EQUAL(to_bytes(req.read_value_view(version).value), value); - std::vector names; + std::vector names; std::vector values; cql3::unset_bind_variable_vector unset; req.read_name_and_value_list(version, names, values, unset); BOOST_CHECK(std::none_of(unset.begin(), unset.end(), std::identity())); BOOST_CHECK_EQUAL(names, names_and_values | boost::adaptors::transformed([] (auto& name_and_value) { - return sstring_view(name_and_value.first); + return std::string_view(name_and_value.first); })); BOOST_CHECK_EQUAL(values, names_and_values | boost::adaptors::transformed([] (auto& name_and_value) { if (!name_and_value.second) { diff --git a/test/lib/cql_assertions.cc b/test/lib/cql_assertions.cc index 8759b751d9..71a1e14448 100644 --- a/test/lib/cql_assertions.cc +++ b/test/lib/cql_assertions.cc @@ -191,7 +191,7 @@ rows_assertions rows_assertions::with_serialized_columns_count(size_t columns_co } shared_ptr cquery_nofail( - cql_test_env& env, sstring_view query, std::unique_ptr&& qo, const seastar::compat::source_location& loc) { + cql_test_env& env, std::string_view query, std::unique_ptr&& qo, const seastar::compat::source_location& loc) { try { if (qo) { return env.execute_cql(query, std::move(qo)).get(); @@ -206,7 +206,7 @@ shared_ptr cquery_nofail( } void require_rows(cql_test_env& e, - sstring_view qstr, + std::string_view qstr, const std::vector>& expected, const seastar::compat::source_location& loc) { try { @@ -218,7 +218,7 @@ void require_rows(cql_test_env& e, } } -void eventually_require_rows(cql_test_env& e, sstring_view qstr, const std::vector>& expected, +void eventually_require_rows(cql_test_env& e, std::string_view qstr, const std::vector>& expected, const seastar::compat::source_location& loc) { try { eventually([&] { diff --git a/test/lib/cql_assertions.hh b/test/lib/cql_assertions.hh index ff583c8268..9cfe8e1ffa 100644 --- a/test/lib/cql_assertions.hh +++ b/test/lib/cql_assertions.hh @@ -74,19 +74,19 @@ void assert_that_failed(future&& f) /// \note Should be called from a seastar::thread context, as it awaits the CQL result. shared_ptr cquery_nofail( cql_test_env& env, - sstring_view query, + std::string_view query, std::unique_ptr&& qo = nullptr, const seastar::compat::source_location& loc = seastar::compat::source_location::current()); /// Asserts that cquery_nofail(e, qstr) contains expected rows, in any order. void require_rows(cql_test_env& e, - sstring_view qstr, + std::string_view qstr, const std::vector>& expected, const seastar::compat::source_location& loc = seastar::compat::source_location::current()); /// Like require_rows, but wraps assertions in \c eventually. void eventually_require_rows( - cql_test_env& e, sstring_view qstr, const std::vector>& expected, + cql_test_env& e, std::string_view qstr, const std::vector>& expected, const seastar::compat::source_location& loc = seastar::compat::source_location::current()); /// Asserts that e.execute_prepared(id, values) contains expected rows, in any order. diff --git a/test/lib/cql_test_env.cc b/test/lib/cql_test_env.cc index fb06002f29..c30c79e0fd 100644 --- a/test/lib/cql_test_env.cc +++ b/test/lib/cql_test_env.cc @@ -220,7 +220,7 @@ public: adjust_rlimit(); } - virtual future<::shared_ptr> execute_cql(sstring_view text) override { + virtual future<::shared_ptr> execute_cql(std::string_view text) override { testlog.trace("{}(\"{}\")", __FUNCTION__, text); auto qs = make_query_state(); auto qo = make_shared(cql3::query_options::DEFAULT); @@ -230,7 +230,7 @@ public: } virtual future<::shared_ptr> execute_cql( - sstring_view text, + std::string_view text, std::unique_ptr qo) override { testlog.trace("{}(\"{}\")", __FUNCTION__, text); @@ -1067,7 +1067,7 @@ private: public: future<::shared_ptr> execute_batch( - const std::vector& queries, std::unique_ptr qo) override { + const std::vector& queries, std::unique_ptr qo) override { using cql3::statements::batch_statement; using cql3::statements::modification_statement; std::vector modifications; diff --git a/test/lib/cql_test_env.hh b/test/lib/cql_test_env.hh index 9c25b5b14a..8ab126d044 100644 --- a/test/lib/cql_test_env.hh +++ b/test/lib/cql_test_env.hh @@ -111,14 +111,14 @@ class cql_test_env { public: virtual ~cql_test_env() {}; - virtual future<::shared_ptr> execute_cql(sstring_view text) = 0; + virtual future<::shared_ptr> execute_cql(std::string_view text) = 0; virtual future<::shared_ptr> execute_cql( - sstring_view text, std::unique_ptr qo) = 0; + std::string_view text, std::unique_ptr qo) = 0; /// Processes queries (which must be modifying queries) as a batch. virtual future<::shared_ptr> execute_batch( - const std::vector& queries, std::unique_ptr qo) = 0; + const std::vector& queries, std::unique_ptr qo) = 0; virtual future prepare(sstring query) = 0; diff --git a/test/lib/expr_test_utils.cc b/test/lib/expr_test_utils.cc index 8eb9aca684..9645265c34 100644 --- a/test/lib/expr_test_utils.cc +++ b/test/lib/expr_test_utils.cc @@ -53,7 +53,7 @@ raw_value make_bigint_raw(int64_t val) { return make_raw(val); } -raw_value make_text_raw(const sstring_view& text) { +raw_value make_text_raw(const std::string_view& text) { return raw_value::make_value(utf8_type->decompose(text)); } @@ -95,7 +95,7 @@ constant make_bigint_const(int64_t val) { return make_const(val); } -constant make_text_const(const sstring_view& text) { +constant make_text_const(const std::string_view& text) { return constant(make_text_raw(text), utf8_type); } @@ -353,7 +353,7 @@ tuple_constructor make_tuple_constructor(std::vector elements, std:: .type = tuple_type_impl::get_instance(std::move(element_types))}; } -usertype_constructor make_usertype_constructor(std::vector> field_values) { +usertype_constructor make_usertype_constructor(std::vector> field_values) { usertype_constructor::elements_map_type elements_map; std::vector field_names; std::vector field_types; diff --git a/test/lib/expr_test_utils.hh b/test/lib/expr_test_utils.hh index 3b713dfc0e..a7e326988c 100644 --- a/test/lib/expr_test_utils.hh +++ b/test/lib/expr_test_utils.hh @@ -30,7 +30,7 @@ raw_value make_tinyint_raw(int8_t val); raw_value make_smallint_raw(int16_t val); raw_value make_int_raw(int32_t val); raw_value make_bigint_raw(int64_t val); -raw_value make_text_raw(const sstring_view& text); +raw_value make_text_raw(const std::string_view& text); raw_value make_float_raw(float val); raw_value make_double_raw(double val); @@ -40,7 +40,7 @@ constant make_tinyint_const(int8_t val); constant make_smallint_const(int16_t val); constant make_int_const(int32_t val); constant make_bigint_const(int64_t val); -constant make_text_const(const sstring_view& text); +constant make_text_const(const std::string_view& text); constant make_float_const(float val); constant make_double_const(double val); @@ -102,7 +102,7 @@ collection_constructor make_map_constructor(const std::vector elements, std::vector element_types); -usertype_constructor make_usertype_constructor(std::vector> field_values); +usertype_constructor make_usertype_constructor(std::vector> field_values); ::lw_shared_ptr make_receiver(data_type receiver_type, sstring name = "receiver_name");