Skip to content

Commit

Permalink
Try to fix tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
dgherzka committed Nov 3, 2023
1 parent 757395a commit ec8fdd3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
4 changes: 2 additions & 2 deletions tests/structs/src/debug_derive_bad.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ typedef struct {
} c;
} b;
} a;
} S2;
} StructWithUnion;

S2 kS2;
StructWithUnion kStructWithUnion;
10 changes: 3 additions & 7 deletions tests/structs/src/debug_derive_good.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ typedef struct {
int a;
} S1;

S1 kS1;

typedef struct {
va_list v;
} S3;
} S2;

S3 get_struct_containing_va_list() {
S3 s;
return s;
}
S1 *kS1;
S2 *kS2;
4 changes: 2 additions & 2 deletions tests/structs/src/test_debug_derive_bad.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! xfail
mod debug_derive_bad;
use debug_derive_bad::rust_kS2;
use debug_derive_bad::rust_kStructWithUnion;

pub fn test_union() {
unsafe {
format!("{rust_kS2:?}");
format!("{rust_kStructWithUnion:?}");
}
}
17 changes: 6 additions & 11 deletions tests/structs/src/test_debug_derive_good.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
//! feature_c_variadic,
//! feature_c_variadic
use crate::debug_derive_good::{rust_kS1, rust_get_struct_containing_va_list};
use crate::debug_derive_good::{rust_kS1, rust_kS2};
use std::fmt::Debug;

pub fn test_simple_struct() {
pub fn test_debuggable() {
unsafe {
format!("{rust_kS1:?}");
// Make sure each struct implements `Debug`
let _debuggable: Vec<*mut dyn Debug> = vec![rust_kS1, rust_kS2];
}
}

pub fn test_struct_containing_va_list() {
unsafe {
let s = rust_get_struct_containing_va_list();
format!("{s:?}");
}
}

0 comments on commit ec8fdd3

Please sign in to comment.