Example #1
0
 public SubObj(KaitaiStream p__io, DefaultEndianExprInherited.Doc.MainObj p__parent = null, DefaultEndianExprInherited p__root = null, bool?isLe = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root;
     m_isLe   = isLe;
     _read();
 }
Example #2
0
        public void TestDefaultEndianExprInherited()
        {
            var r = DefaultEndianExprInherited.FromFile(SourceFile("endian_expr.bin"));

            Assert.AreEqual(r.Docs[0].Indicator, new byte[] { 73, 73 });
            Assert.AreEqual(r.Docs[0].Main.Insides.SomeInt, 66);
            Assert.AreEqual(r.Docs[0].Main.Insides.More.SomeInt1, 16896);
            Assert.AreEqual(r.Docs[0].Main.Insides.More.SomeInt2, 66);
            Assert.AreEqual(r.Docs[0].Main.Insides.More.SomeInst, 66);
            Assert.AreEqual(r.Docs[1].Indicator, new byte[] { 77, 77 });
            Assert.AreEqual(r.Docs[1].Main.Insides.SomeInt, 66);
            Assert.AreEqual(r.Docs[1].Main.Insides.More.SomeInt1, 66);
            Assert.AreEqual(r.Docs[1].Main.Insides.More.SomeInt2, 16896);
            Assert.AreEqual(r.Docs[1].Main.Insides.More.SomeInst, 1107296256);
            Assert.AreEqual(r.Docs[2].Indicator, new byte[] { 88, 88 });
            Assert.AreEqual(r.Docs[2].Main.Insides.SomeInt, 66);
            Assert.AreEqual(r.Docs[2].Main.Insides.More.SomeInt1, 66);
            Assert.AreEqual(r.Docs[2].Main.Insides.More.SomeInt2, 16896);
            Assert.AreEqual(r.Docs[2].Main.Insides.More.SomeInst, 1107296256);
        }
Example #3
0
        public void TestDefaultEndianExprInherited()
        {
            var r = DefaultEndianExprInherited.FromFile(SourceFile("endian_expr.bin"));

            Assert.AreEqual(r.Docs[0].Indicator, new byte[] { 0x49, 0x49 });
            Assert.AreEqual(r.Docs[0].Main.Insides.SomeInt, 0x42);
            Assert.AreEqual(r.Docs[0].Main.Insides.More.SomeInt1, 0x4200);
            Assert.AreEqual(r.Docs[0].Main.Insides.More.SomeInt2, 0x42);
            Assert.AreEqual(r.Docs[0].Main.Insides.More.SomeInst, 0x42);

            Assert.AreEqual(r.Docs[1].Indicator, new byte[] { 0x4d, 0x4d });
            Assert.AreEqual(r.Docs[1].Main.Insides.SomeInt, 0x42);
            Assert.AreEqual(r.Docs[1].Main.Insides.More.SomeInt1, 0x42);
            Assert.AreEqual(r.Docs[1].Main.Insides.More.SomeInt2, 0x4200);
            Assert.AreEqual(r.Docs[1].Main.Insides.More.SomeInst, 0x42000000);

            Assert.AreEqual(r.Docs[2].Indicator, new byte[] { 0x58, 0x58 });
            Assert.AreEqual(r.Docs[2].Main.Insides.SomeInt, 0x42);
            Assert.AreEqual(r.Docs[2].Main.Insides.More.SomeInt1, 0x42);
            Assert.AreEqual(r.Docs[2].Main.Insides.More.SomeInt2, 0x4200);
            Assert.AreEqual(r.Docs[2].Main.Insides.More.SomeInst, 0x42000000);
        }
Example #4
0
 public MainObj(KaitaiStream p__io, DefaultEndianExprInherited.Doc p__parent = null, DefaultEndianExprInherited p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root;
     _read();
 }
Example #5
0
 public DefaultEndianExprInherited(KaitaiStream p__io, KaitaiStruct p__parent = null, DefaultEndianExprInherited p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root ?? this;
     _read();
 }