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

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t/gcode.t
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2014-11-06 23:06:09 +0300
committerAlessandro Ranellucci <aar@cpan.org>2014-11-06 23:06:09 +0300
commit30b0869595e2e2cb7c8115ffb146bf979cec0df2 (patch)
treee3812b2992ef843e15beb5d2457d9d932e5a96d5 /t/gcode.t
parent11bd1e68e21865d9563b907c98a860fa91fc5049 (diff)
Bugfix: crash when slicing one layer objects with sailfish G-code flavor. Includes regression test. #2335
Diffstat (limited to 't/gcode.t')
-rw-r--r--t/gcode.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/gcode.t b/t/gcode.t
index f82bc72ac..ee92d199c 100644
--- a/t/gcode.t
+++ b/t/gcode.t
@@ -1,4 +1,4 @@
-use Test::More tests => 11;
+use Test::More tests => 16;
use strict;
use warnings;
@@ -101,15 +101,22 @@ use Slic3r::Test;
my ($print, $comment) = @_;
my @percent = ();
+ my $got_100 = 0;
+ my $extruding_after_100 = 0;
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
my ($self, $cmd, $args, $info) = @_;
if ($cmd eq 'M73') {
push @percent, $args->{P};
+ $got_100 = 1 if $args->{P} eq '100';
+ }
+ if ($info->{extruding} && $got_100) {
+ $extruding_after_100 = 1;
}
});
# the extruder heater is turned off when M73 P100 is reached
ok !(defined first { $_ > 100 } @percent), "M73 is never given more than 100% ($comment)";
+ ok !$extruding_after_100, "no extrusions after M73 P100 ($comment)";
};
{
@@ -133,6 +140,13 @@ use Slic3r::Test;
my $print = Slic3r::Test::init_print(['20mm_cube','20mm_cube'], config => $config);
$test->($print, 'two objects');
}
+
+ {
+ my $config = Slic3r::Config->new_from_defaults;
+ $config->set('gcode_flavor', 'sailfish');
+ my $print = Slic3r::Test::init_print('20mm_cube', config => $config, scale_xyz => [1,1, 1/(20/$config->layer_height) ]);
+ $test->($print, 'one layer object');
+ }
}
__END__