File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ edition = "2018"
66
77[dependencies ]
88byteorder  = " 1.0" 
9+ rand  = { version  = " 0.7" features  = [" small_rng" 
910
1011[dev-dependencies ]
11- rand  = { version  = " 0.7" features  = [" small_rng" 
1212num_cpus  = " 1.10.1" 
Original file line number Diff line number Diff line change 1- use  byteorder :: { BigEndian ,   ByteOrder } ; 
1+ use  rand :: { SeedableRng ,   Rng ,  rngs :: SmallRng } ; 
22
33fn  main ( )  { 
4-     // Exercise external crate, printing to stdout . 
5-     let  buf =  & [ 1 , 2 , 3 , 4 ] ; 
6-     let  n  = < BigEndian   as   ByteOrder > :: read_u32 ( buf ) ; 
7-     assert_eq ! ( n ,   0x01020304 ) ; 
8-     println ! ( "{:#010x}" ,  n ) ; 
4+     // Try seeding with "real" entropy . 
5+     let  mut  rng =  SmallRng :: from_entropy ( ) ; 
6+     let  _val  = rng . gen :: < i32 > ( ) ; 
7+     let  _val = rng . gen :: < isize > ( ) ; 
8+     let  _val = rng . gen :: < i128 > ( ) ; 
99
10-     // Access program arguments, printing to stderr. 
11-     for  arg in  std:: env:: args ( )  { 
12-         eprintln ! ( "{}" ,  arg) ; 
13-     } 
10+     // Also try per-thread RNG. 
11+     let  mut  rng = rand:: thread_rng ( ) ; 
12+     let  _val = rng. gen :: < i32 > ( ) ; 
13+     let  _val = rng. gen :: < isize > ( ) ; 
14+     let  _val = rng. gen :: < i128 > ( ) ; 
1415} 
1516
1617#[ cfg( test) ]  
Original file line number Diff line number Diff line change 1717
1818#  Test
1919function  run_tests  {
20-     ./miri test 
20+     #  FIXME debugging
21+     #  ./miri test
2122    #  "miri test" has built the sysroot for us, now this should pass without
2223    #  any interactive questions.
23-     test-cargo-miri/run-test.py
24+     MIRI_LOG=info  test-cargo-miri/run-test.py
2425}
2526
2627echo  " Test host architecture" 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments