added unit tests for calc.h