summaryrefslogtreecommitdiffstats
path: root/private/ntos/rtl/alpha/tfilmem.c
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/rtl/alpha/tfilmem.c
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/ntos/rtl/alpha/tfilmem.c')
-rw-r--r--private/ntos/rtl/alpha/tfilmem.c79
1 files changed, 79 insertions, 0 deletions
diff --git a/private/ntos/rtl/alpha/tfilmem.c b/private/ntos/rtl/alpha/tfilmem.c
new file mode 100644
index 000000000..0a347599c
--- /dev/null
+++ b/private/ntos/rtl/alpha/tfilmem.c
@@ -0,0 +1,79 @@
+/*++
+
+Copyright (c) 1993 Digital Equipment Corporation
+
+Module Name:
+
+ tfilmem.c
+
+Abstract:
+
+ This module implements a test of the operation of the RtlFillMemory
+ function by running an exhaustive test of every case of string offset
+ and length up to and a little beyond one 32-byte cache line. This
+ represents several thousand test cases. It is assumed any bugs that
+ exist will be found within this range. If only the error count summary
+ is desired, type "tfilmem > nul" instead.
+
+Author:
+
+ Thomas Van Baak (tvb) 13-Jan-1993
+
+Environment:
+
+ User mode.
+
+Revision History:
+
+--*/
+
+#include <nt.h>
+#include <ntrtl.h>
+#include <stdio.h>
+#include "localrtl.h"
+
+#define BUFFER_SIZE (MAX_MARGIN + MAX_OFFSET + MAX_LENGTH + MAX_MARGIN)
+
+UCHAR Buffer1[BUFFER_SIZE];
+UCHAR Buffer2[BUFFER_SIZE];
+
+void
+_CRTAPI1
+main()
+{
+ ULONG ErrorCount;
+ ULONG Length;
+ ULONG Offset;
+ ULONG Result;
+ ULONG TestCases;
+
+ fprintf(stderr, "Testing RtlFillMemory\n");
+ ErrorCount = 0;
+ TestCases = 0;
+
+ for (Offset = 0; Offset <= MAX_OFFSET; Offset += 1) {
+ for (Length = 0; Length <= MAX_LENGTH; Length += 1) {
+
+ FillPattern(Buffer1, BUFFER_SIZE);
+ FillPattern(Buffer2, BUFFER_SIZE);
+ LocalFillMemory(&Buffer1[Offset], Length, '@');
+ RtlFillMemory(&Buffer2[Offset], Length, '@');
+
+ Result = LocalCompareMemory(Buffer1, Buffer2, BUFFER_SIZE);
+
+ TestCases += 1;
+ if (Result != BUFFER_SIZE) {
+ ErrorCount += 1;
+
+ printf("ERROR: Offset = %d, Length = %d\n", Offset, Length);
+ printf("Buffers differ starting at byte %d:\n", Result);
+ printf("Buffer1 = <%*s>\n", BUFFER_SIZE, Buffer1);
+ printf("Buffer2 = <%*s>\n", BUFFER_SIZE, Buffer2);
+ printf("\n");
+ }
+ }
+ }
+
+ fprintf(stderr, "Test of RtlFillMemory completed: ");
+ fprintf(stderr, "%d test cases, %d errors found.\n", TestCases, ErrorCount);
+}