Beispiel #1
0
        public void Int32Test()
        {
            int clr = int.MaxValue / 2;

            var v = IshtarMarshal.ToIshtarObject(clr);
            var r = IshtarMarshal.ToDotnetInt32(v, null);

            Assert.AreEqual(clr, r);
        }
Beispiel #2
0
        public unsafe void CorrectAllocateArray()
        {
            if (VM.watcher is DefaultWatchDog)
            {
                VM.watcher = new TestWatchDog();
            }

            var array = IshtarGC.AllocArray(VeinTypeCode.TYPE_I4.AsRuntimeClass(), 10, 1);

            Assert.AreEqual(10UL, array->length);
            Assert.AreEqual(1UL, array->rank);

            foreach (var i in..10)
            {
                array->Set((uint)i, IshtarMarshal.ToIshtarObject(88 * i));
            }

            foreach (var i in..10)
            {
                var obj = array->Get((uint)i);
                Assert.AreEqual(i * 88, IshtarMarshal.ToDotnetInt32(obj, null));
            }
        }