mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-24 17:27:39 +02:00
Do the default func test last so we can see what the failure is on more explicitly
This commit is contained in:
@@ -289,12 +289,11 @@ FUNC(zero_last_n_bytes)(integer_t vec, const integer_t index, char n) {
|
|||||||
return andnot_si(mask, vec);
|
return andnot_si(mask, vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define check_chunk() { \
|
#define check_chunk() if (n > -1) { \
|
||||||
if (n > -1) { \
|
const uint8_t *ans = haystack + n; \
|
||||||
const uint8_t *ans = haystack + n; \
|
zero_upper(); \
|
||||||
zero_upper(); \
|
return ans < limit ? ans : NULL; \
|
||||||
return ans < limit ? ans : NULL; \
|
}
|
||||||
}}
|
|
||||||
|
|
||||||
#define find_match(haystack, sz, get_test_vec) { \
|
#define find_match(haystack, sz, get_test_vec) { \
|
||||||
zero_upper(); \
|
zero_upper(); \
|
||||||
|
|||||||
@@ -118,6 +118,10 @@ test_find_either_of_two_bytes(PyObject *self UNUSED, PyObject *args) {
|
|||||||
func = find_either_of_two_bytes_128; break;
|
func = find_either_of_two_bytes_128; break;
|
||||||
case 3:
|
case 3:
|
||||||
func = find_either_of_two_bytes_256; break;
|
func = find_either_of_two_bytes_256; break;
|
||||||
|
case 0: break;
|
||||||
|
default:
|
||||||
|
PyErr_SetString(PyExc_ValueError, "Unknown which_function");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
uint8_t *abuf;
|
uint8_t *abuf;
|
||||||
if (posix_memalign((void**)&abuf, 64, 256 + buf.len) != 0) {
|
if (posix_memalign((void**)&abuf, 64, 256 + buf.len) != 0) {
|
||||||
|
|||||||
@@ -293,11 +293,12 @@ class TestParser(BaseTest):
|
|||||||
|
|
||||||
def test(buf, a, b, align_offset=0):
|
def test(buf, a, b, align_offset=0):
|
||||||
a, b = ord(a), ord(b)
|
a, b = ord(a), ord(b)
|
||||||
sizes = [0]
|
sizes = []
|
||||||
if has_sse4_2:
|
if has_sse4_2:
|
||||||
sizes.append(2)
|
sizes.append(2)
|
||||||
if has_avx2:
|
if has_avx2:
|
||||||
sizes.append(3)
|
sizes.append(3)
|
||||||
|
sizes.append(0)
|
||||||
expected = test_find_either_of_two_bytes(buf, a, b, 1)
|
expected = test_find_either_of_two_bytes(buf, a, b, 1)
|
||||||
|
|
||||||
for sz in sizes:
|
for sz in sizes:
|
||||||
|
|||||||
Reference in New Issue
Block a user