Skip to content

Commit b944f4d

Browse files
authored
Fix uninitialized value in PDisk UT (#10193)
1 parent 62f0fb0 commit b944f4d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

ydb/core/blobstorage/pdisk/blobstorage_pdisk_blockdevice_ut.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "blobstorage_pdisk_actorsystem_creator.h"
77
#include "blobstorage_pdisk_mon.h"
88
#include "blobstorage_pdisk_ut_defs.h"
9+
#include "blobstorage_pdisk_ut_helpers.h"
910

1011
#include <ydb/core/control/immediate_control_board_wrapper.h>
1112

@@ -138,16 +139,6 @@ class TCompletionWorkerWithCounter : public NPDisk::TCompletionAction {
138139
TDuration WorkTime;
139140
};
140141

141-
static TString MakeDatabasePath(const char *dir) {
142-
TString databaseDirectory = Sprintf("%s/yard", dir);
143-
return databaseDirectory;
144-
}
145-
146-
static TString MakePDiskPath(const char *dir) {
147-
TString databaseDirectory = MakeDatabasePath(dir);
148-
return databaseDirectory + "/pdisk.dat";
149-
}
150-
151142
TString CreateFile(const char *baseDir, ui32 dataSize) {
152143
TString databaseDirectory = MakeDatabasePath(baseDir);
153144
MakeDirIfNotExist(databaseDirectory.c_str());
@@ -249,6 +240,7 @@ Y_UNIT_TEST_SUITE(TBlockDeviceTest) {
249240
THolder<TPDiskMon> mon(new TPDiskMon(counters, 0, nullptr));
250241

251242
ui32 buffSize = 64_KB;
243+
auto randomData = PrepareData(buffSize);
252244
ui32 bufferPoolSize = 512;
253245
THolder<NPDisk::TBufferPool> bufferPool(NPDisk::CreateBufferPool(buffSize, bufferPoolSize, false, {}));
254246
ui64 inFlight = 128;
@@ -273,6 +265,7 @@ Y_UNIT_TEST_SUITE(TBlockDeviceTest) {
273265
device->PreadAsync(data, 32_KB, 0, buffer.Release(), TReqId(), nullptr);
274266
break;
275267
case 1:
268+
memcpy(data, randomData.data(), 32_KB);
276269
device->PwriteAsync(data, 32_KB, 0, buffer.Release(), TReqId(), nullptr);
277270
break;
278271
case 2:

0 commit comments

Comments
 (0)