aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-12-29 16:53:02 -0800
committerGarrett D'Amore <garrett@damore.org>2024-12-29 17:36:46 -0800
commit337d6066098bd1d78dfe33afccdcccc83a9be391 (patch)
treecabe35da9c8b4e618db3127543970d643048a589 /src
parentaabe3ed301081aacce11408749c26b6baae3faaa (diff)
downloadnng-337d6066098bd1d78dfe33afccdcccc83a9be391.tar.gz
nng-337d6066098bd1d78dfe33afccdcccc83a9be391.tar.bz2
nng-337d6066098bd1d78dfe33afccdcccc83a9be391.zip
aio test: add a test for IOV overrun
Diffstat (limited to 'src')
-rw-r--r--src/core/aio_test.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/aio_test.c b/src/core/aio_test.c
index a41f608d..f9663903 100644
--- a/src/core/aio_test.c
+++ b/src/core/aio_test.c
@@ -435,6 +435,23 @@ test_aio_busy(void)
NUTS_ASSERT(!nng_aio_busy(aio));
nng_aio_free(aio);
}
+void
+test_aio_scatter_gather_too_many(void)
+{
+ nng_aio *aio;
+ nng_iov iov[32];
+
+ NUTS_PASS(nng_aio_alloc(&aio, NULL, NULL));
+
+ for (int i = 0; i < 32; i++) {
+ iov[i].iov_buf = "abc";
+ iov[i].iov_len = 3;
+ }
+
+ NUTS_FAIL(nng_aio_set_iov(aio, 32, iov), NNG_EINVAL);
+
+ nng_aio_free(aio);
+}
NUTS_TESTS = {
{ "sleep", test_sleep },
@@ -453,5 +470,6 @@ NUTS_TESTS = {
{ "sleep loop", test_sleep_loop },
{ "sleep cancel", test_sleep_cancel },
{ "aio busy", test_aio_busy },
+ { "scatter gather too many", test_aio_scatter_gather_too_many },
{ NULL, NULL },
};