mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #2474 from backwaterred/master
This commit is contained in:
commit
54f4c8ff35
92 changed files with 5332 additions and 28 deletions
2
.vscode/cSpell.json
vendored
2
.vscode/cSpell.json
vendored
|
@ -11,7 +11,7 @@
|
|||
{ "name": "workspace", "path": "./cspell.dictionaries/workspace.wordlist.txt" }
|
||||
],
|
||||
// ignorePaths - a list of globs to specify which files are to be ignored
|
||||
"ignorePaths": ["Cargo.lock", "target/**", "tests/**/fixtures/**"],
|
||||
"ignorePaths": ["Cargo.lock", "target/**", "tests/**/fixtures/**", "src/uu/dd/test-resources/**"],
|
||||
// ignoreWords - a list of words to be ignored (even if they are in the flagWords)
|
||||
"ignoreWords": [],
|
||||
// words - list of words to be always considered correct
|
||||
|
|
27
.vscode/cspell.dictionaries/jargon.wordlist.txt
vendored
27
.vscode/cspell.dictionaries/jargon.wordlist.txt
vendored
|
@ -12,6 +12,7 @@ colorizable
|
|||
colorize
|
||||
coprime
|
||||
consts
|
||||
conv
|
||||
cyclomatic
|
||||
dedup
|
||||
deduplication
|
||||
|
@ -23,6 +24,7 @@ dev
|
|||
devs
|
||||
discoverability
|
||||
duplicative
|
||||
dsync
|
||||
enqueue
|
||||
errored
|
||||
executable
|
||||
|
@ -30,7 +32,10 @@ executables
|
|||
exponentiate
|
||||
eval
|
||||
falsey
|
||||
fileio
|
||||
flamegraph
|
||||
fullblock
|
||||
gibi
|
||||
gibibytes
|
||||
glob
|
||||
globbing
|
||||
|
@ -39,8 +44,12 @@ hardlink
|
|||
hardlinks
|
||||
hasher
|
||||
hashsums
|
||||
infile
|
||||
iflag
|
||||
iflags
|
||||
kibi
|
||||
kibibytes
|
||||
lcase
|
||||
mebi
|
||||
mebibytes
|
||||
mergeable
|
||||
|
@ -49,8 +58,21 @@ microbenchmarks
|
|||
microbenchmarking
|
||||
multibyte
|
||||
multicall
|
||||
noatime
|
||||
nocache
|
||||
nocreat
|
||||
noctty
|
||||
noerror
|
||||
nofollow
|
||||
nolinks
|
||||
nonblock
|
||||
nonportable
|
||||
nonprinting
|
||||
notrunc
|
||||
noxfer
|
||||
ofile
|
||||
oflag
|
||||
oflags
|
||||
peekable
|
||||
performant
|
||||
precompiled
|
||||
|
@ -70,9 +92,12 @@ semiprime
|
|||
semiprimes
|
||||
shortcode
|
||||
shortcodes
|
||||
siginfo
|
||||
sigusr
|
||||
subcommand
|
||||
subexpression
|
||||
submodule
|
||||
sync
|
||||
symlink
|
||||
symlinks
|
||||
syscall
|
||||
|
@ -80,12 +105,14 @@ syscalls
|
|||
tokenize
|
||||
toolchain
|
||||
truthy
|
||||
ucase
|
||||
unbuffered
|
||||
unescape
|
||||
unintuitive
|
||||
unprefixed
|
||||
unportable
|
||||
unsync
|
||||
urand
|
||||
whitespace
|
||||
wordlist
|
||||
wordlists
|
||||
|
|
56
Cargo.lock
generated
56
Cargo.lock
generated
|
@ -167,6 +167,15 @@ version = "0.2.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40"
|
||||
|
||||
[[package]]
|
||||
name = "byte-unit"
|
||||
version = "4.0.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "063197e6eb4b775b64160dedde7a0986bb2836cce140e9492e9e96f28e18bcd8"
|
||||
dependencies = [
|
||||
"utf8-width",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "byteorder"
|
||||
version = "1.4.3"
|
||||
|
@ -175,9 +184,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
|
|||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.68"
|
||||
version = "1.0.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787"
|
||||
checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
|
||||
|
||||
[[package]]
|
||||
name = "cexpr"
|
||||
|
@ -310,6 +319,7 @@ dependencies = [
|
|||
"uu_csplit",
|
||||
"uu_cut",
|
||||
"uu_date",
|
||||
"uu_dd",
|
||||
"uu_df",
|
||||
"uu_dircolors",
|
||||
"uu_dirname",
|
||||
|
@ -510,9 +520,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "crossbeam-deque"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9"
|
||||
checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"crossbeam-epoch",
|
||||
|
@ -699,6 +709,12 @@ version = "1.1.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7"
|
||||
|
||||
[[package]]
|
||||
name = "gcd"
|
||||
version = "2.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c7cd301bf2ab11ae4e5bdfd79c221d97a25e46c089144a62ee9d09cb32d2b92"
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.8.4"
|
||||
|
@ -1269,9 +1285,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
|
|||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.27"
|
||||
version = "1.0.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038"
|
||||
checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
|
||||
dependencies = [
|
||||
"unicode-xid 0.2.2",
|
||||
]
|
||||
|
@ -1491,9 +1507,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "reference-counted-singleton"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9e03aec30be874d0786379a6ee483c653c58dd6863ad4ed873e697ed968f9358"
|
||||
checksum = "ef445213a92fdddc4bc69d9111156d20ffd50704a86ad82b372aab701a0d3a9a"
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
|
@ -1721,9 +1737,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.73"
|
||||
version = "1.0.74"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7"
|
||||
checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote 1.0.9",
|
||||
|
@ -1899,6 +1915,12 @@ dependencies = [
|
|||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "utf8-width"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7cf7d77f457ef8dfa11e4cd5933c5ddb5dc52a94664071951219a97710f0a32b"
|
||||
|
||||
[[package]]
|
||||
name = "uu_arch"
|
||||
version = "0.0.7"
|
||||
|
@ -2063,6 +2085,20 @@ dependencies = [
|
|||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uu_dd"
|
||||
version = "0.0.7"
|
||||
dependencies = [
|
||||
"byte-unit",
|
||||
"clap",
|
||||
"gcd",
|
||||
"libc",
|
||||
"signal-hook",
|
||||
"tempfile",
|
||||
"uucore",
|
||||
"uucore_procs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uu_df"
|
||||
version = "0.0.7"
|
||||
|
|
|
@ -45,6 +45,7 @@ feat_common_core = [
|
|||
"df",
|
||||
"dircolors",
|
||||
"dirname",
|
||||
"dd",
|
||||
"du",
|
||||
"echo",
|
||||
"env",
|
||||
|
@ -255,6 +256,7 @@ cp = { optional=true, version="0.0.7", package="uu_cp", path="src/uu/cp" }
|
|||
csplit = { optional=true, version="0.0.7", package="uu_csplit", path="src/uu/csplit" }
|
||||
cut = { optional=true, version="0.0.7", package="uu_cut", path="src/uu/cut" }
|
||||
date = { optional=true, version="0.0.7", package="uu_date", path="src/uu/date" }
|
||||
dd = { optional=true, version="0.0.7", package="uu_dd", path="src/uu/dd" }
|
||||
df = { optional=true, version="0.0.7", package="uu_df", path="src/uu/df" }
|
||||
dircolors= { optional=true, version="0.0.7", package="uu_dircolors", path="src/uu/dircolors" }
|
||||
dirname = { optional=true, version="0.0.7", package="uu_dirname", path="src/uu/dirname" }
|
||||
|
|
34
README.md
34
README.md
|
@ -366,23 +366,23 @@ To contribute to uutils, please see [CONTRIBUTING](CONTRIBUTING.md).
|
|||
| Done | Semi-Done | To Do |
|
||||
|-----------|-----------|--------|
|
||||
| arch | cp | chcon |
|
||||
| base32 | date | dd |
|
||||
| base64 | df | runcon |
|
||||
| basename | expr | stty |
|
||||
| cat | install | |
|
||||
| chgrp | join | |
|
||||
| chmod | ls | |
|
||||
| chown | more | |
|
||||
| chroot | numfmt | |
|
||||
| cksum | od (`--strings` and 128-bit data types missing) | |
|
||||
| comm | pr | |
|
||||
| csplit | printf | |
|
||||
| cut | sort | |
|
||||
| dircolors | split | |
|
||||
| dirname | tac | |
|
||||
| du | tail | |
|
||||
| echo | test | |
|
||||
| env | | |
|
||||
| base32 | date | runcon |
|
||||
| base64 | dd | stty |
|
||||
| basename | df | |
|
||||
| cat | expr | |
|
||||
| chgrp | install | |
|
||||
| chmod | join | |
|
||||
| chown | ls | |
|
||||
| chroot | more | |
|
||||
| cksum | numfmt | |
|
||||
| comm | od (`--strings` and 128-bit data types missing) |
|
||||
| csplit | pr | |
|
||||
| cut | printf | |
|
||||
| dircolors | sort | |
|
||||
| dirname | split | |
|
||||
| du | tac | |
|
||||
| echo | tail | |
|
||||
| env | test | |
|
||||
| expand | | |
|
||||
| factor | | |
|
||||
| false | | |
|
||||
|
|
31
src/uu/dd/Cargo.toml
Normal file
31
src/uu/dd/Cargo.toml
Normal file
|
@ -0,0 +1,31 @@
|
|||
[package]
|
||||
name = "uu_dd"
|
||||
version = "0.0.7"
|
||||
authors = ["uutils developers"]
|
||||
license = "MIT"
|
||||
description = "dd ~ (uutils) copy and convert files"
|
||||
|
||||
homepage = "https://github.com/uutils/coreutils"
|
||||
repository = "https://github.com/uutils/coreutils/tree/master/src/uu/dd"
|
||||
keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"]
|
||||
categories = ["command-line-utilities"]
|
||||
edition = "2018"
|
||||
|
||||
[lib]
|
||||
path = "src/dd.rs"
|
||||
|
||||
[dependencies]
|
||||
byte-unit = "4.0"
|
||||
clap = { version = "2.33", features = [ "wrap_help" ] }
|
||||
gcd = "2.0"
|
||||
libc = "0.2"
|
||||
signal-hook = "0.3.9"
|
||||
uucore = { version=">=0.0.8", package="uucore", path="../../uucore" }
|
||||
uucore_procs = { version=">=0.0.5", package="uucore_procs", path="../../uucore_procs" }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = "^3"
|
||||
|
||||
[[bin]]
|
||||
name = "dd"
|
||||
path = "src/main.rs"
|
221
src/uu/dd/src/conversion_tables.rs
Normal file
221
src/uu/dd/src/conversion_tables.rs
Normal file
|
@ -0,0 +1,221 @@
|
|||
// This file is part of the uutils coreutils package.
|
||||
//
|
||||
// (c) Tyler Steele <tyler.steele@protonmail.com>
|
||||
//
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
|
||||
// Note: Conversion tables are just lookup tables.
|
||||
// eg. The ASCII->EBCDIC table stores the EBCDIC code at the index
|
||||
// obtained by treating the ASCII representation as a number.
|
||||
|
||||
pub type ConversionTable = [u8; 256];
|
||||
|
||||
pub const ASCII_UCASE_TO_LCASE: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
|
||||
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
|
||||
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
|
||||
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
|
||||
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
|
||||
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
|
||||
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
|
||||
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
|
||||
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
||||
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
||||
|
||||
pub const ASCII_LCASE_TO_UCASE: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
|
||||
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
|
||||
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
|
||||
0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
|
||||
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
|
||||
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
|
||||
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
|
||||
0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
|
||||
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
|
||||
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
|
||||
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
||||
|
||||
pub const ASCII_TO_EBCDIC: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
|
||||
0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||
0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x9a, 0x6d,
|
||||
0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0x5f, 0x07,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
|
||||
0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
||||
0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
|
||||
0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x6a, 0x9b, 0x9c, 0x9d, 0x9e,
|
||||
0x9f, 0xa0, 0xaa, 0xab, 0xac, 0x4a, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
||||
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xa1, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
|
||||
0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
||||
|
||||
pub const ASCII_TO_EBCDIC_UCASE_TO_LCASE: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
|
||||
0x7c, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xad, 0xe0, 0xbd, 0x9a, 0x6d,
|
||||
0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0x5f, 0x07,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
|
||||
0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
||||
0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
|
||||
0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x6a, 0x9b, 0x9c, 0x9d, 0x9e,
|
||||
0x9f, 0xa0, 0xaa, 0xab, 0xac, 0x4a, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
||||
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xa1, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
|
||||
0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
||||
|
||||
pub const ASCII_TO_EBCDIC_LCASE_TO_UCASE: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
|
||||
0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||
0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x9a, 0x6d,
|
||||
0x79, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||
0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xc0, 0x4f, 0xd0, 0x5f, 0x07,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
|
||||
0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
||||
0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
|
||||
0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x6a, 0x9b, 0x9c, 0x9d, 0x9e,
|
||||
0x9f, 0xa0, 0xaa, 0xab, 0xac, 0x4a, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
||||
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xa1, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
|
||||
0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
||||
|
||||
pub const ASCII_TO_IBM: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
|
||||
0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||
0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
|
||||
0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
|
||||
0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
||||
0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
|
||||
0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
|
||||
0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
||||
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
|
||||
0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
||||
|
||||
pub const ASCII_TO_IBM_UCASE_TO_LCASE: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
|
||||
0x7c, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
|
||||
0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
|
||||
0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
||||
0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
|
||||
0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
|
||||
0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
||||
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
|
||||
0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
||||
|
||||
pub const ASCII_TO_IBM_LCASE_TO_UCASE: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
|
||||
0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||
0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
|
||||
0x79, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||
0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
|
||||
0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
||||
0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
|
||||
0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
|
||||
0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
||||
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
|
||||
0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
||||
|
||||
pub const EBCDIC_TO_ASCII: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f, 0x97, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x9d, 0x85, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8f, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x0a, 0x17, 0x1b, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07,
|
||||
0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a,
|
||||
0x20, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xd5, 0x2e, 0x3c, 0x28, 0x2b, 0x7c,
|
||||
0x26, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x7e,
|
||||
0x2d, 0x2f, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xcb, 0x2c, 0x25, 0x5f, 0x3e, 0x3f,
|
||||
0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc1, 0xc2, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22,
|
||||
0xc3, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9,
|
||||
0xca, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x5e, 0xcc, 0xcd, 0xce, 0xcf, 0xd0,
|
||||
0xd1, 0xe5, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0xd2, 0xd3, 0xd4, 0x5b, 0xd6, 0xd7,
|
||||
0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0x5d, 0xe6, 0xe7,
|
||||
0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed,
|
||||
0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0xee, 0xef, 0xf0, 0xf1, 0xf2, 0xf3,
|
||||
0x5c, 0x9f, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9,
|
||||
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
||||
|
||||
pub const EBCDIC_TO_ASCII_UCASE_TO_LCASE: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
|
||||
0x7c, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
|
||||
0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
|
||||
0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
|
||||
0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
||||
0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
|
||||
0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
|
||||
0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
||||
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
|
||||
0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
||||
|
||||
pub const EBCDIC_TO_ASCII_LCASE_TO_UCASE: ConversionTable = [
|
||||
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, 0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
|
||||
0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26, 0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
|
||||
0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d, 0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
|
||||
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
|
||||
0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||
0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xad, 0xe0, 0xbd, 0x5f, 0x6d,
|
||||
0x79, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
|
||||
0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
|
||||
0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08, 0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xe1,
|
||||
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
|
||||
0x58, 0x59, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75,
|
||||
0x76, 0x77, 0x78, 0x80, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e,
|
||||
0x9f, 0xa0, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
|
||||
0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xda, 0xdb,
|
||||
0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
|
||||
];
|
172
src/uu/dd/src/datastructures.rs
Normal file
172
src/uu/dd/src/datastructures.rs
Normal file
|
@ -0,0 +1,172 @@
|
|||
// This file is part of the uutils coreutils package.
|
||||
//
|
||||
// (c) Tyler Steele <tyler.steele@protonmail.com>
|
||||
//
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
// spell-checker:ignore ctable, outfile
|
||||
|
||||
use crate::conversion_tables::*;
|
||||
|
||||
use std::error::Error;
|
||||
use std::time;
|
||||
|
||||
pub struct ProgUpdate {
|
||||
pub read_stat: ReadStat,
|
||||
pub write_stat: WriteStat,
|
||||
pub duration: time::Duration,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Default)]
|
||||
pub struct ReadStat {
|
||||
pub reads_complete: u64,
|
||||
pub reads_partial: u64,
|
||||
pub records_truncated: u32,
|
||||
}
|
||||
impl std::ops::AddAssign for ReadStat {
|
||||
fn add_assign(&mut self, other: Self) {
|
||||
*self = Self {
|
||||
reads_complete: self.reads_complete + other.reads_complete,
|
||||
reads_partial: self.reads_partial + other.reads_partial,
|
||||
records_truncated: self.records_truncated + other.records_truncated,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct WriteStat {
|
||||
pub writes_complete: u64,
|
||||
pub writes_partial: u64,
|
||||
pub bytes_total: u128,
|
||||
}
|
||||
impl std::ops::AddAssign for WriteStat {
|
||||
fn add_assign(&mut self, other: Self) {
|
||||
*self = Self {
|
||||
writes_complete: self.writes_complete + other.writes_complete,
|
||||
writes_partial: self.writes_partial + other.writes_partial,
|
||||
bytes_total: self.bytes_total + other.bytes_total,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type Cbs = usize;
|
||||
|
||||
/// Stores all Conv Flags that apply to the input
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
pub struct IConvFlags {
|
||||
pub ctable: Option<&'static ConversionTable>,
|
||||
pub block: Option<Cbs>,
|
||||
pub unblock: Option<Cbs>,
|
||||
pub swab: bool,
|
||||
pub sync: Option<u8>,
|
||||
pub noerror: bool,
|
||||
}
|
||||
|
||||
/// Stores all Conv Flags that apply to the output
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
pub struct OConvFlags {
|
||||
pub sparse: bool,
|
||||
pub excl: bool,
|
||||
pub nocreat: bool,
|
||||
pub notrunc: bool,
|
||||
pub fdatasync: bool,
|
||||
pub fsync: bool,
|
||||
}
|
||||
|
||||
/// Stores all Flags that apply to the input
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
pub struct IFlags {
|
||||
pub cio: bool,
|
||||
pub direct: bool,
|
||||
pub directory: bool,
|
||||
pub dsync: bool,
|
||||
pub sync: bool,
|
||||
pub nocache: bool,
|
||||
pub nonblock: bool,
|
||||
pub noatime: bool,
|
||||
pub noctty: bool,
|
||||
pub nofollow: bool,
|
||||
pub nolinks: bool,
|
||||
pub binary: bool,
|
||||
pub text: bool,
|
||||
pub fullblock: bool,
|
||||
pub count_bytes: bool,
|
||||
pub skip_bytes: bool,
|
||||
}
|
||||
|
||||
/// Stores all Flags that apply to the output
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
pub struct OFlags {
|
||||
pub append: bool,
|
||||
pub cio: bool,
|
||||
pub direct: bool,
|
||||
pub directory: bool,
|
||||
pub dsync: bool,
|
||||
pub sync: bool,
|
||||
pub nocache: bool,
|
||||
pub nonblock: bool,
|
||||
pub noatime: bool,
|
||||
pub noctty: bool,
|
||||
pub nofollow: bool,
|
||||
pub nolinks: bool,
|
||||
pub binary: bool,
|
||||
pub text: bool,
|
||||
pub seek_bytes: bool,
|
||||
}
|
||||
|
||||
/// The value of the status cl-option.
|
||||
/// Controls printing of transfer stats
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
pub enum StatusLevel {
|
||||
Progress,
|
||||
Noxfer,
|
||||
None,
|
||||
}
|
||||
|
||||
/// The value of count=N
|
||||
/// Defaults to Reads(N)
|
||||
/// if iflag=count_bytes
|
||||
/// then becomes Bytes(N)
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum CountType {
|
||||
Reads(usize),
|
||||
Bytes(usize),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum InternalError {
|
||||
WrongInputType,
|
||||
WrongOutputType,
|
||||
InvalidConvBlockUnblockCase,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for InternalError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::WrongInputType | Self::WrongOutputType => {
|
||||
write!(f, "Internal dd error: Wrong Input/Output data type")
|
||||
}
|
||||
Self::InvalidConvBlockUnblockCase => {
|
||||
write!(f, "Invalid Conversion, Block, or Unblock data")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for InternalError {}
|
||||
|
||||
pub mod options {
|
||||
pub const INFILE: &str = "if";
|
||||
pub const OUTFILE: &str = "of";
|
||||
pub const IBS: &str = "ibs";
|
||||
pub const OBS: &str = "obs";
|
||||
pub const BS: &str = "bs";
|
||||
pub const CBS: &str = "cbs";
|
||||
pub const COUNT: &str = "count";
|
||||
pub const SKIP: &str = "skip";
|
||||
pub const SEEK: &str = "seek";
|
||||
pub const STATUS: &str = "status";
|
||||
pub const CONV: &str = "conv";
|
||||
pub const IFLAG: &str = "iflag";
|
||||
pub const OFLAG: &str = "oflag";
|
||||
}
|
1236
src/uu/dd/src/dd.rs
Normal file
1236
src/uu/dd/src/dd.rs
Normal file
File diff suppressed because it is too large
Load diff
351
src/uu/dd/src/dd_unit_tests/block_unblock_tests.rs
Normal file
351
src/uu/dd/src/dd_unit_tests/block_unblock_tests.rs
Normal file
|
@ -0,0 +1,351 @@
|
|||
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat
|
||||
|
||||
use super::*;
|
||||
|
||||
#[cfg(unix)]
|
||||
macro_rules! make_block_test (
|
||||
( $test_id:ident, $test_name:expr, $src:expr, $block:expr, $spec:expr ) =>
|
||||
{
|
||||
make_spec_test!($test_id,
|
||||
$test_name,
|
||||
Input {
|
||||
src: $src,
|
||||
non_ascii: false,
|
||||
ibs: 512,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: IConvFlags {
|
||||
block: $block,
|
||||
..IConvFlags::default()
|
||||
},
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: File::create(format!("./test-resources/FAILED-{}.test", $test_name)).unwrap(),
|
||||
obs: 512,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
$spec,
|
||||
format!("./test-resources/FAILED-{}.test", $test_name)
|
||||
);
|
||||
};
|
||||
);
|
||||
|
||||
#[cfg(unix)]
|
||||
macro_rules! make_unblock_test (
|
||||
( $test_id:ident, $test_name:expr, $src:expr, $unblock:expr, $spec:expr ) =>
|
||||
{
|
||||
make_spec_test!($test_id,
|
||||
$test_name,
|
||||
Input {
|
||||
src: $src,
|
||||
non_ascii: false,
|
||||
ibs: 512,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: IConvFlags {
|
||||
unblock: $unblock,
|
||||
..IConvFlags::default()
|
||||
},
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: File::create(format!("./test-resources/FAILED-{}.test", $test_name)).unwrap(),
|
||||
obs: 512,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
$spec,
|
||||
format!("./test-resources/FAILED-{}.test", $test_name)
|
||||
);
|
||||
};
|
||||
);
|
||||
|
||||
#[test]
|
||||
fn block_test_no_nl() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![0u8, 1u8, 2u8, 3u8];
|
||||
let res = block(buf, 4, &mut rs);
|
||||
|
||||
assert_eq!(res, vec![vec![0u8, 1u8, 2u8, 3u8],]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_no_nl_short_record() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![0u8, 1u8, 2u8, 3u8];
|
||||
let res = block(buf, 8, &mut rs);
|
||||
|
||||
assert_eq!(
|
||||
res,
|
||||
vec![vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_no_nl_trunc() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![0u8, 1u8, 2u8, 3u8, 4u8];
|
||||
let res = block(buf, 4, &mut rs);
|
||||
|
||||
// Commented section(s) should be truncated and appear for reference only.
|
||||
assert_eq!(res, vec![vec![0u8, 1u8, 2u8, 3u8 /*, 4u8*/],]);
|
||||
assert_eq!(rs.records_truncated, 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_nl_gt_cbs_trunc() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![
|
||||
0u8, 1u8, 2u8, 3u8, 4u8, NEWLINE, 0u8, 1u8, 2u8, 3u8, 4u8, NEWLINE, 5u8, 6u8, 7u8, 8u8,
|
||||
];
|
||||
let res = block(buf, 4, &mut rs);
|
||||
|
||||
assert_eq!(
|
||||
res,
|
||||
vec![
|
||||
// Commented section(s) should be truncated and appear for reference only.
|
||||
vec![0u8, 1u8, 2u8, 3u8],
|
||||
// vec![4u8, SPACE, SPACE, SPACE],
|
||||
vec![0u8, 1u8, 2u8, 3u8],
|
||||
// vec![4u8, SPACE, SPACE, SPACE],
|
||||
vec![5u8, 6u8, 7u8, 8u8],
|
||||
]
|
||||
);
|
||||
assert_eq!(rs.records_truncated, 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_surrounded_nl() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![0u8, 1u8, 2u8, 3u8, NEWLINE, 4u8, 5u8, 6u8, 7u8, 8u8];
|
||||
let res = block(buf, 8, &mut rs);
|
||||
|
||||
assert_eq!(
|
||||
res,
|
||||
vec![
|
||||
vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],
|
||||
vec![4u8, 5u8, 6u8, 7u8, 8u8, SPACE, SPACE, SPACE],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_multiple_nl_same_cbs_block() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![
|
||||
0u8, 1u8, 2u8, 3u8, NEWLINE, 4u8, NEWLINE, 5u8, 6u8, 7u8, 8u8, 9u8,
|
||||
];
|
||||
let res = block(buf, 8, &mut rs);
|
||||
|
||||
assert_eq!(
|
||||
res,
|
||||
vec![
|
||||
vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],
|
||||
vec![4u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE],
|
||||
vec![5u8, 6u8, 7u8, 8u8, 9u8, SPACE, SPACE, SPACE],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_multiple_nl_diff_cbs_block() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![
|
||||
0u8, 1u8, 2u8, 3u8, NEWLINE, 4u8, 5u8, 6u8, 7u8, NEWLINE, 8u8, 9u8,
|
||||
];
|
||||
let res = block(buf, 8, &mut rs);
|
||||
|
||||
assert_eq!(
|
||||
res,
|
||||
vec![
|
||||
vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],
|
||||
vec![4u8, 5u8, 6u8, 7u8, SPACE, SPACE, SPACE, SPACE],
|
||||
vec![8u8, 9u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_end_nl_diff_cbs_block() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![0u8, 1u8, 2u8, 3u8, NEWLINE];
|
||||
let res = block(buf, 4, &mut rs);
|
||||
|
||||
assert_eq!(res, vec![vec![0u8, 1u8, 2u8, 3u8],]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_end_nl_same_cbs_block() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![0u8, 1u8, 2u8, NEWLINE];
|
||||
let res = block(buf, 4, &mut rs);
|
||||
|
||||
assert_eq!(res, vec![vec![0u8, 1u8, 2u8, SPACE]]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_double_end_nl() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![0u8, 1u8, 2u8, NEWLINE, NEWLINE];
|
||||
let res = block(buf, 4, &mut rs);
|
||||
|
||||
assert_eq!(
|
||||
res,
|
||||
vec![vec![0u8, 1u8, 2u8, SPACE], vec![SPACE, SPACE, SPACE, SPACE],]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_start_nl() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![NEWLINE, 0u8, 1u8, 2u8, 3u8];
|
||||
let res = block(buf, 4, &mut rs);
|
||||
|
||||
assert_eq!(
|
||||
res,
|
||||
vec![vec![SPACE, SPACE, SPACE, SPACE], vec![0u8, 1u8, 2u8, 3u8],]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_double_surrounded_nl_no_trunc() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![0u8, 1u8, 2u8, 3u8, NEWLINE, NEWLINE, 4u8, 5u8, 6u8, 7u8];
|
||||
let res = block(buf, 8, &mut rs);
|
||||
|
||||
assert_eq!(
|
||||
res,
|
||||
vec![
|
||||
vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],
|
||||
vec![SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE],
|
||||
vec![4u8, 5u8, 6u8, 7u8, SPACE, SPACE, SPACE, SPACE],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn block_test_double_surrounded_nl_double_trunc() {
|
||||
let mut rs = ReadStat::default();
|
||||
let buf = vec![
|
||||
0u8, 1u8, 2u8, 3u8, NEWLINE, NEWLINE, 4u8, 5u8, 6u8, 7u8, 8u8,
|
||||
];
|
||||
let res = block(buf, 4, &mut rs);
|
||||
|
||||
assert_eq!(
|
||||
res,
|
||||
vec![
|
||||
// Commented section(s) should be truncated and appear for reference only.
|
||||
vec![0u8, 1u8, 2u8, 3u8],
|
||||
vec![SPACE, SPACE, SPACE, SPACE],
|
||||
vec![4u8, 5u8, 6u8, 7u8 /*, 8u8*/],
|
||||
]
|
||||
);
|
||||
assert_eq!(rs.records_truncated, 1);
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
make_block_test!(
|
||||
block_cbs16,
|
||||
"block-cbs-16",
|
||||
File::open("./test-resources/dd-block-cbs16.test").unwrap(),
|
||||
Some(16),
|
||||
File::open("./test-resources/dd-block-cbs16.spec").unwrap()
|
||||
);
|
||||
|
||||
#[cfg(unix)]
|
||||
make_block_test!(
|
||||
block_cbs16_as_cbs8,
|
||||
"block-cbs-16-as-cbs8",
|
||||
File::open("./test-resources/dd-block-cbs16.test").unwrap(),
|
||||
Some(8),
|
||||
File::open("./test-resources/dd-block-cbs8.spec").unwrap()
|
||||
);
|
||||
|
||||
#[cfg(unix)]
|
||||
make_block_test!(
|
||||
block_consecutive_nl,
|
||||
"block-consecutive-nl",
|
||||
File::open("./test-resources/dd-block-consecutive-nl.test").unwrap(),
|
||||
Some(16),
|
||||
File::open("./test-resources/dd-block-consecutive-nl-cbs16.spec").unwrap()
|
||||
);
|
||||
|
||||
#[test]
|
||||
fn unblock_test_full_cbs() {
|
||||
let buf = vec![0u8, 1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8];
|
||||
let res = unblock(buf, 8);
|
||||
|
||||
assert_eq!(res, vec![0u8, 1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8, NEWLINE],);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unblock_test_all_space() {
|
||||
let buf = vec![SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE];
|
||||
let res = unblock(buf, 8);
|
||||
|
||||
assert_eq!(res, vec![NEWLINE],);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unblock_test_decoy_spaces() {
|
||||
let buf = vec![0u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, 7u8];
|
||||
let res = unblock(buf, 8);
|
||||
|
||||
assert_eq!(
|
||||
res,
|
||||
vec![0u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, 7u8, NEWLINE],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unblock_test_strip_single_cbs() {
|
||||
let buf = vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE];
|
||||
let res = unblock(buf, 8);
|
||||
|
||||
assert_eq!(res, vec![0u8, 1u8, 2u8, 3u8, NEWLINE],);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unblock_test_strip_multi_cbs() {
|
||||
let buf = vec![
|
||||
vec![0u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE],
|
||||
vec![0u8, 1u8, SPACE, SPACE, SPACE, SPACE, SPACE, SPACE],
|
||||
vec![0u8, 1u8, 2u8, SPACE, SPACE, SPACE, SPACE, SPACE],
|
||||
vec![0u8, 1u8, 2u8, 3u8, SPACE, SPACE, SPACE, SPACE],
|
||||
]
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let res = unblock(buf, 8);
|
||||
|
||||
let exp = vec![
|
||||
vec![0u8, NEWLINE],
|
||||
vec![0u8, 1u8, NEWLINE],
|
||||
vec![0u8, 1u8, 2u8, NEWLINE],
|
||||
vec![0u8, 1u8, 2u8, 3u8, NEWLINE],
|
||||
]
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
assert_eq!(res, exp);
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
make_unblock_test!(
|
||||
unblock_multi_16,
|
||||
"unblock-multi-16",
|
||||
File::open("./test-resources/dd-unblock-cbs16.test").unwrap(),
|
||||
Some(16),
|
||||
File::open("./test-resources/dd-unblock-cbs16.spec").unwrap()
|
||||
);
|
||||
|
||||
#[cfg(unix)]
|
||||
make_unblock_test!(
|
||||
unblock_multi_16_as_8,
|
||||
"unblock-multi-16-as-8",
|
||||
File::open("./test-resources/dd-unblock-cbs16.test").unwrap(),
|
||||
Some(8),
|
||||
File::open("./test-resources/dd-unblock-cbs8.spec").unwrap()
|
||||
);
|
106
src/uu/dd/src/dd_unit_tests/conv_sync_tests.rs
Normal file
106
src/uu/dd/src/dd_unit_tests/conv_sync_tests.rs
Normal file
|
@ -0,0 +1,106 @@
|
|||
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat
|
||||
|
||||
use super::*;
|
||||
|
||||
macro_rules! make_sync_test (
|
||||
( $test_id:ident, $test_name:expr, $src:expr, $sync:expr, $ibs:expr, $obs:expr, $spec:expr ) =>
|
||||
{
|
||||
make_spec_test!($test_id,
|
||||
$test_name,
|
||||
Input {
|
||||
src: $src,
|
||||
non_ascii: false,
|
||||
ibs: $ibs,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: IConvFlags {
|
||||
sync: $sync,
|
||||
..IConvFlags::default()
|
||||
},
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: File::create(format!("./test-resources/FAILED-{}.test", $test_name)).unwrap(),
|
||||
obs: $obs,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
$spec,
|
||||
format!("./test-resources/FAILED-{}.test", $test_name)
|
||||
);
|
||||
};
|
||||
);
|
||||
|
||||
// Zeros
|
||||
make_sync_test!(
|
||||
zeros_4k_conv_sync_obs_gt_ibs,
|
||||
"zeros_4k_conv_sync_obs_gt_ibs",
|
||||
File::open("./test-resources/zeros-620f0b67a91f7f74151bc5be745b7110.test").unwrap(),
|
||||
Some(0u8),
|
||||
521,
|
||||
1031,
|
||||
File::open("./test-resources/gnudd-conv-sync-ibs-521-obs-1031-zeros.spec").unwrap()
|
||||
);
|
||||
|
||||
make_sync_test!(
|
||||
zeros_4k_conv_sync_ibs_gt_obs,
|
||||
"zeros_4k_conv_sync_ibs_gt_obs",
|
||||
File::open("./test-resources/zeros-620f0b67a91f7f74151bc5be745b7110.test").unwrap(),
|
||||
Some(0u8),
|
||||
1031,
|
||||
521,
|
||||
File::open("./test-resources/gnudd-conv-sync-ibs-1031-obs-521-zeros.spec").unwrap()
|
||||
);
|
||||
|
||||
// Deadbeef
|
||||
make_sync_test!(
|
||||
deadbeef_32k_conv_sync_obs_gt_ibs,
|
||||
"deadbeef_32k_conv_sync_obs_gt_ibs",
|
||||
File::open("./test-resources/deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test").unwrap(),
|
||||
Some(0u8),
|
||||
521,
|
||||
1031,
|
||||
File::open("./test-resources/gnudd-conv-sync-ibs-521-obs-1031-deadbeef.spec").unwrap()
|
||||
);
|
||||
|
||||
make_sync_test!(
|
||||
deadbeef_32k_conv_sync_ibs_gt_obs,
|
||||
"deadbeef_32k_conv_sync_ibs_gt_obs",
|
||||
File::open("./test-resources/deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test").unwrap(),
|
||||
Some(0u8),
|
||||
1031,
|
||||
521,
|
||||
File::open("./test-resources/gnudd-conv-sync-ibs-1031-obs-521-deadbeef.spec").unwrap()
|
||||
);
|
||||
|
||||
// Random
|
||||
make_sync_test!(
|
||||
random_73k_test_bs_prime_obs_gt_ibs_sync,
|
||||
"random-73k-test-bs-prime-obs-gt-ibs-sync",
|
||||
File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test").unwrap(),
|
||||
Some(0u8),
|
||||
521,
|
||||
1031,
|
||||
File::open("./test-resources/gnudd-conv-sync-ibs-521-obs-1031-random.spec").unwrap()
|
||||
);
|
||||
|
||||
make_sync_test!(
|
||||
random_73k_test_bs_prime_ibs_gt_obs_sync,
|
||||
"random-73k-test-bs-prime-ibs-gt-obs-sync",
|
||||
File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test").unwrap(),
|
||||
Some(0u8),
|
||||
1031,
|
||||
521,
|
||||
File::open("./test-resources/gnudd-conv-sync-ibs-1031-obs-521-random.spec").unwrap()
|
||||
);
|
||||
|
||||
make_sync_test!(
|
||||
deadbeef_16_delayed,
|
||||
"deadbeef-16-delayed",
|
||||
LazyReader {
|
||||
src: File::open("./test-resources/deadbeef-16.test").unwrap()
|
||||
},
|
||||
Some(0u8),
|
||||
16,
|
||||
32,
|
||||
File::open("./test-resources/deadbeef-16.spec").unwrap()
|
||||
);
|
233
src/uu/dd/src/dd_unit_tests/conversion_tests.rs
Normal file
233
src/uu/dd/src/dd_unit_tests/conversion_tests.rs
Normal file
|
@ -0,0 +1,233 @@
|
|||
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat
|
||||
|
||||
use super::*;
|
||||
|
||||
macro_rules! make_conv_test (
|
||||
( $test_id:ident, $test_name:expr, $src:expr, $ctable:expr, $spec:expr ) =>
|
||||
{
|
||||
make_spec_test!($test_id,
|
||||
$test_name,
|
||||
Input {
|
||||
src: $src,
|
||||
non_ascii: false,
|
||||
ibs: 512,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: icf!($ctable),
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: File::create(format!("./test-resources/FAILED-{}.test", $test_name)).unwrap(),
|
||||
obs: 512,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
$spec,
|
||||
format!("./test-resources/FAILED-{}.test", $test_name)
|
||||
);
|
||||
};
|
||||
);
|
||||
|
||||
macro_rules! make_icf_test (
|
||||
( $test_id:ident, $test_name:expr, $src:expr, $icf:expr, $spec:expr ) =>
|
||||
{
|
||||
make_spec_test!($test_id,
|
||||
$test_name,
|
||||
Input {
|
||||
src: $src,
|
||||
non_ascii: false,
|
||||
ibs: 512,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: $icf,
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: File::create(format!("./test-resources/FAILED-{}.test", $test_name)).unwrap(),
|
||||
obs: 512,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
$spec,
|
||||
format!("./test-resources/FAILED-{}.test", $test_name)
|
||||
);
|
||||
};
|
||||
);
|
||||
|
||||
make_conv_test!(
|
||||
atoe_conv_spec_test,
|
||||
"atoe-conv-spec-test",
|
||||
File::open("./test-resources/seq-byte-values-b632a992d3aed5d8d1a59cc5a5a455ba.test").unwrap(),
|
||||
Some(&ASCII_TO_EBCDIC),
|
||||
File::open("./test-resources/gnudd-conv-atoe-seq-byte-values.spec").unwrap()
|
||||
);
|
||||
|
||||
make_conv_test!(
|
||||
etoa_conv_spec_test,
|
||||
"etoa-conv-spec-test",
|
||||
File::open("./test-resources/seq-byte-values-b632a992d3aed5d8d1a59cc5a5a455ba.test").unwrap(),
|
||||
Some(&EBCDIC_TO_ASCII),
|
||||
File::open("./test-resources/gnudd-conv-etoa-seq-byte-values.spec").unwrap()
|
||||
);
|
||||
|
||||
make_conv_test!(
|
||||
atoibm_conv_spec_test,
|
||||
"atoibm-conv-spec-test",
|
||||
File::open("./test-resources/seq-byte-values-b632a992d3aed5d8d1a59cc5a5a455ba.test").unwrap(),
|
||||
Some(&ASCII_TO_IBM),
|
||||
File::open("./test-resources/gnudd-conv-atoibm-seq-byte-values.spec").unwrap()
|
||||
);
|
||||
|
||||
make_conv_test!(
|
||||
lcase_ascii_to_ucase_ascii,
|
||||
"lcase_ascii_to_ucase_ascii",
|
||||
File::open("./test-resources/lcase-ascii.test").unwrap(),
|
||||
Some(&ASCII_LCASE_TO_UCASE),
|
||||
File::open("./test-resources/ucase-ascii.test").unwrap()
|
||||
);
|
||||
|
||||
make_conv_test!(
|
||||
ucase_ascii_to_lcase_ascii,
|
||||
"ucase_ascii_to_lcase_ascii",
|
||||
File::open("./test-resources/ucase-ascii.test").unwrap(),
|
||||
Some(&ASCII_UCASE_TO_LCASE),
|
||||
File::open("./test-resources/lcase-ascii.test").unwrap()
|
||||
);
|
||||
|
||||
make_conv_test!(
|
||||
// conv=ebcdic,ucase
|
||||
atoe_and_ucase_conv_spec_test,
|
||||
"atoe-and-ucase-conv-spec-test",
|
||||
File::open("./test-resources/seq-byte-values-b632a992d3aed5d8d1a59cc5a5a455ba.test").unwrap(),
|
||||
Some(&ASCII_TO_EBCDIC_LCASE_TO_UCASE),
|
||||
File::open("./test-resources/ucase-ebcdic.test").unwrap()
|
||||
);
|
||||
|
||||
make_conv_test!(
|
||||
// conv=ebcdic,lcase
|
||||
atoe_and_lcase_conv_spec_test,
|
||||
"atoe-and-lcase-conv-spec-test",
|
||||
File::open("./test-resources/seq-byte-values-b632a992d3aed5d8d1a59cc5a5a455ba.test").unwrap(),
|
||||
Some(&ASCII_TO_EBCDIC_UCASE_TO_LCASE),
|
||||
File::open("./test-resources/lcase-ebcdic.test").unwrap()
|
||||
);
|
||||
|
||||
make_conv_test!(
|
||||
// conv=ibm,ucase
|
||||
atoibm_and_ucase_conv_spec_test,
|
||||
"atoibm-and-ucase-conv-spec-test",
|
||||
File::open("./test-resources/seq-byte-values-b632a992d3aed5d8d1a59cc5a5a455ba.test").unwrap(),
|
||||
Some(&ASCII_TO_IBM_UCASE_TO_LCASE),
|
||||
File::open("./test-resources/lcase-ibm.test").unwrap()
|
||||
);
|
||||
|
||||
make_conv_test!(
|
||||
// conv=ibm,lcase
|
||||
atoibm_and_lcase_conv_spec_test,
|
||||
"atoibm-and-lcase-conv-spec-test",
|
||||
File::open("./test-resources/seq-byte-values-b632a992d3aed5d8d1a59cc5a5a455ba.test").unwrap(),
|
||||
Some(&ASCII_TO_IBM_LCASE_TO_UCASE),
|
||||
File::open("./test-resources/ucase-ibm.test").unwrap()
|
||||
);
|
||||
|
||||
#[test]
|
||||
fn all_valid_ascii_ebcdic_ascii_roundtrip_conv_test() {
|
||||
// ASCII->EBCDIC
|
||||
let test_name = "all-valid-ascii-to-ebcdic";
|
||||
let tmp_fname_ae = format!("./test-resources/FAILED-{}.test", test_name);
|
||||
|
||||
let i = Input {
|
||||
src: File::open(
|
||||
"./test-resources/all-valid-ascii-chars-37eff01866ba3f538421b30b7cbefcac.test",
|
||||
)
|
||||
.unwrap(),
|
||||
non_ascii: false,
|
||||
ibs: 128,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: icf!(Some(&ASCII_TO_EBCDIC)),
|
||||
iflags: IFlags::default(),
|
||||
};
|
||||
|
||||
let o = Output {
|
||||
dst: File::create(&tmp_fname_ae).unwrap(),
|
||||
obs: 1024,
|
||||
cflags: OConvFlags::default(),
|
||||
};
|
||||
|
||||
dd_fileout(i, o).unwrap();
|
||||
|
||||
// EBCDIC->ASCII
|
||||
let test_name = "all-valid-ebcdic-to-ascii";
|
||||
let tmp_fname_ea = format!("./test-resources/FAILED-{}.test", test_name);
|
||||
|
||||
let i = Input {
|
||||
src: File::open(&tmp_fname_ae).unwrap(),
|
||||
non_ascii: false,
|
||||
ibs: 256,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: icf!(Some(&EBCDIC_TO_ASCII)),
|
||||
iflags: IFlags::default(),
|
||||
};
|
||||
|
||||
let o = Output {
|
||||
dst: File::create(&tmp_fname_ea).unwrap(),
|
||||
obs: 1024,
|
||||
cflags: OConvFlags::default(),
|
||||
};
|
||||
|
||||
dd_fileout(i, o).unwrap();
|
||||
|
||||
// Final Comparison
|
||||
let res = File::open(&tmp_fname_ea).unwrap();
|
||||
let spec =
|
||||
File::open("./test-resources/all-valid-ascii-chars-37eff01866ba3f538421b30b7cbefcac.test")
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(
|
||||
res.metadata().unwrap().len(),
|
||||
spec.metadata().unwrap().len()
|
||||
);
|
||||
|
||||
let res = BufReader::new(res);
|
||||
let spec = BufReader::new(spec);
|
||||
|
||||
let res = BufReader::new(res);
|
||||
|
||||
// Check all bytes match
|
||||
for (b_res, b_spec) in res.bytes().zip(spec.bytes()) {
|
||||
assert_eq!(b_res.unwrap(), b_spec.unwrap());
|
||||
}
|
||||
|
||||
fs::remove_file(&tmp_fname_ae).unwrap();
|
||||
fs::remove_file(&tmp_fname_ea).unwrap();
|
||||
}
|
||||
|
||||
make_icf_test!(
|
||||
swab_256_test,
|
||||
"swab-256",
|
||||
File::open("./test-resources/seq-byte-values.test").unwrap(),
|
||||
IConvFlags {
|
||||
ctable: None,
|
||||
block: None,
|
||||
unblock: None,
|
||||
swab: true,
|
||||
sync: None,
|
||||
noerror: false,
|
||||
},
|
||||
File::open("./test-resources/seq-byte-values-swapped.test").unwrap()
|
||||
);
|
||||
|
||||
make_icf_test!(
|
||||
swab_257_test,
|
||||
"swab-257",
|
||||
File::open("./test-resources/seq-byte-values-odd.test").unwrap(),
|
||||
IConvFlags {
|
||||
ctable: None,
|
||||
block: None,
|
||||
unblock: None,
|
||||
swab: true,
|
||||
sync: None,
|
||||
noerror: false,
|
||||
},
|
||||
File::open("./test-resources/seq-byte-values-odd.spec").unwrap()
|
||||
);
|
89
src/uu/dd/src/dd_unit_tests/mod.rs
Normal file
89
src/uu/dd/src/dd_unit_tests/mod.rs
Normal file
|
@ -0,0 +1,89 @@
|
|||
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat
|
||||
|
||||
use super::*;
|
||||
|
||||
mod block_unblock_tests;
|
||||
mod conv_sync_tests;
|
||||
mod conversion_tests;
|
||||
mod sanity_tests;
|
||||
|
||||
use std::fs;
|
||||
use std::io::prelude::*;
|
||||
use std::io::BufReader;
|
||||
|
||||
struct LazyReader<R: Read> {
|
||||
src: R,
|
||||
}
|
||||
|
||||
impl<R: Read> Read for LazyReader<R> {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
let reduced = cmp::max(buf.len() / 2, 1);
|
||||
self.src.read(&mut buf[..reduced])
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! icf (
|
||||
( $ctable:expr ) =>
|
||||
{
|
||||
IConvFlags {
|
||||
ctable: $ctable,
|
||||
..IConvFlags::default()
|
||||
}
|
||||
};
|
||||
);
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! make_spec_test (
|
||||
( $test_id:ident, $test_name:expr, $src:expr ) =>
|
||||
{
|
||||
// When spec not given, output should match input
|
||||
make_spec_test!($test_id, $test_name, $src, $src);
|
||||
};
|
||||
( $test_id:ident, $test_name:expr, $src:expr, $spec:expr ) =>
|
||||
{
|
||||
make_spec_test!($test_id,
|
||||
$test_name,
|
||||
Input {
|
||||
src: $src,
|
||||
non_ascii: false,
|
||||
ibs: 512,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: IConvFlags::default(),
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: File::create(format!("./test-resources/FAILED-{}.test", $test_name)).unwrap(),
|
||||
obs: 512,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
$spec,
|
||||
format!("./test-resources/FAILED-{}.test", $test_name)
|
||||
);
|
||||
};
|
||||
( $test_id:ident, $test_name:expr, $i:expr, $o:expr, $spec:expr, $tmp_fname:expr ) =>
|
||||
{
|
||||
#[test]
|
||||
fn $test_id()
|
||||
{
|
||||
dd_fileout($i,$o).unwrap();
|
||||
|
||||
let res = File::open($tmp_fname).unwrap();
|
||||
// Check test file isn't empty (unless spec file is too)
|
||||
assert_eq!(res.metadata().unwrap().len(), $spec.metadata().unwrap().len());
|
||||
|
||||
let spec = BufReader::new($spec);
|
||||
let res = BufReader::new(res);
|
||||
|
||||
// Check all bytes match
|
||||
for (b_res, b_spec) in res.bytes().zip(spec.bytes())
|
||||
{
|
||||
assert_eq!(b_res.unwrap(),
|
||||
b_spec.unwrap());
|
||||
}
|
||||
|
||||
fs::remove_file($tmp_fname).unwrap();
|
||||
}
|
||||
};
|
||||
);
|
316
src/uu/dd/src/dd_unit_tests/sanity_tests.rs
Normal file
316
src/uu/dd/src/dd_unit_tests/sanity_tests.rs
Normal file
|
@ -0,0 +1,316 @@
|
|||
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat
|
||||
|
||||
use super::*;
|
||||
|
||||
const DST_PLACEHOLDER: Vec<u8> = Vec::new();
|
||||
|
||||
macro_rules! make_io_test (
|
||||
( $test_id:ident, $test_name:expr, $i:expr, $o:expr, $spec:expr ) =>
|
||||
{
|
||||
make_spec_test!($test_id,
|
||||
$test_name,
|
||||
$i,
|
||||
Output {
|
||||
dst: File::create(format!("./test-resources/FAILED-{}.test", $test_name)).unwrap(),
|
||||
obs: $o.obs,
|
||||
cflags: $o.cflags,
|
||||
},
|
||||
$spec,
|
||||
format!("./test-resources/FAILED-{}.test", $test_name)
|
||||
);
|
||||
};
|
||||
);
|
||||
|
||||
make_spec_test!(
|
||||
zeros_4k_test,
|
||||
"zeros-4k",
|
||||
File::open("./test-resources/zeros-620f0b67a91f7f74151bc5be745b7110.test").unwrap()
|
||||
);
|
||||
|
||||
make_spec_test!(
|
||||
ones_4k_test,
|
||||
"ones-4k",
|
||||
File::open("./test-resources/ones-6ae59e64850377ee5470c854761551ea.test").unwrap()
|
||||
);
|
||||
|
||||
make_spec_test!(
|
||||
deadbeef_32k_test,
|
||||
"deadbeef-32k",
|
||||
File::open("./test-resources/deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test").unwrap()
|
||||
);
|
||||
|
||||
make_spec_test!(
|
||||
random_73k_test,
|
||||
"random-73k",
|
||||
File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test").unwrap()
|
||||
);
|
||||
|
||||
make_io_test!(
|
||||
random_73k_test_not_a_multiple_obs_gt_ibs,
|
||||
"random-73k-not-a-multiple-obs-gt-ibs",
|
||||
Input {
|
||||
src: File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test").unwrap(),
|
||||
non_ascii: false,
|
||||
ibs: 521,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: IConvFlags::default(),
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: DST_PLACEHOLDER,
|
||||
obs: 1031,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test").unwrap()
|
||||
);
|
||||
|
||||
make_io_test!(
|
||||
random_73k_test_obs_lt_not_a_multiple_ibs,
|
||||
"random-73k-obs-lt-not-a-multiple-ibs",
|
||||
Input {
|
||||
src: File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test").unwrap(),
|
||||
non_ascii: false,
|
||||
ibs: 1031,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: IConvFlags::default(),
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: DST_PLACEHOLDER,
|
||||
obs: 521,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test").unwrap()
|
||||
);
|
||||
|
||||
make_io_test!(
|
||||
deadbeef_all_32k_test_count_reads,
|
||||
"deadbeef_all_32k_test_count_reads",
|
||||
Input {
|
||||
src: File::open("./test-resources/deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test").unwrap(),
|
||||
non_ascii: false,
|
||||
ibs: 1024,
|
||||
print_level: None,
|
||||
count: Some(CountType::Reads(32)),
|
||||
cflags: IConvFlags::default(),
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: DST_PLACEHOLDER,
|
||||
obs: 1024,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
File::open("./test-resources/deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test").unwrap()
|
||||
);
|
||||
|
||||
make_io_test!(
|
||||
deadbeef_all_32k_test_count_bytes,
|
||||
"deadbeef_all_32k_test_count_bytes",
|
||||
Input {
|
||||
src: File::open("./test-resources/deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test").unwrap(),
|
||||
non_ascii: false,
|
||||
ibs: 531,
|
||||
print_level: None,
|
||||
count: Some(CountType::Bytes(32 * 1024)),
|
||||
cflags: IConvFlags::default(),
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: DST_PLACEHOLDER,
|
||||
obs: 1031,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
File::open("./test-resources/deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test").unwrap()
|
||||
);
|
||||
|
||||
make_io_test!(
|
||||
deadbeef_32k_to_16k_test_count_reads,
|
||||
"deadbeef_32k_test_count_reads",
|
||||
Input {
|
||||
src: File::open("./test-resources/deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test").unwrap(),
|
||||
non_ascii: false,
|
||||
ibs: 1024,
|
||||
print_level: None,
|
||||
count: Some(CountType::Reads(16)),
|
||||
cflags: IConvFlags::default(),
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: DST_PLACEHOLDER,
|
||||
obs: 1031,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
File::open("./test-resources/gnudd-deadbeef-first-16k.spec").unwrap()
|
||||
);
|
||||
|
||||
make_io_test!(
|
||||
deadbeef_32k_to_12345_test_count_bytes,
|
||||
"deadbeef_32k_to_12345_test_count_bytes",
|
||||
Input {
|
||||
src: File::open("./test-resources/deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test").unwrap(),
|
||||
non_ascii: false,
|
||||
ibs: 531,
|
||||
print_level: None,
|
||||
count: Some(CountType::Bytes(12345)),
|
||||
cflags: IConvFlags::default(),
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: DST_PLACEHOLDER,
|
||||
obs: 1031,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
File::open("./test-resources/gnudd-deadbeef-first-12345.spec").unwrap()
|
||||
);
|
||||
|
||||
make_io_test!(
|
||||
random_73k_test_count_reads,
|
||||
"random-73k-test-count-reads",
|
||||
Input {
|
||||
src: File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test").unwrap(),
|
||||
non_ascii: false,
|
||||
ibs: 1024,
|
||||
print_level: None,
|
||||
count: Some(CountType::Reads(32)),
|
||||
cflags: IConvFlags::default(),
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: DST_PLACEHOLDER,
|
||||
obs: 1024,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
File::open("./test-resources/gnudd-random-first-32k.spec").unwrap()
|
||||
);
|
||||
|
||||
make_io_test!(
|
||||
random_73k_test_count_bytes,
|
||||
"random-73k-test-count-bytes",
|
||||
Input {
|
||||
src: File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test").unwrap(),
|
||||
non_ascii: false,
|
||||
ibs: 521,
|
||||
print_level: None,
|
||||
count: Some(CountType::Bytes(32 * 1024)),
|
||||
cflags: IConvFlags::default(),
|
||||
iflags: IFlags::default(),
|
||||
},
|
||||
Output {
|
||||
dst: DST_PLACEHOLDER,
|
||||
obs: 1031,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
File::open("./test-resources/gnudd-random-first-32k.spec").unwrap()
|
||||
);
|
||||
|
||||
make_io_test!(
|
||||
random_73k_test_lazy_fullblock,
|
||||
"random-73k-test-lazy-fullblock",
|
||||
Input {
|
||||
src: LazyReader {
|
||||
src: File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test")
|
||||
.unwrap()
|
||||
},
|
||||
non_ascii: false,
|
||||
ibs: 521,
|
||||
print_level: None,
|
||||
count: None,
|
||||
cflags: IConvFlags::default(),
|
||||
iflags: IFlags {
|
||||
fullblock: true,
|
||||
..IFlags::default()
|
||||
},
|
||||
},
|
||||
Output {
|
||||
dst: DST_PLACEHOLDER,
|
||||
obs: 1031,
|
||||
cflags: OConvFlags::default(),
|
||||
},
|
||||
File::open("./test-resources/random-5828891cb1230748e146f34223bbd3b5.test").unwrap()
|
||||
);
|
||||
|
||||
// Test internal buffer size fn
|
||||
#[test]
|
||||
fn bsize_test_primes() {
|
||||
let (n, m) = (7901, 7919);
|
||||
let res = calc_bsize(n, m);
|
||||
assert!(res % n == 0);
|
||||
assert!(res % m == 0);
|
||||
|
||||
assert_eq!(res, n * m);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bsize_test_rel_prime_obs_greater() {
|
||||
let (n, m) = (7 * 5119, 13 * 5119);
|
||||
let res = calc_bsize(n, m);
|
||||
assert!(res % n == 0);
|
||||
assert!(res % m == 0);
|
||||
|
||||
assert_eq!(res, 7 * 13 * 5119);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bsize_test_rel_prime_ibs_greater() {
|
||||
let (n, m) = (13 * 5119, 7 * 5119);
|
||||
let res = calc_bsize(n, m);
|
||||
assert!(res % n == 0);
|
||||
assert!(res % m == 0);
|
||||
|
||||
assert_eq!(res, 7 * 13 * 5119);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bsize_test_3fac_rel_prime() {
|
||||
let (n, m) = (11 * 13 * 5119, 7 * 11 * 5119);
|
||||
let res = calc_bsize(n, m);
|
||||
assert!(res % n == 0);
|
||||
assert!(res % m == 0);
|
||||
|
||||
assert_eq!(res, 7 * 11 * 13 * 5119);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bsize_test_ibs_greater() {
|
||||
let (n, m) = (512 * 1024, 256 * 1024);
|
||||
let res = calc_bsize(n, m);
|
||||
assert!(res % n == 0);
|
||||
assert!(res % m == 0);
|
||||
|
||||
assert_eq!(res, n);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bsize_test_obs_greater() {
|
||||
let (n, m) = (256 * 1024, 512 * 1024);
|
||||
let res = calc_bsize(n, m);
|
||||
assert!(res % n == 0);
|
||||
assert!(res % m == 0);
|
||||
|
||||
assert_eq!(res, m);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bsize_test_bs_eq() {
|
||||
let (n, m) = (1024, 1024);
|
||||
let res = calc_bsize(n, m);
|
||||
assert!(res % n == 0);
|
||||
assert!(res % m == 0);
|
||||
|
||||
assert_eq!(res, m);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_nocreat_causes_failure_when_ofile_doesnt_exist() {
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--conv=nocreat"),
|
||||
String::from("--of=not-a-real.file"),
|
||||
];
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
let _ = Output::<File>::new(&matches).unwrap();
|
||||
}
|
1
src/uu/dd/src/main.rs
Normal file
1
src/uu/dd/src/main.rs
Normal file
|
@ -0,0 +1 @@
|
|||
uucore_procs::main!(uu_dd); // spell-checker:ignore procs uucore
|
664
src/uu/dd/src/parseargs.rs
Normal file
664
src/uu/dd/src/parseargs.rs
Normal file
|
@ -0,0 +1,664 @@
|
|||
// This file is part of the uutils coreutils package.
|
||||
//
|
||||
// (c) Tyler Steele <tyler.steele@protonmail.com>
|
||||
//
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
// spell-checker:ignore ctty, ctable, iconvflags, oconvflags
|
||||
|
||||
#[cfg(test)]
|
||||
mod unit_tests;
|
||||
|
||||
use super::*;
|
||||
use std::error::Error;
|
||||
|
||||
pub type Matches = clap::ArgMatches<'static>;
|
||||
|
||||
/// Parser Errors describe errors with parser input
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum ParseError {
|
||||
MultipleFmtTable,
|
||||
MultipleUCaseLCase,
|
||||
MultipleBlockUnblock,
|
||||
MultipleExclNoCreat,
|
||||
FlagNoMatch(String),
|
||||
ConvFlagNoMatch(String),
|
||||
MultiplierStringParseFailure(String),
|
||||
MultiplierStringOverflow(String),
|
||||
BlockUnblockWithoutCBS,
|
||||
StatusLevelNotRecognized(String),
|
||||
Unimplemented(String),
|
||||
}
|
||||
|
||||
impl std::fmt::Display for ParseError {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Self::MultipleFmtTable => {
|
||||
write!(
|
||||
f,
|
||||
"Only one of conv=ascii conv=ebcdic or conv=ibm may be specified"
|
||||
)
|
||||
}
|
||||
Self::MultipleUCaseLCase => {
|
||||
write!(f, "Only one of conv=lcase or conv=ucase may be specified")
|
||||
}
|
||||
Self::MultipleBlockUnblock => {
|
||||
write!(f, "Only one of conv=block or conv=unblock may be specified")
|
||||
}
|
||||
Self::MultipleExclNoCreat => {
|
||||
write!(f, "Only one ov conv=excl or conv=nocreat may be specified")
|
||||
}
|
||||
Self::FlagNoMatch(arg) => {
|
||||
write!(f, "Unrecognized iflag=FLAG or oflag=FLAG -> {}", arg)
|
||||
}
|
||||
Self::ConvFlagNoMatch(arg) => {
|
||||
write!(f, "Unrecognized conv=CONV -> {}", arg)
|
||||
}
|
||||
Self::MultiplierStringParseFailure(arg) => {
|
||||
write!(f, "Unrecognized byte multiplier -> {}", arg)
|
||||
}
|
||||
Self::MultiplierStringOverflow(arg) => {
|
||||
write!(
|
||||
f,
|
||||
"Multiplier string would overflow on current system -> {}",
|
||||
arg
|
||||
)
|
||||
}
|
||||
Self::BlockUnblockWithoutCBS => {
|
||||
write!(f, "conv=block or conv=unblock specified without cbs=N")
|
||||
}
|
||||
Self::StatusLevelNotRecognized(arg) => {
|
||||
write!(f, "status=LEVEL not recognized -> {}", arg)
|
||||
}
|
||||
Self::Unimplemented(arg) => {
|
||||
write!(f, "feature not implemented on this system -> {}", arg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for ParseError {}
|
||||
|
||||
/// Some flags specified as part of a conv=CONV[,CONV]... block
|
||||
/// relate to the input file, others to the output file.
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum ConvFlag {
|
||||
// Input
|
||||
FmtAtoE,
|
||||
FmtEtoA,
|
||||
FmtAtoI,
|
||||
Block,
|
||||
Unblock,
|
||||
UCase,
|
||||
LCase,
|
||||
Swab,
|
||||
Sync,
|
||||
NoError,
|
||||
// Output
|
||||
Sparse,
|
||||
Excl,
|
||||
NoCreat,
|
||||
NoTrunc,
|
||||
FDataSync,
|
||||
FSync,
|
||||
}
|
||||
|
||||
impl std::str::FromStr for ConvFlag {
|
||||
type Err = ParseError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s {
|
||||
// Input
|
||||
"ascii" => Ok(Self::FmtEtoA),
|
||||
"ebcdic" => Ok(Self::FmtAtoE),
|
||||
"ibm" => Ok(Self::FmtAtoI),
|
||||
"lcase" => Ok(Self::LCase),
|
||||
"ucase" => Ok(Self::UCase),
|
||||
"block" => Ok(Self::Block),
|
||||
"unblock" => Ok(Self::Unblock),
|
||||
"swab" => Ok(Self::Swab),
|
||||
"sync" => Ok(Self::Sync),
|
||||
"noerror" => Ok(Self::NoError),
|
||||
// Output
|
||||
"sparse" => Ok(Self::Sparse),
|
||||
"excl" => Ok(Self::Excl),
|
||||
"nocreat" => Ok(Self::NoCreat),
|
||||
"notrunc" => Ok(Self::NoTrunc),
|
||||
"fdatasync" => Ok(Self::FDataSync),
|
||||
"fsync" => Ok(Self::FSync),
|
||||
_ => Err(ParseError::ConvFlagNoMatch(String::from(s))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum Flag {
|
||||
// Input only
|
||||
FullBlock,
|
||||
CountBytes,
|
||||
SkipBytes,
|
||||
// Either
|
||||
#[allow(unused)]
|
||||
Cio,
|
||||
#[allow(unused)]
|
||||
Direct,
|
||||
#[allow(unused)]
|
||||
Directory,
|
||||
#[allow(unused)]
|
||||
Dsync,
|
||||
#[allow(unused)]
|
||||
Sync,
|
||||
#[allow(unused)]
|
||||
NoCache,
|
||||
#[allow(unused)]
|
||||
NonBlock,
|
||||
#[allow(unused)]
|
||||
NoATime,
|
||||
#[allow(unused)]
|
||||
NoCtty,
|
||||
#[allow(unused)]
|
||||
NoFollow,
|
||||
#[allow(unused)]
|
||||
NoLinks,
|
||||
#[allow(unused)]
|
||||
Binary,
|
||||
#[allow(unused)]
|
||||
Text,
|
||||
// Output only
|
||||
Append,
|
||||
SeekBytes,
|
||||
}
|
||||
|
||||
impl std::str::FromStr for Flag {
|
||||
type Err = ParseError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s {
|
||||
// Input only
|
||||
"fullblock" => Ok(Self::FullBlock),
|
||||
"count_bytes" => Ok(Self::CountBytes),
|
||||
"skip_bytes" => Ok(Self::SkipBytes),
|
||||
// Either
|
||||
"cio" =>
|
||||
// Ok(Self::Cio),
|
||||
{
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
"direct" =>
|
||||
// Ok(Self::Direct),
|
||||
{
|
||||
if cfg!(target_os = "linux") {
|
||||
Ok(Self::Direct)
|
||||
} else {
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
}
|
||||
"directory" =>
|
||||
// Ok(Self::Directory),
|
||||
{
|
||||
if cfg!(target_os = "linux") {
|
||||
Ok(Self::Directory)
|
||||
} else {
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
}
|
||||
"dsync" =>
|
||||
// Ok(Self::Dsync),
|
||||
{
|
||||
if cfg!(target_os = "linux") {
|
||||
Ok(Self::Dsync)
|
||||
} else {
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
}
|
||||
"sync" =>
|
||||
// Ok(Self::Sync),
|
||||
{
|
||||
if cfg!(target_os = "linux") {
|
||||
Ok(Self::Sync)
|
||||
} else {
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
}
|
||||
"nocache" =>
|
||||
// Ok(Self::NoCache),
|
||||
{
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
"nonblock" =>
|
||||
// Ok(Self::NonBlock),
|
||||
{
|
||||
if cfg!(target_os = "linux") {
|
||||
Ok(Self::NonBlock)
|
||||
} else {
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
}
|
||||
"noatime" =>
|
||||
// Ok(Self::NoATime),
|
||||
{
|
||||
if cfg!(target_os = "linux") {
|
||||
Ok(Self::NoATime)
|
||||
} else {
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
}
|
||||
"noctty" =>
|
||||
// Ok(Self::NoCtty),
|
||||
{
|
||||
if cfg!(target_os = "linux") {
|
||||
Ok(Self::NoCtty)
|
||||
} else {
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
}
|
||||
"nofollow" =>
|
||||
// Ok(Self::NoFollow),
|
||||
{
|
||||
if cfg!(target_os = "linux") {
|
||||
Ok(Self::NoFollow)
|
||||
} else {
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
}
|
||||
"nolinks" =>
|
||||
// Ok(Self::NoLinks),
|
||||
{
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
"binary" =>
|
||||
// Ok(Self::Binary),
|
||||
{
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
"text" =>
|
||||
// Ok(Self::Text),
|
||||
{
|
||||
Err(ParseError::Unimplemented(s.to_string()))
|
||||
}
|
||||
// Output only
|
||||
"append" => Ok(Self::Append),
|
||||
"seek_bytes" => Ok(Self::SeekBytes),
|
||||
_ => Err(ParseError::FlagNoMatch(String::from(s))),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::str::FromStr for StatusLevel {
|
||||
type Err = ParseError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s {
|
||||
"none" => Ok(StatusLevel::None),
|
||||
"noxfer" => Ok(StatusLevel::Noxfer),
|
||||
"progress" => Ok(StatusLevel::Progress),
|
||||
_ => Err(ParseError::StatusLevelNotRecognized(s.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse bytes using str::parse, then map error if needed.
|
||||
fn parse_bytes_only(s: &str) -> Result<usize, ParseError> {
|
||||
s.parse()
|
||||
.map_err(|_| ParseError::MultiplierStringParseFailure(s.to_string()))
|
||||
}
|
||||
|
||||
/// Parse byte and multiplier like 512, 5KiB, or 1G.
|
||||
/// Uses uucore::parse_size, and adds the 'w' and 'c' suffixes which are mentioned
|
||||
/// in dd's info page.
|
||||
fn parse_bytes_with_opt_multiplier(s: &str) -> Result<usize, ParseError> {
|
||||
if let Some(idx) = s.rfind('c') {
|
||||
parse_bytes_only(&s[..idx])
|
||||
} else if let Some(idx) = s.rfind('w') {
|
||||
let partial = parse_bytes_only(&s[..idx])?;
|
||||
|
||||
partial
|
||||
.checked_mul(2)
|
||||
.ok_or_else(|| ParseError::MultiplierStringOverflow(s.to_string()))
|
||||
} else {
|
||||
uucore::parse_size::parse_size(s).map_err(|e| match e {
|
||||
uucore::parse_size::ParseSizeError::ParseFailure(s) => {
|
||||
ParseError::MultiplierStringParseFailure(s)
|
||||
}
|
||||
uucore::parse_size::ParseSizeError::SizeTooBig(s) => {
|
||||
ParseError::MultiplierStringOverflow(s)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse_ibs(matches: &Matches) -> Result<usize, ParseError> {
|
||||
if let Some(mixed_str) = matches.value_of(options::BS) {
|
||||
parse_bytes_with_opt_multiplier(mixed_str)
|
||||
} else if let Some(mixed_str) = matches.value_of(options::IBS) {
|
||||
parse_bytes_with_opt_multiplier(mixed_str)
|
||||
} else {
|
||||
Ok(512)
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_cbs(matches: &Matches) -> Result<Option<usize>, ParseError> {
|
||||
if let Some(s) = matches.value_of(options::CBS) {
|
||||
let bytes = parse_bytes_with_opt_multiplier(s)?;
|
||||
Ok(Some(bytes))
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse_status_level(matches: &Matches) -> Result<Option<StatusLevel>, ParseError> {
|
||||
match matches.value_of(options::STATUS) {
|
||||
Some(s) => {
|
||||
let st = s.parse()?;
|
||||
Ok(Some(st))
|
||||
}
|
||||
None => Ok(None),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse_obs(matches: &Matches) -> Result<usize, ParseError> {
|
||||
if let Some(mixed_str) = matches.value_of("bs") {
|
||||
parse_bytes_with_opt_multiplier(mixed_str)
|
||||
} else if let Some(mixed_str) = matches.value_of("obs") {
|
||||
parse_bytes_with_opt_multiplier(mixed_str)
|
||||
} else {
|
||||
Ok(512)
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_ctable(fmt: Option<ConvFlag>, case: Option<ConvFlag>) -> Option<&'static ConversionTable> {
|
||||
fn parse_conv_and_case_table(
|
||||
fmt: &ConvFlag,
|
||||
case: &ConvFlag,
|
||||
) -> Option<&'static ConversionTable> {
|
||||
match (fmt, case) {
|
||||
(ConvFlag::FmtAtoE, ConvFlag::UCase) => Some(&ASCII_TO_EBCDIC_LCASE_TO_UCASE),
|
||||
(ConvFlag::FmtAtoE, ConvFlag::LCase) => Some(&ASCII_TO_EBCDIC_UCASE_TO_LCASE),
|
||||
(ConvFlag::FmtEtoA, ConvFlag::UCase) => Some(&EBCDIC_TO_ASCII_LCASE_TO_UCASE),
|
||||
(ConvFlag::FmtEtoA, ConvFlag::LCase) => Some(&EBCDIC_TO_ASCII_UCASE_TO_LCASE),
|
||||
(ConvFlag::FmtAtoI, ConvFlag::UCase) => Some(&ASCII_TO_IBM_UCASE_TO_LCASE),
|
||||
(ConvFlag::FmtAtoI, ConvFlag::LCase) => Some(&ASCII_TO_IBM_LCASE_TO_UCASE),
|
||||
(_, _) => None,
|
||||
}
|
||||
}
|
||||
fn parse_conv_table_only(fmt: &ConvFlag) -> Option<&'static ConversionTable> {
|
||||
match fmt {
|
||||
ConvFlag::FmtAtoE => Some(&ASCII_TO_EBCDIC),
|
||||
ConvFlag::FmtEtoA => Some(&EBCDIC_TO_ASCII),
|
||||
ConvFlag::FmtAtoI => Some(&ASCII_TO_IBM),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
// ------------------------------------------------------------------------
|
||||
match (fmt, case) {
|
||||
// Both [ascii | ebcdic | ibm] and [lcase | ucase] specified
|
||||
(Some(fmt), Some(case)) => parse_conv_and_case_table(&fmt, &case),
|
||||
// Only [ascii | ebcdic | ibm] specified
|
||||
(Some(fmt), None) => parse_conv_table_only(&fmt),
|
||||
// Only [lcase | ucase] specified
|
||||
(None, Some(ConvFlag::UCase)) => Some(&ASCII_LCASE_TO_UCASE),
|
||||
(None, Some(ConvFlag::LCase)) => Some(&ASCII_UCASE_TO_LCASE),
|
||||
// ST else...
|
||||
(_, _) => None,
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_flag_list<T: std::str::FromStr<Err = ParseError>>(
|
||||
tag: &str,
|
||||
matches: &Matches,
|
||||
) -> Result<Vec<T>, ParseError> {
|
||||
let mut flags = Vec::new();
|
||||
|
||||
if let Some(comma_str) = matches.value_of(tag) {
|
||||
for s in comma_str.split(',') {
|
||||
let flag = s.parse()?;
|
||||
flags.push(flag);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(flags)
|
||||
}
|
||||
|
||||
/// Parse Conversion Options (Input Variety)
|
||||
/// Construct and validate a IConvFlags
|
||||
pub fn parse_conv_flag_input(matches: &Matches) -> Result<IConvFlags, ParseError> {
|
||||
let mut iconvflags = IConvFlags::default();
|
||||
let mut fmt = None;
|
||||
let mut case = None;
|
||||
let mut is_sync = false;
|
||||
|
||||
let flags = parse_flag_list(options::CONV, matches)?;
|
||||
let cbs = parse_cbs(matches)?;
|
||||
|
||||
for flag in flags {
|
||||
match flag {
|
||||
ConvFlag::FmtEtoA => {
|
||||
if fmt.is_some() {
|
||||
return Err(ParseError::MultipleFmtTable);
|
||||
} else {
|
||||
fmt = Some(flag);
|
||||
}
|
||||
}
|
||||
ConvFlag::FmtAtoE => {
|
||||
if fmt.is_some() {
|
||||
return Err(ParseError::MultipleFmtTable);
|
||||
} else {
|
||||
fmt = Some(flag);
|
||||
}
|
||||
}
|
||||
ConvFlag::FmtAtoI => {
|
||||
if fmt.is_some() {
|
||||
return Err(ParseError::MultipleFmtTable);
|
||||
} else {
|
||||
fmt = Some(flag);
|
||||
}
|
||||
}
|
||||
ConvFlag::UCase => {
|
||||
if case.is_some() {
|
||||
return Err(ParseError::MultipleUCaseLCase);
|
||||
} else {
|
||||
case = Some(flag)
|
||||
}
|
||||
}
|
||||
ConvFlag::LCase => {
|
||||
if case.is_some() {
|
||||
return Err(ParseError::MultipleUCaseLCase);
|
||||
} else {
|
||||
case = Some(flag)
|
||||
}
|
||||
}
|
||||
ConvFlag::Block => match (cbs, iconvflags.unblock) {
|
||||
(Some(cbs), None) => iconvflags.block = Some(cbs),
|
||||
(None, _) => return Err(ParseError::BlockUnblockWithoutCBS),
|
||||
(_, Some(_)) => return Err(ParseError::MultipleBlockUnblock),
|
||||
},
|
||||
ConvFlag::Unblock => match (cbs, iconvflags.block) {
|
||||
(Some(cbs), None) => iconvflags.unblock = Some(cbs),
|
||||
(None, _) => return Err(ParseError::BlockUnblockWithoutCBS),
|
||||
(_, Some(_)) => return Err(ParseError::MultipleBlockUnblock),
|
||||
},
|
||||
ConvFlag::Swab => iconvflags.swab = true,
|
||||
ConvFlag::Sync => is_sync = true,
|
||||
ConvFlag::NoError => iconvflags.noerror = true,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
// The final conversion table depends on both
|
||||
// fmt (eg. ASCII -> EBCDIC)
|
||||
// case (eg. UCASE -> LCASE)
|
||||
// So the final value can't be set until all flags are parsed.
|
||||
let ctable = parse_ctable(fmt, case);
|
||||
|
||||
// The final value of sync depends on block/unblock
|
||||
// block implies sync with ' '
|
||||
// unblock implies sync with 0
|
||||
// So the final value can't be set until all flags are parsed.
|
||||
let sync = if is_sync && (iconvflags.block.is_some() || iconvflags.unblock.is_some()) {
|
||||
Some(b' ')
|
||||
} else if is_sync {
|
||||
Some(0u8)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Ok(IConvFlags {
|
||||
ctable,
|
||||
sync,
|
||||
..iconvflags
|
||||
})
|
||||
}
|
||||
|
||||
/// Parse Conversion Options (Output Variety)
|
||||
/// Construct and validate a OConvFlags
|
||||
pub fn parse_conv_flag_output(matches: &Matches) -> Result<OConvFlags, ParseError> {
|
||||
let mut oconvflags = OConvFlags::default();
|
||||
|
||||
let flags = parse_flag_list(options::CONV, matches)?;
|
||||
|
||||
for flag in flags {
|
||||
match flag {
|
||||
ConvFlag::Sparse => oconvflags.sparse = true,
|
||||
ConvFlag::Excl => {
|
||||
if !oconvflags.nocreat {
|
||||
oconvflags.excl = true;
|
||||
} else {
|
||||
return Err(ParseError::MultipleExclNoCreat);
|
||||
}
|
||||
}
|
||||
ConvFlag::NoCreat => {
|
||||
if !oconvflags.excl {
|
||||
oconvflags.nocreat = true;
|
||||
} else {
|
||||
return Err(ParseError::MultipleExclNoCreat);
|
||||
}
|
||||
}
|
||||
ConvFlag::NoTrunc => oconvflags.notrunc = true,
|
||||
ConvFlag::FDataSync => oconvflags.fdatasync = true,
|
||||
ConvFlag::FSync => oconvflags.fsync = true,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(oconvflags)
|
||||
}
|
||||
|
||||
/// Parse IFlags struct from CL-input
|
||||
pub fn parse_iflags(matches: &Matches) -> Result<IFlags, ParseError> {
|
||||
let mut iflags = IFlags::default();
|
||||
|
||||
let flags = parse_flag_list(options::IFLAG, matches)?;
|
||||
|
||||
for flag in flags {
|
||||
match flag {
|
||||
Flag::Cio => iflags.cio = true,
|
||||
Flag::Direct => iflags.direct = true,
|
||||
Flag::Directory => iflags.directory = true,
|
||||
Flag::Dsync => iflags.dsync = true,
|
||||
Flag::Sync => iflags.sync = true,
|
||||
Flag::NoCache => iflags.nocache = true,
|
||||
Flag::NonBlock => iflags.nonblock = true,
|
||||
Flag::NoATime => iflags.noatime = true,
|
||||
Flag::NoCtty => iflags.noctty = true,
|
||||
Flag::NoFollow => iflags.nofollow = true,
|
||||
Flag::NoLinks => iflags.nolinks = true,
|
||||
Flag::Binary => iflags.binary = true,
|
||||
Flag::Text => iflags.text = true,
|
||||
Flag::FullBlock => iflags.fullblock = true,
|
||||
Flag::CountBytes => iflags.count_bytes = true,
|
||||
Flag::SkipBytes => iflags.skip_bytes = true,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(iflags)
|
||||
}
|
||||
|
||||
/// Parse OFlags struct from CL-input
|
||||
pub fn parse_oflags(matches: &Matches) -> Result<OFlags, ParseError> {
|
||||
let mut oflags = OFlags::default();
|
||||
|
||||
let flags = parse_flag_list(options::OFLAG, matches)?;
|
||||
|
||||
for flag in flags {
|
||||
match flag {
|
||||
Flag::Append => oflags.append = true,
|
||||
Flag::Cio => oflags.cio = true,
|
||||
Flag::Direct => oflags.direct = true,
|
||||
Flag::Directory => oflags.directory = true,
|
||||
Flag::Dsync => oflags.dsync = true,
|
||||
Flag::Sync => oflags.sync = true,
|
||||
Flag::NoCache => oflags.nocache = true,
|
||||
Flag::NonBlock => oflags.nonblock = true,
|
||||
Flag::NoATime => oflags.noatime = true,
|
||||
Flag::NoCtty => oflags.noctty = true,
|
||||
Flag::NoFollow => oflags.nofollow = true,
|
||||
Flag::NoLinks => oflags.nolinks = true,
|
||||
Flag::Binary => oflags.binary = true,
|
||||
Flag::Text => oflags.text = true,
|
||||
Flag::SeekBytes => oflags.seek_bytes = true,
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(oflags)
|
||||
}
|
||||
|
||||
/// Parse the amount of the input file to skip.
|
||||
pub fn parse_skip_amt(
|
||||
ibs: &usize,
|
||||
iflags: &IFlags,
|
||||
matches: &Matches,
|
||||
) -> Result<Option<usize>, ParseError> {
|
||||
if let Some(amt) = matches.value_of(options::SKIP) {
|
||||
let n = parse_bytes_with_opt_multiplier(amt)?;
|
||||
if iflags.skip_bytes {
|
||||
Ok(Some(n))
|
||||
} else {
|
||||
Ok(Some(ibs * n))
|
||||
}
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse the amount of the output file to seek.
|
||||
pub fn parse_seek_amt(
|
||||
obs: &usize,
|
||||
oflags: &OFlags,
|
||||
matches: &Matches,
|
||||
) -> Result<Option<usize>, ParseError> {
|
||||
if let Some(amt) = matches.value_of(options::SEEK) {
|
||||
let n = parse_bytes_with_opt_multiplier(amt)?;
|
||||
if oflags.seek_bytes {
|
||||
Ok(Some(n))
|
||||
} else {
|
||||
Ok(Some(obs * n))
|
||||
}
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse the value of count=N and the type of N implied by iflags
|
||||
pub fn parse_count(iflags: &IFlags, matches: &Matches) -> Result<Option<CountType>, ParseError> {
|
||||
if let Some(amt) = matches.value_of(options::COUNT) {
|
||||
let n = parse_bytes_with_opt_multiplier(amt)?;
|
||||
if iflags.count_bytes {
|
||||
Ok(Some(CountType::Bytes(n)))
|
||||
} else {
|
||||
Ok(Some(CountType::Reads(n)))
|
||||
}
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse whether the args indicate the input is not ascii
|
||||
pub fn parse_input_non_ascii(matches: &Matches) -> Result<bool, ParseError> {
|
||||
if let Some(conv_opts) = matches.value_of(options::CONV) {
|
||||
Ok(conv_opts.contains("ascii"))
|
||||
} else {
|
||||
Ok(false)
|
||||
}
|
||||
}
|
593
src/uu/dd/src/parseargs/unit_tests.rs
Normal file
593
src/uu/dd/src/parseargs/unit_tests.rs
Normal file
|
@ -0,0 +1,593 @@
|
|||
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat
|
||||
|
||||
use super::*;
|
||||
|
||||
use crate::StatusLevel;
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
#[test]
|
||||
fn unimplemented_flags_should_error_non_linux() {
|
||||
let mut succeeded = Vec::new();
|
||||
|
||||
// The following flags are only implemented in linux
|
||||
for flag in vec![
|
||||
"direct",
|
||||
"directory",
|
||||
"dsync",
|
||||
"sync",
|
||||
"nonblock",
|
||||
"noatime",
|
||||
"noctty",
|
||||
"nofollow",
|
||||
] {
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
format!("--iflag={}", flag),
|
||||
format!("--oflag={}", flag),
|
||||
];
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
match parse_iflags(&matches) {
|
||||
Ok(_) => succeeded.push(format!("iflag={}", flag)),
|
||||
Err(_) => { /* expected behaviour :-) */ }
|
||||
}
|
||||
match parse_oflags(&matches) {
|
||||
Ok(_) => succeeded.push(format!("oflag={}", flag)),
|
||||
Err(_) => { /* expected behaviour :-) */ }
|
||||
}
|
||||
}
|
||||
|
||||
if !succeeded.is_empty() {
|
||||
panic!(
|
||||
"The following flags did not panic as expected: {:?}",
|
||||
succeeded
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unimplemented_flags_should_error() {
|
||||
let mut succeeded = Vec::new();
|
||||
|
||||
// The following flags are not implemented
|
||||
for flag in vec!["cio", "nocache", "nolinks", "text", "binary"] {
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
format!("--iflag={}", flag),
|
||||
format!("--oflag={}", flag),
|
||||
];
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
match parse_iflags(&matches) {
|
||||
Ok(_) => succeeded.push(format!("iflag={}", flag)),
|
||||
Err(_) => { /* expected behaviour :-) */ }
|
||||
}
|
||||
match parse_oflags(&matches) {
|
||||
Ok(_) => succeeded.push(format!("oflag={}", flag)),
|
||||
Err(_) => { /* expected behaviour :-) */ }
|
||||
}
|
||||
}
|
||||
|
||||
if !succeeded.is_empty() {
|
||||
panic!(
|
||||
"The following flags did not panic as expected: {:?}",
|
||||
succeeded
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_status_level_absent() {
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--if=foo.file"),
|
||||
String::from("--of=bar.file"),
|
||||
];
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
let st = parse_status_level(&matches).unwrap();
|
||||
|
||||
assert_eq!(st, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_status_level_none() {
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--status=none"),
|
||||
String::from("--if=foo.file"),
|
||||
String::from("--of=bar.file"),
|
||||
];
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
let st = parse_status_level(&matches).unwrap().unwrap();
|
||||
|
||||
assert_eq!(st, StatusLevel::None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_all_top_level_args_no_leading_dashes() {
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("if=foo.file"),
|
||||
String::from("of=bar.file"),
|
||||
String::from("ibs=10"),
|
||||
String::from("obs=10"),
|
||||
String::from("cbs=1"),
|
||||
String::from("bs=100"),
|
||||
String::from("count=2"),
|
||||
String::from("skip=2"),
|
||||
String::from("seek=2"),
|
||||
String::from("status=progress"),
|
||||
String::from("conv=ascii,ucase"),
|
||||
String::from("iflag=count_bytes,skip_bytes"),
|
||||
String::from("oflag=append,seek_bytes"),
|
||||
];
|
||||
let args = args
|
||||
.into_iter()
|
||||
.fold(Vec::new(), append_dashes_if_not_present);
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
assert_eq!(100, parse_ibs(&matches).unwrap());
|
||||
assert_eq!(100, parse_obs(&matches).unwrap());
|
||||
assert_eq!(1, parse_cbs(&matches).unwrap().unwrap());
|
||||
assert_eq!(
|
||||
CountType::Bytes(2),
|
||||
parse_count(
|
||||
&IFlags {
|
||||
count_bytes: true,
|
||||
..IFlags::default()
|
||||
},
|
||||
&matches
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
200,
|
||||
parse_skip_amt(&100, &IFlags::default(), &matches)
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
200,
|
||||
parse_seek_amt(&100, &OFlags::default(), &matches)
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
StatusLevel::Progress,
|
||||
parse_status_level(&matches).unwrap().unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
IConvFlags {
|
||||
ctable: Some(&EBCDIC_TO_ASCII_LCASE_TO_UCASE),
|
||||
..IConvFlags::default()
|
||||
},
|
||||
parse_conv_flag_input(&matches).unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
OConvFlags::default(),
|
||||
parse_conv_flag_output(&matches).unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
IFlags {
|
||||
count_bytes: true,
|
||||
skip_bytes: true,
|
||||
..IFlags::default()
|
||||
},
|
||||
parse_iflags(&matches).unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
OFlags {
|
||||
append: true,
|
||||
seek_bytes: true,
|
||||
..OFlags::default()
|
||||
},
|
||||
parse_oflags(&matches).unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_all_top_level_args_with_leading_dashes() {
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--if=foo.file"),
|
||||
String::from("--of=bar.file"),
|
||||
String::from("--ibs=10"),
|
||||
String::from("--obs=10"),
|
||||
String::from("--cbs=1"),
|
||||
String::from("--bs=100"),
|
||||
String::from("--count=2"),
|
||||
String::from("--skip=2"),
|
||||
String::from("--seek=2"),
|
||||
String::from("--status=progress"),
|
||||
String::from("--conv=ascii,ucase"),
|
||||
String::from("--iflag=count_bytes,skip_bytes"),
|
||||
String::from("--oflag=append,seek_bytes"),
|
||||
];
|
||||
let args = args
|
||||
.into_iter()
|
||||
.fold(Vec::new(), append_dashes_if_not_present);
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
assert_eq!(100, parse_ibs(&matches).unwrap());
|
||||
assert_eq!(100, parse_obs(&matches).unwrap());
|
||||
assert_eq!(1, parse_cbs(&matches).unwrap().unwrap());
|
||||
assert_eq!(
|
||||
CountType::Bytes(2),
|
||||
parse_count(
|
||||
&IFlags {
|
||||
count_bytes: true,
|
||||
..IFlags::default()
|
||||
},
|
||||
&matches
|
||||
)
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
200,
|
||||
parse_skip_amt(&100, &IFlags::default(), &matches)
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
200,
|
||||
parse_seek_amt(&100, &OFlags::default(), &matches)
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
StatusLevel::Progress,
|
||||
parse_status_level(&matches).unwrap().unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
IConvFlags {
|
||||
ctable: Some(&EBCDIC_TO_ASCII_LCASE_TO_UCASE),
|
||||
..IConvFlags::default()
|
||||
},
|
||||
parse_conv_flag_input(&matches).unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
OConvFlags::default(),
|
||||
parse_conv_flag_output(&matches).unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
IFlags {
|
||||
count_bytes: true,
|
||||
skip_bytes: true,
|
||||
..IFlags::default()
|
||||
},
|
||||
parse_iflags(&matches).unwrap()
|
||||
);
|
||||
assert_eq!(
|
||||
OFlags {
|
||||
append: true,
|
||||
seek_bytes: true,
|
||||
..OFlags::default()
|
||||
},
|
||||
parse_oflags(&matches).unwrap()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_status_level_progress() {
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--if=foo.file"),
|
||||
String::from("--of=bar.file"),
|
||||
String::from("--status=progress"),
|
||||
];
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
let st = parse_status_level(&matches).unwrap().unwrap();
|
||||
|
||||
assert_eq!(st, StatusLevel::Progress);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_status_level_noxfer() {
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--if=foo.file"),
|
||||
String::from("--status=noxfer"),
|
||||
String::from("--of=bar.file"),
|
||||
];
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
let st = parse_status_level(&matches).unwrap().unwrap();
|
||||
|
||||
assert_eq!(st, StatusLevel::Noxfer);
|
||||
}
|
||||
|
||||
// ----- IConvFlags/Output -----
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn icf_ctable_error() {
|
||||
let args = vec![String::from("dd"), String::from("--conv=ascii,ebcdic,ibm")];
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
let _ = parse_conv_flag_input(&matches).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn icf_case_error() {
|
||||
let args = vec![String::from("dd"), String::from("--conv=ucase,lcase")];
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
let _ = parse_conv_flag_input(&matches).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn icf_block_error() {
|
||||
let args = vec![String::from("dd"), String::from("--conv=block,unblock")];
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
let _ = parse_conv_flag_input(&matches).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn icf_creat_error() {
|
||||
let args = vec![String::from("dd"), String::from("--conv=excl,nocreat")];
|
||||
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
let _ = parse_conv_flag_output(&matches).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_icf_token_ibm() {
|
||||
let exp = vec![ConvFlag::FmtAtoI];
|
||||
|
||||
let args = vec![String::from("dd"), String::from("--conv=ibm")];
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
let act = parse_flag_list::<ConvFlag>("conv", &matches).unwrap();
|
||||
|
||||
assert_eq!(exp.len(), act.len());
|
||||
for cf in &exp {
|
||||
assert!(exp.contains(&cf));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_icf_tokens_elu() {
|
||||
let exp = vec![ConvFlag::FmtEtoA, ConvFlag::LCase, ConvFlag::Unblock];
|
||||
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--conv=ebcdic,lcase,unblock"),
|
||||
];
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
let act = parse_flag_list::<ConvFlag>("conv", &matches).unwrap();
|
||||
|
||||
assert_eq!(exp.len(), act.len());
|
||||
for cf in &exp {
|
||||
assert!(exp.contains(&cf));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_icf_tokens_remaining() {
|
||||
let exp = vec![
|
||||
ConvFlag::FmtAtoE,
|
||||
ConvFlag::UCase,
|
||||
ConvFlag::Block,
|
||||
ConvFlag::Sparse,
|
||||
ConvFlag::Swab,
|
||||
ConvFlag::Sync,
|
||||
ConvFlag::NoError,
|
||||
ConvFlag::Excl,
|
||||
ConvFlag::NoCreat,
|
||||
ConvFlag::NoTrunc,
|
||||
ConvFlag::NoError,
|
||||
ConvFlag::FDataSync,
|
||||
ConvFlag::FSync,
|
||||
];
|
||||
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--conv=ascii,ucase,block,sparse,swab,sync,noerror,excl,nocreat,notrunc,noerror,fdatasync,fsync"),
|
||||
];
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
let act = parse_flag_list::<ConvFlag>("conv", &matches).unwrap();
|
||||
|
||||
assert_eq!(exp.len(), act.len());
|
||||
for cf in &exp {
|
||||
assert!(exp.contains(&cf));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_iflag_tokens() {
|
||||
let exp = vec![
|
||||
Flag::FullBlock,
|
||||
Flag::CountBytes,
|
||||
Flag::SkipBytes,
|
||||
Flag::Append,
|
||||
Flag::SeekBytes,
|
||||
];
|
||||
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--iflag=fullblock,count_bytes,skip_bytes,append,seek_bytes"),
|
||||
];
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
let act = parse_flag_list::<Flag>("iflag", &matches).unwrap();
|
||||
|
||||
assert_eq!(exp.len(), act.len());
|
||||
for cf in &exp {
|
||||
assert!(exp.contains(&cf));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_oflag_tokens() {
|
||||
let exp = vec![
|
||||
Flag::FullBlock,
|
||||
Flag::CountBytes,
|
||||
Flag::SkipBytes,
|
||||
Flag::Append,
|
||||
Flag::SeekBytes,
|
||||
];
|
||||
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--oflag=fullblock,count_bytes,skip_bytes,append,seek_bytes"),
|
||||
];
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
let act = parse_flag_list::<Flag>("oflag", &matches).unwrap();
|
||||
|
||||
assert_eq!(exp.len(), act.len());
|
||||
for cf in &exp {
|
||||
assert!(exp.contains(&cf));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[test]
|
||||
fn parse_iflag_tokens_linux() {
|
||||
let exp = vec![
|
||||
Flag::Direct,
|
||||
Flag::Directory,
|
||||
Flag::Dsync,
|
||||
Flag::Sync,
|
||||
Flag::NonBlock,
|
||||
Flag::NoATime,
|
||||
Flag::NoCtty,
|
||||
Flag::NoFollow,
|
||||
];
|
||||
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--iflag=direct,directory,dsync,sync,nonblock,noatime,noctty,nofollow"),
|
||||
];
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
let act = parse_flag_list::<Flag>("iflag", &matches).unwrap();
|
||||
|
||||
assert_eq!(exp.len(), act.len());
|
||||
for cf in &exp {
|
||||
assert!(exp.contains(&cf));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[test]
|
||||
fn parse_oflag_tokens_linux() {
|
||||
let exp = vec![
|
||||
Flag::Direct,
|
||||
Flag::Directory,
|
||||
Flag::Dsync,
|
||||
Flag::Sync,
|
||||
Flag::NonBlock,
|
||||
Flag::NoATime,
|
||||
Flag::NoCtty,
|
||||
Flag::NoFollow,
|
||||
];
|
||||
|
||||
let args = vec![
|
||||
String::from("dd"),
|
||||
String::from("--oflag=direct,directory,dsync,sync,nonblock,noatime,noctty,nofollow"),
|
||||
];
|
||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||
|
||||
let act = parse_flag_list::<Flag>("oflag", &matches).unwrap();
|
||||
|
||||
assert_eq!(exp.len(), act.len());
|
||||
for cf in &exp {
|
||||
assert!(exp.contains(&cf));
|
||||
}
|
||||
}
|
||||
|
||||
// ----- Multiplier Strings etc. -----
|
||||
macro_rules! test_byte_parser (
|
||||
( $test_name:ident, $bs_str:expr, $bs:expr ) =>
|
||||
{
|
||||
#[allow(non_snake_case)]
|
||||
#[test]
|
||||
fn $test_name()
|
||||
{
|
||||
// let bs_str = String::from($bs_str);
|
||||
assert_eq!($bs, parse_bytes_with_opt_multiplier($bs_str).unwrap())
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
test_byte_parser!(test_bytes_n, "765", 765);
|
||||
test_byte_parser!(test_bytes_c, "13c", 13);
|
||||
|
||||
test_byte_parser!(test_bytes_w, "1w", 2);
|
||||
|
||||
test_byte_parser!(test_bytes_b, "1b", 512);
|
||||
|
||||
test_byte_parser!(test_bytes_k, "1kB", 1000);
|
||||
test_byte_parser!(test_bytes_K, "1K", 1024);
|
||||
test_byte_parser!(test_bytes_Ki, "1KiB", 1024);
|
||||
|
||||
test_byte_parser!(test_bytes_MB, "2MB", 2 * 1000 * 1000);
|
||||
test_byte_parser!(test_bytes_M, "2M", 2 * 1024 * 1024);
|
||||
test_byte_parser!(test_bytes_Mi, "2MiB", 2 * 1024 * 1024);
|
||||
|
||||
test_byte_parser!(test_bytes_GB, "3GB", 3 * 1000 * 1000 * 1000);
|
||||
test_byte_parser!(test_bytes_G, "3G", 3 * 1024 * 1024 * 1024);
|
||||
test_byte_parser!(test_bytes_Gi, "3GiB", 3 * 1024 * 1024 * 1024);
|
||||
|
||||
#[cfg(target_pointer_width = "64")]
|
||||
#[cfg(test)]
|
||||
mod test_64bit_arch {
|
||||
use super::*;
|
||||
|
||||
test_byte_parser!(test_bytes_TB, "4TB", 4 * 1000 * 1000 * 1000 * 1000);
|
||||
test_byte_parser!(test_bytes_T, "4T", 4 * 1024 * 1024 * 1024 * 1024);
|
||||
test_byte_parser!(test_bytes_Ti, "4TiB", 4 * 1024 * 1024 * 1024 * 1024);
|
||||
|
||||
test_byte_parser!(test_bytes_PB, "5PB", 5 * 1000 * 1000 * 1000 * 1000 * 1000);
|
||||
test_byte_parser!(test_bytes_P, "5P", 5 * 1024 * 1024 * 1024 * 1024 * 1024);
|
||||
test_byte_parser!(test_bytes_Pi, "5PiB", 5 * 1024 * 1024 * 1024 * 1024 * 1024);
|
||||
|
||||
test_byte_parser!(
|
||||
test_bytes_EB,
|
||||
"6EB",
|
||||
6 * 1000 * 1000 * 1000 * 1000 * 1000 * 1000
|
||||
);
|
||||
test_byte_parser!(
|
||||
test_bytes_E,
|
||||
"6E",
|
||||
6 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024
|
||||
);
|
||||
test_byte_parser!(
|
||||
test_bytes_Ei,
|
||||
"6EiB",
|
||||
6 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_overflow_panic() {
|
||||
let bs_str = format!("{}KiB", usize::MAX);
|
||||
|
||||
parse_bytes_with_opt_multiplier(&bs_str).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn test_neg_panic() {
|
||||
let bs_str = format!("{}", -1);
|
||||
|
||||
parse_bytes_with_opt_multiplier(&bs_str).unwrap();
|
||||
}
|
Binary file not shown.
16
src/uu/dd/test-resources/dd-block-cbs16-win.test
Normal file
16
src/uu/dd/test-resources/dd-block-cbs16-win.test
Normal file
|
@ -0,0 +1,16 @@
|
|||
0
|
||||
01
|
||||
012
|
||||
0123
|
||||
01234
|
||||
012345
|
||||
0123456
|
||||
01234567
|
||||
012345678
|
||||
0123456789
|
||||
0123456789a
|
||||
0123456789ab
|
||||
0123456789abc
|
||||
0123456789abcd
|
||||
0123456789abcde
|
||||
0123456789abcdef
|
1
src/uu/dd/test-resources/dd-block-cbs16.spec
Normal file
1
src/uu/dd/test-resources/dd-block-cbs16.spec
Normal file
|
@ -0,0 +1 @@
|
|||
0 01 012 0123 01234 012345 0123456 01234567 012345678 0123456789 0123456789a 0123456789ab 0123456789abc 0123456789abcd 0123456789abcde 0123456789abcdef
|
16
src/uu/dd/test-resources/dd-block-cbs16.test
Normal file
16
src/uu/dd/test-resources/dd-block-cbs16.test
Normal file
|
@ -0,0 +1,16 @@
|
|||
0
|
||||
01
|
||||
012
|
||||
0123
|
||||
01234
|
||||
012345
|
||||
0123456
|
||||
01234567
|
||||
012345678
|
||||
0123456789
|
||||
0123456789a
|
||||
0123456789ab
|
||||
0123456789abc
|
||||
0123456789abcd
|
||||
0123456789abcde
|
||||
0123456789abcdef
|
1
src/uu/dd/test-resources/dd-block-cbs8.spec
Normal file
1
src/uu/dd/test-resources/dd-block-cbs8.spec
Normal file
|
@ -0,0 +1 @@
|
|||
0 01 012 0123 01234 012345 0123456 012345670123456701234567012345670123456701234567012345670123456701234567
|
|
@ -0,0 +1 @@
|
|||
pre post
|
|
@ -0,0 +1,4 @@
|
|||
pre
|
||||
|
||||
|
||||
post
|
4
src/uu/dd/test-resources/dd-block-consecutive-nl.test
Normal file
4
src/uu/dd/test-resources/dd-block-consecutive-nl.test
Normal file
|
@ -0,0 +1,4 @@
|
|||
pre
|
||||
|
||||
|
||||
post
|
16
src/uu/dd/test-resources/dd-unblock-cbs16-win.spec
Normal file
16
src/uu/dd/test-resources/dd-unblock-cbs16-win.spec
Normal file
|
@ -0,0 +1,16 @@
|
|||
0
|
||||
01
|
||||
012
|
||||
0123
|
||||
01234
|
||||
012345
|
||||
0123456
|
||||
01234567
|
||||
012345678
|
||||
0123456789
|
||||
0123456789a
|
||||
0123456789ab
|
||||
0123456789abc
|
||||
0123456789abcd
|
||||
0123456789abcde
|
||||
0123456789abcdef
|
16
src/uu/dd/test-resources/dd-unblock-cbs16.spec
Normal file
16
src/uu/dd/test-resources/dd-unblock-cbs16.spec
Normal file
|
@ -0,0 +1,16 @@
|
|||
0
|
||||
01
|
||||
012
|
||||
0123
|
||||
01234
|
||||
012345
|
||||
0123456
|
||||
01234567
|
||||
012345678
|
||||
0123456789
|
||||
0123456789a
|
||||
0123456789ab
|
||||
0123456789abc
|
||||
0123456789abcd
|
||||
0123456789abcde
|
||||
0123456789abcdef
|
1
src/uu/dd/test-resources/dd-unblock-cbs16.test
Normal file
1
src/uu/dd/test-resources/dd-unblock-cbs16.test
Normal file
|
@ -0,0 +1 @@
|
|||
0 01 012 0123 01234 012345 0123456 01234567 012345678 0123456789 0123456789a 0123456789ab 0123456789abc 0123456789abcd 0123456789abcde 0123456789abcdef
|
32
src/uu/dd/test-resources/dd-unblock-cbs8-win.spec
Normal file
32
src/uu/dd/test-resources/dd-unblock-cbs8-win.spec
Normal file
|
@ -0,0 +1,32 @@
|
|||
0
|
||||
|
||||
01
|
||||
|
||||
012
|
||||
|
||||
0123
|
||||
|
||||
01234
|
||||
|
||||
012345
|
||||
|
||||
0123456
|
||||
|
||||
01234567
|
||||
|
||||
01234567
|
||||
8
|
||||
01234567
|
||||
89
|
||||
01234567
|
||||
89a
|
||||
01234567
|
||||
89ab
|
||||
01234567
|
||||
89abc
|
||||
01234567
|
||||
89abcd
|
||||
01234567
|
||||
89abcde
|
||||
01234567
|
||||
89abcdef
|
32
src/uu/dd/test-resources/dd-unblock-cbs8.spec
Normal file
32
src/uu/dd/test-resources/dd-unblock-cbs8.spec
Normal file
|
@ -0,0 +1,32 @@
|
|||
0
|
||||
|
||||
01
|
||||
|
||||
012
|
||||
|
||||
0123
|
||||
|
||||
01234
|
||||
|
||||
012345
|
||||
|
||||
0123456
|
||||
|
||||
01234567
|
||||
|
||||
01234567
|
||||
8
|
||||
01234567
|
||||
89
|
||||
01234567
|
||||
89a
|
||||
01234567
|
||||
89ab
|
||||
01234567
|
||||
89abc
|
||||
01234567
|
||||
89abcd
|
||||
01234567
|
||||
89abcde
|
||||
01234567
|
||||
89abcdef
|
BIN
src/uu/dd/test-resources/deadbeef-16.spec
Normal file
BIN
src/uu/dd/test-resources/deadbeef-16.spec
Normal file
Binary file not shown.
1
src/uu/dd/test-resources/deadbeef-16.test
Normal file
1
src/uu/dd/test-resources/deadbeef-16.test
Normal file
|
@ -0,0 +1 @@
|
|||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
File diff suppressed because one or more lines are too long
BIN
src/uu/dd/test-resources/gnudd-conv-atoe-seq-byte-values.spec
Normal file
BIN
src/uu/dd/test-resources/gnudd-conv-atoe-seq-byte-values.spec
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/gnudd-conv-atoibm-seq-byte-values.spec
Normal file
BIN
src/uu/dd/test-resources/gnudd-conv-atoibm-seq-byte-values.spec
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/uu/dd/test-resources/gnudd-conv-etoa-seq-byte-values.spec
Normal file
BIN
src/uu/dd/test-resources/gnudd-conv-etoa-seq-byte-values.spec
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/uu/dd/test-resources/gnudd-conv-ltou-seq-byte-values.spec
Normal file
BIN
src/uu/dd/test-resources/gnudd-conv-ltou-seq-byte-values.spec
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
BIN
src/uu/dd/test-resources/gnudd-conv-utol-seq-byte-values.spec
Normal file
BIN
src/uu/dd/test-resources/gnudd-conv-utol-seq-byte-values.spec
Normal file
Binary file not shown.
1
src/uu/dd/test-resources/gnudd-deadbeef-first-12345.spec
Normal file
1
src/uu/dd/test-resources/gnudd-deadbeef-first-12345.spec
Normal file
File diff suppressed because one or more lines are too long
1
src/uu/dd/test-resources/gnudd-deadbeef-first-16k.spec
Normal file
1
src/uu/dd/test-resources/gnudd-deadbeef-first-16k.spec
Normal file
File diff suppressed because one or more lines are too long
BIN
src/uu/dd/test-resources/gnudd-random-first-32k.spec
Normal file
BIN
src/uu/dd/test-resources/gnudd-random-first-32k.spec
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/lcase-ascii.test
Normal file
BIN
src/uu/dd/test-resources/lcase-ascii.test
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/lcase-ebcdic.spec
Normal file
BIN
src/uu/dd/test-resources/lcase-ebcdic.spec
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/lcase-ebcdic.test
Normal file
BIN
src/uu/dd/test-resources/lcase-ebcdic.test
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/lcase-ibm.spec
Normal file
BIN
src/uu/dd/test-resources/lcase-ibm.spec
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/lcase-ibm.test
Normal file
BIN
src/uu/dd/test-resources/lcase-ibm.test
Normal file
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
Binary file not shown.
Binary file not shown.
BIN
src/uu/dd/test-resources/seq-byte-values-odd.spec
Normal file
BIN
src/uu/dd/test-resources/seq-byte-values-odd.spec
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/seq-byte-values-odd.test
Normal file
BIN
src/uu/dd/test-resources/seq-byte-values-odd.test
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/seq-byte-values-swapped.test
Normal file
BIN
src/uu/dd/test-resources/seq-byte-values-swapped.test
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/seq-byte-values.test
Normal file
BIN
src/uu/dd/test-resources/seq-byte-values.test
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/ucase-ascii.test
Normal file
BIN
src/uu/dd/test-resources/ucase-ascii.test
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/ucase-ebcdic.spec
Normal file
BIN
src/uu/dd/test-resources/ucase-ebcdic.spec
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/ucase-ebcdic.test
Normal file
BIN
src/uu/dd/test-resources/ucase-ebcdic.test
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/ucase-ibm.spec
Normal file
BIN
src/uu/dd/test-resources/ucase-ibm.spec
Normal file
Binary file not shown.
BIN
src/uu/dd/test-resources/ucase-ibm.test
Normal file
BIN
src/uu/dd/test-resources/ucase-ibm.test
Normal file
Binary file not shown.
Binary file not shown.
565
tests/by-util/test_dd.rs
Normal file
565
tests/by-util/test_dd.rs
Normal file
|
@ -0,0 +1,565 @@
|
|||
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, availible, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat
|
||||
|
||||
use crate::common::util::*;
|
||||
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::{BufReader, Read, Write};
|
||||
use std::path::PathBuf;
|
||||
use tempfile::tempfile;
|
||||
|
||||
macro_rules! inf {
|
||||
($fname:expr) => {{
|
||||
&format!("if={}", $fname)
|
||||
}};
|
||||
}
|
||||
|
||||
macro_rules! of {
|
||||
($fname:expr) => {{
|
||||
&format!("of={}", $fname)
|
||||
}};
|
||||
}
|
||||
|
||||
macro_rules! fixture_path {
|
||||
($fname:expr) => {{
|
||||
PathBuf::from(format!("./tests/fixtures/dd/{}", $fname))
|
||||
}};
|
||||
}
|
||||
|
||||
macro_rules! assert_fixture_exists {
|
||||
($fname:expr) => {{
|
||||
let fpath = fixture_path!($fname);
|
||||
if !fpath.exists() {
|
||||
panic!("Fixture missing: {:?}", fpath);
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
macro_rules! assert_fixture_not_exists {
|
||||
($fname:expr) => {{
|
||||
let fpath = PathBuf::from(format!("./fixtures/dd/{}", $fname));
|
||||
if fpath.exists() {
|
||||
panic!("Fixture present: {:?}", fpath);
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
macro_rules! build_test_file {
|
||||
($fp:expr, $data:expr) => {{
|
||||
OpenOptions::new()
|
||||
.write(true)
|
||||
.create(true)
|
||||
.truncate(true)
|
||||
.open($fp)
|
||||
.unwrap()
|
||||
.write_all($data)
|
||||
.unwrap()
|
||||
}};
|
||||
}
|
||||
|
||||
macro_rules! cmp_file (
|
||||
($spec:expr, $test:expr) =>
|
||||
{
|
||||
let specfile_len = $spec.metadata().unwrap().len();
|
||||
let testfile_len = $test.metadata().unwrap().len();
|
||||
assert_eq!(testfile_len, specfile_len);
|
||||
|
||||
let spec = BufReader::new($spec);
|
||||
let test = BufReader::new($test);
|
||||
|
||||
for (b_spec, b_test) in spec.bytes().zip(test.bytes())
|
||||
{
|
||||
assert_eq!(b_spec.unwrap(),
|
||||
b_test.unwrap());
|
||||
}
|
||||
};
|
||||
);
|
||||
|
||||
fn build_ascii_block(n: usize) -> Vec<u8> {
|
||||
(0..=127).cycle().take(n).collect()
|
||||
}
|
||||
|
||||
// Sanity Tests
|
||||
#[test]
|
||||
fn version() {
|
||||
new_ucmd!().args(&["--version"]).succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn help() {
|
||||
new_ucmd!().args(&["--help"]).succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_stdout() {
|
||||
let input = build_ascii_block(521);
|
||||
let output = String::from_utf8(input.clone()).unwrap();
|
||||
new_ucmd!()
|
||||
.args(&["status=none"])
|
||||
.pipe_in(input)
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_only(output);
|
||||
}
|
||||
|
||||
// Top-Level Items
|
||||
// count=N, skip=N, status=LEVEL, conv=FLAG, *flag=FLAG
|
||||
#[test]
|
||||
fn test_stdin_stdout_count() {
|
||||
let input = build_ascii_block(521);
|
||||
let mut output = String::from_utf8(input.clone()).unwrap();
|
||||
output.truncate(256);
|
||||
new_ucmd!()
|
||||
.args(&["status=none", "count=2", "ibs=128"])
|
||||
.pipe_in(input)
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_only(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_stdout_count_bytes() {
|
||||
let input = build_ascii_block(521);
|
||||
let mut output = String::from_utf8(input.clone()).unwrap();
|
||||
output.truncate(256);
|
||||
new_ucmd!()
|
||||
.args(&["status=none", "count=256", "iflag=count_bytes"])
|
||||
.pipe_in(input)
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_only(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_stdout_skip() {
|
||||
let input = build_ascii_block(521);
|
||||
let mut output = String::from_utf8(input.clone()).unwrap();
|
||||
let _ = output.drain(..256);
|
||||
new_ucmd!()
|
||||
.args(&["status=none", "skip=2", "ibs=128"])
|
||||
.pipe_in(input)
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_only(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_stdout_skip_bytes() {
|
||||
let input = build_ascii_block(521);
|
||||
let mut output = String::from_utf8(input.clone()).unwrap();
|
||||
let _ = output.drain(..256);
|
||||
new_ucmd!()
|
||||
.args(&["status=none", "skip=256", "ibs=128", "iflag=skip_bytes"])
|
||||
.pipe_in(input)
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_only(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_stdout_skip_w_multiplier() {
|
||||
let input = build_ascii_block(10 * 1024);
|
||||
let output = String::from_utf8(input[5 * 1024..].to_vec()).unwrap();
|
||||
new_ucmd!()
|
||||
.args(&["status=none", "skip=5K", "iflag=skip_bytes"])
|
||||
.pipe_in(input)
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_is(output)
|
||||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_stdin_stdout_count_w_multiplier() {
|
||||
let input = build_ascii_block(5 * 1024);
|
||||
let output = String::from_utf8(input[..2 * 1024].to_vec()).unwrap();
|
||||
new_ucmd!()
|
||||
.args(&["status=none", "count=2KiB", "iflag=count_bytes"])
|
||||
.pipe_in(input)
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_is(output)
|
||||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_final_stats_noxfer() {
|
||||
new_ucmd!()
|
||||
.args(&["status=noxfer"])
|
||||
.succeeds()
|
||||
.stderr_only("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_final_stats_unspec() {
|
||||
let output = vec![
|
||||
"0+0 records in",
|
||||
"0+0 records out",
|
||||
"0 bytes (0 B, 0 B) copied, 0.0 s, 0 B/s",
|
||||
];
|
||||
let output = output.into_iter().fold(String::new(), |mut acc, s| {
|
||||
acc.push_str(s);
|
||||
acc.push('\n');
|
||||
acc
|
||||
});
|
||||
new_ucmd!().run().stderr_only(&output).success();
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[test]
|
||||
fn test_excl_causes_failure_when_present() {
|
||||
let fname = "this-file-exists-excl.txt";
|
||||
assert_fixture_exists!(&fname);
|
||||
|
||||
let (_fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["of=this-file-exists-excl.txt", "conv=excl"])
|
||||
.fails();
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[test]
|
||||
fn test_noatime_does_not_update_infile_atime() {
|
||||
// NOTE: Not all environments support tracking access time. If this
|
||||
// test fails on some systems and passes on others, assume the functionality
|
||||
// is not working and the systems that pass it simply don't update file access time.
|
||||
let fname = "this-ifile-exists-noatime.txt";
|
||||
assert_fixture_exists!(&fname);
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["status=none", "iflag=noatime", inf!(fname)]);
|
||||
|
||||
let pre_atime = fix.metadata(fname).accessed().unwrap();
|
||||
|
||||
ucmd.run().no_stderr().success();
|
||||
|
||||
let post_atime = fix.metadata(fname).accessed().unwrap();
|
||||
assert_eq!(pre_atime, post_atime);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[test]
|
||||
fn test_noatime_does_not_update_ofile_atime() {
|
||||
// NOTE: Not all environments support tracking access time. If this
|
||||
// test fails on some systems and passes on others, assume the functionality
|
||||
// is not working and the systems that pass it simply don't update file access time.
|
||||
let fname = "this-ofile-exists-noatime.txt";
|
||||
assert_fixture_exists!(&fname);
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["status=none", "oflag=noatime", of!(fname)]);
|
||||
|
||||
let pre_atime = fix.metadata(fname).accessed().unwrap();
|
||||
|
||||
ucmd.pipe_in("").run().no_stderr().success();
|
||||
|
||||
let post_atime = fix.metadata(fname).accessed().unwrap();
|
||||
assert_eq!(pre_atime, post_atime);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[test]
|
||||
fn test_nocreat_causes_failure_when_outfile_not_present() {
|
||||
let fname = "this-file-does-not-exist.txt";
|
||||
assert_fixture_not_exists!(&fname);
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["conv=nocreat", of!(&fname)])
|
||||
.pipe_in("")
|
||||
.fails()
|
||||
.stderr_is("dd Error: No such file or directory (os error 2)");
|
||||
assert!(!fix.file_exists(fname));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_notrunc_does_not_truncate() {
|
||||
// Set up test if needed (eg. after failure)
|
||||
let fname = "this-file-exists-notrunc.txt";
|
||||
let fpath = fixture_path!(fname);
|
||||
match fpath.metadata() {
|
||||
Ok(m) if m.len() == 256 => {}
|
||||
_ => build_test_file!(&fpath, &build_ascii_block(256)),
|
||||
}
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["status=none", "conv=notrunc", of!(&fname), "if=null.txt"])
|
||||
.run()
|
||||
.no_stdout()
|
||||
.no_stderr()
|
||||
.success();
|
||||
|
||||
assert_eq!(256, fix.metadata(fname).len());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_existing_file_truncated() {
|
||||
// Set up test if needed (eg. after failure)
|
||||
let fname = "this-file-exists-truncated.txt";
|
||||
let fpath = fixture_path!(fname);
|
||||
match fpath.metadata() {
|
||||
Ok(m) if m.len() == 256 => {}
|
||||
_ => build_test_file!(&fpath, &vec![0; 256]),
|
||||
}
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["status=none", "if=null.txt", of!(fname)])
|
||||
.run()
|
||||
.no_stdout()
|
||||
.no_stderr()
|
||||
.success();
|
||||
|
||||
assert_eq!(0, fix.metadata(fname).len());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_null_stats() {
|
||||
let stats = vec![
|
||||
"0+0 records in\n",
|
||||
"0+0 records out\n",
|
||||
"0 bytes (0 B, 0 B) copied, 0.0 s, 0 B/s\n",
|
||||
];
|
||||
let stats = stats.into_iter().fold(String::new(), |mut acc, s| {
|
||||
acc.push_str(s);
|
||||
acc
|
||||
});
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["if=null.txt"])
|
||||
.run()
|
||||
.stderr_only(stats)
|
||||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_null_fullblock() {
|
||||
new_ucmd!()
|
||||
.args(&["if=null.txt", "status=none", "iflag=fullblock"])
|
||||
.run()
|
||||
.no_stdout()
|
||||
.no_stderr()
|
||||
.success();
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[ignore] // See note below before using this test.
|
||||
#[test]
|
||||
fn test_fullblock() {
|
||||
let tname = "fullblock-from-urand";
|
||||
let tmp_fn = format!("TESTFILE-{}.tmp", &tname);
|
||||
let exp_stats = vec![
|
||||
"1+0 records in\n",
|
||||
"1+0 records out\n",
|
||||
"134217728 bytes (134 MB, 128 MiB) copied,",
|
||||
];
|
||||
let exp_stats = exp_stats.into_iter().fold(Vec::new(), |mut acc, s| {
|
||||
acc.extend(s.bytes());
|
||||
acc
|
||||
});
|
||||
|
||||
let ucmd = new_ucmd!()
|
||||
.args(&[
|
||||
"if=/dev/urandom",
|
||||
of!(&tmp_fn),
|
||||
"bs=128M",
|
||||
// Note: In order for this test to actually test iflag=fullblock, the bs=VALUE
|
||||
// must be big enough to 'overwhelm' urandom's store of bytes.
|
||||
// Try executing 'dd if=/dev/urandom bs=128M count=1' (i.e without iflag=fullblock).
|
||||
// The stats should contain the line: '0+1 records in' indicating a partial read.
|
||||
// Since my system only copies 32 MiB without fullblock, I expect 128 MiB to be
|
||||
// a reasonable value for testing most systems.
|
||||
"count=1",
|
||||
"iflag=fullblock",
|
||||
])
|
||||
.run();
|
||||
ucmd.success();
|
||||
|
||||
let run_stats = &ucmd.stderr()[..exp_stats.len()];
|
||||
assert_eq!(exp_stats, run_stats);
|
||||
}
|
||||
|
||||
// Fileio
|
||||
#[test]
|
||||
fn test_ys_to_stdout() {
|
||||
let output: Vec<_> = String::from("y\n").bytes().cycle().take(1024).collect();
|
||||
let output = String::from_utf8(output).unwrap();
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["status=none", "if=y-nl-1k.txt"])
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_is(output)
|
||||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_zeros_to_stdout() {
|
||||
let output = vec![0; 256 * 1024];
|
||||
let output = String::from_utf8(output).unwrap();
|
||||
new_ucmd!()
|
||||
.args(&["status=none", "if=zero-256k.txt"])
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_is(output)
|
||||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_to_stdout_with_ibs_obs() {
|
||||
let output: Vec<_> = String::from("y\n").bytes().cycle().take(1024).collect();
|
||||
let output = String::from_utf8(output).unwrap();
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["status=none", "if=y-nl-1k.txt", "ibs=521", "obs=1031"])
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_is(output)
|
||||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ascii_10k_to_stdout() {
|
||||
let output = build_ascii_block(1024 * 1024);
|
||||
// build_test_file!("ascii-10k.txt", &output);
|
||||
let output = String::from_utf8(output).unwrap();
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["status=none", "if=ascii-10k.txt"])
|
||||
.run()
|
||||
.no_stderr()
|
||||
.stdout_is(output)
|
||||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_zeros_to_file() {
|
||||
let tname = "zero-256k";
|
||||
let test_fn = format!("{}.txt", tname);
|
||||
let tmp_fn = format!("TESTFILE-{}.tmp", &tname);
|
||||
assert_fixture_exists!(test_fn);
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["status=none", inf!(test_fn), of!(tmp_fn)])
|
||||
.run()
|
||||
.no_stderr()
|
||||
.no_stdout()
|
||||
.success();
|
||||
|
||||
cmp_file!(
|
||||
File::open(fixture_path!(&test_fn)).unwrap(),
|
||||
fix.open(&tmp_fn)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_to_file_with_ibs_obs() {
|
||||
let tname = "zero-256k";
|
||||
let test_fn = format!("{}.txt", tname);
|
||||
let tmp_fn = format!("TESTFILE-{}.tmp", &tname);
|
||||
assert_fixture_exists!(test_fn);
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&[
|
||||
"status=none",
|
||||
inf!(test_fn),
|
||||
of!(tmp_fn),
|
||||
"ibs=222",
|
||||
"obs=111",
|
||||
])
|
||||
.run()
|
||||
.no_stderr()
|
||||
.no_stdout()
|
||||
.success();
|
||||
|
||||
cmp_file!(
|
||||
File::open(fixture_path!(&test_fn)).unwrap(),
|
||||
fix.open(&tmp_fn)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ascii_521k_to_file() {
|
||||
let tname = "ascii-521k";
|
||||
let input = build_ascii_block(512 * 1024);
|
||||
let tmp_fn = format!("TESTFILE-{}.tmp", &tname);
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["status=none", of!(tmp_fn)])
|
||||
.pipe_in(input.clone())
|
||||
.run()
|
||||
.no_stderr()
|
||||
.no_stdout()
|
||||
.success();
|
||||
|
||||
assert_eq!(512 * 1024, fix.metadata(&tmp_fn).len());
|
||||
|
||||
cmp_file!(
|
||||
{
|
||||
let mut input_f = tempfile().unwrap();
|
||||
input_f.write_all(&input).unwrap();
|
||||
input_f
|
||||
},
|
||||
fix.open(&tmp_fn)
|
||||
);
|
||||
}
|
||||
|
||||
#[ignore]
|
||||
#[cfg(unix)]
|
||||
#[test]
|
||||
fn test_ascii_5_gibi_to_file() {
|
||||
let tname = "ascii-5G";
|
||||
let tmp_fn = format!("TESTFILE-{}.tmp", &tname);
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&[
|
||||
"status=none",
|
||||
"count=5G",
|
||||
"iflag=count_bytes",
|
||||
"if=/dev/zero",
|
||||
of!(tmp_fn),
|
||||
])
|
||||
.run()
|
||||
.no_stderr()
|
||||
.no_stdout()
|
||||
.success();
|
||||
|
||||
assert_eq!(5 * 1024 * 1024 * 1024, fix.metadata(&tmp_fn).len());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_self_transfer() {
|
||||
let fname = "self-transfer-256k.txt";
|
||||
assert_fixture_exists!(fname);
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["status=none", "conv=notrunc", inf!(fname), of!(fname)]);
|
||||
|
||||
assert!(fix.file_exists(fname));
|
||||
assert_eq!(256 * 1024, fix.metadata(fname).len());
|
||||
|
||||
ucmd.run().no_stdout().no_stderr().success();
|
||||
|
||||
assert!(fix.file_exists(fname));
|
||||
assert_eq!(256 * 1024, fix.metadata(fname).len());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_unicode_filenames() {
|
||||
let tname = "😎💚🦊";
|
||||
let test_fn = format!("{}.txt", tname);
|
||||
let tmp_fn = format!("TESTFILE-{}.tmp", &tname);
|
||||
assert_fixture_exists!(test_fn);
|
||||
|
||||
let (fix, mut ucmd) = at_and_ucmd!();
|
||||
ucmd.args(&["status=none", inf!(test_fn), of!(tmp_fn)])
|
||||
.run()
|
||||
.no_stderr()
|
||||
.no_stdout()
|
||||
.success();
|
||||
|
||||
cmp_file!(
|
||||
File::open(fixture_path!(&test_fn)).unwrap(),
|
||||
fix.open(&tmp_fn)
|
||||
);
|
||||
}
|
||||
|
||||
// conv=[ascii,ebcdic,ibm], conv=[ucase,lcase], conv=[block,unblock], conv=sync
|
||||
// TODO: Move conv tests from unit test module
|
BIN
tests/fixtures/dd/ascii-10k.txt
vendored
Normal file
BIN
tests/fixtures/dd/ascii-10k.txt
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/dd/gnudd-conv-atoe-seq-byte-values.spec
vendored
Normal file
BIN
tests/fixtures/dd/gnudd-conv-atoe-seq-byte-values.spec
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/dd/gnudd-conv-atoibm-seq-byte-values.spec
vendored
Normal file
BIN
tests/fixtures/dd/gnudd-conv-atoibm-seq-byte-values.spec
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/dd/gnudd-conv-ebcdic-ltou-seq-byte-values.spec
vendored
Normal file
BIN
tests/fixtures/dd/gnudd-conv-ebcdic-ltou-seq-byte-values.spec
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/dd/gnudd-conv-ebcdic-utol-seq-byte-values.spec
vendored
Normal file
BIN
tests/fixtures/dd/gnudd-conv-ebcdic-utol-seq-byte-values.spec
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/dd/gnudd-conv-etoa-seq-byte-values.spec
vendored
Normal file
BIN
tests/fixtures/dd/gnudd-conv-etoa-seq-byte-values.spec
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/dd/gnudd-conv-ibm-ltou-seq-byte-values.spec
vendored
Normal file
BIN
tests/fixtures/dd/gnudd-conv-ibm-ltou-seq-byte-values.spec
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/dd/gnudd-conv-ibm-utol-seq-byte-values.spec
vendored
Normal file
BIN
tests/fixtures/dd/gnudd-conv-ibm-utol-seq-byte-values.spec
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/dd/gnudd-conv-ltou-seq-byte-values.spec
vendored
Normal file
BIN
tests/fixtures/dd/gnudd-conv-ltou-seq-byte-values.spec
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/dd/gnudd-conv-utol-seq-byte-values.spec
vendored
Normal file
BIN
tests/fixtures/dd/gnudd-conv-utol-seq-byte-values.spec
vendored
Normal file
Binary file not shown.
0
tests/fixtures/dd/null.txt
vendored
Normal file
0
tests/fixtures/dd/null.txt
vendored
Normal file
BIN
tests/fixtures/dd/self-transfer-256k.txt
vendored
Normal file
BIN
tests/fixtures/dd/self-transfer-256k.txt
vendored
Normal file
Binary file not shown.
BIN
tests/fixtures/dd/seq-byte-values.test
vendored
Normal file
BIN
tests/fixtures/dd/seq-byte-values.test
vendored
Normal file
Binary file not shown.
0
tests/fixtures/dd/this-file-exists-excl.txt
vendored
Normal file
0
tests/fixtures/dd/this-file-exists-excl.txt
vendored
Normal file
0
tests/fixtures/dd/this-file-exists-no-noatime.txt
vendored
Normal file
0
tests/fixtures/dd/this-file-exists-no-noatime.txt
vendored
Normal file
1
tests/fixtures/dd/this-file-exists-notrunc.txt
vendored
Normal file
1
tests/fixtures/dd/this-file-exists-notrunc.txt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd
|
1
tests/fixtures/dd/this-file-exists-truncated.txt
vendored
Normal file
1
tests/fixtures/dd/this-file-exists-truncated.txt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcd
|
0
tests/fixtures/dd/this-ifile-exists-noatime.txt
vendored
Normal file
0
tests/fixtures/dd/this-ifile-exists-noatime.txt
vendored
Normal file
0
tests/fixtures/dd/this-ofile-exists-noatime.txt
vendored
Normal file
0
tests/fixtures/dd/this-ofile-exists-noatime.txt
vendored
Normal file
512
tests/fixtures/dd/y-nl-1k.txt
vendored
Normal file
512
tests/fixtures/dd/y-nl-1k.txt
vendored
Normal file
|
@ -0,0 +1,512 @@
|
|||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
||||
y
|
BIN
tests/fixtures/dd/zero-256k.txt
vendored
Normal file
BIN
tests/fixtures/dd/zero-256k.txt
vendored
Normal file
Binary file not shown.
0
tests/fixtures/dd/😎💚🦊.txt
vendored
Normal file
0
tests/fixtures/dd/😎💚🦊.txt
vendored
Normal file
Loading…
Add table
Add a link
Reference in a new issue