Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] fix testing failures relate to 0x0x #31

Merged

Conversation

jiangying000
Copy link
Collaborator

relate to #15 #19

现在 cargo xtest 时所有测试在我的机器都能跑过了

@jolestar jolestar merged commit c24e339 into starcoinorg:starcoin-main Sep 23, 2022
@nkysg
Copy link

nkysg commented Sep 23, 2022

我的机器上报错

cargo test -p move-stdlib --test move_unit_test

thread '<unknown>' has overflowed its stack
fatal runtime error: stack overflow
error: test failed, to rerun pass '--test move_unit_test'

你遇到这问题没 @jiangying000

@jiangying000
Copy link
Collaborator Author

我没遇到,刚跑的日志,cargo test -p move-stdlib --test move_unit_test
ubuntu 18.04

warning: unused import: `ed25519::signature::Signature`
  --> language/move-prover/interpreter/crypto/src/lib.rs:16:5
   |
16 |     ed25519::signature::Signature, PublicKey as Ed25519PublicKey, Signature as Ed25519Signature,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: `bytecode-interpreter-crypto` (lib) generated 1 warning
warning: unused variable: `sub_status`
  --> language/move-binary-format/src/errors.rs:66:28
   |
66 |             (major_status, sub_status, location)
   |                            ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_sub_status`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: `move-binary-format` (lib) generated 1 warning
warning: field is never read: `id`
    --> language/move-vm/runtime/src/loader.rs:1386:5
     |
1386 |     id: ModuleId,
     |     ^^^^^^^^^^^^
     |
     = note: `#[warn(dead_code)]` on by default
note: `Module` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    --> language/move-vm/runtime/src/loader.rs:1384:10
     |
1384 | #[derive(Debug)]
     |          ^^^^^
     = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: field is never read: `struct_refs`
    --> language/move-vm/runtime/src/loader.rs:1398:5
     |
1398 |     struct_refs: Vec<usize>,
     |     ^^^^^^^^^^^^^^^^^^^^^^^
     |
note: `Module` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    --> language/move-vm/runtime/src/loader.rs:1384:10
     |
1384 | #[derive(Debug)]
     |          ^^^^^
     = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: field is never read: `owner`
    --> language/move-vm/runtime/src/loader.rs:2040:5
     |
2040 |     owner: usize,
     |     ^^^^^^^^^^^^
     |
note: `FieldInstantiation` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    --> language/move-vm/runtime/src/loader.rs:2036:10
     |
2036 | #[derive(Debug)]
     |          ^^^^^
     = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: `move-vm-runtime` (lib) generated 3 warnings
warning: use of deprecated associated function `itertools::Itertools::fold1`: Use `Iterator::reduce` instead
   --> language/move-model/src/exp_generator.rs:153:14
    |
153 |         args.fold1(|a, b| self.mk_bool_call(oper.clone(), vec![a, b]))
    |              ^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: field is never read: `type_arg_names`
    --> language/move-model/src/model.rs:2852:5
     |
2852 |     type_arg_names: Vec<Symbol>,
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `#[warn(dead_code)]` on by default
note: `FunctionData` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    --> language/move-model/src/model.rs:2831:10
     |
2831 | #[derive(Debug)]
     |          ^^^^^
     = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: field is never read: `result_type`
  --> language/move-model/src/builder/exp_translator.rs:41:5
   |
41 |     pub result_type: Option<Type>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: `ExpTranslator` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
  --> language/move-model/src/builder/exp_translator.rs:29:10
   |
29 | #[derive(Debug)]
   |          ^^^^^
   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: field is never read: `loc`
  --> language/move-model/src/builder/model_builder.rs:67:5
   |
67 |     pub loc: Loc,
   |     ^^^^^^^^^^^^
   |
note: `SpecFunEntry` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
  --> language/move-model/src/builder/model_builder.rs:65:10
   |
65 | #[derive(Debug, Clone)]
   |          ^^^^^  ^^^^^
   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: field is never read: `var_id`
  --> language/move-model/src/builder/model_builder.rs:79:5
   |
79 |     pub var_id: SpecVarId,
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
note: `SpecVarEntry` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
  --> language/move-model/src/builder/model_builder.rs:75:10
   |
