This repository was archived by the owner on Oct 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -658,7 +658,7 @@ extern (C) void _d_print_throwable(Throwable t)
658
658
659
659
void sink (in char [] buf) scope nothrow
660
660
{
661
- fprintf(stderr, " %.*s " , cast ( int ) buf.length, buf.ptr );
661
+ fwrite(buf.ptr, char .sizeof, buf.length, stderr );
662
662
}
663
663
formatThrowable(t, &sink);
664
664
}
Original file line number Diff line number Diff line change 1
1
include ../common.mak
2
2
3
3
TESTS =stderr_msg unittest_assert invalid_memory_operation unknown_gc static_dtor \
4
- future_message refcounted rt_trap_exceptions_drt catch_in_finally
4
+ future_message refcounted rt_trap_exceptions_drt catch_in_finally \
5
+ message_with_null
5
6
6
7
ifeq ($(OS ) -$(BUILD ) ,linux-debug)
7
8
TESTS+=line_trace line_trace_21656 long_backtrace_trunc rt_trap_exceptions
@@ -77,13 +78,24 @@ $(ROOT)/catch_in_finally.done: STDERR_EXP="success."
77
78
$(ROOT ) /rt_trap_exceptions.done : STDERR_EXP="object.Exception@src/rt_trap_exceptions.d(12): this will abort"
78
79
$(ROOT ) /rt_trap_exceptions.done : STDERR_EXP2="src/rt_trap_exceptions.d:8 main"
79
80
$(ROOT ) /assert_fail.done : STDERR_EXP="success."
81
+
82
+ $(ROOT ) /message_with_null.done : STDERR_EXP=" world"
83
+
80
84
$(ROOT ) /% .done : $(ROOT ) /%
81
85
@echo Testing $*
82
86
$(QUIET )$(TIMELIMIT )$(ROOT ) /$* $(RUN_ARGS ) 2> $(ROOT ) /$* .stderr || true
83
- cat $(ROOT ) /$* .stderr
84
- $(NEGATE ) grep -qF $(STDERR_EXP ) < $(ROOT ) /$* .stderr
85
- if [ ! -z $( STDERR_EXP2) ] ; then \
86
- $(NEGATE ) grep -qF $(STDERR_EXP2 ) < $(ROOT ) /$* .stderr; \
87
+
88
+ @if $(NEGATE) grep -qF $(STDERR_EXP) < $(ROOT)/$*.stderr ; then true ; else \
89
+ echo 'Searched for pattern $(STDERR_EXP), NEGATE = $(NEGATE)' ;\
90
+ tail --bytes=5000 $(ROOT)/$*.stderr ;\
91
+ exit 1 ;\
92
+ fi
93
+ @if [ ! -z $(STDERR_EXP2) ] ; then \
94
+ if $(NEGATE) grep -qF $(STDERR_EXP2) < $(ROOT)/$*.stderr ; then true ; else \
95
+ echo 'Searched for '$(STDERR_EXP2)' NEGATE = $(NEGATE)' ;\
96
+ tail --bytes=5000 $(ROOT)/$*.stderr ;\
97
+ exit 1 ;\
98
+ fi \
87
99
fi
88
100
@touch $@
89
101
Original file line number Diff line number Diff line change
1
+ module message_with_null ;
2
+
3
+ void main ()
4
+ {
5
+ throw new Exception (" hello\0 world!" );
6
+ }
You can’t perform that action at this time.
0 commit comments