Program made to modular programming class (PS - Programacao Sistematica).
tpimentelms / megasenha Goto Github PK
View Code? Open in Web Editor NEWProgram made to modular programming class (PS - Programacao Sistematica).
Program made to modular programming class (PS - Programacao Sistematica).
//Tests to verify if the functions are assigning values to the address that is passed
void test_VerifygetWordFirstRoundisWorking(void){
wordAndHints newWordAndHint;
wordAndHints newWordAndHint2;
FILE *file;
file = fopen("dicas_primeira_fase.txt","r");
primeira_fase(file, &(newWordAndHint));
CU_ASSERT_NOT_EQUAL(newWordAndHint.word , newWordAndHint2.word);
}
void test_VerifygetWordSecondRoundEasyisWorking(void){
wordAndHints newWordAndHint;
wordAndHints newWordAndHint2;
FILE *file;
file = fopen("dicas_primeira_fase.txt","r");
segunda_fase_facil(file, &(newWordAndHint));
CU_ASSERT_NOT_EQUAL(newWordAndHint2.word, newWordAndHint.word);
}
void test_VerifygetWordSecondRoundMediumisWorking(void){
wordAndHints newWordAndHint;
wordAndHints newWordAndHint2;
FILE *file;
file = fopen("dicas_primeira_fase.txt","r");
segunda_fase_medio(file, &(newWordAndHint));
CU_ASSERT_NOT_EQUAL(newWordAndHint2.word, newWordAndHint.word);
}
void test_VerifygetWordSecondRoundHardisWorking(void){
wordAndHints newWordAndHint;
wordAndHints newWordAndHint2;
FILE *file;
file = fopen("dicas_primeira_fase.txt","r");
segunda_fase_dificil(file, &(newWordAndHint));
CU_ASSERT_NOT_EQUAL(newWordAndHint2.word , newWordAndHint.word);
}
void test_VerifygetSizeOfRankingisWorking(void){
FILE *file;
int size;
file = fopen("ranking.txt","r");
size = getSizeOfRanking(file);
CU_ASSERT_TRUE(size!=0);
}
void test_VerifygetSizeofRankingEmptyFile(void){
int size;
FILE *file;
file = fopen("rankingEmpty.txt", "r");
size = getSizeOfRanking(file);
CU_ASSERT_EQUAL(size,0);
}
void test_VerifygetSizeofRankingNullPointer(void){
int size;
FILE *file;
size = getSizeOfRanking(file);
CU_ASSERT_EQUAL(size,0);
}
void test_VerifygetSizeofRankingSize4(void){
int size;
FILE *file;
file = fopen("rankingTest.txt", "r");
size = getSizeOfRanking(file);
CU_ASSERT_EQUAL(size,4);
}
void test_VerifywriteRankingExample(void){
Ranking ranking;
ranking.scores.nome = "Exemplo";
ranking.scores.score = 100;
writeRanking(ranking);
}
void test_VerifycountLinesisWorking(void){
CU_ASSERT_TRUE( countLines() !=0);
}
void test_VerifyreadRankingisWorking(void){
Ranking ranking;
ranking = readRanking();
CU_ASSERT_TRUE(ranking==10)
}
void adicionar_testes_smo_datas(void){
CU_pSuite suite;
/*Cria uma suite que conterá todos os testes*/
suite = CU_add_suite("Testes da smo_datas",NULL,NULL);
/*Adiciona os testes para a função DT_data_valida*/
CU_ADD_TEST(suite, test_VerifygetWordFirstRoundisWorking);
CU_ADD_TEST(suite, test_VerifygetWordSecondRoundEasyisWorking);
CU_ADD_TEST(suite, test_VerifygetWordSecondRoundMediumisWorking);
CU_ADD_TEST(suite, test_VerifygetWordSecondRoundHardisWorking);
CU_ADD_TEST(suite, test_VerifycountLinesisWorking);
CU_ADD_TEST(suite, test_VerifyreadRankingisWorking);
CU_ADD_TEST(suite, test_VerifygetSizeofRankingEmptyFile);
CU_ADD_TEST(suite, test_VerifygetSizeofRankingNullPointer);
CU_ADD_TEST(suite, test_VerifygetSizeofRankingSize4);
}
int main(void){
/Inicializa o registro de suítes e testes do CUnit/
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
/*Adiciona os testes ao registro*/
adicionar_testes_smo_datas();
/*Muda o modo do CUnit para o modo VERBOSE
O modo VERBOSE mostra algumas informacoes a
mais na hora da execucao*/
CU_basic_set_mode(CU_BRM_VERBOSE);
/*Roda os testes e mostra na tela os resultados*/
CU_basic_run_tests();
/*Limpa o registro*/
CU_cleanup_registry();
return CU_get_error();
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.