Skip to content
Extraits de code Groupes Projets
Valider 4cd9209a rédigé par Axel Legay's avatar Axel Legay
Parcourir les fichiers

Update ex-lepl1503.c

parent d153797d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -17,6 +17,12 @@ void test_maxifailed(void) /*Exemple de test qui échouera */ ...@@ -17,6 +17,12 @@ void test_maxifailed(void) /*Exemple de test qui échouera */
CU_ASSERT(maxi(0,2)==3); CU_ASSERT(maxi(0,2)==3);
} }
void erreurmalloc(void){
char *buffer;
buffer=malloc(3*sizeof(char));
buffer[3]='a'; /*Accès hors tableau*/
}
int main() { int main() {
CU_initialize_registry(); CU_initialize_registry();
CU_pSuite suite = CU_add_suite("maxi_test", 0, 0); CU_pSuite suite = CU_add_suite("maxi_test", 0, 0);
...@@ -28,5 +34,6 @@ int main() { ...@@ -28,5 +34,6 @@ int main() {
CU_automated_run_tests(); CU_automated_run_tests();
CU_cleanup_registry(); CU_cleanup_registry();
erreurmalloc();
return 0; return 0;
} }
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter