Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Projet_Q4_Groupe_O4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lepl1503-2020-groupe-O4
Projet_Q4_Groupe_O4
Commits
7eb6e4fc
Commit
7eb6e4fc
authored
May 15, 2020
by
Arnaud Lefebvre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
fbd1e37d
Pipeline
#10445
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
Final Code/test.c
Final Code/test.c
+53
-0
No files found.
Final Code/test.c
0 → 100644
View file @
7eb6e4fc
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
#include <CUnit/Automated.h>
#include <pthread.h>
#include <semaphore.h>
#include <inttypes.h>
#include "fonctions.h"
/*
Test si les diviseurs premiers retournés par la fonction list_prime() sont corrects
*/
void
test_entier
(
void
)
{
list_t
*
prime2
=
prime_list
(
2
);
CU_ASSERT
(
prime2
->
first
->
value
==
2
);
clear_list_t
(
prime2
);
list_t
*
prime3
=
prime_list
(
666343
);
CU_ASSERT
(
get_node_t
(
prime3
)
==
666343
);
CU_ASSERT
(
get_node_t
(
prime3
)
==
89
);
CU_ASSERT
(
get_node_t
(
prime3
)
==
7487
);
clear_list_t
(
prime3
);
list_t
*
prime4
=
prime_list
(
2147483647
);
CU_ASSERT
(
get_node_t
(
prime4
)
==
2147483647
);
clear_list_t
(
prime4
);
}
/*
Exemple de test qui échouera
*/
void
test_failed
(
void
)
{
list_t
*
faux
=
prime_list
(
666343
);
CU_ASSERT
(
get_node_t
(
faux
)
!=
3
);
clear_list_t
(
faux
);
}
int
main
()
{
CU_initialize_registry
();
CU_pSuite
suite
=
CU_add_suite
(
"maxi_test"
,
0
,
0
);
CU_add_test
(
suite
,
"fact_entier"
,
test_entier
);
CU_add_test
(
suite
,
"fail"
,
test_failed
);
CU_basic_set_mode
(
CU_BRM_VERBOSE
);
CU_basic_run_tests
();
CU_automated_run_tests
();
CU_cleanup_registry
();
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment