bt2: Adapt test_field_class.py and make it pass
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 29 May 2019 16:08:29 +0000 (12:08 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 5 Jun 2019 17:47:34 +0000 (13:47 -0400)
commitd47b87ac209ea8f1b98b7e6cf209dfd4bf9cc9c0
tree36b2931cb5904798b0421d25d34d08cb3d58b8c3
parent5f25509b06eb8dd0a76d3068894d9f8fefd63178
bt2: Adapt test_field_class.py and make it pass

Update the test_field_class.py test to match the current API of
Babeltrace.  Update field_class.py and some others to make that test
pass.

The main change in test_field_class.py is that field classes are now
created from an existing trace class (tc.create_foo_field_class())
rather than by constructor (FooFieldClass()).  Everything related to
copy, deep copy and equality is removed.  Everything related to
structure alignment, byte order and encoding is removed, as those were
ctf concepts that were removed from Babeltrace's trace-ir API.

All specific field class tests try to follow the same pattern.  The
test_create_default test method verifies the properties of a specific
field class create with passing as few parameters as possible.  Then,
for each possible creation parameter, we verify a case that works and
some problematic cases such as invalid value or invalid type.  More
tests are done for specific field classes that support additional
features, such as container field classes.

The support for modifying field class properties after they have been
created is removed.  All characteristics of a field class must passed
during construction (this doesn't apply to fields of composite field
classes).

A new concept of "field path" was introduced in the library, which is
useful in the context of dynamically-sized arrays and variants.  Support
is therefore added to obtain the "field path" to a variant's selector
field or dynamic array length field.

Change-Id: Ia998119fcf7c61ef5904fbe72baa36a2838d5780
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1319
Tested-by: jenkins
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
bindings/python/bt2/Makefile.am
bindings/python/bt2/bt2/__init__.py.in
bindings/python/bt2/bt2/field_class.py
bindings/python/bt2/bt2/field_path.py [new file with mode: 0644]
bindings/python/bt2/bt2/trace_class.py
tests/bindings/python/bt2/test_event_class.py
tests/bindings/python/bt2/test_field_class.py
This page took 0.026059 seconds and 4 git commands to generate.