[test] ECC: make sure negative tests pass for the right reasons
This is a backport of #7028 to 1.1.0.
It squashes the two original commits and applies changes for
compatibility with 1.1.0.
1. cherry picked from commit
30c41bfb158c0f595809d0eaf032926a3c2cf236
[test] ECC: make sure negative tests pass for the right reasons
2. cherry picked from commit
bfb10b975818d1887d676d309fcc21a765611f6d
[test] throw error from wrapper function instead of an EC_METHOD specific one
Given that in 1.1.0 `EC_POINT_get_affine_coordinates_GFp` and
`EC_POINT_get_affine_coordinates_GF2m` have not been unified, in this
backport the tests distinguish between the 2 different functions as the
cause of the expected error.
[extended tests] to trigger sanitizer checks and coverage analysis.
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7152)