vfmt cfns_wrapper.c.v and sort_with_compare_context_test.v
parent
7993ff295e
commit
ede2b798f6
|
@ -68,7 +68,9 @@ pub fn vmemset(s voidptr, c int, n int) voidptr {
|
|||
}
|
||||
|
||||
type FnSortCB = fn (const_a voidptr, const_b voidptr) int
|
||||
|
||||
type FnSortContextCB = fn (const_a voidptr, const_b voidptr, context voidptr) int
|
||||
|
||||
fn C.vqsort_r(base voidptr, nel usize, width usize, cb FnSortContextCB, context voidptr)
|
||||
|
||||
[inline; unsafe]
|
||||
|
|
|
@ -36,7 +36,7 @@ fn test_sort_with_compare() {
|
|||
'a: "hi" | b: "3"',
|
||||
'a: "3" | b: "5"',
|
||||
'a: "5" | b: "1"',
|
||||
'a: "3" | b: "1"'
|
||||
'a: "3" | b: "1"',
|
||||
]
|
||||
//
|
||||
mut already_sorted_context := Context{}
|
||||
|
@ -48,6 +48,6 @@ fn test_sort_with_compare() {
|
|||
'a: "5" | b: "1"',
|
||||
'a: "5" | b: "3"',
|
||||
'a: "5" | b: "hi"',
|
||||
'a: "1" | b: "3"'
|
||||
'a: "1" | b: "3"',
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue