<feed xmlns='http://www.w3.org/2005/Atom'>
<title>i3status.git/testcases, branch 2.13</title>
<subtitle>[no description]</subtitle>
<id>http://git.sigexec.com/cgit.cgi/i3status.git/atom?h=2.13</id>
<link rel='self' href='http://git.sigexec.com/cgit.cgi/i3status.git/atom?h=2.13'/>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/'/>
<updated>2019-06-10T14:36:18+00:00</updated>
<entry>
<title>print_file_contents: allocate enough to include \0</title>
<updated>2019-06-10T14:36:18+00:00</updated>
<author>
<name>Sam Newbold</name>
<email>sam@rwsh.org</email>
</author>
<published>2019-06-10T14:29:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/commit/?id=300b31b2dfb3ee7a84c78bd2802cb5649d0dc1ba'/>
<id>urn:sha1:300b31b2dfb3ee7a84c78bd2802cb5649d0dc1ba</id>
<content type='text'>
related to #331
Previously, if max_chars was read, the null byte would be written
past the end of buf.
</content>
</entry>
<entry>
<title>Added function to print content from file (#331)</title>
<updated>2019-02-21T14:34:32+00:00</updated>
<author>
<name>Dennis Vesterlund</name>
<email>dennisvesterlund@gmail.com</email>
</author>
<published>2019-02-21T14:34:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/commit/?id=9b5f6ae5f460c8642286cf174751a317f155d043'/>
<id>urn:sha1:9b5f6ae5f460c8642286cf174751a317f155d043</id>
<content type='text'>
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</content>
</entry>
<entry>
<title>Add testcase for invalid %cpu placeholder</title>
<updated>2018-10-23T15:16:16+00:00</updated>
<author>
<name>Gaël PORTAY</name>
<email>gael.portay@savoirfairelinux.com</email>
</author>
<published>2018-10-23T14:58:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/commit/?id=aa572d24b5ecf16a064f924548ed1926b7b231d6'/>
<id>urn:sha1:aa572d24b5ecf16a064f924548ed1926b7b231d6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add testcase for #304</title>
<updated>2018-09-03T18:51:48+00:00</updated>
<author>
<name>David96</name>
<email>davidlepplaweber@aospa.co</email>
</author>
<published>2018-09-03T18:51:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/commit/?id=02be7c6fdf14250232529ce928ab96309057bdc0'/>
<id>urn:sha1:02be7c6fdf14250232529ce928ab96309057bdc0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix for issue 300: Correctly print usage for cpu 10</title>
<updated>2018-07-31T05:27:13+00:00</updated>
<author>
<name>=</name>
<email>=</email>
</author>
<published>2018-07-31T05:27:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/commit/?id=d003edcba6aaf29f74b904c09fc9dfdf3b2ff2cc'/>
<id>urn:sha1:d003edcba6aaf29f74b904c09fc9dfdf3b2ff2cc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>hide seconds in battery by default</title>
<updated>2018-06-29T12:37:48+00:00</updated>
<author>
<name>Felix Buehler</name>
<email>account@buehler.rocks</email>
</author>
<published>2018-06-29T11:35:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/commit/?id=50b899ba42c074c430f612fbf868bae364bcabd7'/>
<id>urn:sha1:50b899ba42c074c430f612fbf868bae364bcabd7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Treat zero battery capacity as "not available" (#259)</title>
<updated>2018-01-28T14:37:51+00:00</updated>
<author>
<name>johcgt</name>
<email>35880934+johcgt@users.noreply.github.com</email>
</author>
<published>2018-01-28T14:37:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/commit/?id=d5c69a9d60a0bf9b6fbbaff7e122042410bfe44a'/>
<id>urn:sha1:d5c69a9d60a0bf9b6fbbaff7e122042410bfe44a</id>
<content type='text'>
`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.</content>
</entry>
<entry>
<title>Add network test cases (#246)</title>
<updated>2017-11-20T18:51:48+00:00</updated>
<author>
<name>Emeric Planet</name>
<email>emeric.planet@datadoghq.com</email>
</author>
<published>2017-11-20T18:51:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/commit/?id=6464ae2df9f784e7b657ed5e36923f2a3062356e'/>
<id>urn:sha1:6464ae2df9f784e7b657ed5e36923f2a3062356e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix CPU unit tests (#239)</title>
<updated>2017-08-29T17:01:30+00:00</updated>
<author>
<name>Emeric Planet</name>
<email>emeric.planet@datadoghq.com</email>
</author>
<published>2017-08-29T17:01:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/commit/?id=884e4da6730a31fc7a5ef892fb9cb061baaf5f6c'/>
<id>urn:sha1:884e4da6730a31fc7a5ef892fb9cb061baaf5f6c</id>
<content type='text'>
Support any amount of available cores on testing machine.</content>
</entry>
<entry>
<title>Add battery capacity parsing (#216)</title>
<updated>2017-04-13T19:46:21+00:00</updated>
<author>
<name>Emeric Planet</name>
<email>emeric.planet@gmail.com</email>
</author>
<published>2017-04-13T19:46:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.sigexec.com/cgit.cgi/i3status.git/commit/?id=c7dea747519f99584002084df3dce546f37df8b5'/>
<id>urn:sha1:c7dea747519f99584002084df3dce546f37df8b5</id>
<content type='text'>
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</content>
</entry>
</feed>
