@@ -39,23 +39,32 @@ int main(void)
39
39
cfg_set_print_filter_func (cfg , no_foo );
40
40
f = fmemopen (buf , sizeof (buf ), "w+" );
41
41
fail_unless (f != NULL );
42
- cfg_print (cfg , f );
42
+ fail_unless ( cfg_print (cfg , f ) == CFG_SUCCESS );
43
43
fclose (f );
44
44
45
+ #if defined(__has_feature )
46
+ # if __has_feature (memory_sanitizer )
47
+ /* Skip check since fmemopen(2) is broken with sanitizers, see
48
+ * https://github.com/google/sanitizers/issues/627
49
+ * https://github.com/google/sanitizers/issues/628
50
+ */
51
+ # else
45
52
fprintf (stderr , "no_foo filter:\n%s" , buf );
46
53
fail_unless (strstr (buf , "foo-" ) == NULL );
47
54
fail_unless (strstr (buf , "bar-" ) != NULL );
48
55
49
56
cfg_set_print_filter_func (cfg , no_bar );
50
57
f = fmemopen (buf , sizeof (buf ), "w+" );
51
58
fail_unless (f != NULL );
52
- cfg_print (cfg , f );
59
+ fail_unless ( cfg_print (cfg , f ) == CFG_SUCCESS );
53
60
fclose (f );
54
61
55
62
fprintf (stderr , "----\n" );
56
63
fprintf (stderr , "no_bar filter:\n%s" , buf );
57
64
fail_unless (strstr (buf , "foo-" ) != NULL );
58
65
fail_unless (strstr (buf , "bar-" ) == NULL );
66
+ # endif
67
+ #endif
59
68
60
69
cfg_free (cfg );
61
70
0 commit comments