added more tests and helper macros
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
#include "../includes/Pickler.h"
|
||||
#include "Pickler.h"
|
||||
void testing() {
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[]) {
|
||||
|
||||
pickle_shelf __pickle_shelf__ = pickle_shelf();
|
||||
pickle_shelf __pickle_shelf = pickle_shelf();
|
||||
|
||||
CREATEJAR(Pickle_Logic_Tests);
|
||||
CREATEJAR(Pickle_Deffinition_Test);
|
||||
|
||||
PICKLE(Add_Pickle_Test){
|
||||
CREATEJAR(PickleAddTest);
|
||||
struct pickle p = {"Pickle_Test","testing", true};
|
||||
@@ -22,21 +23,62 @@ int main (int argc, char *argv[]) {
|
||||
if(DIFFERENT(test_jar.functionCount, PickleAddTest.functionCount)) {
|
||||
ASSERT("functionCount not the same", false);
|
||||
}
|
||||
ASSERT("",true);
|
||||
ASSERT("Good",true);
|
||||
}();
|
||||
|
||||
PICKLE(Test_SAME){
|
||||
ASSERT("This test should succsead", SAME(2,2));
|
||||
}();
|
||||
PICKLE(Test_DIFFERENT){
|
||||
ASSERT("This is testing if this works", DIFFERENT(1,2));
|
||||
}();
|
||||
|
||||
PICKLE(Test_INSTALLSHELF) {
|
||||
struct pickle_shelf shelf = {0,0,true};
|
||||
INSTALLSHELF;
|
||||
if(DIFFERENT(shelf.passed, __pickle_shelf__.passed))
|
||||
ASSERT("var passed not the same",false);
|
||||
if(DIFFERENT(shelf.pickle_jarCount, __pickle_shelf__.pickle_jarCount))
|
||||
ASSERT("var pickle_jarCount not the same",false);
|
||||
if(DIFFERENT(shelf.pickle_jars, __pickle_shelf__.pickle_jars))
|
||||
ASSERT("var pickle_jars not the same",false);
|
||||
ASSERT("Good",true);
|
||||
}();
|
||||
|
||||
PICKLE(Test_PICKLESHELF) {
|
||||
{
|
||||
INSTALLSHELF;
|
||||
CREATEJAR(PICKLESHELF_Test_Jar);
|
||||
PICKLE(test) {ASSERT("Good", true);}();
|
||||
ADDPICKLE(PICKLESHELF_Test_Jar,test);
|
||||
PUTJARONSHELF(PICKLESHELF_Test_Jar);
|
||||
|
||||
if(DIFFERENT(PICKLESHELF, 0))
|
||||
ASSERT("Pickle Shelf not good", false);
|
||||
}
|
||||
{
|
||||
INSTALLSHELF;
|
||||
CREATEJAR(PICKLESHELF_Test_Jar);
|
||||
PICKLE(test) {ASSERT("Should Failed", false);}();
|
||||
ADDPICKLE(PICKLESHELF_Test_Jar,test);
|
||||
PUTJARONSHELF(PICKLESHELF_Test_Jar);
|
||||
|
||||
if(SAME(PICKLESHELF, 0))
|
||||
ASSERT("Pickle Shelf not good", false);
|
||||
}
|
||||
ASSERT("Good",true);
|
||||
}();
|
||||
|
||||
|
||||
|
||||
ADDPICKLE(Pickle_Deffinition_Test,Add_Pickle_Test);
|
||||
ADDPICKLE(Pickle_Deffinition_Test,Test_INSTALLSHELF);
|
||||
ADDPICKLE(Pickle_Logic_Tests,Test_PICKLESHELF);
|
||||
ADDPICKLE(Pickle_Logic_Tests,Test_SAME);
|
||||
ADDPICKLE(Pickle_Logic_Tests,Test_DIFFERENT);
|
||||
PUTJARONSHLEF(Pickle_Logic_Tests);
|
||||
PUTJARONSHLEF(Pickle_Deffinition_Test);
|
||||
PUTJARONASHELF(__pickle_shelf,Pickle_Logic_Tests);
|
||||
PUTJARONASHELF(__pickle_shelf,Pickle_Deffinition_Test);
|
||||
|
||||
return __pickle_shelf_run(&__pickle_shelf__);
|
||||
;
|
||||
return __pickle_shelf_run(&__pickle_shelf);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user