Exemplo n.º 1
0
    public static int Main()
    {
        MySystemTime st = new MySystemTime();

        GetSystemTime(st);

        Console.WriteLine("Today's date is : {0:0000}-{1:00}-{2:00}", st.Year, st.Month, st.Day);
        Console.WriteLine("The time now is : {0:00}:{1:00}:{2:00}", st.Hour, st.Minute, st.Second);

        Rect r = new Rect();

        r.left   = 10;
        r.top    = 12;
        r.right  = 30;
        r.bottom = 30;

        Point p = new Point();

        p.x = 15;
        p.y = 20;

        if (!PtInRect(ref r, p))
        {
            return(1);
        }

        A a = new A();

        a.a = 0x12345678;

        if (a.b1 != 0x78)
        {
            return(2);
        }
        if (a.b2 != 0x56)
        {
            return(3);
        }
        if (a.b3 != 0x34)
        {
            return(4);
        }
        if (a.b4 != 0x12)
        {
            return(5);
        }

        Console.WriteLine("Point lies inside rect");
        Console.WriteLine("Test passes");
        return(0);
    }
Exemplo n.º 2
0
	public static int Main () {

		MySystemTime st = new MySystemTime ();

		GetSystemTime (st);

		Console.WriteLine ("Today's date is : {0:0000}-{1:00}-{2:00}", st.Year, st.Month, st.Day);
		Console.WriteLine ("The time now is : {0:00}:{1:00}:{2:00}", st.Hour, st.Minute, st.Second);

		Rect r = new Rect ();

		r.left = 10;
		r.top  = 12;
		r.right = 30;
		r.bottom = 30;

		Point p = new Point ();

		p.x = 15;
		p.y = 20;

		if (!PtInRect (ref r, p))
			return 1;

		A a = new A ();

		a.a = 0x12345678;

		if (a.b1 != 0x78)
			return 2;
		if (a.b2 != 0x56)
			return 3;
		if (a.b3 != 0x34)
			return 4;
		if (a.b4 != 0x12)
			return 5;
		
		Console.WriteLine ("Point lies inside rect");
		Console.WriteLine ("Test passes");
		return 0;
	}
Exemplo n.º 3
0
	public static extern void GetSystemTime (MySystemTime st);
Exemplo n.º 4
0
 public static extern void GetSystemTime(MySystemTime st);