From ba8c755830aee22833dcd766cfcfd0cf2dc5b2ff Mon Sep 17 00:00:00 2001 From: DuanYH <18574375425@163.com> Date: Fri, 29 May 2026 22:06:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(test):=20=E4=BF=AE=E5=A4=8D=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BB=A3=E7=A0=81=E4=B8=AD=20unused=20parameter=20?= =?UTF-8?q?=E7=BC=96=E8=AF=91=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(eventx): timeout_monitor_test 中未使用的 lambda 参数 value fix(jsonrpc): raw_stream_proto_test/header_stream_proto_test 中未使用的 id、js_params fix(jsonrpc): rpc_int_test 中未使用的 lambda 参数 r --- modules/eventx/timeout_monitor_test.cpp | 2 +- modules/jsonrpc/protos/header_stream_proto_test.cpp | 2 ++ modules/jsonrpc/protos/raw_stream_proto_test.cpp | 2 ++ modules/jsonrpc/rpc_int_test.cpp | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/eventx/timeout_monitor_test.cpp b/modules/eventx/timeout_monitor_test.cpp index 8e4205b..4387263 100644 --- a/modules/eventx/timeout_monitor_test.cpp +++ b/modules/eventx/timeout_monitor_test.cpp @@ -75,7 +75,7 @@ TEST(TimeoutMonitor, Clear) sp_timer->enable(); bool run = false; - tm.setCallback([&] (int value) { + tm.setCallback([&] (int /*value*/) { run = true; }); diff --git a/modules/jsonrpc/protos/header_stream_proto_test.cpp b/modules/jsonrpc/protos/header_stream_proto_test.cpp index 041602a..4777a57 100644 --- a/modules/jsonrpc/protos/header_stream_proto_test.cpp +++ b/modules/jsonrpc/protos/header_stream_proto_test.cpp @@ -188,6 +188,8 @@ TEST(HeaderStreamProto, MultiPackages) { EXPECT_EQ(method, "test2"); } ++count; + UNUSED_VAR(id); + UNUSED_VAR(js_params); }, [] (int, const Response &) { } ); diff --git a/modules/jsonrpc/protos/raw_stream_proto_test.cpp b/modules/jsonrpc/protos/raw_stream_proto_test.cpp index fa6f9ae..073a686 100644 --- a/modules/jsonrpc/protos/raw_stream_proto_test.cpp +++ b/modules/jsonrpc/protos/raw_stream_proto_test.cpp @@ -188,6 +188,8 @@ TEST(RawStreamProto, MultiPackages) { EXPECT_EQ(method, "test2"); } ++count; + UNUSED_VAR(id); + UNUSED_VAR(js_params); }, [] (int, const Response &) { } ); diff --git a/modules/jsonrpc/rpc_int_test.cpp b/modules/jsonrpc/rpc_int_test.cpp index b17636c..abd79c4 100644 --- a/modules/jsonrpc/rpc_int_test.cpp +++ b/modules/jsonrpc/rpc_int_test.cpp @@ -230,6 +230,7 @@ TEST(RpcInt, Clear) { [&] { rpc.request("A", Json(), [&] (const Response &r) { + UNUSED_VAR(r); is_method_cb_invoke = true; } ); -- Gitee