Skip to content

Commit a126759

Browse files
committed
capi: Onboard yet more tests to Miri
We missed checking the normalization test suite for Miri eligible candidates. There are a few. Tag them accordingly. Signed-off-by: Daniel Müller <[email protected]>
1 parent 68f96d7 commit a126759

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

capi/src/normalize.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,8 @@ mod tests {
713713

714714
use blazesym::helper::read_elf_build_id;
715715

716+
use test_tag::tag;
717+
716718
use crate::blaze_err_last;
717719

718720

@@ -728,6 +730,7 @@ mod tests {
728730
}
729731

730732
/// Exercise the `Debug` representation of various types.
733+
#[tag(miri)]
731734
#[test]
732735
fn debug_repr() {
733736
let output = blaze_normalized_output {
@@ -799,6 +802,7 @@ mod tests {
799802
}
800803

801804
/// Make sure that we can stringify normalization reasons as expected.
805+
#[tag(miri)]
802806
#[test]
803807
fn reason_stringification() {
804808
let data = [
@@ -826,6 +830,7 @@ mod tests {
826830

827831
/// Check that we can convert an [`Unknown`] into a
828832
/// [`blaze_user_meta_unknown`] and back.
833+
#[tag(miri)]
829834
#[test]
830835
fn unknown_conversion() {
831836
let unknown = Unknown {
@@ -843,6 +848,7 @@ mod tests {
843848

844849
/// Check that we can convert an [`Apk`] into a [`blaze_user_meta_apk`] and
845850
/// back.
851+
#[tag(miri)]
846852
#[test]
847853
fn apk_conversion() {
848854
let apk = Apk {
@@ -860,6 +866,7 @@ mod tests {
860866

861867
/// Check that we can convert an [`Elf`] into a [`blaze_user_meta_elf`]
862868
/// and back.
869+
#[tag(miri)]
863870
#[test]
864871
fn elf_conversion() {
865872
let elf = Elf {
@@ -877,6 +884,7 @@ mod tests {
877884
}
878885

879886
/// Make sure that we can create and free a normalizer instance.
887+
#[tag(miri)]
880888
#[test]
881889
fn normalizer_creation() {
882890
let normalizer = blaze_normalizer_new();
@@ -892,7 +900,6 @@ mod tests {
892900
libc::__errno_location as Addr,
893901
libc::dlopen as Addr,
894902
libc::fopen as Addr,
895-
elf_conversion as Addr,
896903
normalize_user_addrs as Addr,
897904
];
898905

@@ -903,7 +910,7 @@ mod tests {
903910

904911
let user_addrs = unsafe { &*result };
905912
assert_eq!(user_addrs.meta_cnt, 3);
906-
assert_eq!(user_addrs.output_cnt, 6);
913+
assert_eq!(user_addrs.output_cnt, 5);
907914

908915
let meta = unsafe { user_addrs.metas.read() };
909916
assert_eq!(meta.kind, blaze_user_meta_kind::BLAZE_USER_META_UNKNOWN);
@@ -938,7 +945,6 @@ mod tests {
938945
libc::__errno_location as Addr,
939946
libc::dlopen as Addr,
940947
libc::fopen as Addr,
941-
elf_conversion as Addr,
942948
normalize_user_addrs as Addr,
943949
];
944950
let () = addrs.sort();
@@ -963,7 +969,7 @@ mod tests {
963969

964970
let user_addrs = unsafe { &*result };
965971
assert_eq!(user_addrs.meta_cnt, 2);
966-
assert_eq!(user_addrs.output_cnt, 5);
972+
assert_eq!(user_addrs.output_cnt, 4);
967973

968974
let () = unsafe { blaze_user_output_free(result) };
969975
let () = unsafe { blaze_normalizer_free(normalizer) };
@@ -977,7 +983,6 @@ mod tests {
977983
libc::__errno_location as Addr,
978984
libc::dlopen as Addr,
979985
libc::fopen as Addr,
980-
elf_conversion as Addr,
981986
normalize_user_addrs as Addr,
982987
];
983988
let () = addrs.sort_by(|addr1, addr2| addr1.cmp(addr2).reverse());

0 commit comments

Comments
 (0)