Added test case for write protection when opened read-only.