浏览代码

Tests: Remove the 10KB file read test for AllocatingMemoryStream

When we move the test to AK (together with the actual stream
implementation), finding the input file to read from is going to become
significantly harder, since the test also runs outside of SerenityOS.

Since this was just a smoke test during early development (and we should
now have reasonable coverage with actual usages in the other parts of
the OS), let's just remove that test instead of trying to make input
file lookups work.
Tim Schumacher 2 年之前
父节点
当前提交
11550f582b
共有 1 个文件被更改,包括 0 次插入36 次删除
  1. 0 36
      Tests/LibCore/TestLibCoreStream.cpp

+ 0 - 36
Tests/LibCore/TestLibCoreStream.cpp

@@ -680,39 +680,3 @@ TEST_CASE(allocating_memory_stream_offset_of_oob)
         EXPECT(!offset.has_value());
         EXPECT(!offset.has_value());
     }
     }
 }
 }
-
-TEST_CASE(allocating_memory_stream_10kb)
-{
-    auto file = MUST(Core::Stream::File::open("/usr/Tests/LibCore/10kb.txt"sv, Core::Stream::OpenMode::Read));
-    size_t const file_size = MUST(file->size());
-    size_t constexpr test_chunk_size = 4096;
-
-    // Read file contents into the memory stream.
-    Core::Stream::AllocatingMemoryStream stream;
-    while (!file->is_eof()) {
-        Array<u8, test_chunk_size> array;
-        MUST(stream.write(MUST(file->read(array))));
-    }
-
-    EXPECT_EQ(stream.used_buffer_size(), file_size);
-
-    MUST(file->seek(0, SeekMode::SetPosition));
-
-    // Check the stream contents when reading back.
-    size_t offset = 0;
-    while (!file->is_eof()) {
-        Array<u8, test_chunk_size> file_array;
-        Array<u8, test_chunk_size> stream_array;
-        auto file_span = MUST(file->read(file_array));
-        auto stream_span = MUST(stream.read(stream_array));
-        EXPECT_EQ(file_span.size(), stream_span.size());
-
-        for (size_t i = 0; i < file_span.size(); i++) {
-            if (file_array[i] == stream_array[i])
-                continue;
-
-            FAIL(String::formatted("Data started to diverge at index {}: file={}, stream={}", offset + i, file_array[i], stream_array[i]));
-        }
-        offset += file_span.size();
-    }
-}