Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
83 lines (59 loc) · 1.94 KB

File metadata and controls

83 lines (59 loc) · 1.94 KB
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
Copyright (C) 2011 Markus Kauppila <markus.kauppila@gmail.com>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef _TEST_C
#define _TEST_C
#include <stdio.h>
May 23, 2011
May 23, 2011
26
#include <SDL/SDL.h>
May 26, 2011
May 26, 2011
28
#include "SDL_test.h"
May 23, 2011
May 23, 2011
29
May 27, 2011
May 27, 2011
30
/* Test cases */
May 30, 2011
May 30, 2011
31
32
static const TestCaseReference test1 =
(TestCaseReference){ "hello", "description", TEST_ENABLED, 0 };
May 27, 2011
May 27, 2011
33
May 30, 2011
May 30, 2011
34
static const TestCaseReference test2 =
May 30, 2011
May 30, 2011
35
(TestCaseReference){ "hello2", "description", TEST_ENABLED, 0 };
May 30, 2011
May 30, 2011
36
37
38
static const TestCaseReference test3 =
(TestCaseReference){ "hello3", "description", TEST_ENABLED, 0 };
May 27, 2011
May 27, 2011
39
40
41
/* Test suite */
extern const TestCaseReference *testSuite[] = {
May 30, 2011
May 30, 2011
42
&test1, &test2, &test3, NULL
May 26, 2011
May 26, 2011
43
44
};
May 23, 2011
May 23, 2011
45
May 30, 2011
May 30, 2011
46
TestCaseReference **QueryTestSuite() {
May 27, 2011
May 27, 2011
47
return (TestCaseReference **)testSuite;
May 30, 2011
May 30, 2011
50
/* Test case functions */
May 30, 2011
May 30, 2011
51
int hello(void *arg)
May 30, 2011
May 30, 2011
52
53
{
TestCaseInit();
May 26, 2011
May 26, 2011
54
May 23, 2011
May 23, 2011
55
56
57
const char *revision = SDL_GetRevision();
printf("Revision is %s\n", revision);
May 26, 2011
May 26, 2011
58
59
AssertEquals("will fail", 3, 5);
May 30, 2011
May 30, 2011
60
return TestCaseQuit();
May 30, 2011
May 30, 2011
63
int hello2(void *arg)
May 30, 2011
May 30, 2011
64
65
{
TestCaseInit();
May 26, 2011
May 26, 2011
66
67
char *msg = "eello";
May 30, 2011
May 30, 2011
68
//msg[0] = 'H';
May 26, 2011
May 26, 2011
69
May 30, 2011
May 30, 2011
70
return TestCaseQuit();
May 30, 2011
May 30, 2011
73
int hello3(void *arg)
May 30, 2011
May 30, 2011
74
75
{
TestCaseInit();
May 26, 2011
May 26, 2011
76
77
78
printf("hello3\n");
AssertEquals("passes", 3, 3);
May 23, 2011
May 23, 2011
79
May 30, 2011
May 30, 2011
80
return TestCaseQuit();