Commit Graph

125 Commits

Author SHA1 Message Date
Johan Hedberg
b8779d2202 Revert "Ensure config.h is included by using CPPFLAGS"
This reverts commit 8a03376544.

The patch needs to be split up and the gdbus/ changes were bogus
compared to the original commit message.

Conflicts:
	Makefile.am
	Makefile.obexd
	profiles/cyclingspeed/cyclingspeed.c
	profiles/heartrate/heartrate.c
	src/error.c
2012-12-07 12:46:04 +02:00
Lucas De Marchi
8a03376544 Ensure config.h is included by using CPPFLAGS
Instead of trying to include config.h in each file over the tree and
possibly forgetting to include it, give a "-include config.h" argument
to the compiler so it's guaranteed that a) it will be included for all
source files and b) it will be the first header included.

gdbus/ directory is left out, since it would break other projects using
it.
2012-12-05 17:18:07 +02:00
Luiz Augusto von Dentz
d947e0718a gobex: Add unit test for encoding/decoding apparam headers 2012-12-04 22:22:06 +01:00
Luiz Augusto von Dentz
2476a6cb13 gobex: Add unit tests for GObexApparam API 2012-12-04 22:22:06 +01:00
Jaganath Kanakkassery
889a1a1400 gobex: Remove g_idle_add to exit main loop in test_stream_put_req_abort()
A callback is provided in g_obex_cancel_transfer() which will be called
when abort completes which exists the mail loop as well
2012-12-04 22:22:06 +01:00
Luiz Augusto von Dentz
52b3354422 gobex: Fix unit test for PUT request followed by ABORT
gobex was actually used to respond not to request so the test is
renamed to test_stream_put_rsp_abort and a new test is created using
g_obex_put_req to initiate the request and g_obex_cancel_transfer to
abort it.
2012-12-04 22:22:06 +01:00
Jaganath Kanakkassery
9166ea3ffd gobex: Add unit test for PUT request followed by ABORT 2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
34680daae1 gobex: fix unit test when using SOCK_SEQPACKET
Now that SRM is automatically configured when the transport type is
SOCK_SEQPACKET all tests that uses this transport are already testing
SRM so there is no need to keep adding the headers manually.

In addition to that remove the tests for SRM using SOCK_STREAM since
those are currently not supported without including the headers.
2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
cd0af353a5 gobex: simplify naming of tests when transfering sequence of packets
Before random was used but the number of packets were not really random
so now seq is used instead.
2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
ac5aedf446 gobex: add unit test for CONN followed by PUT request with SRM 2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
2cc6193673 gobex: add unit test for GET request with SRM and SRMP additional wait 2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
fc12e4ca63 gobex: add unit test for GET request with SRM and SRMP wait 2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
2951b0d6be gobex: add unit test for GET response with SRM and SRMP wait 2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
d3f6db2a6b gobex: add unit test for PUT response with SRM and SRMP wait 2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
d4395a7e3b gobex: add unit test for PUT request with SRM and SRMP wait 2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
4c305704fd gobex: add unit test for GET request with SRM 2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
f2da5d46b5 gobex: add unit test for PUT response with SRM 2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
5dbde0863d gobex: add unit test for GET response with SRM enable 2012-12-04 22:22:05 +01:00
Luiz Augusto von Dentz
cd3e6c9c61 gobex: add unit test for PUT request with SRM 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
74bb8e1474 gobex: add unit test for GET response with random data 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
80c602ba33 gobex: add unit test for GET request with random data 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
1e5b2ca160 gobex: add unit test for PUT response with random data 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
48497a481e gobex: add unit test for packet PUT request with random data 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
13564dd509 gobex: remove unused delay on test_put_req_random 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
19359ee369 gobex: fix wrong name of test_get_rsp_eagain 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
37cfa1cc4c gobex: always set CONNECTION_ID to 1 on unit tests
This simplify the creation of new test by not requiring different
variables for every connection response.
2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
27249cbd0a gobex: add unit test for GET response with APPARAM 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
c02e6e5e27 gobex: add unit test for GET request with APPARAM 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
7f604f1818 gobex: add unit test for GET request with delay 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
04bfae5d56 gobex: add unit test for PUT response with delay 2012-12-04 22:22:04 +01:00
Bartosz Szatkowski
b8cc54f1b9 gobex: Add "cd ../dir" handling in setpath 2012-12-04 22:22:04 +01:00
Luiz Augusto von Dentz
648e662542 gobex: add unit test for CONNECT followed by PUT request with random data
Note that in order to work the buffer had to be increased to OBEX maximum
MTU otherwise test_io_cb would be sending responses for each fragment it
has read which may not constitute a full packet.
2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
75447e6647 gobex: add unit test for CONNECT followed by GET wrong response 2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
4c7baae49e gobex: add unit test for CONNECT followed by PUT response 2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
8b6ff020b6 gobex: add unit test for CONNECT followed by PUT request 2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
6b1a901678 gobex: add unit test for CONNECT followed by GET response 2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
a28a22a707 gobex: add unit test for CONNECT followed by GET request 2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
4f64bb1b38 gobex: add unit test for CONNECT response 2012-12-04 22:22:03 +01:00
Luiz Augusto von Dentz
e94ce4ff86 gobex: add unit test for CONNECT request 2012-12-04 22:22:03 +01:00
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