The solution is pretty simple, but not obvious if your are not used to C++.
You just can't compare a char* and a string.
if(GetEntityKey(entity1,"name")=="test_box")
Where GetEntityKey(...) is returning a char*.
One way to do it would be to convert the char* to a string and then compare the two strings:
std::string strEntityName = GetEntityKey(entity1,"name");
if (strEntityName =="test_box")
{
.....
}
if the compiler complains about the std::string, just include the string header:
#include <string>