test: move tests for dc_utf8_strlen()

This commit is contained in:
Lars-Magnus Skog
2019-05-29 22:56:12 +02:00
parent 4175ce56eb
commit 51071fb09d
2 changed files with 14 additions and 26 deletions

View File

@@ -1882,4 +1882,18 @@ mod tests {
free(buf as *mut libc::c_void);
}
}
#[test]
fn test_dc_utf8_strlen() {
unsafe {
assert_eq!(
dc_utf8_strlen(b"c\x00" as *const u8 as *const libc::c_char),
1
);
assert_eq!(
dc_utf8_strlen(b"\xc3\xa4\x00" as *const u8 as *const libc::c_char),
1
);
}
}
}