From 152f1c0d80997bc0a8db448b89530cd6bb83fe72 Mon Sep 17 00:00:00 2001 From: proller Date: Tue, 17 Dec 2024 13:27:31 +0000 Subject: [PATCH] Add ut --- .../diagnostics/profile_log_events_ut.cpp | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/cloud/filestore/libs/diagnostics/profile_log_events_ut.cpp b/cloud/filestore/libs/diagnostics/profile_log_events_ut.cpp index 8004112187d..48e53c636b5 100644 --- a/cloud/filestore/libs/diagnostics/profile_log_events_ut.cpp +++ b/cloud/filestore/libs/diagnostics/profile_log_events_ut.cpp @@ -985,6 +985,33 @@ Y_UNIT_TEST_SUITE(TProfileLogEventsTest) UNIT_ASSERT_VALUES_EQUAL(names.size(), nodeInfo.GetSize()); } + Y_UNIT_TEST(ShouldReadDataResponseInitializeFieldsCorrectly) + { + NProto::TReadDataResponse res; + constexpr auto Size = 42; + TString data{Size, ' '}; + res.SetBuffer(data); + + NProto::TProfileLogRequestInfo profileLogRequest; + FinalizeProfileLogRequestInfo(profileLogRequest, res); + UNIT_ASSERT_VALUES_EQUAL( + profileLogRequest.GetRanges(0).GetActualBytes(), + Size); + } + + Y_UNIT_TEST(ShouldWriteDataResponseInitializeFieldsCorrectly) + { + NProto::TWriteDataResponse res; + constexpr auto Size = 42; + res.SetBytes(Size); + + NProto::TProfileLogRequestInfo profileLogRequest; + FinalizeProfileLogRequestInfo(profileLogRequest, res); + UNIT_ASSERT_VALUES_EQUAL( + profileLogRequest.GetRanges(0).GetActualBytes(), + Size); + } + Y_UNIT_TEST(ShouldGetCorrectFuseRequestName) { UNIT_ASSERT_VALUES_EQUAL(