On a good day, HIV tests will reveal the presence of antibodies to the HIV virus developed over the previous 6 months.

The HIV test does nothing more than sort the positive guys (6 months after infection) from the negative guys.

It does nothing to prevent or protect - only to separate after the damage has been done.