diff options
author | 2023-03-07 23:03:41 -0800 | |
---|---|---|
committer | 2023-03-14 09:45:47 +0000 | |
commit | fc2b2fdd408e6563d23949ccdadbadd99c3f0baf (patch) | |
tree | ed9e264c799f33065177c5892559317177d523c8 | |
parent | dffdf88e5100778073f67f3547f0d321915fe214 (diff) |
Mock static initialization order 23
cpp static order initialization is not guarantee.
In order to avoid the mess, we need to have a lazy init schema.
Removing temporary hack to keep old behavior working
Bug: 265217208
Test: atest --host
Change-Id: If28273f2a48ec72fc3e155b993322660876d5ab7
-rw-r--r-- | system/test/common/mock_functions.cc | 5 | ||||
-rw-r--r-- | system/test/common/mock_functions.h | 4 |
2 files changed, 1 insertions, 8 deletions
diff --git a/system/test/common/mock_functions.cc b/system/test/common/mock_functions.cc index 88a0e8e853..776cf1d4a4 100644 --- a/system/test/common/mock_functions.cc +++ b/system/test/common/mock_functions.cc @@ -20,11 +20,8 @@ #include "osi/include/log.h" -std::map<std::string, int> mock_function_count_map; - static std::map<std::string, int>& _get_func_call_count_map() { - // TODO(265217208) return singleton map instead - // static std::map<std::string, int> mock_function_count_map; + static std::map<std::string, int> mock_function_count_map; return mock_function_count_map; } diff --git a/system/test/common/mock_functions.h b/system/test/common/mock_functions.h index c7e106ffc1..54b1281aed 100644 --- a/system/test/common/mock_functions.h +++ b/system/test/common/mock_functions.h @@ -19,10 +19,6 @@ #include <map> #include <string> -// TODO(265217208) Remove -// Usage is deprecated, use get_func_call_count / inc_func_call_count instead -extern std::map<std::string, int> mock_function_count_map; - int get_func_call_size(); int get_func_call_count(const char* fn); |