MLX42
1.0
MLX42
Loading...
Searching...
No Matches
WindowFixture.hpp
Go to the documentation of this file.
1
// -----------------------------------------------------------------------------
2
// Codam Coding College, Amsterdam @ 2022-2023 by Jelle van Kraaij.
3
// See README in the root project for more information.
4
// -----------------------------------------------------------------------------
5
6
# pragma once
7
8
# include <gtest/gtest.h>
9
# include <
MLX42/MLX42.h
>
10
11
class
Window
:
public
::testing::Test
12
{
13
protected
:
14
mlx_t
*
mlx
=
nullptr
;
15
16
static
constexpr
const
char
*
name
=
"MLX42"
;
17
static
const
int32_t
height
= 400;
18
static
const
int32_t
width
= 400;
19
20
inline
void
SetUp
()
override
21
{
22
// reset error code as it is shared between tests
23
mlx_errno
=
MLX_SUCCESS
;
24
mlx_set_setting
(
MLX_HEADLESS
,
true
);
25
ASSERT_EQ
(
mlx_errno
,
MLX_SUCCESS
);
26
mlx
=
mlx_init
(
width
,
height
,
name
,
false
);
27
ASSERT_NE
(
mlx
,
nullptr
);
28
ASSERT_EQ
(
mlx_errno
,
MLX_SUCCESS
);
29
}
30
31
inline
void
TearDown
()
override
32
{
33
ASSERT_NE
(
mlx
,
nullptr
);
34
mlx_terminate
(
mlx
);
35
ASSERT_EQ
(
mlx_errno
,
MLX_SUCCESS
);
36
}
37
};
MLX42.h
mlx_init
mlx_t * mlx_init(int32_t width, int32_t height, const char *title, bool resize)
Definition
mlx_init.c:164
MLX_HEADLESS
@ MLX_HEADLESS
Definition
MLX42.h:403
mlx_set_setting
void mlx_set_setting(mlx_settings_t setting, int32_t value)
Definition
mlx_init.c:213
mlx_errno
mlx_errno
Definition
MLX42.h:371
MLX_SUCCESS
@ MLX_SUCCESS
Definition
MLX42.h:372
mlx_terminate
void mlx_terminate(mlx_t *mlx)
Definition
mlx_exit.c:36
Window
Definition
WindowFixture.hpp:12
Window::SetUp
void SetUp() override
Definition
WindowFixture.hpp:20
Window::TearDown
void TearDown() override
Definition
WindowFixture.hpp:31
height
GLint GLsizei GLsizei height
Definition
glad.h:1965
width
GLint GLsizei width
Definition
glad.h:1965
name
GLuint const GLchar * name
Definition
glad.h:3345
length
GLuint GLsizei GLsizei * length
Definition
glad.h:3372
mlx
Definition
MLX42.h:361
lib
MLX42
tests
WindowFixture.hpp
Generated by
1.9.8