bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 6/6] Add test for explicit_bzero


From: roucaries . bastien
Subject: [PATCH 6/6] Add test for explicit_bzero
Date: Sun, 12 Apr 2020 02:48:27 +0200

From: Bastien Roucariès <address@hidden>

Simple test

Signed-off-by: Bastien Roucariès <address@hidden>
---
 tests/test-explicit_bzero.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 tests/test-explicit_bzero.c

diff --git a/tests/test-explicit_bzero.c b/tests/test-explicit_bzero.c
new file mode 100644
index 000000000..902866cdd
--- /dev/null
+++ b/tests/test-explicit_bzero.c
@@ -0,0 +1,34 @@
+/* Test of asinl() function.
+   Copyright (C) 2010-2020 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bastien Roucariès <address@hidden>  */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "macros.h"
+
+char hello[] = "hello";
+
+int
+main ()
+{
+  explicit_bzero(hello,sizeof(hello));
+  ASSERT (hello[0]==0);
+
+  return 0;
+}
-- 
2.25.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]