21#define BOOST_TEST_NO_MAIN
22#include <boost/test/unit_test.hpp>
27#define PCB_LAYER_COUNT PCB_LAYER_ID_COUNT
35 BOOST_CHECK_EQUAL(set.count(), 0);
46 BOOST_CHECK_EQUAL(set.count(), 2);
47 BOOST_CHECK(set.test(
F_Cu));
48 BOOST_CHECK(set.test(
In1_Cu));
55 BOOST_CHECK_EQUAL(set.count(), 1);
56 BOOST_CHECK(set.test(
F_Cu));
63 BOOST_CHECK_EQUAL(set.count(), 3);
64 BOOST_CHECK(set.test(
F_Cu));
65 BOOST_CHECK(set.test(
In1_Cu));
66 BOOST_CHECK(set.test(
In2_Cu));
74 BOOST_CHECK_EQUAL(set.count(), 3);
75 BOOST_CHECK(set.test(
F_Cu));
76 BOOST_CHECK(set.test(
In1_Cu));
77 BOOST_CHECK(set.test(
In2_Cu));
84 BOOST_CHECK(set.Contains(
F_Cu));
85 BOOST_CHECK(set.Contains(
In1_Cu));
86 BOOST_CHECK(!set.Contains(
In30_Cu));
94 LSEQ sequence = set.Seq();
95 BOOST_CHECK_EQUAL(sequence.size(), 3);
96 BOOST_CHECK_EQUAL(sequence[0],
F_Cu);
97 BOOST_CHECK_EQUAL(sequence[1],
In1_Cu);
98 BOOST_CHECK_EQUAL(sequence[2],
In2_Cu);
106 std::string hexString = set.
FmtHex();
107 std::string expectedHexString =
"00000000_00000051";
109 BOOST_CHECK_EQUAL(hexString, expectedHexString);
111 std::string binString = set.FmtBin();
112 std::string expectedBinString =
"0000_0000|0000_0000|0000_0000|0000_0000|0000_0000|0000_0000|0000_0000|0101_0001";
125 BOOST_CHECK(set.Contains(
B_Cu));
126 BOOST_CHECK(set.Contains(
In1_Cu));
130 extractedLayer = set.ExtractLayer();
131 BOOST_CHECK_EQUAL(extractedLayer,
F_Cu);
133 extractedLayer = set.ExtractLayer();
134 BOOST_CHECK_EQUAL(extractedLayer,
B_Cu);
150 if( seq1.size() != seq2.size() )
152 for(
size_t i = 0; i < seq1.size(); ++i )
154 if( seq1[i] != seq2[i] )
167 LSEQ result = lset.Seq();
198 LSEQ result = lset.SeqStackupTop2Bottom(
F_SilkS );
208 LSEQ result = lset.SeqStackupForPlotting();
BASE_SET & set(size_t pos)
LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.
LSET is a set of PCB_LAYER_IDs.
PCB_LAYER_ID ExtractLayer() const
Find the first set PCB_LAYER_ID.
static LSET InternalCuMask()
Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
std::string FmtHex() const
Return a hex string showing contents of this LSEQ.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
BOOST_AUTO_TEST_CASE(LSETConstructorEmpty)
bool compareLSEQ(const LSEQ &seq1, const LSEQ &seq2)
PCB_LAYER_ID
A quick note on layer IDs:
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
VECTOR3I expected(15, 30, 45)