# Berlekamp–Massey algorithm verification

I'm implementing Berlekamp–Massey algorithm for BCH codes, but I have some troubles with it: I don't realize how to verify this algorithm. Is there any methods to prove, that code works correctly or maybe there is useful examples in some books, that I can test my code on?

1. Generate a valid codeword, and insert errors at random locations. Repeat for $$1,2,\ldots,t$$ errors. Verify that the algorithm corrects all the errors. Repeat for a large number of codewords.