diff options
| author | Kristian Høgsberg <krh@bitplanet.net> | 2012-03-24 14:34:05 -0400 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-03-24 14:35:53 -0400 |
| commit | 9086b60d81a48f14b6c48b30e307caa053568548 (patch) | |
| tree | 69e292f67c2901db2cf7048b2118c55bfec9bf0a | |
| parent | connection-test: Test fd transport (diff) | |
| download | wayland-9086b60d81a48f14b6c48b30e307caa053568548.tar wayland-9086b60d81a48f14b6c48b30e307caa053568548.tar.gz wayland-9086b60d81a48f14b6c48b30e307caa053568548.tar.bz2 wayland-9086b60d81a48f14b6c48b30e307caa053568548.tar.lz wayland-9086b60d81a48f14b6c48b30e307caa053568548.tar.xz wayland-9086b60d81a48f14b6c48b30e307caa053568548.tar.zst wayland-9086b60d81a48f14b6c48b30e307caa053568548.zip | |
connection-test: Add test case to stress connection buffers
This catches the bug fixed in cab70c9e5d8c38260a07bb1ddb7618826a120465.
| -rw-r--r-- | tests/connection-test.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/connection-test.c b/tests/connection-test.c index 3747857..ff31518 100644 --- a/tests/connection-test.c +++ b/tests/connection-test.c @@ -402,3 +402,25 @@ TEST(connection_marshal_demarshal) release_marshal_data(&data); } + +TEST(connection_marshal_alot) +{ + struct marshal_data data; + char f[64]; + int i; + + setup_marshal_data(&data); + + /* We iterate enough to make sure we wrap the circular buffers + * for both regular data an fds. */ + + for (i = 0; i < 2000; i++) { + strcpy(f, "/tmp/weston-tests-XXXXXX"); + data.value.h = mkstemp(f); + assert(data.value.h >= 0); + marshal_demarshal(&data, (void *) validate_demarshal_h, + 8, "h", data.value.h); + } + + release_marshal_data(&data); +} |
