sync
This commit is contained in:
35
C/C2/test/administration_test.c
Normal file
35
C/C2/test/administration_test.c
Normal file
@@ -0,0 +1,35 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "administration.h"
|
||||
#include "unity.h"
|
||||
#include "unity_test_module.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 administration_setUp(void)
|
||||
{
|
||||
// This is run before EACH test
|
||||
}
|
||||
|
||||
void administration_tearDown(void)
|
||||
{
|
||||
// This is run after EACH test
|
||||
}
|
||||
|
||||
void test_EmptyTest(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL(1, 0);
|
||||
}
|
||||
|
||||
//add here your testcases
|
||||
|
||||
void run_administration_tests()
|
||||
{
|
||||
UnityRegisterSetupTearDown(administration_setUp, administration_tearDown);
|
||||
|
||||
MY_RUN_TEST(test_EmptyTest);
|
||||
|
||||
UnityUnregisterSetupTearDown();
|
||||
}
|
||||
|
||||
34
C/C2/test/file_element_test.c
Normal file
34
C/C2/test/file_element_test.c
Normal file
@@ -0,0 +1,34 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "file_element.h"
|
||||
#include "unity.h"
|
||||
#include "unity_test_module.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 file_element_setUp(void)
|
||||
{
|
||||
// This is run before EACH test
|
||||
}
|
||||
|
||||
void file_element_tearDown(void)
|
||||
{
|
||||
// This is run after EACH test
|
||||
}
|
||||
|
||||
void test_EmptyTest_file(void)
|
||||
{
|
||||
TEST_ASSERT_EQUAL(1, 0);
|
||||
}
|
||||
|
||||
void run_file_element_tests()
|
||||
{
|
||||
UnityRegisterSetupTearDown( file_element_setUp, file_element_tearDown);
|
||||
|
||||
MY_RUN_TEST(test_EmptyTest_file);
|
||||
|
||||
UnityUnregisterSetupTearDown();
|
||||
}
|
||||
19
C/C2/test/main.c
Normal file
19
C/C2/test/main.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#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_administration_tests();
|
||||
extern void run_file_element_tests();
|
||||
|
||||
int main (int argc, char * argv[])
|
||||
{
|
||||
UnityTestModule allModules[] = { { "administration", run_administration_tests} ,
|
||||
{ "file_element", run_file_element_tests}
|
||||
};
|
||||
|
||||
size_t number_of_modules = sizeof(allModules)/sizeof(allModules[0]);
|
||||
|
||||
return UnityTestModuleRun(argc, argv, allModules, number_of_modules);
|
||||
}
|
||||
Reference in New Issue
Block a user