I would write a unittest comparing the values (<171 and >>171) for these functions for old and new impl. 

I don't know however how to write unittests in C++ (we dont have a framework, do we?) or preferably import these functions via swig to python and do unittest in it. Can you help with either? Thanks.