procps-ng-NEXT
----------------
* doc: Document I idle state in ps.1 and top.1 Debian #886967
+ * free: fix some of the SI multiples issue #45
* kill: -l space between name parses correctly Debian #854407
* library: dont use vm_min_free on non Linux Debian #831396
* library: dont use SIGPWR on FreeBSD Debian #832148
if (args.exponent > 1) {
/* In desired scale. */
snprintf(buf, sizeof(buf), "%ld",
- (long int)((size / 1024) * base / power(base, args.exponent - 2))
+ (long int)((size * 1024) / power(base, args.exponent-1))
);
return buf;
}
spawn $free -b
expect_pass "$test" "^${free_header}Mem:\\s+${memtotal}\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+${swaptotal}\\s+\\d+\\s+\\d+\\s*"
-foreach {arg divisor } {-k 1 -m 1024 -g 1048576 --mega 1000 --giga 1000000 } {
+foreach {arg divisor } {-k 1024 -m 1048576 -g 1073741824 --kilo 1000 --mega 1000000 --giga 1000000000 } {
set test "free with $arg argument"
- set memtotal [ expr { $memtotal_kb / $divisor } ]
- set swaptotal [ expr { $swaptotal_kb / $divisor } ]
+ set memtest [ expr { $memtotal / $divisor } ]
+ set swaptest [ expr { $swaptotal / $divisor } ]
spawn $free $arg
- expect_pass "$test" "^${free_header}Mem:\\s+$memtotal\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+${swaptotal}\\s+\\d+\\s+\\d+\\s*"
+ expect_pass "$test" "^${free_header}Mem:\\s+$memtest\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s+\\d+\\s*Swap:\\s+${swaptest}\\s+\\d+\\s+\\d+\\s*"
}
#set test "free with human readable output"