public ExprCalcArrayOps(KaitaiStream p__io, KaitaiStruct p__parent = null, ExprCalcArrayOps p__root = null) : base(p__io)
 {
     m_parent           = p__parent;
     m_root             = p__root ?? this;
     f_doubleArray      = false;
     f_intArraySize     = false;
     f_intArrayMax      = false;
     f_doubleArrayMax   = false;
     f_strArrayMax      = false;
     f_strArrayMin      = false;
     f_doubleArrayMid   = false;
     f_strArray         = false;
     f_doubleArraySize  = false;
     f_strArrayFirst    = false;
     f_strArrayLast     = false;
     f_strArrayMid      = false;
     f_doubleArrayLast  = false;
     f_intArrayMin      = false;
     f_strArraySize     = false;
     f_intArrayFirst    = false;
     f_doubleArrayFirst = false;
     f_intArrayMid      = false;
     f_doubleArrayMin   = false;
     f_intArray         = false;
     f_intArrayLast     = false;
     _read();
 }
示例#2
0
        public void TestExprCalcArrayOps()
        {
            var r = ExprCalcArrayOps.FromFile(SourceFile("fixed_struct.bin"));

            Assert.AreEqual(r.IntArraySize, 7);
            Assert.AreEqual(r.IntArrayFirst, 10);
            Assert.AreEqual(r.IntArrayMid, 25);
            Assert.AreEqual(r.IntArrayLast, 1000);
            Assert.AreEqual(r.IntArrayMin, 10);
            Assert.AreEqual(r.IntArrayMax, 1000);
            Assert.AreEqual(r.DoubleArraySize, 5);
            Assert.AreEqual(r.DoubleArrayFirst, 10.0, 1e-6);
            Assert.AreEqual(r.DoubleArrayMid, 25.0, 1e-6);
            Assert.AreEqual(r.DoubleArrayLast, 3.14159, 1e-6);
            Assert.AreEqual(r.DoubleArrayMin, 3.14159, 1e-6);
            Assert.AreEqual(r.DoubleArrayMax, 100.0, 1e-6);
            Assert.AreEqual(r.StrArraySize, 4);
            Assert.AreEqual(r.StrArrayFirst, "un");
            Assert.AreEqual(r.StrArrayMid, "deux");
            Assert.AreEqual(r.StrArrayLast, "quatre");
            Assert.AreEqual(r.StrArrayMin, "deux");
            Assert.AreEqual(r.StrArrayMax, "un");
        }