C ordening
This commit is contained in:
16
C/C(extra) ExtraAssignments/Skater/test/main.c
Normal file
16
C/C(extra) ExtraAssignments/Skater/test/main.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "unity_test_module.h"
|
||||
|
||||
/* As an alternative for header files we can declare that
|
||||
* the following methos are available 'extern'ally.
|
||||
*/
|
||||
extern void run_skater_tests();
|
||||
|
||||
int main (int argc, char * argv[])
|
||||
{
|
||||
UnityTestModule allModules[] = { { "skater", run_skater_tests}
|
||||
};
|
||||
|
||||
size_t number_of_modules = sizeof(allModules)/sizeof(allModules[0]);
|
||||
|
||||
return UnityTestModuleRun(argc, argv, allModules, number_of_modules);
|
||||
}
|
||||
41
C/C(extra) ExtraAssignments/Skater/test/skater_test.c
Normal file
41
C/C(extra) ExtraAssignments/Skater/test/skater_test.c
Normal file
@@ -0,0 +1,41 @@
|
||||
#include <string.h>
|
||||
// add your include here
|
||||
#include "unity.h"
|
||||
#include "unity_test_module.h"
|
||||
#include "skater.h"
|
||||
|
||||
|
||||
// I rather dislike keeping line numbers updated, so I made my own
|
||||
// macro to ditch the line number
|
||||
#define MY_RUN_TEST(func) RUN_TEST(func, 0)
|
||||
|
||||
void skater_setUp(void)
|
||||
{
|
||||
// This is run before EACH test
|
||||
}
|
||||
|
||||
void skater_tearDown(void)
|
||||
{
|
||||
// This is run after EACH test
|
||||
}
|
||||
|
||||
|
||||
// TODO:
|
||||
// - Rename and change this test to something usefull
|
||||
// - Add more tests
|
||||
// - Remove this comment :)
|
||||
// Should you need a list of all TEST_ASSERT macros: take a look
|
||||
// at unity.h
|
||||
void test_skater_EmptyTest(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL(1, 0);
|
||||
}
|
||||
|
||||
void run_skater_tests()
|
||||
{
|
||||
UnityRegisterSetupTearDown( skater_setUp, skater_tearDown);
|
||||
|
||||
MY_RUN_TEST(test_skater_EmptyTest);
|
||||
|
||||
UnityUnregisterSetupTearDown();
|
||||
}
|
||||
Reference in New Issue
Block a user