This repository was archived by the owner on Mar 7, 2021. It is now read-only.
File tree 4 files changed +11
-11
lines changed
4 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
- name = " chrdev-tests"
2
+ name = " chrdev-region-allocation- tests"
3
3
version = " 0.1.0"
4
4
authors = [
" Alex Gaynor <[email protected] >" ,
" Geoffrey Thomas <[email protected] >" ]
5
5
edition = " 2018"
Original file line number Diff line number Diff line change 3
3
4
4
use linux_kernel_module;
5
5
6
- struct ChrdevTestModule {
6
+ struct ChrdevRegionAllocationTestModule {
7
7
_dev : linux_kernel_module:: chrdev:: DeviceNumberRegion ,
8
8
}
9
9
10
- impl linux_kernel_module:: KernelModule for ChrdevTestModule {
10
+ impl linux_kernel_module:: KernelModule for ChrdevRegionAllocationTestModule {
11
11
fn init ( ) -> linux_kernel_module:: KernelResult < Self > {
12
- Ok ( ChrdevTestModule {
12
+ Ok ( ChrdevRegionAllocationTestModule {
13
13
_dev : linux_kernel_module:: chrdev:: DeviceNumberRegion :: allocate (
14
14
0 ..1 ,
15
- "chrdev-tests\x00 " ,
15
+ "chrdev-region-allocation- tests\x00 " ,
16
16
) ?,
17
17
} )
18
18
}
19
19
}
20
20
21
21
linux_kernel_module:: kernel_module!(
22
- ChrdevTestModule ,
22
+ ChrdevRegionAllocationTestModule ,
23
23
author: "Alex Gaynor and Geoffrey Thomas" ,
24
- description: "A module for testing character devices " ,
24
+ description: "A module for testing character device region allocation " ,
25
25
license: "GPL"
26
26
) ;
Original file line number Diff line number Diff line change @@ -7,19 +7,19 @@ fn test_proc_devices() {
7
7
let devices = fs:: read_to_string ( "/proc/devices" ) . unwrap ( ) ;
8
8
let dev_no_line = devices
9
9
. lines ( )
10
- . find ( |l| l. ends_with ( "chrdev-tests" ) )
10
+ . find ( |l| l. ends_with ( "chrdev-region-allocation- tests" ) )
11
11
. unwrap ( ) ;
12
12
let elements = dev_no_line. rsplitn ( 2 , " " ) . collect :: < Vec < _ > > ( ) ;
13
13
assert_eq ! ( elements. len( ) , 2 ) ;
14
- assert_eq ! ( elements[ 0 ] , "chrdev-tests" ) ;
14
+ assert_eq ! ( elements[ 0 ] , "chrdev-region-allocation- tests" ) ;
15
15
assert ! ( elements[ 1 ] . trim( ) . parse:: <u32 >( ) . is_ok( ) ) ;
16
16
} ) ;
17
17
18
18
let devices = fs:: read_to_string ( "/proc/devices" ) . unwrap ( ) ;
19
19
assert ! (
20
20
devices
21
21
. lines( )
22
- . find( |l| l. ends_with( "chrdev-tests" ) )
22
+ . find( |l| l. ends_with( "chrdev-region-allocation- tests" ) )
23
23
. is_none( )
24
24
) ;
25
25
}
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def main():
43
43
module = os .path .join (
44
44
BASE_DIR ,
45
45
"target/x86_64-linux-kernel-module/debug/lib{}_tests.a" .format (
46
- path
46
+ path . replace ( "-" , "_" )
47
47
)
48
48
)
49
49
run (
You can’t perform that action at this time.
0 commit comments