85 lines
2.7 KiB
C++
85 lines
2.7 KiB
C++
#include "Pickler.h"
|
|
void testing() {
|
|
}
|
|
|
|
int main (int argc, char *argv[]) {
|
|
|
|
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};
|
|
ADDPICKLE(PickleAddTest,p);
|
|
struct pickle_jar test_jar = { "PickleAddTest", &p, 1, true};
|
|
if(DIFFERENT(PickleAddTest.passed ,test_jar.passed)) {
|
|
ASSERT("PickleAddTest.passed and test_jar.passed different", false);
|
|
}
|
|
if(DIFFERENT(test_jar.name, PickleAddTest.name)) {
|
|
ASSERT("Name Not the Same",false);
|
|
}
|
|
if(DIFFERENT(test_jar.functionCount, PickleAddTest.functionCount)) {
|
|
ASSERT("functionCount not the same", false);
|
|
}
|
|
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);
|
|
PUTJARONASHELF(__pickle_shelf,Pickle_Logic_Tests);
|
|
PUTJARONASHELF(__pickle_shelf,Pickle_Deffinition_Test);
|
|
|
|
return __pickle_shelf_run(&__pickle_shelf);
|
|
}
|
|
|