Use 'EXPECT_' rather than 'ASSERT_' in unit-tests, where possible.

This patch replaces many gtest ASSERT_ statements with EXPECT_
statements, allowing the test to continue running even if an assertion
fails.

I've tried to avoid EXPECT_-ing when a failure would make the test
impossible to continue, such as bounds-checking assertions. It's
possible that I've accidentally replaced some important ASSERT
statements, so please look at any changes near bounds checking or
memory allocation, to be sure that it's okay.