Ejemplo n.º 1
0
        public void AddTest()
        {
            BddGCache target = new BddGCache();

            int u1 = 4;
            int u2 = 5;
            Op  op = Op.DIS;
            int u  = 0;

            target.Add(u1, u2, op, u);

            BddSharp_Kernel_BddGCacheAccessor accessor = new BddSharp_Kernel_BddGCacheAccessor(target);

            BddGCacheEntry[] temp   = accessor.cacheArray;
            bool             result = false;

            foreach (BddGCacheEntry en in temp)
            {
                if (en.op == op && en.u1 == u1 && en.u2 == u2)
                {
                    result = true;
                    break;
                }
            }
            Assert.AreEqual(true, result);
        }
Ejemplo n.º 2
0
        public void ClearTest()
        {
            BddGCache target = new BddGCache();
            BddSharp_Kernel_BddGCacheAccessor ass = new BddSharp_Kernel_BddGCacheAccessor(target);

            BddGCacheEntry[] temp = ass.cacheArray;

            target.Clear();
            BddGCacheEntry[] temp2 = ass.cacheArray;
            Assert.AreNotSame(temp, temp2);
        }
Ejemplo n.º 3
0
        public void ItemTest()
        {
            BddGCache target = new BddGCache();

            int u1 = 45;

            int u2 = 876;

            Op  op = Op.INV_IMPL;
            int u  = 647;

            target.Add(u1, u2, op, u);


            Assert.AreEqual(u, target[u1, u2, op], "BddSharp.Kernel.BddGCache.this was not set correctly.");
        }
Ejemplo n.º 4
0
        public void ContainsKeyTest()
        {
            BddGCache target = new BddGCache();

            int u1 = 45;

            int u2 = 876;

            Op  op = Op.INV_IMPL;
            int u  = 647;

            target.Add(u1, u2, op, u);
            bool expected = true;
            bool actual;

            actual = target.ContainsKey(u1, u2, op);

            Assert.AreEqual(expected, actual, "BddSharp.Kernel.BddGCache.ContainsKey did not return the expected value.");
            Assert.IsFalse(target.ContainsKey(2, 4, Op.NAND));
        }
Ejemplo n.º 5
0
        public void ConstructorTest()
        {
            BddGCache target = new BddGCache();

            Assert.IsNotNull(target);
        }