You cannot calculate the accuracy of the code. You can test whether it is correct or not. If it does not produce the right answer every time then it is incorrect code, not inaccurate code.
To test whether your code is correct or not, read some input images and run your LBP code and compare the result to what is obtained by someone else's code such as http://www.mathworks.com/matlabcentral/fileexchange/36484-local-binary-patterns