Esempio n. 1
0
        public static int TestEntryPoint()
        {
            // Test that a function with HFA args gets the expected contents of the structs.

            var ds = new doublesStruct();

            ds.f1 = 1;
            ds.f2 = 2;
            ds.f3 = 3;
            ds.f4 = 4;

            var ds2 = new doublesStruct();

            ds2.f1 = 11;
            ds2.f2 = 22;
            ds2.f3 = 33;
            ds2.f4 = 44;

            var ds3 = new doublesStruct();

            ds3.f1 = 111;
            ds3.f2 = 222;
            ds3.f3 = 333;
            ds3.f4 = 444;

            return(foo(ds, ds2, ds3) ? 100 : -1);
        }
Esempio n. 2
0
        static bool foo(doublesStruct d1, doublesStruct d2, doublesStruct d3)
        {
            bool success = (d1.f1 == 1 &&
                            d1.f2 == 2 &&
                            d1.f3 == 3 &&
                            d1.f4 == 4 &&

                            d2.f1 == 11 &&
                            d2.f2 == 22 &&
                            d2.f3 == 33 &&
                            d2.f4 == 44 &&

                            d3.f1 == 111 &&
                            d3.f2 == 222 &&
                            d3.f3 == 333 &&
                            d3.f4 == 444);

            if (!success)
            {
                Console.WriteLine(string.Format("{0}, {1}, {2}, {3}", d1.f1, d1.f2, d1.f3, d1.f4));
                Console.WriteLine(string.Format("{0}, {1}, {2}, {3}", d2.f1, d2.f2, d2.f3, d2.f4));
                Console.WriteLine(string.Format("{0}, {1}, {2}, {3}", d3.f1, d3.f2, d3.f3, d3.f4));
            }

            return(success);
        }