Shaking your head is a side-to-side movement. It can never mean 'yes' - at least not in English-speaking cultures.
Shaking your head always indicates 'no', or some kind of negative emotion, such as disbelief. In this context, I would understand it to mean that the test results were bad.