diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/runner.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 4c8b6379..ffac5045 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -4108,6 +4108,31 @@ The current type of b is: 9 self.do_run(src, '6c9cdfe937383b79e52ca7a2cce83a21d9f5422c', output_nicerizer = check) + def test_memcpy2(self): + src = r''' + #include <stdio.h> + #include <string.h> + #include <assert.h> + int main() { + char buffer[256]; + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + for (int k = 0; k < 35; k++) { + for (int t = 0; t < 256; t++) buffer[t] = t; + char *dest = buffer + i + 128; + char *src = buffer+j; + //printf("%d, %d, %d\n", i, j, k); + assert(memcpy(dest, src, k) == dest); + assert(memcmp(dest, src, k) == 0); + } + } + } + printf("ok.\n"); + return 1; + } + ''' + self.do_run(src, 'ok.'); + def test_memmove(self): src = ''' #include <stdio.h> |