build_up_residue unittest