391 Commits

Author SHA1 Message Date
Nick Mathewson
f4775918cd Refactor evtag tests into their own suite.
svn:r1366
2009-07-20 14:55:51 +00:00
Nick Mathewson
e8400a43ca Rename encode_int(64) to avoid polluting the global namespace.
They're now called evtag_encode_int(64).  The old names are available
as macros in event2/tag_compat.h.

Also, add unit tests for encode/decode_int64.

svn:r1365
2009-07-20 14:55:35 +00:00
Nick Mathewson
dc031990e0 Add strcasecmp tests to improve evutil coverage a bit
svn:r1364
2009-07-20 14:55:07 +00:00
Nick Mathewson
9cf4ee7e17 Fix a simple warning
svn:r1362
2009-07-17 21:47:35 +00:00
Nick Mathewson
c02b305ae5 Trivial tests to exercise deferred and locking bufferevent code.
These are done as variations of test_bufferevent_connect, since that
one exercises event callbacks as well as read/write callbacks.

The coverage for bufferevent.c is now up to about 87%, from about 70%.

svn:r1358
2009-07-17 20:23:12 +00:00
Nick Mathewson
61f2a45de1 Add a tinytest flag to initialize threading.
svn:r1357
2009-07-17 20:23:05 +00:00
Nick Mathewson
4ba6eda48f Make evthread_use_pthreads() actually return 0 on success.
svn:r1356
2009-07-17 20:22:56 +00:00
Nick Mathewson
9c2ecba7f8 Oops. -1 is an integer, not a pointer.
svn:r1352
2009-07-17 18:42:12 +00:00
Nick Mathewson
d6f2e19924 Unit tests for bufferevent_get(fd|_underlying)
svn:r1351
2009-07-17 18:38:46 +00:00
Nick Mathewson
5d71b25b51 Remove all trailing whitespace from end-of-line.
svn:r1350
2009-07-17 18:38:38 +00:00
Nick Mathewson
d4e3671fb4 Add a test to free_active_base to free a base with an active event.
svn:r1349
2009-07-17 18:38:21 +00:00
Nick Mathewson
043515bc52 Stop using C++ style comments.
svn:r1343
2009-07-14 18:50:06 +00:00
Nick Mathewson
e224321c64 Convert and expand free_active_base/event_base_new tests to avoid dbl-free. Patch from Zack Weinberg
svn:r1342
2009-07-14 18:49:42 +00:00
Nick Mathewson
d866f05585 Patch from Zack Weinberg: normalize perror() tt functions and add tt_fail/tt_abort_printf
svn:r1340
2009-07-13 20:03:00 +00:00
Niels Provos
6469598e56 Allow C identifiers as struct names; allow multiple comments in .rpc files; from Zack Weinberg; plus a tiny tweak
svn:r1336
2009-07-03 17:43:26 +00:00
Nick Mathewson
bbd14de053 Add sometimes-needed header to regress_bufferevent.c
svn:r1325
2009-06-11 17:55:08 +00:00
Nick Mathewson
d1ffba1d7c Replace some read/write instances with send/recv to work properly on win32.
svn:r1324
2009-06-05 19:52:13 +00:00
Nick Mathewson
0b22ca1929 Use ev_ssize_t in place of ssize_t *everywhere*.
svn:r1309
2009-05-22 19:11:48 +00:00
Nick Mathewson
23243b8a98 Replace reserve/commit with new iovec-based interface. Add a new evbuffer_peek.
svn:r1296
2009-05-19 21:39:35 +00:00
Nick Mathewson
ed1bbc7a9f Tweak the evconnlistener interface a little.
svn:r1295
2009-05-18 16:15:56 +00:00
Nick Mathewson
dc4c7b9570 Change the interface of evbuffer_add_reference: give the cleanup function more info.
svn:r1294
2009-05-15 22:44:18 +00:00
Nick Mathewson
bba69e03f8 New semantics for evbuffer_cb_set_flags().
Previously, set_flags() would replace all previous user-visible flags.
Now it just sets the flags, and there is a clear_flags() function to
clear other flags.

svn:r1293
2009-05-15 20:23:59 +00:00
Nick Mathewson
83f46e51d7 Do not use the "evbuffer_" prefix to denote parts of bufferevents.
This is a bit of an interface doozy, but it's really needed in order
to be able to document this stuff without apologizing it.  This patch
does the following renamings:

   evbuffercb -> bufferevent_data_cb
   everrorcb -> bufferevent_event_cb
   EVBUFFER_(READ,WRITE,...) -> BEV_EVENT_(...)
   EVBUFFER_(INPUT,OUTPUT) -> bufferevent_get_(input,output)

All the old names are available in event2/bufferevent_compat.h

