# Autogenerated from KST: please remove this line if doing any edits by hand!

import unittest

from expr_calc_array_ops import ExprCalcArrayOps

class TestExprCalcArrayOps(unittest.TestCase):
    def test_expr_calc_array_ops(self):
        with ExprCalcArrayOps.from_file('src/fixed_struct.bin') as r:

            self.assertEqual(r.int_array_size, 7)
            self.assertEqual(r.int_array_first, 10)
            self.assertEqual(r.int_array_mid, 25)
            self.assertEqual(r.int_array_last, 1000)
            self.assertEqual(r.int_array_min, 10)
            self.assertEqual(r.int_array_max, 1000)
            self.assertEqual(r.double_array_size, 5)
            self.assertAlmostEqual(r.double_array_first, 10.0, 6)
            self.assertAlmostEqual(r.double_array_mid, 25.0, 6)
            self.assertAlmostEqual(r.double_array_last, 3.14159, 6)
            self.assertAlmostEqual(r.double_array_min, 3.14159, 6)
            self.assertAlmostEqual(r.double_array_max, 100.0, 6)
            self.assertEqual(r.str_array_size, 4)
            self.assertEqual(r.str_array_first, u"un")
            self.assertEqual(r.str_array_mid, u"deux")
            self.assertEqual(r.str_array_last, u"quatre")
            self.assertEqual(r.str_array_min, u"deux")
            self.assertEqual(r.str_array_max, u"un")
