How long can cats not poop/pee?

The cat did not use the litter until he reached the destination, roughly 30 minutes after arrival, both there and returned, when I took him to visit relatives, a 10-hour drive (I had brought a cooking pan just in case). Was I fortunate? How long can a cat usually hold out?