Skip to content

FileCache.PayloadMode.RawBytes seems to be broken #57

Description

@RaeuberHotzenplotz

Tested with v3.3.0:

        [TestCase(new byte[] { 1, 2, 3 })]
        [TestCase(new byte[] { 0, 0, 0, 24, 0, 0, 0, 0, 11, 22, 33 })] // fake header 
        [TestCase(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8})]
        public void Cache_Can_Read_And_Write_Raw_Bytes(byte[] payload)
        {
            var cache = new FileCache(System.IO.Path.GetTempPath())
            {
                PayloadReadMode = FileCache.PayloadMode.RawBytes,
                PayloadWriteMode = FileCache.PayloadMode.RawBytes
            };

            const string key = "key";
            cache[key] = payload;
            Assert.AreEqual(payload, cache[key]);
        }

Reads NULL, throws EndOfStreamException or OutOfMemoryException. I wonder why reading raw bytes requires the magic header, which is never written and cannot find an unit test in the repository that reads/writes raw bytes and checks that the returned bytes equal the original bytes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions