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

Commit fc2b2fdd authored by William Escande's avatar William Escande
Browse files

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
parent dffdf88e
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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;
}

+0 −4
Original line number Diff line number Diff line
@@ -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);