Add '#undef rand' to fix test program build.