diff mbox series

testsuite: avoid standard includes in the tests

Message ID 20191128222712.7972-1-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series testsuite: avoid standard includes in the tests | expand

Commit Message

Luc Van Oostenryck Nov. 28, 2019, 10:27 p.m. UTC
These headers are often complex and full of implementation
specificities. They have no place in the testsuite.

So, remove these includes and replace them by the prototype
of the function being used.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 validation/backend/hello.c | 2 +-
 validation/backend/sum.c   | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/validation/backend/hello.c b/validation/backend/hello.c
index b0e514be4..eb89846f0 100644
--- a/validation/backend/hello.c
+++ b/validation/backend/hello.c
@@ -1,4 +1,4 @@ 
-#include <stdio.h>
+int puts(const char *s);
 
 int main(int argc, char *argv[])
 {
diff --git a/validation/backend/sum.c b/validation/backend/sum.c
index fa51120e1..38ebf41ed 100644
--- a/validation/backend/sum.c
+++ b/validation/backend/sum.c
@@ -1,5 +1,4 @@ 
-#include <stdio.h>
-#include <stdlib.h>
+int printf(const char * fmt, ...);
 
 static int sum(int n)
 {