Projet Informatique Théorique 2016
Instructions et Documentation
test_automate_vide.c
1 /*
2  * Ce fichier fait partie d'un projet de programmation donné en Licence 3
3  * à l'Université de Bordeaux
4  *
5  * Copyright (C) 2015 Adrien Boussicault
6  *
7  * This Library is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This Library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this Library. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 #include "automate.h"
23 #include "outils.h"
24 
25 
26 int test_automate_vide(){
27 
28  int result = 1;
29 
30  Automate * automate = creer_automate();
31 
32  TEST(
33  1
34  && automate
35  && ! est_un_etat_de_l_automate( automate, 0)
36  && ! est_un_etat_final_de_l_automate( automate, 0)
37  && ! est_un_etat_initial_de_l_automate( automate, 0)
38  && ! est_une_lettre_de_l_automate( automate, 'a')
39  && ! est_une_transition_de_l_automate( automate, 0, 'a', 0 )
40  , result
41  );
42 
43  liberer_automate( automate );
44 
45  return result;
46 
47 }
48 
49 
50 int main(){
51 
52  if( ! test_automate_vide() ){ return 1; }
53 
54  return 0;
55 }
Le type d'un automate.
Definition: automate.h:39
void liberer_automate(Automate *automate)
Détruit un automate.
Definition: automate.c:168
int est_une_transition_de_l_automate(const Automate *automate, int origine, char lettre, int fin)
Renvoie 1 si ('origine', 'lettre', 'fin') est une transition de l'automate et 0 sinon.
Definition: automate.c:392
int est_un_etat_initial_de_l_automate(const Automate *automate, int etat)
Renvoie 1 si ('etat') est un état initial de l'automate et 0 sinon.
Definition: automate.c:403
int est_une_lettre_de_l_automate(const Automate *automate, char lettre)
Renvoie 1 si ('etat') est une lettre de l'automate et 0 sinon.
Definition: automate.c:411
int est_un_etat_de_l_automate(const Automate *automate, int etat)
Renvoie 1 si ('etat') est un état de l'automate et 0 sinon.
Definition: automate.c:399
int est_un_etat_final_de_l_automate(const Automate *automate, int etat)
Renvoie 1 si ('etat') est un état final initial de l'automate et 0 sinon.
Definition: automate.c:407
Automate * creer_automate()
Crée un automate vide, sans états, sans lettres et sans transitions.
Definition: automate.c:91