forked from aaSSfxxx/r2-regressions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/sh | ||
|
||
# GPL 3+ - Copyright (C) 2011-2012 pancake, Edd Barrett, Simon Ruderich | ||
|
||
. ../tests.sh | ||
|
||
## malloc:// "file" | ||
|
||
# Normal request. | ||
NAME='malloc://' | ||
FILE=malloc://1024 | ||
ARGS= | ||
CMDS=' | ||
i | ||
px | ||
' | ||
EXPECT='file 1024 | ||
fd 42 | ||
size 0x400 | ||
mode r-- | ||
block 0x40 | ||
uri malloc://1024 | ||
offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF | ||
0x00000000 0000 0000 0000 0000 0000 0000 0000 0000 ................ | ||
0x00000010 0000 0000 0000 0000 0000 0000 0000 0000 ................ | ||
0x00000020 0000 0000 0000 0000 0000 0000 0000 0000 ................ | ||
0x00000030 0000 0000 0000 0000 0000 0000 0000 0000 ................' | ||
# fd changes in each test, replace it with 42. | ||
FILTER='sed "s/^fd\t[0-9][0-9]*/fd\t42/"' | ||
run_test | ||
|
||
# Small request. | ||
NAME='malloc://' | ||
FILE=malloc://1 | ||
ARGS= | ||
CMDS=' | ||
i | ||
px | ||
' | ||
EXPECT='file 1 | ||
fd 42 | ||
size 0x1 | ||
mode r-- | ||
block 0x40 | ||
uri malloc://1 | ||
offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF | ||
0x00000000 00ff ffff ffff ffff ffff ffff ffff ffff ................ | ||
0x00000010 ffff ffff ffff ffff ffff ffff ffff ffff ................ | ||
0x00000020 ffff ffff ffff ffff ffff ffff ffff ffff ................ | ||
0x00000030 ffff ffff ffff ffff ffff ffff ffff ffff ................' | ||
# fd changes in each test, replace it with 42. | ||
FILTER='sed "s/^fd\t[0-9][0-9]*/fd\t42/"' | ||
run_test | ||
|
||
# No memory requested. | ||
NAME='malloc://' | ||
FILE=malloc:// | ||
ARGS= | ||
CMDS=' | ||
' | ||
EXPECT='Cannot allocate () 0 bytes | ||
Cannot open file.' | ||
EXITCODE=1 | ||
run_test |