Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15c5134a authored by William Escande's avatar William Escande
Browse files

Mock static initialization order 05

cpp static order initialization is not guarantee.
In order to avoid the mess, we need to have a lazy init schema.
Replacing all osi extern with the correct header
```
's|extern std::map<std::string, int> mock_function_count_map;|#include "test/common/mock_functions.h"|'
```

Bug: 265217208
Test: atest --host
Change-Id: Ia6d4a4594fb51129754327cf0cd979f834065fe3
parent 7c242acf
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@
#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

// Mock include file to share data between tests and mock
#include "test/mock/mock_osi_alarm.h"

+1 −2
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@
#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

// Original included files, if any
// NOTE: Since this is a mock file with mock definitions some number of
//       include files may not be required.  The include-what-you-use
@@ -58,6 +56,7 @@ extern std::map<std::string, int> mock_function_count_map;
#include "osi/include/osi.h"
#include "osi/include/thread.h"
#include "osi/include/wakelock.h"
#include "test/common/mock_functions.h"

// Mocked compile conditionals, if any

+0 −2
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@
#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

// Mock include file to share data between tests and mock
#include "test/mock/mock_osi_allocation_tracker.h"

+1 −2
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@
#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

// Original included files, if any
// NOTE: Since this is a mock file with mock definitions some number of
//       include files may not be required.  The include-what-you-use
@@ -46,6 +44,7 @@ extern std::map<std::string, int> mock_function_count_map;
#include "osi/include/allocator.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"
#include "test/common/mock_functions.h"

// Mocked compile conditionals, if any

+0 −2
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@
#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

// Mock include file to share data between tests and mock
#include "test/mock/mock_osi_allocator.h"

Loading