Use anonymous namespace in unit tests.

This is the convention for hidden symbols in C++, makes test boilerplate
hidden and mean you can't forget to make things static.

Change-Id: Ie59df08c7f2fdbd6ed3d6b9db34a981f4e61a133
diff --git a/src/fdt_handler_test.cc b/src/fdt_handler_test.cc
index c3fbb92..9556ede 100644
--- a/src/fdt_handler_test.cc
+++ b/src/fdt_handler_test.cc
@@ -25,9 +25,11 @@
 
 #include <gmock/gmock.h>
 
+namespace
+{
 using ::testing::Eq;
 
-static constexpr size_t TEST_HEAP_SIZE = PAGE_SIZE * 10;
+constexpr size_t TEST_HEAP_SIZE = PAGE_SIZE * 10;
 
 /*
  * /dts-v1/;
@@ -56,7 +58,7 @@
  * | xxd -i
  */
 
-static constexpr uint8_t test_dtb[] = {
+constexpr uint8_t test_dtb[] = {
 	0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x01, 0x7f, 0x00, 0x00, 0x00, 0x38,
 	0x00, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
 	0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f,
@@ -107,3 +109,5 @@
 	EXPECT_THAT(pa_addr(params.mem_ranges[2].begin), Eq(0x30020000));
 	EXPECT_THAT(pa_addr(params.mem_ranges[2].end), Eq(0x30030000));
 }
+
+} /* namespace */
diff --git a/src/fdt_test.cc b/src/fdt_test.cc
index 9d0e4a9..1006c8f 100644
--- a/src/fdt_test.cc
+++ b/src/fdt_test.cc
@@ -21,6 +21,8 @@
 
 #include <gmock/gmock.h>
 
+namespace
+{
 using ::testing::Eq;
 
 /*
@@ -48,7 +50,7 @@
  * | xxd -i
  */
 
-static const uint8_t test_dtb[] = {
+const uint8_t test_dtb[] = {
 	0xd0, 0x0d, 0xfe, 0xed, 0x00, 0x00, 0x01, 0x44, 0x00, 0x00, 0x00, 0x38,
 	0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x11,
 	0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c,
@@ -82,3 +84,5 @@
 	EXPECT_THAT(fdt_total_size((struct fdt_header *)&test_dtb[0]),
 		    Eq(sizeof(test_dtb)));
 }
+
+} /* namespace */
diff --git a/src/mm_test.cc b/src/mm_test.cc
index d0c976d..23091d3 100644
--- a/src/mm_test.cc
+++ b/src/mm_test.cc
@@ -26,18 +26,20 @@
 
 #include <gmock/gmock.h>
 
+namespace
+{
 using ::testing::Eq;
 
 constexpr size_t TEST_HEAP_SIZE = PAGE_SIZE * 10;
 constexpr size_t ENTRY_COUNT = PAGE_SIZE / sizeof(pte_t);
-const static int TOP_LEVEL = arch_mm_max_level(0);
-const static pte_t ABSENT_ENTRY = arch_mm_absent_pte(TOP_LEVEL);
+const int TOP_LEVEL = arch_mm_max_level(0);
+const pte_t ABSENT_ENTRY = arch_mm_absent_pte(TOP_LEVEL);
 
 /**
  * Calculates the size of the address space represented by a page table entry at
  * the given level.
  */
-static size_t mm_entry_size(int level)
+size_t mm_entry_size(int level)
 {
 	return UINT64_C(1) << (PAGE_BITS + level * PAGE_LEVEL_BITS);
 }
@@ -45,7 +47,7 @@
 /**
  * Fill a ptable with absent entries.
  */
-static void init_absent(pte_t *table)
+void init_absent(pte_t *table)
 {
 	for (uint64_t i = 0; i < ENTRY_COUNT; ++i) {
 		table[i] = ABSENT_ENTRY;
@@ -55,8 +57,7 @@
 /**
  * Fill a ptable with block entries.
  */
-static void init_blocks(pte_t *table, int level, paddr_t start_address,
-			uint64_t attrs)
+void init_blocks(pte_t *table, int level, paddr_t start_address, uint64_t attrs)
 {
 	for (uint64_t i = 0; i < ENTRY_COUNT; ++i) {
 		table[i] = arch_mm_block_pte(
@@ -344,3 +345,5 @@
 			<< "i=" << i;
 	}
 }
+
+} /* namespace */