69 std::shared_ptr<NET_SETTINGS>& netSettings =
70 m_schematic->Project().GetProjectFile().m_NetSettings;
78 BOOST_CHECK( netSettings->GetEffectiveNetClass( wxT(
"/AD.1" ) )
80 .StartsWith( wxT(
"ADI" ) ) );
81 BOOST_CHECK( netSettings->GetEffectiveNetClass( wxT(
"/AD.2" ) )
83 .StartsWith( wxT(
"ADI" ) ) );
96 std::shared_ptr<NET_SETTINGS>& netSettings =
97 m_schematic->Project().GetProjectFile().m_NetSettings;
101 wxFileName netFile = m_schematic->Project().GetProjectFullName();
102 netFile.SetName( netFile.GetName() + wxT(
"_issue24220_test" ) );
103 netFile.SetExt( wxT(
"xml" ) );
105 if( wxFileExists( netFile.GetFullPath() ) )
106 wxRemoveFile( netFile.GetFullPath() );
109 std::unique_ptr<NETLIST_EXPORTER_XML> exporter =
110 std::make_unique<NETLIST_EXPORTER_XML>( m_schematic.get() );
112 bool success = exporter->WriteNetlist( netFile.GetFullPath(), 0,
reporter );
118 wxXmlNode* root = xdoc.GetRoot();
121 wxXmlNode* nets =
nullptr;
123 for( wxXmlNode* child = root->GetChildren(); child; child = child->GetNext() )
125 if( child->GetName() == wxT(
"nets" ) )
134 bool matchedAd1 =
false;
135 bool matchedAd2 =
false;
137 for( wxXmlNode* net = nets->GetChildren(); net; net = net->GetNext() )
139 if( net->GetName() != wxT(
"net" ) )
142 wxString netName = net->GetAttribute( wxT(
"name" ), wxEmptyString );
143 wxString netClass = net->GetAttribute( wxT(
"class" ), wxEmptyString );
145 if( netName != wxT(
"/AD.1" ) && netName != wxT(
"/AD.2" ) )
148 std::shared_ptr<NETCLASS>
expected =
149 netSettings->GetEffectiveNetClass( netName );
155 BOOST_CHECK_NE( netClass, wxString( wxT(
"Default" ) ) );
156 BOOST_CHECK( netClass.StartsWith( wxT(
"ADI" ) ) );
158 if( netName == wxT(
"/AD.1" ) )
160 else if( netName == wxT(
"/AD.2" ) )
164 BOOST_CHECK( matchedAd1 );
165 BOOST_CHECK( matchedAd2 );
167 wxRemoveFile( netFile.GetFullPath() );
BOOST_CHECK_EQUAL(result, "25.4")