aboutsummaryrefslogtreecommitdiff
path: root/src/env
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-01-04 20:36:02 -0300
committerEuAndreh <eu@euandre.org>2024-01-05 05:47:09 -0300
commit8492f115890d56c98c1da24b9fdf26bb1b714c05 (patch)
tree7d90469d2aff11c2e4c8e99e7b46aa8e8eb43008 /src/env
parentFix the build system. (diff)
downloadgrovel-8492f115890d56c98c1da24b9fdf26bb1b714c05.tar.gz
grovel-8492f115890d56c98c1da24b9fdf26bb1b714c05.tar.xz
Setup stub unit test infrastructure
Diffstat (limited to 'src/env')
-rw-r--r--src/env/__environ.c8
-rw-r--r--src/env/__init_tls.c8
-rw-r--r--src/env/__libc_start_main.c8
-rw-r--r--src/env/__reset_tls.c8
-rw-r--r--src/env/__stack_chk_fail.c8
-rw-r--r--src/env/clearenv.c8
-rw-r--r--src/env/getenv.c8
-rw-r--r--src/env/putenv.c8
-rw-r--r--src/env/secure_getenv.c8
-rw-r--r--src/env/setenv.c8
-rw-r--r--src/env/unsetenv.c8
11 files changed, 88 insertions, 0 deletions
diff --git a/src/env/__environ.c b/src/env/__environ.c
index fe8abcf9..0f71d82d 100644
--- a/src/env/__environ.c
+++ b/src/env/__environ.c
@@ -4,3 +4,11 @@ char **__environ = 0;
weak_alias(__environ, ___environ);
weak_alias(__environ, _environ);
weak_alias(__environ, environ);
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif
diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c
index a93141ed..6412eee8 100644
--- a/src/env/__init_tls.c
+++ b/src/env/__init_tls.c
@@ -151,3 +151,11 @@ static void static_init_tls(size_t *aux)
}
weak_alias(static_init_tls, __init_tls);
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif
diff --git a/src/env/__libc_start_main.c b/src/env/__libc_start_main.c
index c5b277bd..a58bc4bb 100644
--- a/src/env/__libc_start_main.c
+++ b/src/env/__libc_start_main.c
@@ -95,3 +95,11 @@ static int libc_start_main_stage2(int (*main)(int,char **,char **), int argc, ch
exit(main(argc, argv, envp));
return 0;
}
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif
diff --git a/src/env/__reset_tls.c b/src/env/__reset_tls.c
index 15685bc6..af09c9a2 100644
--- a/src/env/__reset_tls.c
+++ b/src/env/__reset_tls.c
@@ -13,3 +13,11 @@ void __reset_tls()
memset(mem+p->len, 0, p->size - p->len);
}
}
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif
diff --git a/src/env/__stack_chk_fail.c b/src/env/__stack_chk_fail.c
index e5352602..82d401d3 100644
--- a/src/env/__stack_chk_fail.c
+++ b/src/env/__stack_chk_fail.c
@@ -29,3 +29,11 @@ void __stack_chk_fail(void)
hidden void __stack_chk_fail_local(void);
weak_alias(__stack_chk_fail, __stack_chk_fail_local);
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif
diff --git a/src/env/clearenv.c b/src/env/clearenv.c
index db8e8e94..cc25b5bd 100644
--- a/src/env/clearenv.c
+++ b/src/env/clearenv.c
@@ -12,3 +12,11 @@ int clearenv()
if (e) while (*e) __env_rm_add(*e++, 0);
return 0;
}
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif
diff --git a/src/env/getenv.c b/src/env/getenv.c
index a90d39cf..076a3c3f 100644
--- a/src/env/getenv.c
+++ b/src/env/getenv.c
@@ -11,3 +11,11 @@ char *getenv(const char *name)
return *e + l+1;
return 0;
}
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif
diff --git a/src/env/putenv.c b/src/env/putenv.c
index dce8c828..a0b1ef8d 100644
--- a/src/env/putenv.c
+++ b/src/env/putenv.c
@@ -44,3 +44,11 @@ int putenv(char *s)
if (!l || !s[l]) return unsetenv(s);
return __putenv(s, l, 0);
}
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif
diff --git a/src/env/secure_getenv.c b/src/env/secure_getenv.c
index 72322f81..55e0c8c0 100644
--- a/src/env/secure_getenv.c
+++ b/src/env/secure_getenv.c
@@ -6,3 +6,11 @@ char *secure_getenv(const char *name)
{
return libc.secure ? NULL : getenv(name);
}
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif
diff --git a/src/env/setenv.c b/src/env/setenv.c
index c5226b6d..c712c05b 100644
--- a/src/env/setenv.c
+++ b/src/env/setenv.c
@@ -40,3 +40,11 @@ int setenv(const char *var, const char *value, int overwrite)
memcpy(s+l1+1, value, l2+1);
return __putenv(s, l1, s);
}
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif
diff --git a/src/env/unsetenv.c b/src/env/unsetenv.c
index b14c4c92..11f8ff25 100644
--- a/src/env/unsetenv.c
+++ b/src/env/unsetenv.c
@@ -26,3 +26,11 @@ int unsetenv(const char *name)
}
return 0;
}
+
+
+#ifdef TEST
+int
+main(void) {
+ return 0;
+}
+#endif