Age | Commit message (Collapse) | Author | Files | Lines |
|
Some test functions are not executed at all. This commit fix it.
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Test recently added functions using usbg_gadget_str enum.
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I3a47f0d16b9259f09bb4ea3eeb3734a89af43019
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: Ia82f5f124e7b57c2694c605ddc942513fc337645
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: Idfc179ff08a0d23b73ca0f30519bbc73f6556e10
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I0e5c09b5664f8e15d9ba70e9a5682992341e0884
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I19b4777e9b61c7dc63c8bb0644de2a63089e6bd3
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Instead of passing void **state as argument for for_each_* functions and
initializing state there, we make initialization first and pass initialized
state as argument for them. It looks more natural this way. This also
allows to run these functions multiple times in single test function.
Change-Id: If84bbedf374f1f0ebf70315cea950dcd2e527d18
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Test functions usually need to initialize usbg state before testing.
However, initialization may fail, causing test to finish immediatelly,
running teardown function.
This commit add function which takes care of state pointer when
initializing.
Change-Id: I797e56ac3cda67e871c6c4fbd2184220b05068f6
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
To avoid defining the same or similar values multiple times, we can define
data by proper macros.
Change-Id: I8fa5fd02c76f16a1b9d65a33482a6cd1caa16b70
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Most gadget tests run the same initialization and loop through all
gadgets, performing single operation on them and checking results.
Common code is now separated to for_each_test_gadget function.
Change-Id: I0a1870487aa0c25153c96e57da5501e1bccb8132
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Every allocation here requires checking if it was successful and
storing it on queue to be freed later. Now it can all be done by single
function call.
Change-Id: I06c0099d0b44cb030b6ab8e338ccd58e078a92ac
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Deprecated functions of cmocka are no longer used.
Change-Id: If8804103492b089cf033a35d055260452553638e
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I86e5263e11f3794aa1b999f02778dbf6ce32e572
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Config attributes can be get and set using proper pull_* and push_*
functions as setup.
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Fix indent.
Change-Id: Ie168aa3f86c0a8f5e919674a816950bc0c5947ab
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I1c7beaf82e1df526dcd01d13c7d7857d4652fdd7
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Allows config strings to be get from and set on virtual filesystem.
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Add more documentation. Add push_config_string() function.
Change-Id: Ie04321cee9ac2a6defe0b01a650a847e1ac0a581
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Fix coding style.
Change-Id: I1ae18bc2393067cd0735ab812ec720e900ef3161
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Add asserts for gadget, config and bindings.
Change-Id: If6ce39332101826888c70790f8518876e03f8a44
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Sometimes we would like to define bindings names
other than default one. To achieve this we allocate
bindings only if they has not been allocated earlier.
Change-Id: Ifbad9b1069dd1a41d4a9f87c427c991538a8417f
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Reviewed-by: Pawel Szewczyk <p.szewczyk@samsung.com>
|
|
Each test case should use own copy of test_* structures.
To achieve this we do a deep copy of structures which has
not been marked as writable.
Change-Id: I1f1a949059dd1a41d4a9f80ca27c391533a59a7f
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Reviewed-by: Pawel Szewczyk <p.szewczyk@samsung.com>
|
|
Reusing the same structures for many tests is wrong for
security reasons. Some of test cases already allocates
own copy of test structures. This commit adds a field
which indicates if given structure has been allocated
for test case or if it is global structure and should
not be changed.
Change-Id: I8a1f9b9059dd1a41d4a9f80c427c991533f7ab9a
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Reviewed-by: Pawel Szewczyk <p.szewczyk@samsung.com>
|
|
Binding structure may have some uninitialized functions
and we need to initialize it before usage.
Change-Id: I5c6f9d90f9dd1b41d8a9f80cf27cd9153ac79b7b
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Reviewed-by: Pawel Szewczyk <p.szewczyk@samsung.com>
|
|
Using the same type for binding and function (and assuming that binding
has the same name as its target function) was not an elegant solution.
It is fixed by adding separate structure and use it in test setups.
To save old, convinient way of defining bindings by list of functions,
additional field in test binding is provided and prepare_state generate
bindings based on it.
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
s/binded/bound
Change-Id: I8a1f9b9059dd1a41d4a9f80c427c991533a74b7e
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I78ab01d1ca8ff5105448d3bbf3982753cdfc01d6
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Allows to test getting gadget strings the same way as setting them.
Change-Id: I3197865955e22d3ec38f7b81f8050e95f24cdaf8
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: Ia7975f0a3a2e8e2bc6bff8bcd64430a6e26d1888
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I1c47e3990bbd4dbfa620fc353a6cd65898dd6a30
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Like in testing setting gadget attributes, virtual filesystem is
prepared for setting gadget strings.
Change-Id: I0e46e3990aad4dbfa520fc333a6ca65898dd6a30
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Instead of using array exported in usbg-internal.h we use function
provided by libusbg for getting string of gadget attribute
Change-Id: I6430f0de2926177e5f214713778dca16c33a3f40
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I0fa869ecf50ead08171ee1da4b7a5326694efbdc
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Simply check if valid strings are returned
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Use USBG_GADGET_ATTR_MIN - 1 instead of just -1.
Change-Id: I0f3869eaf50ead08171ee1da4b7a5326694efb2c
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I9725395ff5a6bac7f4edfdaa4da9bbce3a3186ff
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I92c185449293fd9426f151687832b3bdb0c57572
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I5ab4262a5532e07de9e6e919e6dde5dd49da4702
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Before executing libusbg functions which get and set gadget attributes,
we must prepare virtual filesystem to behave as expected.
push_* and pull_* functions take arguments similar to usbg functions
which will be called after them, e.g. push_gadget_attrs(g, a)
will prepare for calling usbg_get_gadget_attrs on gadget matching g,
where a is value passed to be read.
Change-Id: I805544dbd35a1a7f8c2e4073f9f4607d9c70bb95
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Remove unused variable in for_each_test_config().
Change-Id: I6dd8dc33639dff2d3322c6098a43c69beb8a7ef6
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: Ia7d368c8749d28235a4209d5a0de90dc6878717b
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I89296562177061559de84aa5332d8dc9347d2e13
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Direct cast from pointer to integer of different size
causes ugly compiler warning. To avoid this use
dedicated macro from cmocka.
Change-Id: I56f4095dd8f98c8349d02b421f02de1d61e0b2b8
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
init_with_state is also used by functions in usbg-test.c, so was declared
globaly in header. Other functions from test.c is not used outside and
we can make them static.
Change-Id: I56f4095dd8f98c8349d02b421f02de1d61e0b2b7
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Also proceed doxygen config file with autoconf now. Autoconf copy .in file,
substituting found variable values. It allows to specify what documentation
should be build by configure script.
Change-Id: I00cae61aefcc5b6444b0afc0dfe73c5973de34a9
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I4db3a1d8683867c1e969898882f0589f477ebe4c
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Remove unnecessary newline.
Change-Id: I3db3a1d8683867c1e969898882f0589f477ebe4b
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I1438caf6806d2197bcf20a63b56e33d9243fb2a0
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Multiple slashes are allowed in paths, so they cannot be compared as
simple strings.
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Fix some code style issue. Move expect_path() macro
to heder file.
Change-Id: I613f9335ac665ae0e038b0493c6582a20678bd12
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Due to recent changes in usbg_state, lets
introduce configfs_path field in state test_state
structure and fill it.
Since now path field should not be filled as it's
filled by prepare_state() function and generates
subsystem path using given configfs path.
Change-Id: I50e606c9f8c5eb478ac48fc453840b9a3efdd117
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Due to adding configure flags which allows to disable
libconfig dependency introduce a temporary fix which should
be removed when we will build tests with autotools.
Change-Id: I51f606c9f8c5eb478ac48fc453840b9a3efdd117
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Size_t is unsigned and passing -1 as buffer length makes no sense.
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Rebased onto current head.
Change-Id: I18e94b152706c4ff1a4ad4e58e53f9940963d194
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|
|
Change-Id: I1658663e8b7f14b5595ef806c5fca03ae10c830d
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Signed-off-by: Stanislaw Wadas <s.wadas@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
|