Exemplo n.º 1
0
    private static void TestPoint4U()
    {
        GenericsNative.Point4 <uint> value = GenericsNative.GetPoint4U(1u, 2u, 3u, 4u);
        Assert.AreEqual(value.e00, 1u);
        Assert.AreEqual(value.e01, 2u);
        Assert.AreEqual(value.e02, 3u);
        Assert.AreEqual(value.e03, 4u);

        GenericsNative.Point4 <uint> value2;
        GenericsNative.GetPoint4UOut(1u, 2u, 3u, 4u, &value2);
        Assert.AreEqual(value2.e00, 1u);
        Assert.AreEqual(value2.e01, 2u);
        Assert.AreEqual(value2.e02, 3u);
        Assert.AreEqual(value2.e03, 4u);

        GenericsNative.GetPoint4UOut(1u, 2u, 3u, 4u, out GenericsNative.Point4 <uint> value3);
        Assert.AreEqual(value3.e00, 1u);
        Assert.AreEqual(value3.e01, 2u);
        Assert.AreEqual(value3.e02, 3u);
        Assert.AreEqual(value3.e03, 4u);

        GenericsNative.Point4 <uint> *value4 = GenericsNative.GetPoint4UPtr(1u, 2u, 3u, 4u);
        Assert.AreEqual(value4->e00, 1u);
        Assert.AreEqual(value4->e01, 2u);
        Assert.AreEqual(value4->e02, 3u);
        Assert.AreEqual(value4->e03, 4u);

        ref readonly GenericsNative.Point4 <uint> value5 = ref GenericsNative.GetPoint4URef(1u, 2u, 3u, 4u);
Exemplo n.º 2
0
    private static void TestPoint4F()
    {
        GenericsNative.Point4 <float> value = GenericsNative.GetPoint4F(1.0f, 2.0f, 3.0f, 4.0f);
        Assert.AreEqual(value.e00, 1.0f);
        Assert.AreEqual(value.e01, 2.0f);
        Assert.AreEqual(value.e02, 3.0f);
        Assert.AreEqual(value.e03, 4.0f);

        GenericsNative.Point4 <float> value2;
        GenericsNative.GetPoint4FOut(1.0f, 2.0f, 3.0f, 4.0f, &value2);
        Assert.AreEqual(value2.e00, 1.0f);
        Assert.AreEqual(value2.e01, 2.0f);
        Assert.AreEqual(value2.e02, 3.0f);
        Assert.AreEqual(value2.e03, 4.0f);

        GenericsNative.GetPoint4FOut(1.0f, 2.0f, 3.0f, 4.0f, out GenericsNative.Point4 <float> value3);
        Assert.AreEqual(value3.e00, 1.0f);
        Assert.AreEqual(value3.e01, 2.0f);
        Assert.AreEqual(value3.e02, 3.0f);
        Assert.AreEqual(value3.e03, 4.0f);

        GenericsNative.Point4 <float> *value4 = GenericsNative.GetPoint4FPtr(1.0f, 2.0f, 3.0f, 4.0f);
        Assert.AreEqual(value4->e00, 1.0f);
        Assert.AreEqual(value4->e01, 2.0f);
        Assert.AreEqual(value4->e02, 3.0f);
        Assert.AreEqual(value4->e03, 4.0f);

        ref readonly GenericsNative.Point4 <float> value5 = ref GenericsNative.GetPoint4FRef(1.0f, 2.0f, 3.0f, 4.0f);
Exemplo n.º 3
0
    private static void TestPoint4D()
    {
        GenericsNative.Point4 <double> value = GenericsNative.GetPoint4D(1.0, 2.0, 3.0, 4.0);
        Assert.AreEqual(value.e00, 1.0);
        Assert.AreEqual(value.e01, 2.0);
        Assert.AreEqual(value.e02, 3.0);
        Assert.AreEqual(value.e03, 4.0);

        GenericsNative.Point4 <double> value2;
        GenericsNative.GetPoint4DOut(1.0, 2.0, 3.0, 4.0, &value2);
        Assert.AreEqual(value2.e00, 1.0);
        Assert.AreEqual(value2.e01, 2.0);
        Assert.AreEqual(value2.e02, 3.0);
        Assert.AreEqual(value2.e03, 4.0);

        GenericsNative.GetPoint4DOut(1.0, 2.0, 3.0, 4.0, out GenericsNative.Point4 <double> value3);
        Assert.AreEqual(value3.e00, 1.0);
        Assert.AreEqual(value3.e01, 2.0);
        Assert.AreEqual(value3.e02, 3.0);
        Assert.AreEqual(value3.e03, 4.0);

        GenericsNative.Point4 <double> *value4 = GenericsNative.GetPoint4DPtr(1.0, 2.0, 3.0, 4.0);
        Assert.AreEqual(value4->e00, 1.0);
        Assert.AreEqual(value4->e01, 2.0);
        Assert.AreEqual(value4->e02, 3.0);
        Assert.AreEqual(value4->e03, 4.0);

        ref readonly GenericsNative.Point4 <double> value5 = ref GenericsNative.GetPoint4DRef(1.0, 2.0, 3.0, 4.0);
Exemplo n.º 4
0
    private static void TestPoint4L()
    {
        GenericsNative.Point4 <long> value = GenericsNative.GetPoint4L(1L, 2L, 3L, 4L);
        Assert.AreEqual(value.e00, 1L);
        Assert.AreEqual(value.e01, 2L);
        Assert.AreEqual(value.e02, 3L);
        Assert.AreEqual(value.e03, 4L);

        GenericsNative.Point4 <long> value2;
        GenericsNative.GetPoint4LOut(1L, 2L, 3L, 4L, &value2);
        Assert.AreEqual(value2.e00, 1L);
        Assert.AreEqual(value2.e01, 2L);
        Assert.AreEqual(value2.e02, 3L);
        Assert.AreEqual(value2.e03, 4L);

        GenericsNative.GetPoint4LOut(1L, 2L, 3L, 4L, out GenericsNative.Point4 <long> value3);
        Assert.AreEqual(value3.e00, 1L);
        Assert.AreEqual(value3.e01, 2L);
        Assert.AreEqual(value3.e02, 3L);
        Assert.AreEqual(value3.e03, 4L);

        GenericsNative.Point4 <long> *value4 = GenericsNative.GetPoint4LPtr(1L, 2L, 3L, 4L);
        Assert.AreEqual(value4->e00, 1L);
        Assert.AreEqual(value4->e01, 2L);
        Assert.AreEqual(value4->e02, 3L);
        Assert.AreEqual(value4->e03, 4L);

        ref readonly GenericsNative.Point4 <long> value5 = ref GenericsNative.GetPoint4LRef(1L, 2L, 3L, 4L);