Test cases for passing req to serialization functions.