Do the test when you have whatever is a normal amount of caffeine for you and after a normal nights sleep.
If you assume that IQ measures $SOMETHING this just mean that both sleep quality and caffeine influence $SOMETHING
It has no other usefulness. A bit like HN karma points: It looks useful, but signifies nothing.