Modify test to ultilize the new API
Use GNU99 standard to fix compiler warnings about drand