Skip to content

Commit

Permalink
Make tests actually make sense
Browse files Browse the repository at this point in the history
  • Loading branch information
dgherzka committed Nov 28, 2023
1 parent 501ec52 commit ceb8c28
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 50 deletions.
29 changes: 29 additions & 0 deletions tests/structs/src/debug_derive.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//! derive:Debug

#include <stdarg.h>

typedef struct {
int a;
} Debuggable1;

typedef struct {
va_list v;
} Debuggable2;

Debuggable1 *kDebuggable1;
Debuggable2 *kDebuggable2;

// A struct containing a union cannot derive Debug, so make
// sure we don't generate a #[derive] for it
typedef struct {
struct {
struct {
union {
int d;
float e;
} c;
} b;
} a;
} NotDebuggable1;

NotDebuggable1 kNotDebuggable1;
15 changes: 0 additions & 15 deletions tests/structs/src/debug_derive_bad.c

This file was deleted.

14 changes: 0 additions & 14 deletions tests/structs/src/debug_derive_good.c

This file was deleted.

11 changes: 11 additions & 0 deletions tests/structs/src/test_debug_derive.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//! feature_c_variadic
use crate::debug_derive::{rust_kDebuggable1, rust_kDebuggable2};
use std::fmt::Debug;

pub fn test_debuggable() {
unsafe {
// Make sure all debuggable structs implement `Debug`
let _debuggable: Vec<*mut dyn Debug> = vec![rust_kDebuggable1, rust_kDebuggable2];
}
}
10 changes: 0 additions & 10 deletions tests/structs/src/test_debug_derive_bad.rs

This file was deleted.

11 changes: 0 additions & 11 deletions tests/structs/src/test_debug_derive_good.rs

This file was deleted.

0 comments on commit ceb8c28

Please sign in to comment.