svn:r1283
2009-05-13 20:36:56 +00:00
Nick Mathewson
8910901020 Addition to bufferevent_async unit test
svn:r1279
2009-05-06 02:34:10 +00:00
Nick Mathewson
fe47003d06 Make unit tests for bufferevent_async compile and _almost_ work.
Either I need to make the callbacks get deferred in a base with no events (doable), or I need to make it okay to call launch_read from inside the callback for read (tricky).

svn:r1277
2009-05-05 16:52:37 +00:00
Nick Mathewson
02801e5be5 Add a trival start of a be_async test.
svn:r1276
2009-05-05 15:36:28 +00:00
Nick Mathewson
659d54d530 Add new code to make and accept connections.
This is stuff that it's easy to get wrong (as I noticed when writing
bench_http), and that takes up a fair amount of space (see http.c).
Also, it's something that we'll eventually want to abstract to use
IOCP, where available.

svn:r1272
2009-05-05 02:59:26 +00:00
Nick Mathewson
bd73ed48e5 Revise regress_pthreads.c to not use event_set
svn:r1269
2009-05-02 16:24:23 +00:00
Nick Mathewson
7f9678079f Initial unit test for overlapped evbuffer usage. It's lame, but it doesn't crash any more.
svn:r1259
2009-04-30 20:48:40 +00:00
Nick Mathewson
16612eb936 Beef up the events in the last test a little.
svn:r1256
2009-04-30 19:20:42 +00:00
Nick Mathewson
ec1468832e Oops: actually commit changes to build and use regress_iocp
svn:r1255
2009-04-30 19:05:43 +00:00
Nick Mathewson
f1090833b2 First tests for IOCP loop, and related fixes.
The fixes are: a shutdown mode that works, and a way to activate an
arbitrary event_overlapped.

svn:r1254
2009-04-30 19:04:44 +00:00
Nick Mathewson
b45cead762 Make environment-variable tests work on win32, which has only one method and lacks (un)setenv.
svn:r1253
2009-04-30 18:05:33 +00:00
Nick Mathewson
586aa46886 Unit test for disabling events with EVENT_NO*, and for EVENT_BASE_FLAG_IGNORE_ENV.
svn:r1247
2009-04-28 19:08:27 +00:00
Niels Provos
b228ff91b8 remove vararg macros for accessing evrpc structs
svn:r1243
2009-04-25 00:15:31 +00:00
Nick Mathewson
d70b080488 Make main/methods test pass on systems where only one backend exists.
svn:r1235
2009-04-23 18:08:42 +00:00
Nick Mathewson
1ad0326440 Fix win32 compilation issues.
svn:r1234
2009-04-23 18:04:50 +00:00
Nick Mathewson
8ba25b9ec7 Add missing regress_minheap.c file
svn:r1230
2009-04-23 05:20:08 +00:00
Nick Mathewson
5c104cef51 Add a randomized test for heap correctness.
svn:r1229
2009-04-23 00:33:37 +00:00
Nick Mathewson
df0617f289 Use signal.h, not sys/signal.h.
This is patch 2673214 from mmadia.  It is correct, since we unconditionally
include signal.h in many other places, and only sometimes include sys/signal.h.
It is necessary to compile on Haiku, I'm told.

svn:r1228
2009-04-23 00:21:23 +00:00
Nick Mathewson
0068c98ad2 Make version test ignore the bottom byte of the version number.
svn:r1225
2009-04-23 00:01:14 +00:00
Nick Mathewson
b21be24545 Somehow free_active_base was using the socketpair, but not saying it needed it. How did this ever work?
svn:r1223
2009-04-23 00:00:55 +00:00
Nick Mathewson
1f9c9e5137 Add a missing "static".
svn:r1219
2009-04-22 15:38:50 +00:00
Nick Mathewson
133a015dba Make sure the test case for mem_functions hits strdup too.
svn:r1218
2009-04-21 18:48:05 +00:00
Nick Mathewson
7f1855d064 Add a basic test for set_mem_functions
svn:r1216
2009-04-21 18:47:35 +00:00
Nick Mathewson
386279d051 Add a test for event_pending; especially the timeout part.
svn:r1214
2009-04-21 18:47:02 +00:00
Nick Mathewson
ff1f429510 Unit tests for event_base_once.
svn:r1213
2009-04-21 18:46:43 +00:00
Nick Mathewson
ea664bf29a Refactor test wrappers to divide legacy items from useful stuff.
svn:r1212
2009-04-21 18:46:30 +00:00
Nick Mathewson
122e934e92 Add unit tests for version methods and feature-based backend selection
svn:r1211
2009-04-21 18:46:11 +00:00
Nick Mathewson
7cf8a7b0e0 Call the main testcases "main", not "legacy".
svn:r1210
2009-04-21 18:45:59 +00:00