summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: Add setlocale() call to test-pseudotcp.cPhilip Withnall2014-08-211-0/+3
| | | | This ensures UTF-8 output is printed correctly.
* tests: Add a logging domain for the unit testsPhilip Withnall2014-08-211-0/+1
| | | | This clarifies the log output a little.
* Fix bug in the ice-tcp unit testYouness Alaoui2014-08-131-3/+4
|
* Revert "agent: Separate reliability from ice-tcp vs ice-udp"Olivier Crête2014-07-252-6/+6
| | | | This reverts commit 18e5dff4f25b12522e857c13d3ef3bdb40212246.
* Change test-icetcp to be more robust against ready->connected->ready state ↵Youness Alaoui2014-07-251-4/+17
| | | | changes
* agent: Separate reliability from ice-tcp vs ice-udpOlivier Crête2014-05-172-6/+6
| | | | | We want ICE-TCP to not have reliable behavior unless the agent is reliable otherwise it will confuse existing VoIP applications.
* Add support for ICE-TCPYouness Alaoui2014-05-176-1/+488
| | | | | | | | | | | | | | | | | | | | | | This is a massive commit that can't be split. We add ice-tcp support into the agent by creating local host tcp-active/tcp-passive candidates. We also need to find the local and remote candidates whenever we discover a peer-reflexive because their data is important to setup the peer-reflexive so a few changes were added to look for the local or remote candidate. For TCP-ACTIVE remote peer-reflexive candidates, we can't add conncheck pairs normally because TCP-PASSIVE (local) do not generate candidate pairs, and we also can't have a connection from any local host, so we can only create a single candidatepair with the local/remote that are connected. The pair->socket of a candidate check pair will hold the connected tcp socket (through connect for ACT or accept for PASS) and we will either have a remote or a local peer-reflexive which will create a new candidate pair, we cannot trigger checks on the initial candidate pair, we must only do it on the new check pairs. but in the case of a tcp-passive, we don't get a new local peer-reflexive candidate, so there is no new candidate with a new NiceSocket, so when we get a triggered check, we need to match it to the candidate check pair or when we select a pair, it will still use the original TCP-PASS socket. We must store the new connected tcp socket in the peer reflexive candidates since they represent that unique peer-reflx candidate's connection
* Disable reliable mode for test-fullmode, we already have pseudotcp unit testsYouness Alaoui2014-05-171-1/+1
|
* Add tcp-passive and tcp-active socket layers with unit testYouness Alaoui2014-05-172-1/+165
|
* test-fullmode: protect against ready->connected->ready state change and ↵Youness Alaoui2014-05-151-7/+21
| | | | accept data reception on connected state
* Remove priority functions from public header file and move to agent-priv.hYouness Alaoui2014-05-151-0/+2
|
* Change priority algorithm for better valuesYouness Alaoui2014-05-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we will always give a handicap to UDP candidates, but still give relays the lower priority. We have the following priorities now : In reliable mode : TCP Host : 120 TCP peer-refl : 110 TCP nat-assist : 105 TCP srv-refl : 100 UDP Host : 60 UDP peer-refl : 55 UDP nat-assist : 52 UDP srv-refl : 50 TCP relay : 10 UDP relay : 5 In unreliable mode : UDP Host : 120 UDP peer-refl : 110 UDP nat-assist : 105 UDP srv-refl : 100 TCP Host : 60 TCP peer-refl : 55 TCP nat-assist : 52 TCP srv-refl : 50 UDP relay : 10 TCP relay : 5
* test-priority: Unit test various configurations of candidate prioritiesYouness Alaoui2014-05-151-5/+20
|
* Add support for ice-tcp priorities, udp-tunneled and nat-assisted prioritiesYouness Alaoui2014-05-151-1/+3
|
* stunmessage: Revert another function to use sockaddrOlivier Crête2014-05-021-1/+1
| | | | The farstream unit tests were using it.
* Protect test-dribble against read->connected->ready state changesYouness Alaoui2014-04-231-4/+14
|
* tests: Add a test-pseudotcp-fuzzy test for fuzzing PseudoTcpSocketPhilip Withnall2014-04-172-0/+470
| | | | | | | | | As documented at the top of the file, this creates two PseudoTcpSockets in a loopback configuration, and mutates the raw packets which are sent between them, hoping to cause assertion failures and illegal memory accesses in the pseudotcp code. Best run under Valgrind or GDB.
* Rename variables that shadow global definitionsOlivier Crête2014-03-311-6/+6
|
* stun: Use struct sockaddr_storage * for any pointer that we write toOlivier Crête2014-03-311-2/+2
| | | | | | Some platforms have a larger alignment requirement for struct sockaddr_* than for plain struct sockaddr, in that case, we need to make sure that the incoming pointer has the right alignement before taking it in.
* pseudotcp: Don't mix "long" and guint, one is signed, the other is unsignedOlivier Crête2014-03-311-1/+2
| | | | So use guint64 everywhere, this is never supposed to be negative.
* test-fullmode: Don't use gmainloop when not requiredOlivier Crête2014-03-271-8/+21
| | | | There are more than one callback that could stop it
* test-fullmode: Do #if instead of #ifdef as we set it to 0Olivier Crête2014-03-271-1/+1
|
* test-fullmode: Only wait for data on component 1Olivier Crête2014-03-271-0/+3
|
* tests: Add private header to tarballOlivier Crête2014-03-061-0/+2
|
* tests: Don't verify the message content with not in reliable mode, because ↵Olivier Crête2014-03-062-33/+44
| | | | its unreliable
* tests: Use dynamically allocated port for test-new-dribbleOlivier Crête2014-02-251-15/+29
|
* tests: Fix horribly raciness in test-new-dribbleOlivier Crête2014-02-251-48/+87
|
* tests: Split racy "closing" into a test for stopping while reading or writingOlivier Crête2014-02-253-88/+194
| | | | | We wan't to make sure not to have a race where a thread blocks in a blocking receive or send while nice_agent_remove_stream() is called
* test: Use a less racy way to know if the test is ready to startOlivier Crête2014-02-252-13/+61
| | | | Also, keep a pointer to the other structure for tests to use
* agent: Replace nice_agent_build_io_stream() with nice_agent_get_io_stream()Olivier Crête2014-01-312-45/+10
| | | | | Also made the GIOStream into a singleton, it always returns the same one. Also make it impossible to create a GIOStream for a non-existing stream/component
* Remove the "length" parameter from NiceOutputMessageOlivier Crête2014-01-312-7/+22
| | | | It was used correctly only half the time anyway
* Remove the "to" parameter from NiceOutputMessageOlivier Crête2014-01-312-5/+3
| | | | | We never send multiple messages to separate targets in practice, so this will simplify the code
* tests: Fix test-restart to only quit on state changesPhilip Withnall2014-01-311-1/+0
| | | | | | Previously, there was a race between receiving the data packets and changing state to READY, which would cause one of the final assertions to fail.
* agent: Add support for vectored I/O for sendsPhilip Withnall2014-01-311-53/+193
| | | | | | | | | | | | | | | | | | | | | | Add one new public function, nice_agent_send_messages_nonblocking(), which replaces nice_agent_send_full(). This isn’t an API break, because nice_agent_send_full() hasn’t been in a release yet. The new API allows sending multiple messages in a single call, and supports vectors of buffers to transmit the messages from. The existing nice_agent_send() API has been left untouched, although it’s a bit of a bugbear because it’s non-blocking and doesn’t fit with the new *_nonblocking() naming scheme. Oh well. This doesn’t bring any notable changes to the number of memcpy()s on the critical path: it remains at zero for the common cases and common socket types. It introduces the possibility for future work to eliminate some memcpy()s in more complex socket types, like tcp-turn and tcp-bsd, but these optimisations have not been made yet. FIXME comments have been added. This includes modifications to the test-send-recv unit test to cover the new API.
* socket: Add vectored I/O support for sending on socketsPhilip Withnall2014-01-311-44/+83
| | | | | | | | | | | | | | | | | Replace the send() API with a send_messages() API, which supports sending multiple messages, each with multiple buffers rather than a single monolithic buffer. This doesn’t break API, as the socket API is not exposed outside libnice. It does introduce a new struct: NiceOutputMessage, which is analogous to struct mmsghdr and NiceInputMessage. This includes updates to the test-bsd test to cover the changed API. The existing nice_socket_send() API has been retained as a thin wrapper around nice_socket_send_messages(), for convenience only. It’s hoped that internal usage of this API will decline to the point where it can be removed.
* tests: Update test-send-recv to support vectored I/OPhilip Withnall2014-01-311-94/+338
|
* tests: Fix a shadowed function name in test-pseudotcpPhilip Withnall2014-01-311-2/+4
| | | | | The write() function already exists; we can’t re-define it as a callback.
* socket: Add vectored I/O support for receiving on socketsPhilip Withnall2014-01-311-29/+293
| | | | | | | | | | | | Replace the recv() API with a recv_messages() API, which supports receiving multiple messages, each with multiple buffers rather than a single monolithic buffer. This doesn’t break API, as the socket API is not exposed outside libnice. It does introduce a new struct: NiceInputMessage, which is analogous to struct mmsghdr. This includes updates to the test-bsd test to cover the changed API.
* agent: Only change pseudotcp clock if the new timeout is soonerOlivier Crête2014-01-311-0/+1
| | | | | Destroying and creating GSources is expensive, so also don't destroy and re-create if possible, instead lets use the new g_source_set_ready_time()
* nice: Add nice_agent_build_io_stream to exported symbolsOlivier Crête2014-01-311-5/+7
|
* tests: Remove redundant GLIB_CHECK_VERSION checksPhilip Withnall2014-01-3114-40/+0
| | | | | | Since we define GLIB_VERSION_MIN_REQUIRED, GLib will not emit deprecated function call warnings for functions like g_type_init() or g_thread_init().
* tests: Add tests for the I/O stream classesPhilip Withnall2014-01-319-0/+2703
|
* tests: Remove a potential race from test-threadPhilip Withnall2014-01-311-1/+3
| | | | | | | | | | | | A g_usleep() was introduced in commit e22ecb19662970a42def6df74db6359e58084727 to fix a potential race where the non-main threads would finish all their work before the error_loop was started, leaving the error_loop to run for 30s then abort the test. A better fix, instead of doing a racy sleep, is to have the non-main threads spin until the error_loop is running. GLib takes care of all the locking for us, and since we don’t care about efficiency for test cases, spinning is fine (the wait is also going to be quite short).
* tests: Add missing switch casesPhilip Withnall2014-01-311-0/+8
| | | | | | | | This appeases GCC’s -Wswitch-enum warning, and makes it more obvious that those enum cases have been explicitly considered, rather than just forgotten about. This introduces no functional changes.
* tests: Fix strict aliasing of sockaddr structuresPhilip Withnall2014-01-312-18/+30
| | | | | | | | | | | | Casting from one struct sockaddr type to another breaks C’s strict aliasing rules (variables of different types cannot alias). Fix this cleanly by using unions of struct sockaddrs to convert between the types (i.e. type-punning). I wish sockaddr didn’t have to be this painful. See: http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Optimize-Options.html#Type_002dpunning
* tests: Add more asserts to pseudotcp testOlivier Crête2014-01-311-3/+13
|
* tests: Use right type when taking to stdio f*() C APIsOlivier Crête2014-01-311-4/+4
|
* tests: Close pseudosocket as soon as it's done sendingOlivier Crête2014-01-311-6/+4
|
* tests: Fix racy destruction of pseudotcp objectOlivier Crête2014-01-311-12/+14
|
* tests: No need to call adjust_clock in readableOlivier Crête2014-01-311-2/+0
| | | | | This can only be called after we received a packet, where we already adjust the clock