add a generic function to test libmagic version