예제 #1
0
        public static bool NestedLayoutClass()
        {
            string       s      = "before";
            bool         retval = true;
            SeqClass     p      = new SeqClass(0, false, s);
            NestedLayout target = new NestedLayout
            {
                value = p
            };

            TestFramework.BeginScenario("Test #4 Nested sequential layout class in a structure.");

            try
            {
                retval = SimpleNestedLayoutClassByValue(target);

                if (retval == false)
                {
                    TestFramework.LogError("01", "PInvokeTests->NestedLayoutClass : Unexpected error occured on unmanaged side");
                    return(false);
                }
            }
            catch (Exception e)
            {
                TestFramework.LogError("04", "Unexpected exception: " + e.ToString());
                retval = false;
            }

            return(retval);
        }
예제 #2
0
        public static void NestedLayoutClass()
        {
            Console.WriteLine($"Running {nameof(NestedLayoutClass)}...");

            string s      = "before";
            var    p      = new SeqClass(0, false, s);
            var    target = new NestedLayout
            {
                value = p
            };

            Assert.IsTrue(SimpleNestedLayoutClassByValue(target));
        }
예제 #3
0
 private static extern bool SimpleNestedLayoutClassByValue(NestedLayout p);