Пример #1
0
        public void Equal_int()
        {
            // arrange
            const int NumElements = 4;
            var       targetData  = new bool[NumElements];
            var       src1Data    = new[] { 0, 0, 1, 1 };
            var       src2Data    = new[] { 0, 1, 0, 1 };

            var target = new DataAndLayout <bool>(targetData, new FastAccess(new Layout(new int[] { NumElements }, 0, new int[] { 1 })));
            var src1   = new DataAndLayout <int>(src1Data, new FastAccess(new Layout(new int[] { NumElements }, 0, new int[] { 1 })));
            var src2   = new DataAndLayout <int>(src2Data, new FastAccess(new Layout(new int[] { NumElements }, 0, new int[] { 1 })));

            // action
            ScalarOps.Equal(target, src1, src2);

            // assert
            CollectionAssert.AreEqual(new[] { true, false, false, true }, targetData);
        }