If it's penalised, I'd say it's likely a "test" (or more of a checkmark). But I wouldn't go so far as to say every employer that asks for your previous salary is testing you.
That said, even if you disclose your previous salary that could affect how you are perceived:
* disclosing it at all without hesitation might mark you as either very open (positive) or untrustworthy (negative)
* if the salary is much lower than expected it might indicate you're not as good as you claim (negative) or that you're bad at negotiating (positive?) or that you left because you wanted a bigger salary (negative)
* if the salary is much higher than expected it might indicate you'll make unreasonable demands (negative) or that you're a strong negotiator (negative?) or that you are underselling yourself (positive?)
Again, it entirely depends on the employer and sometimes a cigar is just a cigar.