Exemplo n.º 1
0
        public void TestGetLiteralStringPointer()
        {
            var String = "Hello World";

            Assert.AreEqual(
                String,
                CLibUtils.GetStringFromPointer(CLibUtils.GetLiteralStringPointer(String))
                );
        }
Exemplo n.º 2
0
        public void TestTrinaryOperator3()
        {
            var Program = CompileProgram(@"
				int test2(char *arg) {
					int cnt;
					cnt = (strlen(arg) >= 3) ? atoi(arg + 2) : 3;
					return cnt;
				}
			"            );

            Assert.AreEqual(7, Program.GetMethod("test2").Invoke(null, new object[] { new IntPtr(CLibUtils.GetLiteralStringPointer("--7")) }));
        }