Machine types are different from int/uint, etc (Issue #2187)

This commit is contained in:
Eric Holk
2012-06-04 17:26:17 -07:00
parent 5f904d278f
commit 1e8f501343
24 changed files with 200 additions and 131 deletions

View File

@@ -135,13 +135,13 @@ mod tests {
assert mem as int != 0;
ret unsafe { c_vec_with_dtor(mem as *mut u8, n,
ret unsafe { c_vec_with_dtor(mem as *mut u8, n as uint,
bind free(mem)) };
}
#[test]
fn test_basic() {
let cv = malloc(16u);
let cv = malloc(16u as size_t);
set(cv, 3u, 8u8);
set(cv, 4u, 9u8);
@@ -154,7 +154,7 @@ mod tests {
#[should_fail]
#[ignore(cfg(target_os = "win32"))]
fn test_overrun_get() {
let cv = malloc(16u);
let cv = malloc(16u as size_t);
get(cv, 17u);
}
@@ -163,14 +163,14 @@ mod tests {
#[should_fail]
#[ignore(cfg(target_os = "win32"))]
fn test_overrun_set() {
let cv = malloc(16u);
let cv = malloc(16u as size_t);
set(cv, 17u, 0u8);
}
#[test]
fn test_and_I_mean_it() {
let cv = malloc(16u);
let cv = malloc(16u as size_t);
let p = unsafe { ptr(cv) };
set(cv, 0u, 32u8);