You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by li...@apache.org on 2022/07/04 04:32:42 UTC

[rocketmq-clients] branch cpp updated: Do not use designated initializers which requires C++20

This is an automated email from the ASF dual-hosted git repository.

lizhanhui pushed a commit to branch cpp
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git


The following commit(s) were added to refs/heads/cpp by this push:
     new c807e97  Do not use designated initializers which requires C++20
c807e97 is described below

commit c807e971ed348539e60d33a2adda92184121a910
Author: Li Zhanhui <li...@gmail.com>
AuthorDate: Mon Jul 4 12:32:32 2022 +0800

    Do not use designated initializers which requires C++20
---
 cpp/src/main/cpp/base/tests/RetryPolicyTest.cpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/cpp/src/main/cpp/base/tests/RetryPolicyTest.cpp b/cpp/src/main/cpp/base/tests/RetryPolicyTest.cpp
index 168b87a..1e3c7bf 100644
--- a/cpp/src/main/cpp/base/tests/RetryPolicyTest.cpp
+++ b/cpp/src/main/cpp/base/tests/RetryPolicyTest.cpp
@@ -20,12 +20,14 @@
 ROCKETMQ_NAMESPACE_BEGIN
 
 TEST(RetryPolicyTest, testBackoff) {
-  RetryPolicy policy{.max_attempt = 3,
-                     .strategy = BackoffStrategy::Customized,
-                     .initial = absl::Milliseconds(0),
-                     .max = absl::Milliseconds(0),
-                     .multiplier = 0.0f,
-                     .next = {absl::Milliseconds(10), absl::Milliseconds(100), absl::Milliseconds(500)}};
+  RetryPolicy policy;
+  policy.max_attempt = 3;
+  policy.strategy = BackoffStrategy::Customized;
+  policy.initial = absl::Milliseconds(0);
+  policy.max = absl::Milliseconds(0);
+  policy.multiplier = 0.0f;
+  policy.next = {absl::Milliseconds(10), absl::Milliseconds(100), absl::Milliseconds(500)};
+
   ASSERT_EQ(policy.backoff(1), 10);
   ASSERT_EQ(policy.backoff(2), 100);
   ASSERT_EQ(policy.backoff(3), 500);