public void TestSwitchManualIntSizeElse()
        {
            var r = SwitchManualIntSizeElse.FromFile(SourceFile("switch_tlv.bin"));

            Assert.AreEqual(r.Chunks.Count, 4);
            Assert.AreEqual(r.Chunks[0].Code, 17);
            Assert.AreEqual(((SwitchManualIntSizeElse.Chunk.ChunkMeta)(r.Chunks[0].Body)).Title, "Stuff");
            Assert.AreEqual(((SwitchManualIntSizeElse.Chunk.ChunkMeta)(r.Chunks[0].Body)).Author, "Me");
            Assert.AreEqual(r.Chunks[1].Code, 34);
            Assert.AreEqual(((SwitchManualIntSizeElse.Chunk.ChunkDir)(r.Chunks[1].Body)).Entries, new List <string> {
                "AAAA", "BBBB", "CCCC"
            });
            Assert.AreEqual(r.Chunks[2].Code, 51);
            Assert.AreEqual(((SwitchManualIntSizeElse.Chunk.Dummy)(r.Chunks[2].Body)).Rest, new byte[] { 16, 32, 48, 64, 80, 96, 112, 128 });
            Assert.AreEqual(r.Chunks[3].Code, 255);
            Assert.AreEqual(((SwitchManualIntSizeElse.Chunk.Dummy)(r.Chunks[3].Body)).Rest, new byte[] {  });
        }
示例#2
0
        public void TestSwitchManualIntSizeElse()
        {
            var r = SwitchManualIntSizeElse.FromFile(SourceFile("switch_tlv.bin"));

            Assert.AreEqual(r.Chunks.Count, 4);

            Assert.AreEqual(r.Chunks[0].Code, 0x11);
            var meta = (SwitchManualIntSizeElse.Chunk.ChunkMeta)r.Chunks[0].Body;

            Assert.AreEqual(meta.Title, "Stuff");
            Assert.AreEqual(meta.Author, "Me");

            Assert.AreEqual(r.Chunks[1].Code, 0x22);
            Assert.AreEqual(((SwitchManualIntSizeElse.Chunk.ChunkDir)r.Chunks[1].Body).Entries, new string[] { "AAAA", "BBBB", "CCCC" });

            Assert.AreEqual(r.Chunks[2].Code, 0x33);
            Assert.AreEqual(((SwitchManualIntSizeElse.Chunk.Dummy)r.Chunks[2].Body).Rest, new byte[] { 0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80 });

            Assert.AreEqual(r.Chunks[3].Code, 0xff);
            Assert.AreEqual(((SwitchManualIntSizeElse.Chunk.Dummy)r.Chunks[3].Body).Rest, new byte[] {});
        }
示例#3
0
 public ChunkMeta(KaitaiStream p__io, SwitchManualIntSizeElse.Chunk p__parent = null, SwitchManualIntSizeElse p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root;
     _read();
 }
示例#4
0
 public SwitchManualIntSizeElse(KaitaiStream p__io, KaitaiStruct p__parent = null, SwitchManualIntSizeElse p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root ?? this;
     _read();
 }