Skip to content

Commit a3252a0

Browse files
committed
Address review comments
Signed-off-by: Xiaodong Ye <yeahdongcn@gmail.com>
1 parent bbca39f commit a3252a0

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

tests/test-backend-ops.cpp

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -442,13 +442,6 @@ struct test_result {
442442
}
443443
};
444444

445-
// Enum for test status
446-
enum class test_status_t {
447-
NOT_SUPPORTED,
448-
OK,
449-
FAIL
450-
};
451-
452445
// Forward declarations for the visitor pattern
453446
struct message_visitor;
454447

@@ -470,6 +463,12 @@ struct message_visitor {
470463
};
471464

472465
// Printer classes for different output formats
466+
enum class test_status_t {
467+
NOT_SUPPORTED,
468+
OK,
469+
FAIL
470+
};
471+
473472
struct test_operation_info : public message_data {
474473
std::string op_name;
475474
std::string op_params;
@@ -637,6 +636,32 @@ struct printer : public message_visitor {
637636
void print_message(const message_data& data) {
638637
data.accept(*this);
639638
}
639+
640+
// Default implementations for all visit methods (no-op)
641+
// Derived classes can override only the ones they care about
642+
void visit(const test_operation_info& info) override {
643+
(void)info;
644+
}
645+
646+
void visit(const test_summary_info& info) override {
647+
(void)info;
648+
}
649+
650+
void visit(const testing_start_info& info) override {
651+
(void)info;
652+
}
653+
654+
void visit(const backend_init_info& info) override {
655+
(void)info;
656+
}
657+
658+
void visit(const backend_status_info& info) override {
659+
(void)info;
660+
}
661+
662+
void visit(const overall_summary_info& info) override {
663+
(void)info;
664+
}
640665
};
641666

642667
struct console_printer : public printer {
@@ -857,31 +882,6 @@ struct sql_printer : public printer {
857882
}
858883
fprintf(fout, ");\n");
859884
}
860-
861-
// Visitor pattern implementations - SQL printer doesn't need to handle message types for now
862-
void visit(const test_operation_info& info) override {
863-
(void)info;
864-
}
865-
866-
void visit(const test_summary_info& info) override {
867-
(void)info;
868-
}
869-
870-
void visit(const testing_start_info& info) override {
871-
(void)info;
872-
}
873-
874-
void visit(const backend_init_info& info) override {
875-
(void)info;
876-
}
877-
878-
void visit(const backend_status_info& info) override {
879-
(void)info;
880-
}
881-
882-
void visit(const overall_summary_info& info) override {
883-
(void)info;
884-
}
885885
};
886886

887887
static std::unique_ptr<printer> create_printer(output_formats format) {

0 commit comments

Comments
 (0)