Open PanWuming opened 5 months ago
Does it also work with memorystreams? I prefer not to write on my disk.
Does it also work with memorystreams? I prefer not to write on my disk.
Thank you for your feedback. I have updated the PR with the requested MemoryStream tests and included exception outputs for debugging. Please review the latest changes.
Description
This PR adds four unit tests to handle scenarios where LiteDB attempts to open invalid database files and streams:
Issues
These tests are intended to address issue #2501.
Bugs Discovered
Test_AddDatabase_InvalidDatabase:
LiteDB.LiteException
to be thrown.Details:
Test_AddDatabase_InvalidDatabase_LargeFile:
LiteDB.LiteException
to be thrown.System.ArgumentOutOfRangeException
was thrown.Test_AddDatabase_InvalidDatabase_MemoryStream:
LiteDB.LiteException
to be thrown.System.NotSupportedException
was thrown.Test_AddDatabase_InvalidDatabase_LargeFile_MemoryStream:
LiteDB.LiteException
to be thrown.System.ArgumentOutOfRangeException
was thrown.These findings indicate that LiteDB is not handling invalid files and streams as expected, leading to different types of exceptions or no exceptions at all.