58 const std::filesystem::path boardPath =
66 const std::filesystem::path outputPath =
67 std::filesystem::temp_directory_path() /
"kicad_d356_midpoint_test.d356";
72 std::ifstream in( outputPath );
77 int expectedViaMask = -1;
85 const int mask = (
via->IsTented(
F_Mask ) ? 1 : 0 ) | (
via->IsTented(
B_Mask ) ? 2 : 0 );
87 if( expectedViaMask < 0 )
88 expectedViaMask = mask;
90 BOOST_REQUIRE_EQUAL( mask, expectedViaMask );
98 while( std::getline( in, line ) )
101 if( line.size() < 32 || line[0] !=
'3' )
104 const std::string refdes = trim( line.substr( 20, 6 ) );
105 const std::string
pin = trim( line.substr( 27, 4 ) );
106 const char midpoint = line[31];
108 if( refdes ==
"VIA" )
115 const size_t sPos = line.rfind(
'S' );
119 else if(
pin.empty() )
132 BOOST_CHECK_GT( namedPads, 0 );
133 BOOST_CHECK_GT( unnamedPads, 0 );
134 BOOST_CHECK_GT( vias, 0 );
136 std::filesystem::remove( outputPath );
std::unique_ptr< BOARD > ReadBoardFromFileOrStream(const std::string &aFilename, std::istream &aFallback)
Read a board from a file, or another stream, as appropriate.
BOOST_CHECK_EQUAL(result, "25.4")