BGQ99 commented on code in PR #3626:
URL: https://github.com/apache/brpc/pull/3626#discussion_r4323672084


##########
test/brpc_urma_unittest.cpp:
##########
@@ -41,6 +43,91 @@ extern butil::atomic<bool> g_urma_available;
 }  // namespace urma
 }  // namespace brpc
 
+class UrmaSendCompletionTest : public ::testing::Test {
+protected:
+    void SetUp() override {
+        SocketOptions options;
+        SocketId id;
+        ASSERT_EQ(0, Socket::Create(options, &id));
+        ASSERT_EQ(0, Socket::Address(id, &_socket));
+    }
+
+    void TearDown() override {
+        if (_socket) {
+            _socket->SetFailed();
+        }
+    }
+
+    static urma_cr_t SendCompletion() {
+        urma_cr_t cr{};
+        cr.status = URMA_CR_SUCCESS;
+        cr.user_ctx = 1;
+        return cr;
+    }
+
+    SocketUniquePtr _socket;
+};
+
+TEST_F(UrmaSendCompletionTest, reclaim_buffer_before_publishing_credit) {
+    char payload = 'x';
+    bool released = false;
+    urma::UrmaEndpoint endpoint(_socket.get());
+    endpoint._sbuf.resize(endpoint._sq_size -

Review Comment:
   Thanks for checking. The existing test build disables C++ access checks with 
-fno-access-control. In CMake, this is set on brpc_test_config, which the URMA 
unit-test target links against; test/Makefile includes the same flag in 
CXXFLAGS. Therefore, these private-member accesses are permitted by the 
existing CMake and Make test configurations, including when URMA is enabled.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to