mainlib test cases