Added regress tests on lock.c