mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-10 15:25:18 -06:00
More refactoring on Config XS bindings
This commit is contained in:
parent
3c862836f2
commit
934bd43e35
7 changed files with 56 additions and 41 deletions
|
@ -6,7 +6,7 @@ use warnings;
|
|||
use Slic3r::XS;
|
||||
use Test::More tests => 110;
|
||||
|
||||
foreach my $config (Slic3r::Config->new, Slic3r::Config::Full->new) {
|
||||
foreach my $config (Slic3r::Config->new, Slic3r::Config::Static::new_FullPrintConfig) {
|
||||
$config->set('layer_height', 0.3);
|
||||
ok abs($config->get('layer_height') - 0.3) < 1e-4, 'set/get float';
|
||||
is $config->serialize('layer_height'), '0.3', 'serialize float';
|
||||
|
@ -140,13 +140,13 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Full->new) {
|
|||
# test that no crash happens when using set_deserialize() with a key that hasn't been set() yet
|
||||
$config->set_deserialize('filament_diameter', '3');
|
||||
|
||||
my $config2 = Slic3r::Config::Full->new;
|
||||
my $config2 = Slic3r::Config::Static::new_FullPrintConfig;
|
||||
$config2->apply_dynamic($config);
|
||||
is $config2->get('perimeters'), 2, 'apply_dynamic';
|
||||
}
|
||||
|
||||
{
|
||||
my $config = Slic3r::Config::Full->new;
|
||||
my $config = Slic3r::Config::Static::new_FullPrintConfig;
|
||||
my $config2 = Slic3r::Config->new;
|
||||
$config2->apply_static($config);
|
||||
is $config2->get('perimeters'), Slic3r::Config::print_config_def()->{perimeters}{default}, 'apply_static and print_config_def';
|
||||
|
|
|
@ -9,9 +9,9 @@ use Test::More tests => 5;
|
|||
{
|
||||
my $print = Slic3r::Print->new;
|
||||
isa_ok $print, 'Slic3r::Print';
|
||||
isa_ok $print->config, 'Slic3r::Config::Print::Ref';
|
||||
isa_ok $print->default_object_config, 'Slic3r::Config::PrintObject::Ref';
|
||||
isa_ok $print->default_region_config, 'Slic3r::Config::PrintRegion::Ref';
|
||||
isa_ok $print->config, 'Slic3r::Config::Static::Ref';
|
||||
isa_ok $print->default_object_config, 'Slic3r::Config::Static::Ref';
|
||||
isa_ok $print->default_region_config, 'Slic3r::Config::Static::Ref';
|
||||
isa_ok $print->placeholder_parser, 'Slic3r::GCode::PlaceholderParser::Ref';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue