Event and Timeout Tests for select#9
Event and Timeout Tests for select#9zeroem wants to merge 1 commit intoChouser:masterfrom zeroem:select-test
Conversation
|
So, one thing I'm not comfortable about is open/close vs fopen/fclose. Open is lower level and I'm relatively certain I'm not using it correctly. However, when trying to import fopen/fclose, the JVM segfaults. So going to look into that as well. |
|
OK, so the test is just broken in general. open/close return a file descriptor whereas fopen/fclose return a file pointer. the |
|
Thanks for working on this! Your patch looks about right to me. You're using open/close which return integer file handles, and that's exactly what select expects. The test succeeded for me several times, though I occasionally do get a test fail because select actually detects an event on the "project.clj" file handle. On the other hand, I had to mess with leiningen project settings a bit to get anything to work. I don't know if it's recent versions of leiningen itself, or Ubuntu, or the JVM or what, but I had to add to project.clj: :jvm-opts ["-Djna.nosys=true"] Did you have to do any of that? |
|
I had to do the My problem with the
and
I have a hard time believing that |
|
Alrighty, figured out why the fopen call was puking and got everything working nicely (I think). |
|
Interestingly, with the tools I added just to do the tests for |
Pretty simple test just to get some coverage of
libc-utils/select. Working on figuring out how to generate file system events so I can test the non-timeout behavior.