diff options
author | Pawel Szewczyk <p.szewczyk@samsung.com> | 2015-05-28 12:32:50 +0200 |
---|---|---|
committer | Krzysztof Opasiak <k.opasiak@samsung.com> | 2015-07-30 15:56:42 +0200 |
commit | f1a89d1c08d4d173032aaf2f29bde090b9c82490 (patch) | |
tree | 1ecd035bddd09e9ca11126740c9ce5a8c3fc9479 /tests | |
parent | 2458818f33eba80674bb806ec5e2c1a6ed94318c (diff) | |
download | libusbg-f1a89d1c08d4d173032aaf2f29bde090b9c82490.tar.gz libusbg-f1a89d1c08d4d173032aaf2f29bde090b9c82490.tar.bz2 libusbg-f1a89d1c08d4d173032aaf2f29bde090b9c82490.zip |
libusbg: tests: Add assertions for function attributes
Change-Id: Idfc179ff08a0d23b73ca0f30519bbc73f6556e10
Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/usbg-test.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/usbg-test.c b/tests/usbg-test.c index 53563b0..5e062dc 100644 --- a/tests/usbg-test.c +++ b/tests/usbg-test.c @@ -1137,6 +1137,38 @@ void assert_gadget_strs_equal(usbg_gadget_strs *actual, usbg_gadget_strs *expect assert_string_equal(get_gadget_str(actual, i), get_gadget_str(expected, i)); } +void assert_f_serial_attrs_equal(usbg_f_serial_attrs *actual, + usbg_f_serial_attrs *expected) +{ + assert_int_equal(actual->port_num, expected->port_num); +} + +static void assert_ether_addrs_equal(const struct ether_addr *ea1, + const struct ether_addr *ea2) +{ + assert_memory_equal(ea1->ether_addr_octet, ea2->ether_addr_octet, + ETHER_ADDR_LEN); +} + +void assert_f_net_attrs_equal(usbg_f_net_attrs *actual, usbg_f_net_attrs *expected) +{ + assert_ether_addrs_equal(&actual->dev_addr, &expected->dev_addr); + assert_ether_addrs_equal(&actual->host_addr, &expected->host_addr); + assert_string_equal(actual->ifname, expected->ifname); + assert_int_equal(actual->qmult, expected->qmult); +} + +void assert_f_phonet_attrs_equal(usbg_f_phonet_attrs *actual, + usbg_f_phonet_attrs *expected) +{ + assert_string_equal(actual->ifname, expected->ifname); +} + +void assert_f_ffs_attrs_equal(usbg_f_ffs_attrs *actual, usbg_f_ffs_attrs *expected) +{ + assert_string_equal(actual->dev_name, expected->dev_name); +} + void for_each_test_function(struct test_state *ts, usbg_state *s, FunctionTest fun) { struct test_gadget *tg; |