[QUEUED scylladb next] test: define table_for_tests earlier

0 views
Skip to first unread message

Commit Bot

<bot@cloudius-systems.com>
unread,
Jun 28, 2024, 11:03:13 AMJun 28
to scylladb-dev@googlegroups.com, Avi Kivity
From: Avi Kivity <a...@scylladb.com>
Committer: Avi Kivity <a...@scylladb.com>
Branch: next

test: define table_for_tests earlier

C++23 made std::unique_ptr constexpr. A side effect of this (presumably)
is that the compiler compiles it more eagerly, requiring the full definition
of the class in std::make_unique, while it previously was content with
finding the definition later.

One victim of this change is table_for_tests; define it earlier to
build with C++23.

---
diff --git a/test/lib/test_services.cc b/test/lib/test_services.cc
--- a/test/lib/test_services.cc
+++ b/test/lib/test_services.cc
@@ -26,17 +26,6 @@
static const sstring some_keyspace("ks");
static const sstring some_column_family("cf");

-table_for_tests::data::data()
-{ }
-
-table_for_tests::data::~data() {}
-
-schema_ptr table_for_tests::make_default_schema() {
- return schema_builder(some_keyspace, some_column_family)
- .with_column(utf8_type->decompose("p1"), utf8_type, column_kind::partition_key)
- .build();
-}
-
class table_for_tests::table_state : public compaction::table_state {
table_for_tests::data& _data;
sstables::sstables_manager& _sstables_manager;
@@ -127,6 +116,17 @@ class table_for_tests::table_state : public compaction::table_state {
}
};

+table_for_tests::data::data()
+{ }
+
+table_for_tests::data::~data() {}
+
+schema_ptr table_for_tests::make_default_schema() {
+ return schema_builder(some_keyspace, some_column_family)
+ .with_column(utf8_type->decompose("p1"), utf8_type, column_kind::partition_key)
+ .build();
+}
+
table_for_tests::table_for_tests(sstables::sstables_manager& sstables_manager, compaction_manager& cm, schema_ptr s, replica::table::config cfg, data_dictionary::storage_options storage)
: _data(make_lw_shared<data>())
{

Commit Bot

<bot@cloudius-systems.com>
unread,
Jun 28, 2024, 4:10:16 PMJun 28
to scylladb-dev@googlegroups.com, Avi Kivity
From: Avi Kivity <a...@scylladb.com>
Committer: Avi Kivity <a...@scylladb.com>
Branch: master
Reply all
Reply to author
Forward
0 new messages