This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for "Out of memory exception"
- Loading branch information
Showing
4 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
include ../common.mak | ||
|
||
TESTS:=overflow_from_zero overflow_from_existing | ||
|
||
DIFF:=diff | ||
SED:=sed | ||
|
||
.PHONY: all clean | ||
all: $(addprefix $(ROOT)/,$(addsuffix .done,$(TESTS))) | ||
|
||
$(ROOT)/overflow_from_zero.done: STDERR_EXP="Memory allocation failed" | ||
$(ROOT)/overflow_from_existing.done: STDERR_EXP="Memory allocation failed" | ||
$(ROOT)/%.done: $(ROOT)/% | ||
@echo Testing $* | ||
$(NEGATE) $(QUIET)$(TIMELIMIT)$(ROOT)/$* $(RUN_ARGS) 2>&1 1>/dev/null | head -n 1 | grep -qF $(STDERR_EXP) | ||
@touch $@ | ||
|
||
$(ROOT)/unittest_assert: DFLAGS+=-unittest | ||
$(ROOT)/%: $(SRC)/%.d | ||
$(QUIET)$(DMD) $(DFLAGS) -of$@ $< | ||
|
||
clean: | ||
rm -rf $(GENERATED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
void main() | ||
{ | ||
void[] buffer; | ||
buffer.length = 1; | ||
buffer.length = size_t.max; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
void main() | ||
{ | ||
void[] buffer; | ||
buffer.length = 1; | ||
buffer.length = size_t.max; | ||
} |