Wykres commitów

8 Commity (master)

Autor SHA1 Wiadomość Data
David Lechner 3dc324d3f1 tests: Format all Python code with black, except tests in basics subdir.
This adds the Python files in the tests/ directory to be formatted with
./tools/codeformat.py.  The basics/ subdirectory is excluded for now so we
aren't changing too much at once.

In a few places `# fmt: off`/`# fmt: on` was used where the code had
special formatting for readability or where the test was actually testing
the specific formatting.
2020-03-30 13:21:58 +11:00
Damien George d35c6ffc84 tests/extmod: Add some uctypes tests to improve coverage of that module. 2017-12-19 16:48:41 +11:00
Paul Sokolovsky 85d809d1f4 tests: Convert remaining "sys.exit()" to "raise SystemExit". 2017-06-10 20:34:38 +03:00
Paul Sokolovsky f2d732f459 tests/extmod: Make tests skippable. 2017-02-15 01:56:22 +03:00
Dave Hylands 66d0c1052a extmod: Fix uctypes size calculation for bitfields 2016-01-10 23:31:26 +02:00
Dave Hylands 5a4a2b1db3 extmod: Add test which demonstrates LITTLE_ENDIAN packing failure 2015-12-09 21:43:28 +02:00
Paul Sokolovsky 1679696612 moductypes: Swap address and descriptor args in constructor.
Now address comes first, and args related to struct type are groupped next.
Besides clear groupping, should help catch errors eagerly (e.g. forgetting
to pass address will error out).

Also, improve args number checking/reporting overall.
2015-06-06 22:57:54 +03:00
Paul Sokolovsky 2559e13957 moductypes: Make sure we can apply .sizeof() to all aggregate types.
Before, sizeof() could be applied to a structure field only if that field
was itself a structure. Now it can be applied to PTR and ARRAY fields too.
It's not possible to apply it to scalar fields though, because as soon as
scalar field (int or float) is dereferenced, its value is converted into
Python int/float value, and all original type info is lost. Moreover, we
allow sizeof of type definitions too, and there int is used to represent
(scalar) types. So, we have ambiguity what int may be - either dereferenced
scalar structure field, or encoded scalar type. So, rather throw an error
if user tries to apply sizeof() to int.
2014-10-30 03:50:23 +02:00