mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-09 14:55:08 -06:00
Disabled broken tests, ported some more tests to C++,
removed Perl tests that were already ported to C++.
This commit is contained in:
parent
f8dc74374c
commit
2e7e95adae
9 changed files with 62 additions and 134 deletions
|
@ -1,40 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 9;
|
||||
|
||||
use constant PI => 4 * atan2(1, 1);
|
||||
|
||||
{
|
||||
my @points = (
|
||||
Slic3r::Point->new(100,100),
|
||||
Slic3r::Point->new(100,200),
|
||||
Slic3r::Point->new(200,200),
|
||||
Slic3r::Point->new(200,100),
|
||||
Slic3r::Point->new(150,150),
|
||||
);
|
||||
my $hull = Slic3r::Geometry::convex_hull(\@points);
|
||||
isa_ok $hull, 'Slic3r::Polygon', 'convex_hull returns a Polygon';
|
||||
is scalar(@$hull), 4, 'convex_hull returns the correct number of points';
|
||||
}
|
||||
|
||||
# directions_parallel() and directions_parallel_within() are tested
|
||||
# also with Slic3r::Line::parallel_to() tests in 10_line.t
|
||||
{
|
||||
ok Slic3r::Geometry::directions_parallel_within(0, 0, 0), 'directions_parallel_within';
|
||||
ok Slic3r::Geometry::directions_parallel_within(0, PI, 0), 'directions_parallel_within';
|
||||
ok Slic3r::Geometry::directions_parallel_within(0, 0, PI/180), 'directions_parallel_within';
|
||||
ok Slic3r::Geometry::directions_parallel_within(0, PI, PI/180), 'directions_parallel_within';
|
||||
ok !Slic3r::Geometry::directions_parallel_within(PI/2, PI, 0), 'directions_parallel_within';
|
||||
ok !Slic3r::Geometry::directions_parallel_within(PI/2, PI, PI/180), 'directions_parallel_within';
|
||||
}
|
||||
|
||||
{
|
||||
my $positions = Slic3r::Geometry::arrange(4, Slic3r::Pointf->new(20, 20), 5);
|
||||
is scalar(@$positions), 4, 'arrange() returns expected number of positions';
|
||||
}
|
||||
|
||||
__END__
|
|
@ -1,29 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 2;
|
||||
|
||||
{
|
||||
my $flow = Slic3r::Flow->new_from_width(
|
||||
role => Slic3r::Flow::FLOW_ROLE_PERIMETER,
|
||||
width => '1',
|
||||
nozzle_diameter => 0.5,
|
||||
layer_height => 0.3,
|
||||
bridge_flow_ratio => 1,
|
||||
);
|
||||
isa_ok $flow, 'Slic3r::Flow', 'new_from_width';
|
||||
}
|
||||
|
||||
{
|
||||
my $flow = Slic3r::Flow->new(
|
||||
width => 1,
|
||||
height => 0.4,
|
||||
nozzle_diameter => 0.5,
|
||||
);
|
||||
isa_ok $flow, 'Slic3r::Flow', 'new';
|
||||
}
|
||||
|
||||
__END__
|
|
@ -1,22 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 3;
|
||||
|
||||
{
|
||||
my $model = Slic3r::Model->new;
|
||||
my $object = $model->_add_object;
|
||||
isa_ok $object, 'Slic3r::Model::Object::Ref';
|
||||
isa_ok $object->origin_translation, 'Slic3r::Pointf3::Ref';
|
||||
$object->origin_translation->translate(10,0,0);
|
||||
is_deeply \@{$object->origin_translation}, [10,0,0], 'origin_translation is modified by ref';
|
||||
|
||||
# my $lhr = [ [ 5, 10, 0.1 ] ];
|
||||
# $object->set_layer_height_ranges($lhr);
|
||||
# is_deeply $object->layer_height_ranges, $lhr, 'layer_height_ranges roundtrip';
|
||||
}
|
||||
|
||||
__END__
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Slic3r::XS;
|
||||
use Test::More tests => 2;
|
||||
|
||||
{
|
||||
my $gcodegen = Slic3r::GCode->new;
|
||||
$gcodegen->set_origin(Slic3r::Pointf->new(10,0));
|
||||
is_deeply $gcodegen->origin->pp, [10,0], 'set_origin';
|
||||
$gcodegen->origin->translate(5,5);
|
||||
is_deeply $gcodegen->origin->pp, [15,5], 'origin returns reference to point';
|
||||
}
|
||||
|
||||
__END__
|
|
@ -1,14 +0,0 @@
|
|||
#!/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__
|
Loading…
Add table
Add a link
Reference in a new issue