Test only for this in my branch ticket26007_01.
It's using the same approach as the test for geoip, which adds a new file to the filestystem.
Nickm, would you have an idea on a different approach than adding a new file here?.
Also, it's based on master and not 0.2.9 because is using SRCDIR was introduced by nickm for the geoip test.
WRT the question of how to avoid adding an extra file: you can use the "get_fname()" function to get a temporary filename from within a unit test, and then use write_str_to_file() to write a string into that file. The file will be automatically cleaned up when the unit tests exit.
For a very simple example, see test_util_listdir() in test_util.c .