75 | #[derive(Debug, Clone)]
   |          ^^^^^  ^^^^^
   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: field is never read: `name`
  --> language/move-model/src/builder/model_builder.rs:88:5
   |
88 |     pub name: QualifiedSymbol,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: `SpecSchemaEntry` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
  --> language/move-model/src/builder/model_builder.rs:85:10
   |
85 | #[derive(Debug)]
   |          ^^^^^
   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: field is never read: `is_resource`
   --> language/move-model/src/builder/model_builder.rs:107:5
    |
107 |     pub is_resource: bool,
    |     ^^^^^^^^^^^^^^^^^^^^^
    |
note: `StructEntry` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
   --> language/move-model/src/builder/model_builder.rs:102:10
    |
102 | #[derive(Debug, Clone)]
    |          ^^^^^  ^^^^^
    = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: field is never read: `fun_id`
   --> language/move-model/src/builder/model_builder.rs:118:5
    |
118 |     pub fun_id: FunId,
    |     ^^^^^^^^^^^^^^^^^
    |
note: `FunEntry` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
   --> language/move-model/src/builder/model_builder.rs:114:10
    |
114 | #[derive(Debug, Clone)]
    |          ^^^^^  ^^^^^
    = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: field is never read: `module`
  --> language/tools/move-bytecode-viewer/src/source_viewer.rs:23:5
   |
23 |     module: CompiledModule,
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default
note: `ModuleViewer` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
  --> language/tools/move-bytecode-viewer/src/source_viewer.rs:18:10
   |
18 | #[derive(Debug, Clone)]
   |          ^^^^^  ^^^^^
   = note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)

warning: `move-model` (lib) generated 8 warnings
warning: `move-bytecode-viewer` (lib) generated 1 warning
    Finished test [unoptimized + debuginfo] target(s) in 0.39s
     Running tests/move_unit_test.rs (target/debug/deps/move_unit_test-e237a29b4a972627)

running 1 test
BUILDING MoveStdlib
Running Move unit tests
[ PASS    ] 0x1::HashTests::sha2_256_expected_hash
[ PASS    ] 0x1::HashTests::sha3_256_expected_hash
[ PASS    ] 0x1::BCSTests::bcs_address
[ PASS    ] 0x1::FixedPoint32Tests::create_div_zero
[ PASS    ] 0x1::BCSTests::bcs_bool
[ PASS    ] 0x1::FixedPoint32Tests::create_from_rational_max_numerator_denominator
[ PASS    ] 0x1::BCSTests::bcs_u128
[ PASS    ] 0x1::CapabilityTests::test_delegate_failure_after_revoke
[ PASS    ] 0x1::BCSTests::bcs_u64
[ PASS    ] 0x1::OptionTests::borrow_mut_none
[ PASS    ] 0x1::EventTests::test_event_128
[ PASS    ] 0x1::FixedPoint32Tests::create_overflow
[ PASS    ] 0x1::BitVectorTests::empty_bitvector
[ PASS    ] 0x1::ASCIITests::printable_chars_dont_allow_newline
[ PASS    ] 0x1::BCSTests::bcs_u8
[ PASS    ] 0x1::FixedPoint32Tests::create_underflow
[ PASS    ] 0x1::BCSTests::bcs_vec_u8
[ PASS    ] 0x1::CapabilityTests::test_delegate_success
[ PASS    ] 0x1::VectorTests::append_empties_is_empty
[ PASS    ] 0x1::FixedPoint32Tests::create_zero
[ PASS    ] 0x1::BCSTests::encode_128
[ PASS    ] 0x1::OptionTests::borrow_mut_some
[ PASS    ] 0x1::FixedPoint32Tests::divide_by_zero
[ PASS    ] 0x1::BitVectorTests::index_bit_out_of_bounds
[ PASS    ] 0x1::ASCIITests::printable_chars_dont_allow_tab
[ PASS    ] 0x1::CapabilityTests::test_failure
[ PASS    ] 0x1::FixedPoint32Tests::divide_overflow_large_numerator
[ PASS    ] 0x1::EventTests::test_event_256
[ PASS    ] 0x1::FixedPoint32Tests::divide_overflow_small_divisore
[ PASS    ] 0x1::CapabilityTests::test_success
[ PASS    ] 0x1::BCSTests::encode_256
[ PASS    ] 0x1::OptionTests::borrow_with_default
[ PASS    ] 0x1::ErrorsTests::errors_state
[ PASS    ] 0x1::FixedPoint32Tests::exact_divide
[ PASS    ] 0x1::BitVectorTests::longest_sequence_no_set_nonzero_index
[ PASS    ] 0x1::VectorTests::append_respects_order_empty_lhs
[ PASS    ] 0x1::GUIDTests::test_basics
[ PASS    ] 0x1::ASCIITests::test_ascii_chars
[ PASS    ] 0x1::FixedPoint32Tests::exact_multiply
[ PASS    ] 0x1::BCSTests::encode_257
[ PASS    ] 0x1::GUIDTests::test_delegation
[ PASS    ] 0x1::EventTests::test_event_257
[ PASS    ] 0x1::FixedPoint32Tests::multiply_overflow_large_multiplier
[ PASS    ] 0x1::OptionTests::destroy_none
[ PASS    ] 0x1::GUIDTests::test_id
[ PASS    ] 0x1::FixedPoint32Tests::multiply_overflow_small_multiplier
[ PASS    ] 0x1::BitVectorTests::longest_sequence_no_set_zero_index
[ PASS    ] 0x1::FixedPoint32Tests::multiply_truncates
[ PASS    ] 0x1::EventTests::test_guid_wrapper_backward_compatibility
[ PASS    ] 0x1::VectorTests::append_respects_order_empty_rhs
[ PASS    ] 0x1::ASCIITests::test_ascii_push_char_pop_char
[ PASS    ] 0x1::BitVectorTests::longest_sequence_one_set_zero_index
[ PASS    ] 0x1::OptionTests::destroy_none_some
[ PASS    ] 0x1::ASCIITests::test_ascii_push_chars
[ PASS    ] 0x1::VectorTests::append_respects_order_nonempty_rhs_lhs
[ PASS    ] 0x1::BitVectorTests::longest_sequence_two_set_nonzero_index
[ PASS    ] 0x1::OptionTests::destroy_some
[ PASS    ] 0x1::ASCIITests::test_invalid_ascii_characters
[ PASS    ] 0x1::BitVectorTests::longest_sequence_with_break
[ PASS    ] 0x1::VectorTests::borrow_out_of_range
[ PASS    ] 0x1::OptionTests::destroy_some_none
[ PASS    ] 0x1::BitVectorTests::set_bit_out_of_bounds
[ PASS    ] 0x1::ASCIITests::test_nonvisible_chars
[ PASS    ] 0x1::VectorTests::destroy_empty
[ PASS    ] 0x1::OptionTests::destroy_with_default
[ PASS    ] 0x1::ASCIITests::test_printable_chars
[ PASS    ] 0x1::BitVectorTests::shift_left_at_size
[ PASS    ] 0x1::OptionTests::extract_none
[ PASS    ] 0x1::VectorTests::destroy_empty_with_pops
[ PASS    ] 0x1::BitVectorTests::shift_left_more_than_size
[ PASS    ] 0x1::OptionTests::extract_some
[ PASS    ] 0x1::BitVectorTests::single_bit_bitvector
[ PASS    ] 0x1::VectorTests::destroy_non_empty
[ PASS    ] 0x1::OptionTests::fill_none
[ PASS    ] 0x1::BitVectorTests::test_set_bit_and_index_basic
[ PASS    ] 0x1::OptionTests::fill_some
[ PASS    ] 0x1::VectorTests::get_set_work
[ PASS    ] 0x1::OptionTests::get_with_default
[ PASS    ] 0x1::VectorTests::index_of_empty_not_has
[ PASS    ] 0x1::OptionTests::option_borrow_none
[ PASS    ] 0x1::OptionTests::option_borrow_some
[ PASS    ] 0x1::VectorTests::index_of_nonempty_has
[ PASS    ] 0x1::OptionTests::option_contains
[ PASS    ] 0x1::VectorTests::index_of_nonempty_has_multiple_occurences
[ PASS    ] 0x1::OptionTests::option_none_is_none
[ PASS    ] 0x1::OptionTests::option_some_is_some
[ PASS    ] 0x1::VectorTests::index_of_nonempty_not_has
[ PASS    ] 0x1::OptionTests::swap_none
[ PASS    ] 0x1::VectorTests::length
[ PASS    ] 0x1::OptionTests::swap_or_fill_none
[ PASS    ] 0x1::OptionTests::swap_or_fill_some
[ PASS    ] 0x1::VectorTests::pop_out_of_range
[ PASS    ] 0x1::OptionTests::swap_some
[ PASS    ] 0x1::VectorTests::pop_push_back
[ PASS    ] 0x1::VectorTests::push_back_and_borrow
[ PASS    ] 0x1::VectorTests::remove_empty_vector
[ PASS    ] 0x1::VectorTests::remove_nonsingleton_vector
[ PASS    ] 0x1::VectorTests::remove_nonsingleton_vector_last_elem
[ PASS    ] 0x1::VectorTests::remove_out_of_bound_index
[ PASS    ] 0x1::VectorTests::remove_singleton_vector
[ PASS    ] 0x1::VectorTests::reverse_singleton_vector
[ PASS    ] 0x1::VectorTests::reverse_vector_empty
[ PASS    ] 0x1::VectorTests::reverse_vector_nonempty_even_length
[ PASS    ] 0x1::VectorTests::reverse_vector_nonempty_odd_length_non_singleton
[ PASS    ] 0x1::VectorTests::swap_different_indices
[ PASS    ] 0x1::VectorTests::swap_empty
[ PASS    ] 0x1::VectorTests::swap_out_of_range
[ PASS    ] 0x1::VectorTests::swap_remove_empty
[ PASS    ] 0x1::VectorTests::swap_remove_end_of_vector
[ PASS    ] 0x1::VectorTests::swap_remove_inside_vector
[ PASS    ] 0x1::VectorTests::swap_remove_out_of_range
[ PASS    ] 0x1::VectorTests::swap_remove_singleton
[ PASS    ] 0x1::VectorTests::swap_same_index
[ PASS    ] 0x1::VectorTests::test_empty_is_empty
[ PASS    ] 0x1::VectorTests::test_natives_with_different_instantiations
[ PASS    ] 0x1::VectorTests::test_singleton_contains
[ PASS    ] 0x1::VectorTests::test_singleton_len
[ PASS    ] 0x1::VectorTests::vector_contains
[ PASS    ] 0x1::BitVectorTests::test_set_bit_and_index_odd_size
[ PASS    ] 0x1::BitVectorTests::test_shift_left
[ PASS    ] 0x1::BitVectorTests::test_shift_left_specific_amount
[ PASS    ] 0x1::BitVectorTests::test_shift_left_specific_amount_to_unset_bit
[ PASS    ] 0x1::BitVectorTests::unset_bit_out_of_bounds
Test result: OK. Total tests: 123; passed: 123; failed: 0
BUILDING MoveStdlib
BUILDING MoveNursery
Running Move unit tests
[ PASS    ] 0x1::RoleTests::test_assign_failure
[ PASS    ] 0x1::ACLTests::test_add_failure
[ PASS    ] 0x1::RoleTests::test_revoke_failure
[ PASS    ] 0x1::ACLTests::test_remove_failure
[ PASS    ] 0x1::CompareTests::equality_of_simple_types
[ PASS    ] 0x1::RoleTests::test_success
[ PASS    ] 0x1::ACLTests::test_success
[ PASS    ] 0x1::CompareTests::greater_than_with_natural_ordering
[ PASS    ] 0x1::CompareTests::greater_than_without_natural_ordering
[ PASS    ] 0x1::CompareTests::inequality_of_simple_types
[ PASS    ] 0x1::CompareTests::less_than_with_natural_ordering
[ PASS    ] 0x1::CompareTests::less_than_without_natural_ordering
Test result: OK. Total tests: 12; passed: 12; failed: 0
test move_unit_tests ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 9.68s

@jiangying000 jiangying000 deleted the double-0x-testing-fix branch September 23, 2022 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants