<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libplist/test, branch 2.8.1</title>
<subtitle>Library to handle Apple Property List format files in binary or XML</subtitle>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/'/>
<entry>
<title>plist: fix the (sec, usec) date API round trip</title>
<updated>2026-11-06T09:29:06+00:00</updated>
<author>
<name>Flavio Toffalini</name>
</author>
<published>2026-10-26T09:03:57+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=1d3b54c784da260f71d885f5f560d69c211a645e'/>
<id>1d3b54c784da260f71d885f5f560d69c211a645e</id>
<content type='text'>
plist_set_date_val stores val = sec + usec / 1000000, but
plist_get_date_val splits it with a truncating cast and fabs():

    *sec  = (int32_t)val;
    val   = fabs((val - (int64_t)val) * 1000000);
    *usec = (int32_t)val;

Two results are wrong. The product is truncated, so set(5, 6) reads
back as (5, 5) - 29.3% of round trips over sec in [0, 3] come back a
microsecond short. And for a negative value, truncation toward zero
plus fabs() give a pair that does not denote the same instant:
set(-3, 250000) stores -2.75 and reads back as (-2, 750000), which the
setter would store as -1.25. Every round trip with sec &lt; 0 and
usec != 0 is wrong.

(int32_t)val is also undefined when the stored value is outside the
int32_t range.

Round the seconds down, round the fraction to microseconds carrying
1000000 into the seconds, and clamp the seconds before converting, so
sec + usec / 1000000 == val to the microsecond with 0 &lt;= usec &lt;
1000000 - the convention the setter uses.

Add test/date_val.c covering fixed cases and a sweep over sec in
[-2, 2]. It fails on an unmodified tree - set(5, 6), set(-3, 250000)
and set(-1, 1) all come back as different instants - and passes with
this change, with make check at 44/44.

Co-Authored-By: Claude Opus 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01Arn4YaWtcQBDsQuJtyBmFP
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
plist_set_date_val stores val = sec + usec / 1000000, but
plist_get_date_val splits it with a truncating cast and fabs():

    *sec  = (int32_t)val;
    val   = fabs((val - (int64_t)val) * 1000000);
    *usec = (int32_t)val;

Two results are wrong. The product is truncated, so set(5, 6) reads
back as (5, 5) - 29.3% of round trips over sec in [0, 3] come back a
microsecond short. And for a negative value, truncation toward zero
plus fabs() give a pair that does not denote the same instant:
set(-3, 250000) stores -2.75 and reads back as (-2, 750000), which the
setter would store as -1.25. Every round trip with sec &lt; 0 and
usec != 0 is wrong.

(int32_t)val is also undefined when the stored value is outside the
int32_t range.

Round the seconds down, round the fraction to microseconds carrying
1000000 into the seconds, and clamp the seconds before converting, so
sec + usec / 1000000 == val to the microsecond with 0 &lt;= usec &lt;
1000000 - the convention the setter uses.

Add test/date_val.c covering fixed cases and a sweep over sec in
[-2, 2]. It fails on an unmodified tree - set(5, 6), set(-3, 250000)
and set(-1, 1) all come back as different instants - and passes with
this change, with make check at 44/44.

Co-Authored-By: Claude Opus 5 &lt;noreply@anthropic.com&gt;
Claude-Session: https://claude.ai/code/session_01Arn4YaWtcQBDsQuJtyBmFP
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Add binary plist parser behavior tests</title>
<updated>2026-11-05T22:46:59+00:00</updated>
<author>
<name>Nathan Chandrasekar</name>
</author>
<published>2026-10-18T00:14:17+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=70a64c23c9d77b114dcc71e70e69aa8868693f3f'/>
<id>70a64c23c9d77b114dcc71e70e69aa8868693f3f</id>
<content type='text'>
Build small binary plists in memory and check that arrays and dicts
parse correctly with 1, 2 and 3 byte object references, and that
strings, extended size markers and array/dict references extending
beyond the object data area into the offset table are rejected.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Build small binary plists in memory and check that arrays and dicts
parse correctly with 1, 2 and 3 byte object references, and that
strings, extended size markers and array/dict references extending
beyond the object data area into the offset table are rejected.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: fix leak of iii in integer_set test</title>
<updated>2026-11-05T10:59:00+00:00</updated>
<author>
<name>Nikias Bassen</name>
</author>
<published>2026-11-05T09:43:33+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=3347d52167a36952666856c2b5ad2a5e9adda3a2'/>
<id>3347d52167a36952666856c2b5ad2a5e9adda3a2</id>
<content type='text'>
Free the plist created for the test before exiting, which fixes a leak
reported by LeakSanitizer.

Co-authored-by: bg0d-droid &lt;81825610+bg0d-droid@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Free the plist created for the test before exiting, which fixes a leak
reported by LeakSanitizer.

Co-authored-by: bg0d-droid &lt;81825610+bg0d-droid@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>plistutil: preserve binary data on Windows standard streams</title>
<updated>2026-09-29T15:00:18+00:00</updated>
<author>
<name>Alberto Maschietto</name>
</author>
<published>2026-09-07T21:12:20+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=fba74cf8bd9696b9b7f42a8cbb9e16dd065b0a83'/>
<id>fba74cf8bd9696b9b7f42a8cbb9e16dd065b0a83</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix fread() unused return values by actually handling errors</title>
<updated>2026-04-10T10:21:17+00:00</updated>
<author>
<name>Nikias Bassen</name>
</author>
<published>2026-04-10T10:21:17+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=9dfcfe8dc22233cb08aa22ba743640d8db92c4e7'/>
<id>9dfcfe8dc22233cb08aa22ba743640d8db92c4e7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>xplist: Enforce single root value inside &lt;plist&gt;</title>
<updated>2026-02-25T01:27:00+00:00</updated>
<author>
<name>Sami Kortelainen</name>
</author>
<published>2026-02-25T01:27:00+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=6e03a1df6d1aa87c8f9e2b35f1a2ca60feca1c0e'/>
<id>6e03a1df6d1aa87c8f9e2b35f1a2ca60feca1c0e</id>
<content type='text'>
Ensure that XML property lists contain exactly one root value inside the &lt;plist&gt; element and reject any additional value nodes before &lt;/plist&gt;.

Add tests covering root value handling and nested CF$UID conversion behavior.

Co-authored-by: Sami Kortelainen &lt;sami.kortelainen@piceasoft.com&gt;
Co-authored-by: Nikias Bassen &lt;nikias@gmx.li&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ensure that XML property lists contain exactly one root value inside the &lt;plist&gt; element and reject any additional value nodes before &lt;/plist&gt;.

Add tests covering root value handling and nested CF$UID conversion behavior.

Co-authored-by: Sami Kortelainen &lt;sami.kortelainen@piceasoft.com&gt;
Co-authored-by: Nikias Bassen &lt;nikias@gmx.li&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xplist: Improve robustness of XML text parsing and value conversion</title>
<updated>2026-01-29T16:45:01+00:00</updated>
<author>
<name>Nikias Bassen</name>
</author>
<published>2026-01-29T16:45:01+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=b7f09ccdddc75d82ccaed867eb60e6997a7cad40'/>
<id>b7f09ccdddc75d82ccaed867eb60e6997a7cad40</id>
<content type='text'>
This change adds stricter validation for numeric and date nodes,
including full-input consumption, overflow/range checks, and rejection
of invalid floating-point values. Whitespace handling is clarified by
explicitly trimming trailing XML whitespace for value nodes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change adds stricter validation for numeric and date nodes,
including full-input consumption, overflow/range checks, and rejection
of invalid floating-point values. Whitespace handling is clarified by
explicitly trimming trailing XML whitespace for value nodes.
</pre>
</div>
</content>
</entry>
<entry>
<title>test: Fix ostep-invalid-types test case</title>
<updated>2025-12-05T20:33:24+00:00</updated>
<author>
<name>Nikias Bassen</name>
</author>
<published>2025-12-05T20:33:24+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=b32b370d8d44fa7cc9d3478b9e19f3abaa43d3c2'/>
<id>b32b370d8d44fa7cc9d3478b9e19f3abaa43d3c2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>test: fix operator error</title>
<updated>2025-11-20T03:01:58+00:00</updated>
<author>
<name>Ankur Tyagi</name>
</author>
<published>2025-11-20T03:01:58+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=18e5b22a71f85091127cc063db79c8df687c582c'/>
<id>18e5b22a71f85091127cc063db79c8df687c582c</id>
<content type='text'>
Otherwise test fail with error [: -neq: binary operator expected

Signed-off-by: Ankur Tyagi &lt;ankur.tyagi85@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Otherwise test fail with error [: -neq: binary operator expected

Signed-off-by: Ankur Tyagi &lt;ankur.tyagi85@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>test: use unique output file names across tests</title>
<updated>2023-10-03T09:41:32+00:00</updated>
<author>
<name>Sergei Trofimovich</name>
</author>
<published>2023-10-03T09:41:32+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.sukimashita.com/libplist.git/commit/?id=2cd858c679d25633077ca78b67182a9b77653816'/>
<id>2cd858c679d25633077ca78b67182a9b77653816</id>
<content type='text'>
Without the change tests ran in parallel occasionally clobber outputs of
one another and fail as:

    $ make check -j16 VERBOSE=y
    ...
    FAIL: huge
    ==========
    Converting
    File ../test/data/5.plist is open
    PList XML parsing succeeded
    PList BIN writing succeeded
    PList BIN parsing succeeded
    PList XML writing succeeded
    Size of input and output is different
    Input size : 4292380
    Output size : 4305301
    Comparing
    PList parsing failed
    FAIL huge.test (exit status: 3)

Closes: https://github.com/libimobiledevice/libplist/issues/234#issuecomment-1743820556
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Without the change tests ran in parallel occasionally clobber outputs of
one another and fail as:

    $ make check -j16 VERBOSE=y
    ...
    FAIL: huge
    ==========
    Converting
    File ../test/data/5.plist is open
    PList XML parsing succeeded
    PList BIN writing succeeded
    PList BIN parsing succeeded
    PList XML writing succeeded
    Size of input and output is different
    Input size : 4292380
    Output size : 4305301
    Comparing
    PList parsing failed
    FAIL huge.test (exit status: 3)

Closes: https://github.com/libimobiledevice/libplist/issues/234#issuecomment-1743820556
</pre>
</div>
</content>
</entry>
</feed>
