Unittest for writing and reading cursor snapshot
Functions under test are dumpSharedLocalSnapshot_forCursor() and readSharedLocalSnapshot_forCursor(). Significant amount of global state needs to be created for the test to be able to invoke the two functions. What we are testing here is, whether correct snapshot information is included in what is written to file. Validation is performed by reading the contents of the file and compairing them with expected values. An implicit rule to run a unittest is defined in src/Makefile.mock. This patch overrides it such that the required directory for the cursor snapshot file is created before running the test. Reviewed-by: Adam Berlin and Jesse Zhang
Showing
想要评论请 注册 或 登录