Commit Graph

136 Commits

Author SHA1 Message Date
Johan Hedberg
3a7f9049c0 gobex: Fix decoding byte array headers with too small length
Length values of less than 3 are invalid.
2012-12-04 22:22:03 +01:00
Johan Hedberg
d21fef52df gobex: Add unit tests for Action command functions 2012-12-04 22:22:02 +01:00
Luiz Augusto von Dentz
b9794defb8 gobex: Add random put request test 2012-12-04 22:22:02 +01:00
Jakub Adamek
f264b1c744 gobex: Fix encoding of empty unicode headers
According to IrOBEX:
"An empty Name header is defined as a Name header of length 3 (one byte
opcode + two byte length)."

The current code encodes an empty header with 5 bytes, including two
bytes of null-terminator.

This patch assumes that this definition of emptiness applies to all
unicode headers, not just the name header.
2012-12-04 22:22:02 +01:00
Johan Hedberg
0528bfc1a0 gobex: Add support for returning -EAGAIN from producer callback 2012-12-04 22:22:02 +01:00
Johan Hedberg
234c29546d gobex: Fix put request handling with final bit value 2012-12-04 22:22:01 +01:00
Johan Hedberg
ddb69649e8 gobex: Merge gobex-transfer.h into gobex.h 2012-12-04 22:22:01 +01:00
Johan Hedberg
c869ca28b8 gobex: Make use of va-args headers in higher level functions 2012-12-04 22:22:01 +01:00
Johan Hedberg
508cb6f8c2 gobex: Fix minor memory leak in unit test 2012-12-04 22:22:01 +01:00
Johan Hedberg
815218c7ef gobex: Make transfer functions take va-args header lists 2012-12-04 22:22:01 +01:00
Johan Hedberg
58cd14d209 gobex: Remove _ID_ from header type definitions 2012-12-04 22:22:01 +01:00
Johan Hedberg
cdcde59687 gobex: Add va-args based packet creation support 2012-12-04 22:22:01 +01:00
Johan Hedberg
f5d10bf7cb gobex: Remove unneeded data_policy from g_obex_header_new_bytes 2012-12-04 22:22:01 +01:00
Johan Hedberg
25faf4fc79 gobex: Allow calling g_obex_get_rsp later with custom headers 2012-12-04 22:22:01 +01:00
Johan Hedberg
7f5cb418d3 gobex: Ignore unexpected responses (which can occur when aborting) 2012-12-04 22:22:01 +01:00
Johan Hedberg
1760e5f5f5 gobex: Add g_obex_delete 2012-12-04 22:22:01 +01:00
Johan Hedberg
8554bc2a89 gobex: Add g_obex_mkdir 2012-12-04 22:22:01 +01:00
Johan Hedberg
15402c02c1 gobex: Add unit test for SetPath("..") 2012-12-04 22:22:01 +01:00
Johan Hedberg
f4baf99a5e gobex: Use proper response code in connect response 2012-12-04 22:22:01 +01:00
Johan Hedberg
1b609bec8e gobex: Add g_obex_setpath 2012-12-04 22:22:00 +01:00
Johan Hedberg
60fd958c20 gobex: Add unit test for g_obex_connect 2012-12-04 22:22:00 +01:00
Johan Hedberg
b1d071bd5c gobex: Refactor common unit test functions to util.c 2012-12-04 22:22:00 +01:00
Johan Hedberg
d1ad690084 gobex: Add unit tests for g_obex_suspend & g_obex_resume 2012-12-04 22:22:00 +01:00
Johan Hedberg
817b488ebc gobex: Assert correct io_cb count in transfer unit tests 2012-12-04 22:22:00 +01:00
Johan Hedberg
b19d1fbde8 gobex: Refactor transfer unit test IO callbacks 2012-12-04 22:22:00 +01:00
Johan Hedberg
98703e92d1 gobex: Add g_obex_get_rsp 2012-12-04 22:22:00 +01:00
Johan Hedberg
6abdccbf94 gobex: Add g_obex_get_req 2012-12-04 22:22:00 +01:00
Johan Hedberg
3f2536cb1d gobex: Extend g_obex_put_rsp unit test to have two rounds of requests 2012-12-04 22:22:00 +01:00
Johan Hedberg
b7809d9045 gobex: Add unit test for g_obex_put_rsp 2012-12-04 22:22:00 +01:00
Johan Hedberg
5ea9277204 gobex: Use zero timeout to make timeout unit tests run faster 2012-12-04 22:22:00 +01:00
Johan Hedberg
89f8833b25 gobex: Add unit test for put transfer API 2012-12-04 22:22:00 +01:00
Johan Hedberg
33324a068a gobex: Move more unit test helpers to util.c 2012-12-04 22:22:00 +01:00
Johan Hedberg
bd5957292f gobex: Add unit test for unexpected data 2012-12-04 22:22:00 +01:00
Johan Hedberg
7fee9ce693 gobex: Remove g_obex_set_request_function 2012-12-04 22:21:59 +01:00
Johan Hedberg
b50f20a501 gobex: Use GObexDataProducer type instead of (custom) GObexPacketDataFunc 2012-12-04 22:21:59 +01:00
Johan Hedberg
0a4824ddb1 gobex: Make on-demand body headers a GObexPacket feature 2012-12-04 22:21:59 +01:00
Johan Hedberg
714abdfc72 gobex: Make on-demand header callbacks able to fail cleanly 2012-12-04 22:21:59 +01:00
Johan Hedberg
a470646232 gobex: Add convenience response sending function 2012-12-04 22:21:58 +01:00
Johan Hedberg
7afc5a6f90 gobex: g_obex_new should create its own GIOChannel ref 2012-12-04 22:21:58 +01:00
Johan Hedberg
57478308af gobex: Add (transport) MTU parameters to g_obex_new 2012-12-04 22:21:58 +01:00
Johan Hedberg
680e9abc4b gobex: Split ev_func into req_func and disconn_func 2012-12-04 22:21:58 +01:00
Johan Hedberg
ad811dd51e gobex: Add support for on-demand headers 2012-12-04 22:21:58 +01:00
Johan Hedberg
a14e52b471 gobex: Add packet transport support 2012-12-04 22:21:58 +01:00
Johan Hedberg
13d42a0945 gobex: Add request cancellation support 2012-12-04 22:21:57 +01:00
Johan Hedberg
371bd8adf6 gobex: Remove disconn callback in favor of generic event callback 2012-12-04 22:21:57 +01:00
Johan Hedberg
9292a83d92 gobex: Add per-request timeouts 2012-12-04 22:21:57 +01:00
Johan Hedberg
e139f2c5b9 gobex: Add connect packet decoding test 2012-12-04 22:21:57 +01:00
Johan Hedberg
bab1892b28 gobex: Add invalid connect response test 2012-12-04 22:21:57 +01:00
Johan Hedberg
dfae4177b7 gobex: Refactor response sending in tests 2012-12-04 22:21:57 +01:00
Johan Hedberg
0f10ac2b8c gobex: Add proper error returns to packet sending functions 2012-12-04 22:21:57 +01:00
Johan Hedberg
d76690df91 gobex: Add invalid packet data decoding test 2012-12-04 22:21:57 +01:00
Johan Hedberg
a8f0a73b48 gobex: Add invalid header data decoding tests 2012-12-04 22:21:57 +01:00
Johan Hedberg
f2b4c7bc5d gobex: Add basic packet encoding test 2012-12-04 22:21:57 +01:00
Johan Hedberg
aa1b87b6d8 gobex: Add initial GError support 2012-12-04 22:21:57 +01:00
Johan Hedberg
31ebc74e69 gobex: Add disconnect callback support 2012-12-04 22:21:57 +01:00
Johan Hedberg
d455694af2 gobex: Split unit tests into separate modules 2012-12-04 22:21:57 +01:00
Johan Hedberg
b105277b97 gobex: Split gobex.c into multiple modules 2012-12-04 22:21:57 +01:00
Johan Hedberg
d3558f1c0b gobex: Make Action ID test data less predictable 2012-12-04 22:21:57 +01:00
Johan Hedberg
0302f86230 gobex: Add functions for fetching data from packets 2012-12-04 22:21:56 +01:00
Johan Hedberg
55b393abb0 gobex: Name header creation functions more intuitively 2012-12-04 22:21:56 +01:00
Johan Hedberg
b76d71e5b2 gobex: Refactor reading/writing to allow packet based transport 2012-12-04 22:21:56 +01:00
Johan Hedberg
fd01c40449 gobex: Add basic response handling 2012-12-04 22:21:56 +01:00
Johan Hedberg
0b92685e8b gobex: Refactor test endpoint creation into create_endpoints() 2012-12-04 22:21:56 +01:00
Johan Hedberg
57e8d5af63 gobex: Fix minor leak in test_recv_connect_stream 2012-12-04 22:21:56 +01:00
Johan Hedberg
8005be3b8a gobex: Add basic packet sending support 2012-12-04 22:21:56 +01:00
Johan Hedberg
aafd18d9d3 gobex: Rename transfer tests to accomodate for new ones 2012-12-04 22:21:56 +01:00
Johan Hedberg
339a4789e4 gobex: Fix OBEX version in connect packet 2012-12-04 22:21:56 +01:00
Johan Hedberg
95b7ce7165 gobex: Make G_OBEX_FINAL definition private 2012-12-04 22:21:56 +01:00
Johan Hedberg
2e94a60c20 gobex: Add basic request callback support 2012-12-04 22:21:56 +01:00
Johan Hedberg
22c146eb06 gobex: Clean up handling of the final bit 2012-12-04 22:21:56 +01:00
Johan Hedberg
b568973ba3 gobex: Minor coding style fixes 2012-12-04 22:21:56 +01:00
Johan Hedberg
5bb407c82b gobex: Rename parse_header tests to decode_header 2012-12-04 22:21:56 +01:00
Johan Hedberg
9966d11291 gobex: Rename GObexRequest to GObexPacket 2012-12-04 22:21:56 +01:00
Johan Hedberg
8d451283e0 gobex: Add basic request decoding support 2012-12-04 22:21:56 +01:00
Johan Hedberg
352a739a89 gobex: Use enum instead of boolean for data policy 2012-12-04 22:21:56 +01:00
Johan Hedberg
0e858224b1 gobex: Rename header_parse to header_decode to match header_encode 2012-12-04 22:21:56 +01:00
Johan Hedberg
b9f6da0fe1 gobex: Fix parse_and_decode->parse_and_encode naming 2012-12-04 22:21:55 +01:00
Johan Hedberg
cf9afde062 gobex: Add header creation functions 2012-12-04 22:21:55 +01:00
Johan Hedberg
579f895300 gobex: Add header encoding support 2012-12-04 22:21:55 +01:00
Johan Hedberg
e8c4fe5aa7 gobex: Add basic header parsing support 2012-12-04 22:21:55 +01:00
Johan Hedberg
b8cd1913e6 gobex: Add request stubs 2012-12-04 22:21:55 +01:00
Johan Hedberg
fd46bedda3 gobex: Refactor basic unit tests 2012-12-04 22:21:55 +01:00
Johan Hedberg
d3a5f0f47d gobex: Add initial unit tests 2012-12-04 22:21:55 +01:00
Johan Hedberg
9d387f4372 Convert unit tests from GLib to GNU Check 2011-10-25 10:08:07 +02:00
Frédéric Danis
bb957be6a4 Add EIR length parameter to eir_parse()
LE uses shorter EIR (31 bytes) than HCI (240 bytes)
2011-10-21 13:35:01 +03:00
Johan Hedberg
029077107e Add basic unit tests framework for EIR parsing 2011-10-18 23:58:12 +03:00