Commit 850eb7ba authored by Markus Kauppila's avatar Markus Kauppila

Added assertEquals(Uint32, Uint32) function

parent 87553ecc
...@@ -25,9 +25,12 @@ all: runner $(ALL_TESTS) ...@@ -25,9 +25,12 @@ all: runner $(ALL_TESTS)
runner: $(SRC) runner: $(SRC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
asserts.o: asserts.c
$(CC) $(CFLAGS) -c $+ -o $@
tests: $(ALL_TESTS) tests: $(ALL_TESTS)
libtest.so: test.o libtest.so: test.o asserts.o
$(CC) -shared -wl,-soname,$@ -o $@ $(LDFLAGS) $+ $(CC) -shared -wl,-soname,$@ -o $@ $(LDFLAGS) $+
test.o: $(TEST_SRC) test.o: $(TEST_SRC)
......
/*
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 _ASSERTS_H
#define _ASSERTS_H
#include <SDL/SDL.h>
void assertEquals(Uint32 expected, Uint32 actual);
#endif
...@@ -23,14 +23,21 @@ ...@@ -23,14 +23,21 @@
#include <stdio.h> #include <stdio.h>
char *names[] = {"hello", "hello2", "hello3"}; #include <SDL/SDL.h>
char **suite() { #include "asserts.h"
const char *names[] = {"hello", "hello2", "hello3"};
const char **suite() {
return names; return names;
} }
void hello(void *arg){ void hello(void *arg){
printf("hello\n"); const char *revision = SDL_GetRevision();
printf("Revision is %s\n", revision);
assertEquals(3, 5);
} }
void hello2(void *arg) { void hello2(void *arg) {
...@@ -40,6 +47,8 @@ void hello2(void *arg) { ...@@ -40,6 +47,8 @@ void hello2(void *arg) {
void hello3(void *arg) { void hello3(void *arg) {
printf("hello\n"); printf("hello\n");
assertEquals(3, 3);
} }
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment