MCPcopy Create free account
hub / github.com/bytedance/bolt / corruptFile

Function corruptFile

bolt/common/caching/tests/AsyncDataCacheTest.cpp:759–764  ·  view source on GitHub ↗

Cuts off the last 1/10th of file at 'path'.

Source from the content-addressed store, hash-verified

757namespace {
758// Cuts off the last 1/10th of file at 'path'.
759void corruptFile(const std::string& path) {
760 const auto fd = ::open(path.c_str(), O_WRONLY);
761 const auto size = ::lseek(fd, 0, SEEK_END);
762 const auto rc = ftruncate(fd, size / 10 * 9);
763 ASSERT_EQ(rc, 0);
764}
765} // namespace
766
767TEST_F(AsyncDataCacheTest, DISABLED_ssd) {

Callers 1

TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected