CppEditor: Tests: Fix newline handling

removeTrailingWhitespace() appended one '\n' too much. As time went by,
excess '\n' where added to the test code.

* Remove excess '\n'.
* For consistency, ensure that each test code line ends with '\n'.

Change-Id: Ie2d4a1b8b27989f26bf154cb3b891dfb8fe6b2fd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
CppEditor: Tests: Call QByteArray::remove() only with i >= 0

For example test_quickfix_InsertDefFromDecl_afterClass led to a
QByteArray::remove(-1) call. According to the doc nothing happens, but
it will become problematic later when we change to QString (with that, a
character will be removed from the end).

Change-Id: Ie89dd7834e44fbcfde63ea6ca3ab181dfe50e191
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
C++: Remove unused functions in Document::Block

Change-Id: I7049388d970c2c1454a95f0a0df6cfd8f5a960a8
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
C++: Remove unused functions in Lexer

Change-Id: I78b70eead1c64b9925272c50cc6109c5b415574d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
C++: Remove Lexer::{tokenOffset(),tokenLength()}

The necessary data can be retrieved by the resulting Token.

Change-Id: I79afb23183c156240c690beff30bb11dfe943e61
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>