Skip to content

Commit baf8a93

Browse files
committed
test: add boundary condition and probability capping C++ unit test
TAG=agy
1 parent a72f33b commit baf8a93

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/multi_pass_tesseract_decoder.test.cc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,25 @@ TEST(MultiPassTesseractDecoderTest, PerfectResetSurfaceCode) {
247247
ASSERT_GT(total_reweights_in_test, 0) << "Test was trivial for d=" << d << ". No reweighting occurred.";
248248
}
249249
}
250+
251+
TEST(MultiPassTesseractDecoderTest, BoundaryConditionAndCappingTest) {
252+
stim::DetectorErrorModel dem(R"DEM(
253+
error(0.49) D0 D1 L0
254+
error(0.5) D0
255+
detector D0
256+
detector D1
257+
logical_observable L0
258+
)DEM");
259+
260+
auto classifier = [](int index, const std::vector<double>& coords, const std::string& tag) -> int {
261+
return index;
262+
};
263+
264+
TesseractConfig config;
265+
config.dem = dem;
266+
267+
MultiPassTesseractDecoder decoder(dem, 2, classifier, config, 1, DetOrder::DetIndex, 12345, SchedulingStrategy::Causal);
268+
269+
std::vector<uint64_t> hits = {0};
270+
ASSERT_NO_THROW(decoder.decode(hits));
271+
}

0 commit comments

Comments
 (0)