Debian Codegraph @

tests/code/testcases/testcastleinternalegl.pas

raw
1 {
2 Copyright 2023-2023 Michalis Kamburelis.
3
4 This file is part of "Castle Game Engine".
5
6 "Castle Game Engine" is free software; see the file COPYING.txt,
7 included in this distribution, for details about the copyright.
8
9 "Castle Game Engine" is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 ----------------------------------------------------------------------------
14 }
15
16 { Test CastleInternalEgl unit. }
17 unit TestCastleInternalEgl;
18
19 interface
20
21 uses CastleTester;
22
23 type
24 TTestCastleInternalEgl = class(TCastleTestCase)
25 published
26 procedure TestEglTypeSizes;
27 end;
28
29 implementation
30
31 uses SysUtils, CastleInternalEgl;
32
33 procedure TTestCastleInternalEgl.TestEglTypeSizes;
34 begin
35 { All EGLNative* types have (so far, on platforms we tested)
36 always size of pointer, and this is safest,
37 see castleinternalegl.pas comments.
38
39 If in doubt, use tests/egl_sizes_test/egl_sizes_test.c
40 to see sizes from C headers.
41
42 This testcase may then be used to test that our Pascal bindings
43 follow C sizes. For now, it is trivial, all sizes match Pointer sizes,
44 but it's not guaranteed by EGL to be always like this. }
45
46 AssertEquals(SizeOf(POinter), SizeOf(EGLNativeDisplayType));
47 AssertEquals(SizeOf(POinter), SizeOf(EGLNativeWindowType));
48 AssertEquals(SizeOf(POinter), SizeOf(EGLNativePixmapType));
49 end;
50
51 initialization
52 RegisterTest(TTestCastleInternalEgl);
53 end.