[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
- [V2][PATH 0/6] Explicit_bzero improvement, roucaries . bastien, 2020/04/11
- [PATCH 1/6] Use memset_s if possible for explicit_bzero, roucaries . bastien, 2020/04/11
- [PATCH 2/6] Use SecureZeroMemory on windows for explicit_bzero, roucaries . bastien, 2020/04/11
- [PATCH 3/6] Support clang for explicit_bzero, roucaries . bastien, 2020/04/11
- [PATCH 4/6] Implement fallback for explicit_bzero using jump to volatile pointer, roucaries . bastien, 2020/04/11
- [PATCH 5/6] Improve styling in explicit_bzero, roucaries . bastien, 2020/04/11
- [PATCH 6/6] Add test for explicit_bzero,
roucaries . bastien <=
- Re: [V2][PATH 0/6] Explicit_bzero improvement, Bruno Haible, 2020/04/12