Enhance UEFI test code

Changes:
  - variable_store_tests.cpp
  	- eliminate duplicated string size calculation
	- simplify compare_variable_name(). The function is changed to fail
	  if size of the two string is not matching.
	- There was a repeating pattern creating uint8_t msg_buffer on the
	  stack. This is test code, but a large enough name + data could
	  cause stack underrun. I added a vector and use it as a buffer.
	  This moves allocation to the HEAP and the compiler will take care
	  of cleaning up the memory when the variable goes out of scope.

  - variable_index_tests.cpp
    - eliminate duplicated string size calculation
	- convert null_name to a class member to remove code duplication

Signed-off-by: Gyorgy Szing <Gyorgy.Szing@arm.com>
Change-Id: Ieb108bf84dde21b7659c90452c42c8e7428909e0
2 files changed