public void TestExprBytesOps()
        {
            var r = ExprBytesOps.FromFile(SourceFile("fixed_struct.bin"));

            Assert.AreEqual(r.OneSize, 3);
            Assert.AreEqual(r.OneFirst, 80);
            Assert.AreEqual(r.OneMid, 65);
            Assert.AreEqual(r.OneLast, 67);
            Assert.AreEqual(r.OneMin, 65);
            Assert.AreEqual(r.OneMax, 80);
            Assert.AreEqual(r.TwoSize, 3);
            Assert.AreEqual(r.TwoFirst, 65);
            Assert.AreEqual(r.TwoMid, 67);
            Assert.AreEqual(r.TwoLast, 75);
            Assert.AreEqual(r.TwoMin, 65);
            Assert.AreEqual(r.TwoMax, 75);
        }
 public ExprBytesOps(KaitaiStream p__io, KaitaiStruct p__parent = null, ExprBytesOps p__root = null) : base(p__io)
 {
     m_parent   = p__parent;
     m_root     = p__root ?? this;
     f_twoLast  = false;
     f_twoMax   = false;
     f_oneMin   = false;
     f_oneFirst = false;
     f_oneMid   = false;
     f_two      = false;
     f_twoMin   = false;
     f_twoMid   = false;
     f_oneSize  = false;
     f_oneLast  = false;
     f_twoSize  = false;
     f_oneMax   = false;
     f_twoFirst = false;
     _read();
 }
Пример #3
0
        public void TestExprBytesOps()
        {
            var r = ExprBytesOps.FromFile(SourceFile("nav_parent_switch.bin"));

            Assert.AreEqual(r.OneSize, 3);
            Assert.AreEqual(r.OneFirst, 1);
            Assert.AreEqual(r.OneMid, 66);
            Assert.AreEqual(r.OneLast, 255);
            Assert.AreEqual(Convert.ToString((long)(r.OneLast), 10), "255");
            Assert.AreEqual(r.OneMin, 1);
            Assert.AreEqual(r.OneMax, 255);
            Assert.AreEqual(Convert.ToString((long)(r.OneMax), 10), "255");
            Assert.AreEqual(r.TwoSize, 3);
            Assert.AreEqual(r.TwoFirst, 65);
            Assert.AreEqual(r.TwoMid, 255);
            Assert.AreEqual(Convert.ToString((long)(r.TwoMid), 10), "255");
            Assert.AreEqual(r.TwoLast, 75);
            Assert.AreEqual(r.TwoMin, 65);
            Assert.AreEqual(r.TwoMax, 255);
            Assert.AreEqual(Convert.ToString((long)(r.TwoMax), 10), "255");
        }