Coverity warning fixes.
This commit is contained in:
parent
c7facfd4d4
commit
a4b38fbb80
|
@ -60,6 +60,7 @@ BITMAP_BASE::BITMAP_BASE( const BITMAP_BASE& aSchBitmap )
|
||||||
m_isMirroredX = aSchBitmap.m_isMirroredX;
|
m_isMirroredX = aSchBitmap.m_isMirroredX;
|
||||||
m_isMirroredY = aSchBitmap.m_isMirroredY;
|
m_isMirroredY = aSchBitmap.m_isMirroredY;
|
||||||
m_rotation = aSchBitmap.m_rotation;
|
m_rotation = aSchBitmap.m_rotation;
|
||||||
|
m_imageType = aSchBitmap.m_imageType;
|
||||||
|
|
||||||
m_image = nullptr;
|
m_image = nullptr;
|
||||||
m_bitmap = nullptr;
|
m_bitmap = nullptr;
|
||||||
|
@ -502,4 +503,4 @@ void BITMAP_BASE::UpdateImageDataBuffer()
|
||||||
stream.CopyTo( m_imageData.GetData(), stream.GetLength() );
|
stream.CopyTo( m_imageData.GetData(), stream.GetLength() );
|
||||||
m_imageData.SetDataLen( stream.GetLength() );
|
m_imageData.SetDataLen( stream.GetLength() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,6 +131,7 @@ LIB_TREE_NODE::LIB_TREE_NODE()
|
||||||
m_IntrinsicRank( 0 ),
|
m_IntrinsicRank( 0 ),
|
||||||
m_Score( 0 ),
|
m_Score( 0 ),
|
||||||
m_Pinned( false ),
|
m_Pinned( false ),
|
||||||
|
m_PinCount( 0 ),
|
||||||
m_Unit( 0 ),
|
m_Unit( 0 ),
|
||||||
m_IsRoot( false )
|
m_IsRoot( false )
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -565,7 +565,7 @@ CADSTAR_PARTS_LIB_MODEL readCadstarHelper( INPUT_TYPE& aInput )
|
||||||
}
|
}
|
||||||
catch( const parse_error& e )
|
catch( const parse_error& e )
|
||||||
{
|
{
|
||||||
const auto p = e.positions().front();
|
const auto& p = e.positions().front();
|
||||||
std::cerr << "Error at line " << p.line << ", column " << p.column << std::endl
|
std::cerr << "Error at line " << p.line << ", column " << p.column << std::endl
|
||||||
<< aInput.line_at( p ) << std::endl
|
<< aInput.line_at( p ) << std::endl
|
||||||
<< std::setw( p.column ) << '^' << std::endl
|
<< std::setw( p.column ) << '^' << std::endl
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2022-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
@ -77,7 +77,7 @@ void SEARCH_PANE_LISTVIEW::GetSelectRowsList( std::vector<long>& aSelectedList )
|
||||||
void SEARCH_PANE_LISTVIEW::OnItemActivated( wxListEvent& aEvent )
|
void SEARCH_PANE_LISTVIEW::OnItemActivated( wxListEvent& aEvent )
|
||||||
{
|
{
|
||||||
CallAfter(
|
CallAfter(
|
||||||
[=]()
|
[&]()
|
||||||
{
|
{
|
||||||
m_handler->ActivateItem( aEvent.GetIndex() );
|
m_handler->ActivateItem( aEvent.GetIndex() );
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -241,6 +241,8 @@ public:
|
||||||
PDF_PLOTTER() :
|
PDF_PLOTTER() :
|
||||||
m_pageTreeHandle( 0 ),
|
m_pageTreeHandle( 0 ),
|
||||||
m_fontResDictHandle( 0 ),
|
m_fontResDictHandle( 0 ),
|
||||||
|
m_imgResDictHandle( 0 ),
|
||||||
|
m_jsNamesHandle( 0 ),
|
||||||
m_pageStreamHandle( 0 ),
|
m_pageStreamHandle( 0 ),
|
||||||
m_streamLengthHandle( 0 ),
|
m_streamLengthHandle( 0 ),
|
||||||
m_workFile( nullptr ),
|
m_workFile( nullptr ),
|
||||||
|
|
|
@ -224,16 +224,18 @@ void UPDATE_MANAGER::CheckForUpdate( wxWindow* aNoticeParent )
|
||||||
if( response.version != settings->m_lastReceivedUpdate )
|
if( response.version != settings->m_lastReceivedUpdate )
|
||||||
{
|
{
|
||||||
aNoticeParent->CallAfter(
|
aNoticeParent->CallAfter(
|
||||||
[=]()
|
[&]()
|
||||||
{
|
{
|
||||||
auto notice = new DIALOG_UPDATE_NOTICE(
|
auto notice = new DIALOG_UPDATE_NOTICE(
|
||||||
aNoticeParent, response.version, response.details_url,
|
aNoticeParent, response.version, response.details_url,
|
||||||
response.downloads_url );
|
response.downloads_url );
|
||||||
|
|
||||||
int retCode = notice->ShowModal();
|
int retCode = notice->ShowModal();
|
||||||
|
|
||||||
if( retCode != wxID_RETRY )
|
if( retCode != wxID_RETRY )
|
||||||
{
|
{
|
||||||
// basically saving the last received update prevents us from prompting again
|
// basically saving the last received update prevents us from
|
||||||
|
// prompting again
|
||||||
settings->m_lastReceivedUpdate = response.version;
|
settings->m_lastReceivedUpdate = response.version;
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
@ -255,4 +257,4 @@ void UPDATE_MANAGER::CheckForUpdate( wxWindow* aNoticeParent )
|
||||||
|
|
||||||
thread_pool& tp = GetKiCadThreadPool();
|
thread_pool& tp = GetKiCadThreadPool();
|
||||||
tp.push_task( update_check );
|
tp.push_task( update_check );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Modifications Copyright (C) 2018-2021 KiCad Developers
|
* Modifications Copyright (C) 2018-2023 KiCad Developers
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -60,6 +60,8 @@ class PolygonTriangulation
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PolygonTriangulation( SHAPE_POLY_SET::TRIANGULATED_POLYGON& aResult ) :
|
PolygonTriangulation( SHAPE_POLY_SET::TRIANGULATED_POLYGON& aResult ) :
|
||||||
|
m_prefactor_x( 0.0 ),
|
||||||
|
m_prefactor_y( 0.0 ),
|
||||||
m_result( aResult )
|
m_result( aResult )
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
|
|
@ -1177,10 +1177,23 @@ DIALOG_NET_INSPECTOR::~DIALOG_NET_INSPECTOR()
|
||||||
g_settings.col_order = column_order;
|
g_settings.col_order = column_order;
|
||||||
|
|
||||||
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
|
||||||
PCBNEW_SETTINGS* app_settings = mgr.GetAppSettings<PCBNEW_SETTINGS>();
|
PCBNEW_SETTINGS* app_settings = nullptr;
|
||||||
app_settings->m_NetInspector.group_by_text = g_settings.group_by_text;
|
|
||||||
app_settings->m_NetInspector.group_by = g_settings.group_by;
|
try
|
||||||
app_settings->m_NetInspector.group_by_kind = g_settings.group_by_kind;
|
{
|
||||||
|
app_settings = mgr.GetAppSettings<PCBNEW_SETTINGS>();
|
||||||
|
}
|
||||||
|
catch( const std::runtime_error& err )
|
||||||
|
{
|
||||||
|
wxLogWarning( wxS( "%s" ), err.what() );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( app_settings )
|
||||||
|
{
|
||||||
|
app_settings->m_NetInspector.group_by_text = g_settings.group_by_text;
|
||||||
|
app_settings->m_NetInspector.group_by = g_settings.group_by;
|
||||||
|
app_settings->m_NetInspector.group_by_kind = g_settings.group_by_kind;
|
||||||
|
}
|
||||||
|
|
||||||
// the displayed list elements are going to be deleted before the list view itself.
|
// the displayed list elements are going to be deleted before the list view itself.
|
||||||
// in some cases it might still do queries on the data model, which would crash
|
// in some cases it might still do queries on the data model, which would crash
|
||||||
|
|
|
@ -361,18 +361,18 @@ size_t FABMASTER::processPadStackLayers( size_t aRow )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pad_name = row[pad_name_col];
|
auto& pad_name = row[pad_name_col];
|
||||||
auto pad_num = row[pad_num_col];
|
auto& pad_num = row[pad_num_col];
|
||||||
auto pad_layer = row[pad_lay_col];
|
auto& pad_layer = row[pad_lay_col];
|
||||||
auto pad_is_fixed = row[pad_fix_col];
|
auto& pad_is_fixed = row[pad_fix_col];
|
||||||
auto pad_is_via = row[pad_via_col];
|
auto& pad_is_via = row[pad_via_col];
|
||||||
auto pad_shape = row[pad_shape_col];
|
auto& pad_shape = row[pad_shape_col];
|
||||||
auto pad_width = row[pad_width_col];
|
auto& pad_width = row[pad_width_col];
|
||||||
auto pad_height = row[pad_height_col];
|
auto& pad_height = row[pad_height_col];
|
||||||
auto pad_xoff = row[pad_xoff_col];
|
auto& pad_xoff = row[pad_xoff_col];
|
||||||
auto pad_yoff = row[pad_yoff_col];
|
auto& pad_yoff = row[pad_yoff_col];
|
||||||
auto pad_flash = row[pad_flash_col];
|
auto& pad_flash = row[pad_flash_col];
|
||||||
auto pad_shapename = row[pad_shape_name_col];
|
auto& pad_shapename = row[pad_shape_name_col];
|
||||||
|
|
||||||
// This layer setting seems to be unused
|
// This layer setting seems to be unused
|
||||||
if( pad_layer == "INTERNAL_PAD_DEF" || pad_layer == "internal_pad_def" )
|
if( pad_layer == "INTERNAL_PAD_DEF" || pad_layer == "internal_pad_def" )
|
||||||
|
@ -444,18 +444,18 @@ size_t FABMASTER::processPadStacks( size_t aRow )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pad_name = row[pad_name_col];
|
auto& pad_name = row[pad_name_col];
|
||||||
auto pad_num = row[pad_num_col];
|
auto& pad_num = row[pad_num_col];
|
||||||
auto pad_layer = row[pad_lay_col];
|
auto& pad_layer = row[pad_lay_col];
|
||||||
auto pad_is_fixed = row[pad_fix_col];
|
auto& pad_is_fixed = row[pad_fix_col];
|
||||||
auto pad_is_via = row[pad_via_col];
|
auto& pad_is_via = row[pad_via_col];
|
||||||
auto pad_shape = row[pad_shape_col];
|
auto& pad_shape = row[pad_shape_col];
|
||||||
auto pad_width = row[pad_width_col];
|
auto& pad_width = row[pad_width_col];
|
||||||
auto pad_height = row[pad_height_col];
|
auto& pad_height = row[pad_height_col];
|
||||||
auto pad_xoff = row[pad_xoff_col];
|
auto& pad_xoff = row[pad_xoff_col];
|
||||||
auto pad_yoff = row[pad_yoff_col];
|
auto& pad_yoff = row[pad_yoff_col];
|
||||||
auto pad_flash = row[pad_flash_col];
|
auto& pad_flash = row[pad_flash_col];
|
||||||
auto pad_shapename = row[pad_shape_name_col];
|
auto& pad_shapename = row[pad_shape_name_col];
|
||||||
|
|
||||||
// This layer setting seems to be unused
|
// This layer setting seems to be unused
|
||||||
if( pad_layer == "INTERNAL_PAD_DEF" || pad_layer == "internal_pad_def" )
|
if( pad_layer == "INTERNAL_PAD_DEF" || pad_layer == "internal_pad_def" )
|
||||||
|
@ -659,7 +659,7 @@ size_t FABMASTER::processSimpleLayers( size_t aRow )
|
||||||
if( rownum >= rows.size() )
|
if( rownum >= rows.size() )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
auto header = rows[aRow];
|
auto& header = rows[aRow];
|
||||||
double scale_factor = processScaleFactor( aRow + 1 );
|
double scale_factor = processScaleFactor( aRow + 1 );
|
||||||
|
|
||||||
if( scale_factor <= 0.0 )
|
if( scale_factor <= 0.0 )
|
||||||
|
@ -803,7 +803,7 @@ size_t FABMASTER::processLayers( size_t aRow )
|
||||||
if( rownum >= rows.size() )
|
if( rownum >= rows.size() )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
auto header = rows[aRow];
|
auto& header = rows[aRow];
|
||||||
double scale_factor = processScaleFactor( aRow + 1 );
|
double scale_factor = processScaleFactor( aRow + 1 );
|
||||||
|
|
||||||
if( scale_factor <= 0.0 )
|
if( scale_factor <= 0.0 )
|
||||||
|
@ -835,14 +835,14 @@ size_t FABMASTER::processLayers( size_t aRow )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto layer_sort = row[layer_sort_col];
|
auto& layer_sort = row[layer_sort_col];
|
||||||
auto layer_subclass = row[layer_subclass_col];
|
auto& layer_subclass = row[layer_subclass_col];
|
||||||
auto layer_art = row[layer_art_col];
|
auto& layer_art = row[layer_art_col];
|
||||||
auto layer_use = row[layer_use_col];
|
auto& layer_use = row[layer_use_col];
|
||||||
auto layer_cond = row[layer_cond_col];
|
auto& layer_cond = row[layer_cond_col];
|
||||||
auto layer_er = row[layer_er_col];
|
auto& layer_er = row[layer_er_col];
|
||||||
auto layer_rho = row[layer_rho_col];
|
auto& layer_rho = row[layer_rho_col];
|
||||||
auto layer_mat = row[layer_mat_col];
|
auto& layer_mat = row[layer_mat_col];
|
||||||
|
|
||||||
if( layer_mat == "AIR" )
|
if( layer_mat == "AIR" )
|
||||||
continue;
|
continue;
|
||||||
|
@ -878,7 +878,7 @@ size_t FABMASTER::processCustomPads( size_t aRow )
|
||||||
if( rownum >= rows.size() )
|
if( rownum >= rows.size() )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
auto header = rows[aRow];
|
auto& header = rows[aRow];
|
||||||
double scale_factor = processScaleFactor( aRow + 1 );
|
double scale_factor = processScaleFactor( aRow + 1 );
|
||||||
|
|
||||||
if( scale_factor <= 0.0 )
|
if( scale_factor <= 0.0 )
|
||||||
|
@ -923,9 +923,9 @@ size_t FABMASTER::processCustomPads( size_t aRow )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto pad_layer = row[pad_subclass_col];
|
auto& pad_layer = row[pad_subclass_col];
|
||||||
auto pad_shape_name = row[pad_shape_name_col];
|
auto pad_shape_name = row[pad_shape_name_col];
|
||||||
auto pad_record_tag = row[pad_record_tag_col];
|
auto& pad_record_tag = row[pad_record_tag_col];
|
||||||
|
|
||||||
GRAPHIC_DATA gr_data;
|
GRAPHIC_DATA gr_data;
|
||||||
gr_data.graphic_dataname = row[pad_grdata_name_col];
|
gr_data.graphic_dataname = row[pad_grdata_name_col];
|
||||||
|
@ -940,9 +940,9 @@ size_t FABMASTER::processCustomPads( size_t aRow )
|
||||||
gr_data.graphic_data8 = row[pad_grdata8_col];
|
gr_data.graphic_data8 = row[pad_grdata8_col];
|
||||||
gr_data.graphic_data9 = row[pad_grdata9_col];
|
gr_data.graphic_data9 = row[pad_grdata9_col];
|
||||||
|
|
||||||
auto pad_stack_name = row[pad_stack_name_col];
|
auto& pad_stack_name = row[pad_stack_name_col];
|
||||||
auto pad_refdes = row[pad_refdes_col];
|
auto& pad_refdes = row[pad_refdes_col];
|
||||||
auto pad_pin_num = row[pad_pin_num_col];
|
auto& pad_pin_num = row[pad_pin_num_col];
|
||||||
|
|
||||||
// N.B. We get the FIGSHAPE records as "FIG_SHAPE name". We only want "name"
|
// N.B. We get the FIGSHAPE records as "FIG_SHAPE name". We only want "name"
|
||||||
// and we don't process other pad shape records
|
// and we don't process other pad shape records
|
||||||
|
@ -1230,7 +1230,7 @@ size_t FABMASTER::processGeometry( size_t aRow )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto geo_tag = row[geo_tag_col];
|
auto& geo_tag = row[geo_tag_col];
|
||||||
|
|
||||||
GRAPHIC_DATA gr_data;
|
GRAPHIC_DATA gr_data;
|
||||||
gr_data.graphic_dataname = row[geo_name_col];
|
gr_data.graphic_dataname = row[geo_name_col];
|
||||||
|
@ -1245,7 +1245,7 @@ size_t FABMASTER::processGeometry( size_t aRow )
|
||||||
gr_data.graphic_data8 = row[geo_grdata8_col];
|
gr_data.graphic_data8 = row[geo_grdata8_col];
|
||||||
gr_data.graphic_data9 = row[geo_grdata9_col];
|
gr_data.graphic_data9 = row[geo_grdata9_col];
|
||||||
|
|
||||||
auto geo_refdes = row[geo_refdes_col];
|
auto& geo_refdes = row[geo_refdes_col];
|
||||||
|
|
||||||
// Grouped graphics are a series of records with the same record ID but incrementing
|
// Grouped graphics are a series of records with the same record ID but incrementing
|
||||||
// Sequence numbers.
|
// Sequence numbers.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018-2019, 2023 KiCad Developers, see AUTHORS.TXT for contributors.
|
* Copyright (C) 2018-2023, 2023 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -161,7 +161,7 @@ BOOST_AUTO_TEST_CASE( WithAlpha )
|
||||||
|
|
||||||
for( const auto& c : cases )
|
for( const auto& c : cases )
|
||||||
{
|
{
|
||||||
auto col = c.start;
|
auto& col = c.start;
|
||||||
|
|
||||||
const auto with_alpha = col.WithAlpha( c.factor );
|
const auto with_alpha = col.WithAlpha( c.factor );
|
||||||
BOOST_CHECK_EQUAL( with_alpha, c.expected );
|
BOOST_CHECK_EQUAL( with_alpha, c.expected );
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2022 KiCad Developers, see AUTHORS.TXT for contributors.
|
* Copyright (C) 2022-2023 KiCad Developers, see AUTHORS.TXT for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -25,6 +25,7 @@
|
||||||
#include <sim/sim_model_ngspice.h>
|
#include <sim/sim_model_ngspice.h>
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
#include <boost/algorithm/string/predicate.hpp>
|
||||||
|
|
||||||
|
|
||||||
class TEST_SIM_MODEL_NGSPICE_FIXTURE : public SIM_MODEL_NGSPICE
|
class TEST_SIM_MODEL_NGSPICE_FIXTURE : public SIM_MODEL_NGSPICE
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -52,15 +53,16 @@ BOOST_AUTO_TEST_CASE( ParamDuplicates )
|
||||||
{
|
{
|
||||||
// Ensure there's no model parameters that have the same name.
|
// Ensure there's no model parameters that have the same name.
|
||||||
BOOST_CHECK( std::none_of( modelParams.begin(), modelParams.end(),
|
BOOST_CHECK( std::none_of( modelParams.begin(), modelParams.end(),
|
||||||
[modelParam]( const auto& aOtherModelParam )
|
[&modelParam]( const auto& aOtherModelParam )
|
||||||
{
|
{
|
||||||
return modelParam.id != aOtherModelParam.id
|
return modelParam.id != aOtherModelParam.id
|
||||||
&& modelParam.name == aOtherModelParam.name;
|
&& modelParam.name == aOtherModelParam.name;
|
||||||
} ) );
|
} ) );
|
||||||
|
|
||||||
// Ensure there's no model parameters that have the same name as an instance parameter.
|
// Ensure there's no model parameters that have the same name as an
|
||||||
|
// instance parameter.
|
||||||
BOOST_CHECK( std::none_of( instanceParams.begin(), instanceParams.end(),
|
BOOST_CHECK( std::none_of( instanceParams.begin(), instanceParams.end(),
|
||||||
[modelParam]( const auto& aInstanceParam )
|
[&modelParam]( const auto& aInstanceParam )
|
||||||
{
|
{
|
||||||
return modelParam.name == aInstanceParam.name;
|
return modelParam.name == aInstanceParam.name;
|
||||||
} ) );
|
} ) );
|
||||||
|
@ -72,7 +74,7 @@ BOOST_AUTO_TEST_CASE( ParamDuplicates )
|
||||||
// We append an "_" to model parameters to disambiguate from these
|
// We append an "_" to model parameters to disambiguate from these
|
||||||
// corresponding instance parameters.
|
// corresponding instance parameters.
|
||||||
BOOST_CHECK( std::any_of( instanceParams.begin(), instanceParams.end(),
|
BOOST_CHECK( std::any_of( instanceParams.begin(), instanceParams.end(),
|
||||||
[modelParam]( const auto& aInstanceParam )
|
[&modelParam]( const auto& aInstanceParam )
|
||||||
{
|
{
|
||||||
return modelParam.name.substr( 0, modelParam.name.length() - 1 )
|
return modelParam.name.substr( 0, modelParam.name.length() - 1 )
|
||||||
== aInstanceParam.name;
|
== aInstanceParam.name;
|
||||||
|
@ -80,14 +82,14 @@ BOOST_AUTO_TEST_CASE( ParamDuplicates )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure there's no instance parameters that have the same name.
|
// Ensure there's no instance parameters that have the same name.
|
||||||
for( const SIM_MODEL::PARAM::INFO& instanceParam : instanceParams )
|
for( const SIM_MODEL::PARAM::INFO& instanceParam : instanceParams )
|
||||||
{
|
{
|
||||||
BOOST_TEST_CONTEXT( "Instance param name: " << instanceParam.name )
|
BOOST_TEST_CONTEXT( "Instance param name: " << instanceParam.name )
|
||||||
{
|
{
|
||||||
BOOST_CHECK( std::none_of( instanceParams.begin(), instanceParams.end(),
|
BOOST_CHECK( std::none_of( instanceParams.begin(), instanceParams.end(),
|
||||||
[instanceParam]( const auto& aOtherInstanceParam )
|
[&instanceParam]( const auto& aOtherInstanceParam )
|
||||||
{
|
{
|
||||||
return instanceParam.id != aOtherInstanceParam.id
|
return instanceParam.id != aOtherInstanceParam.id
|
||||||
&& instanceParam.dir != SIM_MODEL::PARAM::DIR_OUT
|
&& instanceParam.dir != SIM_MODEL::PARAM::DIR_OUT
|
||||||
|
@ -121,32 +123,32 @@ BOOST_AUTO_TEST_CASE( ParamCount )
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 22 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 22 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 25 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 25 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::CAPACITOR:
|
case MODEL_TYPE::CAPACITOR:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 19 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 19 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 22 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 22 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::INDUCTOR:
|
case MODEL_TYPE::INDUCTOR:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 9 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 9 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 20 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 20 );
|
||||||
break;*/
|
break;*/
|
||||||
|
|
||||||
/*case MODEL_TYPE::LTRA:
|
/*case MODEL_TYPE::LTRA:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 18 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 18 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 9 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 9 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::TRANLINE:
|
case MODEL_TYPE::TRANLINE:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 0 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 0 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 17 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 17 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::URC:
|
case MODEL_TYPE::URC:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 7 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 7 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 5 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 5 );
|
||||||
break;*/
|
break;*/
|
||||||
|
|
||||||
/*case MODEL_TYPE::TRANSLINE:
|
/*case MODEL_TYPE::TRANSLINE:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 6 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 6 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 3 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 3 );
|
||||||
|
@ -156,57 +158,57 @@ BOOST_AUTO_TEST_CASE( ParamCount )
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 7 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 7 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 8 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 8 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::CSWITCH:
|
case MODEL_TYPE::CSWITCH:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 7 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 7 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 7 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 7 );
|
||||||
break;*/
|
break;*/
|
||||||
|
|
||||||
case MODEL_TYPE::DIODE:
|
case MODEL_TYPE::DIODE:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 76 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 76 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 30 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 30 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::BJT:
|
case MODEL_TYPE::BJT:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 152 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 152 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 53 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 53 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::VBIC:
|
case MODEL_TYPE::VBIC:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 117 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 117 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 45 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 45 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::HICUM2:
|
case MODEL_TYPE::HICUM2:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 149 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 149 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 61 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 61 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::JFET:
|
case MODEL_TYPE::JFET:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 34 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 34 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 28 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 28 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::JFET2:
|
case MODEL_TYPE::JFET2:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 46 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 46 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 30 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 30 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::MES:
|
case MODEL_TYPE::MES:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 22 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 22 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 25 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 25 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::MESA:
|
case MODEL_TYPE::MESA:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 71 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 71 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 30 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 30 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::HFET1:
|
case MODEL_TYPE::HFET1:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 68 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 68 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 28 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 28 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::HFET2:
|
case MODEL_TYPE::HFET2:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 40 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 40 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 28 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 28 );
|
||||||
|
@ -216,91 +218,92 @@ BOOST_AUTO_TEST_CASE( ParamCount )
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 69 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 69 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 36 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 36 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::MOS1:
|
case MODEL_TYPE::MOS1:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 35 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 35 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 76 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 76 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::MOS2:
|
case MODEL_TYPE::MOS2:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 42 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 42 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 76 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 76 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::MOS3:
|
case MODEL_TYPE::MOS3:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 48 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 48 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 81 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 81 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::BSIM1:
|
case MODEL_TYPE::BSIM1:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 81 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 81 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 14 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 14 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::BSIM2:
|
case MODEL_TYPE::BSIM2:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 137 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 137 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 14 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 14 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::MOS6:
|
case MODEL_TYPE::MOS6:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 42 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 42 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 78 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 78 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::BSIM3:
|
case MODEL_TYPE::BSIM3:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 429 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 429 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 46 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 46 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::MOS9:
|
case MODEL_TYPE::MOS9:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 48 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 48 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 81 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 81 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::B4SOI:
|
case MODEL_TYPE::B4SOI:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 915 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 915 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 74 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 74 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::BSIM4:
|
case MODEL_TYPE::BSIM4:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 892 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 892 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 84 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 84 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::B3SOIFD:
|
case MODEL_TYPE::B3SOIFD:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 393 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 393 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 27 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 27 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::B3SOIDD:
|
case MODEL_TYPE::B3SOIDD:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 393 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 393 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 27 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 27 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::B3SOIPD:
|
case MODEL_TYPE::B3SOIPD:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 470 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 470 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 36 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 36 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::HISIM2:
|
case MODEL_TYPE::HISIM2:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 486 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 486 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 59 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 59 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::HISIMHV1:
|
case MODEL_TYPE::HISIMHV1:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 610 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 610 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 72 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 72 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODEL_TYPE::HISIMHV2:
|
case MODEL_TYPE::HISIMHV2:
|
||||||
BOOST_CHECK_EQUAL( modelParams.size(), 730 );
|
BOOST_CHECK_EQUAL( modelParams.size(), 730 );
|
||||||
BOOST_CHECK_EQUAL( instanceParams.size(), 74 );
|
BOOST_CHECK_EQUAL( instanceParams.size(), 74 );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BOOST_FAIL( wxString::Format(
|
BOOST_FAIL( wxString::Format(
|
||||||
"Unhandled type: %d "
|
"Unhandled type: %d "
|
||||||
"(if you created a new type you need to handle it in this switch statement)",
|
"(if you created a new type you need to handle it in this switch "
|
||||||
|
"statement)",
|
||||||
type ) );
|
type ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue