Added assertEquals(Uint32, Uint32) function
authorMarkus Kauppila <markus.kauppila@gmail.com>
Mon, 23 May 2011 13:14:09 +0300
changeset 5661 8e1868d46268
parent 5660 8aec500a7299
child 5662 57fc58008d76
Added assertEquals(Uint32, Uint32) function
test/test-automation/Makefile.in
test/test-automation/asserts.h
test/test-automation/test.c
--- a/test/test-automation/Makefile.in	Mon May 23 10:43:49 2011 +0300
+++ b/test/test-automation/Makefile.in	Mon May 23 13:14:09 2011 +0300
@@ -25,13 +25,16 @@
 runner: $(SRC)
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+
 
+asserts.o: asserts.c
+	$(CC) $(CFLAGS) -c $+ -o $@
+
 tests: $(ALL_TESTS)
 
-libtest.so: test.o
+libtest.so: test.o asserts.o
 	$(CC) -shared -wl,-soname,$@ -o $@ $(LDFLAGS) $+
 
-test.o: $(TEST_SRC)
-	$(CC) -fPIC $(CFLAGS) -c $+ -o $@
+test.o: $(TEST_SRC) 
+	$(CC) -fPIC $(CFLAGS) -c $+ -o $@ 
 
 Makefile: Makefile.in config.status
 	$(SHELL) /config.status $@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/test-automation/asserts.h	Mon May 23 13:14:09 2011 +0300
@@ -0,0 +1,29 @@
+/*
+  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
--- a/test/test-automation/test.c	Mon May 23 10:43:49 2011 +0300
+++ b/test/test-automation/test.c	Mon May 23 13:14:09 2011 +0300
@@ -23,14 +23,21 @@
 
 #include <stdio.h>
 
-char *names[] = {"hello", "hello2", "hello3"};
+#include <SDL/SDL.h>
+
+#include "asserts.h"
 
-char **suite() {
+const char *names[] = {"hello", "hello2", "hello3"};
+
+const char **suite() {
 	return names;
 }
 
 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) {
@@ -40,6 +47,8 @@
 
 void hello3(void *arg) {
 	printf("hello\n");
+
+	assertEquals(3, 3);
 }
 
 #endif