summaryrefslogtreecommitdiff
path: root/testcases
AgeCommit message (Collapse)Author
2019-06-10print_file_contents: allocate enough to include \0Sam Newbold
related to #331 Previously, if max_chars was read, the null byte would be written past the end of buf.
2019-02-21Added function to print content from file (#331)Dennis Vesterlund
Added a function to print file contents to status bar without newlines. Added tests for print file contents function Added manpage entry for file contents
2018-10-23Add testcase for invalid %cpu placeholderGaƫl PORTAY
2018-09-03Add testcase for #304David96
2018-07-31Fix for issue 300: Correctly print usage for cpu 10=
2018-06-29hide seconds in battery by defaultFelix Buehler
2018-01-28Treat zero battery capacity as "not available" (#259)johcgt
`print_battery_info` computes `batt_info.percentage_remaining` by dividing batt_info.remaining by `full`. If `full` is `0` then the battery remaining will be reported as "inf". Before this, it tries to set `full` to either the design capacity or to the last known good charge. It determines if these values are available by checking whether their fields in `batt_info` are non-negative. As it initialized `batt_info` with values of `-1`, a non-negative value implies that something has provided a value. `slurp_all_batteries` and `add_battery_info` however initialize these fields to zero, so if these functions are called then `batt_info.full_design` will always be used. This means that on systems that don't provide a value for design capacity the percentage remaining will be reported as "inf", unless the user has set `last_full_capacity` to `true` in their `i3status.conf`. This patch changes `print_battery_info` to expect values for the battery capacity to be strictly greater than zero. This seems reasonable as a battery with a capacity of zero isn't useful. An alternative solution would be to change `slurp_all_batteries` and `add_battery_info` to initialize `batt_info` with `-1`, as `print_battery_info` does. This is less appealing as `add_battery_info` is accumulating the values, so using `-1` would introduce off-by-one errors without additional code to avoid them.
2017-11-20Add network test cases (#246)Emeric Planet
2017-08-29Fix CPU unit tests (#239)Emeric Planet
Support any amount of available cores on testing machine.
2017-04-13Add battery capacity parsing (#216)Emeric Planet
The Linux power supply class defines three entries to provide battery status. One of them wasn't used: POWER_SUPPLY_CAPACITY. https://www.kernel.org/doc/Documentation/power/power_supply_class.txt
2017-03-26Multiple CPU support for cpu_usage (#209)eplanet
This change addresses the issue #199 asking for multiple CPU support. It takes an arbitrary CPU number and outputs its usage using the same arithmetics as for CPU aggregation. It currently doesn't support FreeBSD.
2016-11-19Adding documentation for PR #179 (#182)eplanet
2016-11-16Merge pull request #179 from mihaicmn/feature-threshold-formatMichael Stapelberg
Provide format_above_threshold/format_below_threshold options
2016-11-15Add unit tests for threshold formatMihai Coman
2016-11-14Added test case for run_watcheplanet
The valid test case assumes pid 1 exists, which should always be true on Unix environment.
2016-11-14Added unit test case for path_existseplanet
2016-11-14Added unit test case for CPU temperatureeplanet
2016-11-14Unit testing in Travis (#170)eplanet