Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2016-11-06 19:42:36 +0300
committerbubnikv <bubnikv@gmail.com>2016-11-06 19:42:36 +0300
commitaac968162b7636415640332f2225b637d58ae2d4 (patch)
treef8a6b1ab1bf80e33816a43809b6afd628f928bd1 /xs
parente9e55e7ac31244583413e6a61876df3946ad412d (diff)
Unit test to verify whether Slic3r would hang when croaking from
a C++ exception handler. This is an unfortunate error in some Strawberry Perl distributions.
Diffstat (limited to 'xs')
-rw-r--r--xs/MANIFEST1
-rw-r--r--xs/t/22_exception.t16
-rw-r--r--xs/xsp/XS.xsp8
3 files changed, 25 insertions, 0 deletions
diff --git a/xs/MANIFEST b/xs/MANIFEST
index 5a0a3e420..70d83afa7 100644
--- a/xs/MANIFEST
+++ b/xs/MANIFEST
@@ -166,6 +166,7 @@ t/18_motionplanner.t
t/19_model.t
t/20_print.t
t/21_gcode.t
+t/22_exception.t
xsp/BoundingBox.xsp
xsp/BridgeDetector.xsp
xsp/Clipper.xsp
diff --git a/xs/t/22_exception.t b/xs/t/22_exception.t
new file mode 100644
index 000000000..ca2ffea89
--- /dev/null
+++ b/xs/t/22_exception.t
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Slic3r::XS;
+use Test::More tests => 1;
+
+{
+ eval {
+ Slic3r::xspp_test_croak_hangs_on_strawberry();
+ };
+ is $@, "xspp_test_croak_hangs_on_strawberry: exception catched\n", 'croak from inside a C++ exception delivered';
+}
+
+__END__
diff --git a/xs/xsp/XS.xsp b/xs/xsp/XS.xsp
index 9b068882c..c324396b2 100644
--- a/xs/xsp/XS.xsp
+++ b/xs/xsp/XS.xsp
@@ -28,4 +28,12 @@ FORK_NAME()
RETVAL = newSVpv(SLIC3R_FORK_NAME, 0);
OUTPUT: RETVAL
+void
+xspp_test_croak_hangs_on_strawberry()
+ CODE:
+ try {
+ throw 1;
+ } catch (...) {
+ croak("xspp_test_croak_hangs_on_strawberry: exception catched\n");
+ }
%} \ No newline at end of file