axboe / liburing

Library providing helpers for the Linux kernel io_uring support
MIT License
2.72k stars 393 forks source link

Test `io_uring_prep_sendto` #1089

Closed YoSTEALTH closed 4 months ago

YoSTEALTH commented 4 months ago

Need to create basic test for io_uring_prep_sendto

isilence commented 4 months ago

Even though adding such a test would be welcome, but I don't think it's strictly required. It's a simple wrapper, and passing an address is exercised at least in send-zerocopy.c for normal and as well zerocopy modes.

https://github.com/axboe/liburing/blob/master/test/send-zerocopy.c#L375

YoSTEALTH commented 4 months ago

Just a basic test should do, nothing fancy, to make sure all the functions are covered with test. I know its not very important but you never know when things will be effected, even a simple type change or new attribute added could effect each other.

axboe commented 4 months ago

It's already being implicitly tested. I have a feeling you're asking for this to duplicate it in your framework? If so, please just go ahead and write it and send a PR. We're getting inundated with "please add this or that" these days, and it's not scaleable. If some tests or documentation is missing, please feel free to write them and submit them.

axboe commented 4 months ago

https://github.com/axboe/liburing/issues/1090

YoSTEALTH commented 4 months ago

It took me a while to find all those, don't you use something like coverage in C? It normally tells you functions that are not covered in test, figured it would be good to let you guys know.

I would have added all those into 1 issue, but I think you mentioned somewhere to create each post per issue.

I have a feeling you're asking for this to duplicate it in your framework?

No, I don't rewrite the test since it wouldn't make much sense to redo what you have already done. I was trying to do that with futex since there was no documentation, to figure out what io_uring was doing. I mainly test to see if wrapper is working and most of the time trying to figure out how to make C function work best with Cython and Python.