Skip to content

Commit de5a710

Browse files
committed
transpile: tests: add trivial uint32 snapshot test
1 parent 4e7362f commit de5a710

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include <stdint.h>
2+
uint32_t var;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#![allow(
2+
dead_code,
3+
mutable_transmutes,
4+
non_camel_case_types,
5+
non_snake_case,
6+
non_upper_case_globals,
7+
unused_assignments,
8+
unused_mut
9+
)]
10+
pub type __uint32_t = u32;
11+
pub type uint32_t = __uint32_t;
12+
#[no_mangle]
13+
pub static mut var: uint32_t = 0;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
source: c2rust-transpile/tests/snapshots.rs
3+
assertion_line: 67
4+
expression: cat tests/snapshots/platform-specific/uint32.rs
5+
input_file: c2rust-transpile/tests/snapshots/platform-specific/uint32.c
6+
---
7+
#![allow(
8+
dead_code,
9+
mutable_transmutes,
10+
non_camel_case_types,
11+
non_snake_case,
12+
non_upper_case_globals,
13+
unused_assignments,
14+
unused_mut
15+
)]
16+
pub type __uint32_t = u32;
17+
pub type uint32_t = __uint32_t;
18+
#[no_mangle]
19+
pub static mut var: uint32_t = 0;
20+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
source: c2rust-transpile/tests/snapshots.rs
3+
assertion_line: 67
4+
expression: cat tests/snapshots/platform-specific/uint32.rs
5+
input_file: c2rust-transpile/tests/snapshots/platform-specific/uint32.c
6+
---
7+
#![allow(
8+
dead_code,
9+
mutable_transmutes,
10+
non_camel_case_types,
11+
non_snake_case,
12+
non_upper_case_globals,
13+
unused_assignments,
14+
unused_mut
15+
)]
16+
pub type uint32_t = u32;
17+
#[no_mangle]
18+
pub static mut var: uint32_t = 0;
19+

0 commit comments

Comments
 (0)