Do the default func test last so we can see what the failure is on more explicitly

This commit is contained in:
Kovid Goyal 2024-02-11 13:16:38 +05:30
parent ede4d7fbca
commit b021e9b648
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 11 additions and 7 deletions

View File

@ -289,12 +289,11 @@ FUNC(zero_last_n_bytes)(integer_t vec, const integer_t index, char n) {
return andnot_si(mask, vec);
}
#define check_chunk() { \
if (n > -1) { \
#define check_chunk() if (n > -1) { \
const uint8_t *ans = haystack + n; \
zero_upper(); \
return ans < limit ? ans : NULL; \
}}
}
#define find_match(haystack, sz, get_test_vec) { \
zero_upper(); \

View File

@ -118,6 +118,10 @@ test_find_either_of_two_bytes(PyObject *self UNUSED, PyObject *args) {
func = find_either_of_two_bytes_128; break;
case 3:
func = find_either_of_two_bytes_256; break;
case 0: break;
default:
PyErr_SetString(PyExc_ValueError, "Unknown which_function");
return NULL;
}
uint8_t *abuf;
if (posix_memalign((void**)&abuf, 64, 256 + buf.len) != 0) {

View File

@ -293,11 +293,12 @@ class TestParser(BaseTest):
def test(buf, a, b, align_offset=0):
a, b = ord(a), ord(b)
sizes = [0]
sizes = []
if has_sse4_2:
sizes.append(2)
if has_avx2:
sizes.append(3)
sizes.append(0)
expected = test_find_either_of_two_bytes(buf, a, b, 1)
for sz in sizes: