Skip to content

Fix libcore tests #806

Closed
Closed
@bjorn3

Description

@bjorn3

When removing the tests requiring rand and adding a Cargo.toml to src/libcore/tests, running cargo test in that directory gives the following failures:

---- checked_mul stdout ----
---- checked_mul stderr ----
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `Some(18446744073709551612s)`,
 right: `None`', lib.rs:83:5
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- f32::max stdout ----
---- f32::max stderr ----
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `NaN`,
 right: `9.0`', lib.rs:142:1
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- f32::min stdout ----
---- f32::min stderr ----
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `NaN`,
 right: `9.0`', lib.rs:142:1
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- f64::max stdout ----
---- f64::max stderr ----
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `NaN`,
 right: `9.0`', lib.rs:143:1
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- f64::min stdout ----
---- f64::min stderr ----
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `NaN`,
 right: `9.0`', lib.rs:143:1
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- from_str_issue7588 stdout ----
---- from_str_issue7588 stderr ----
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `Some(232)`,
 right: `None`', lib.rs:89:5
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- iterator_len stdout ----
---- iterator_len stderr ----
thread 'main' panicked at 'attempt to copy from unaligned or null pointer', /Users/bjorn/Documents/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libcore/macros/mod.rs:15:40
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- test_is_sorted stdout ----
---- test_is_sorted stderr ----
thread 'main' panicked at 'attempt to create unaligned or null slice', /Users/bjorn/Documents/rustc_codegen_cranelift/build_sysroot/sysroot_src/src/libcore/macros/mod.rs:15:40
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- test_iterator_step_by_nth_overflow stdout ----
---- test_iterator_step_by_nth_overflow stderr ----
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `163208757609`,
 right: `18446744236918309225`', lib.rs:39:5
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

---- test_range_inclusive_size_hint stdout ----
---- test_range_inclusive_size_hint stderr ----
Unexpected error: child process exited with signal 4
---- test_range_size_hint stdout ----
---- test_range_size_hint stderr ----
Unexpected error: child process exited with signal 4

failures:
    checked_mul
    f32::max
    f32::min
    f64::max
    f64::min
    from_str_issue7588
    iterator_len
    test_is_sorted
    test_iterator_step_by_nth_overflow
    test_range_inclusive_size_hint
    test_range_size_hint

test result: FAILED. 0 passed; 11 failed; 0 ignored; 0 measured; 0 filtered out

iter::test_successors even hangs. You have to manually kill the process executing it to be able to continue the testing.

Edit: some failures were due to panic catching not being implemented. Ignoring them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions