My code not running on test cases. What am I doing wrong?

Please clarify what you mean by «code not running on test cases». What exactly do you see?

Also, please always poste code verbatim rather than through a screenshot.

Okay, thanks.

#include "reverse_string.h"
#include <string>

using namespace std;

namespace reverse_string {
    string reverse(string to_reverse){
        int len = to_reverse.length();
        for(int i=0; i < len / 2; i++){
            char temp = to_reverse[i];
            to_reverse[i] = to_reverse[len - i - 1];
            to_reverse[len - i - 1] = temp;
        }
        return to_reverse;
    }
}  // namespace reverse_string

I wrote this code to reverse any given string. Whenever, I click run tests button on online exercism editor, I get the following errors:

We received the following error when we ran your code:

In file included from /tmp/reverse-string/reverse_string_test.cpp:3:
/tmp/reverse-string/reverse_string_test.cpp: In function 'void ____C_A_T_C_H____T_E_S_T____0()':
/tmp/reverse-string/reverse_string_test.cpp:10:35: error: 'reverse_string' is not a member of 'reverse_string'; did you mean 'reverse_string'?
   10 |     REQUIRE("" == reverse_string::reverse_string(""));
      |                                   ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:1:
/tmp/reverse-string/reverse_string.h:4:11: note: 'reverse_string' declared here
    4 | namespace reverse_string {
      |           ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:3:
/tmp/reverse-string/reverse_string_test.cpp:10:35: error: 'reverse_string' is not a member of 'reverse_string'; did you mean 'reverse_string'?
   10 |     REQUIRE("" == reverse_string::reverse_string(""));
      |                                   ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:1:
/tmp/reverse-string/reverse_string.h:4:11: note: 'reverse_string' declared here
    4 | namespace reverse_string {
      |           ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:3:
/tmp/reverse-string/reverse_string_test.cpp:10:35: error: 'reverse_string' is not a member of 'reverse_string'; did you mean 'reverse_string'?
   10 |     REQUIRE("" == reverse_string::reverse_string(""));
      |                                   ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:1:
/tmp/reverse-string/reverse_string.h:4:11: note: 'reverse_string' declared here
    4 | namespace reverse_string {
      |           ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:3:
/tmp/reverse-string/reverse_string_test.cpp: In function 'void ____C_A_T_C_H____T_E_S_T____2()':
/tmp/reverse-string/reverse_string_test.cpp:16:40: error: 'reverse_string' is not a member of 'reverse_string'; did you mean 'reverse_string'?
   16 |     REQUIRE("tobor" == reverse_string::reverse_string("robot"));
      |                                        ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:1:
/tmp/reverse-string/reverse_string.h:4:11: note: 'reverse_string' declared here
    4 | namespace reverse_string {
      |           ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:3:
/tmp/reverse-string/reverse_string_test.cpp:16:40: error: 'reverse_string' is not a member of 'reverse_string'; did you mean 'reverse_string'?
   16 |     REQUIRE("tobor" == reverse_string::reverse_string("robot"));
      |                                        ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:1:
/tmp/reverse-string/reverse_string.h:4:11: note: 'reverse_string' declared here
    4 | namespace reverse_string {
      |           ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:3:
/tmp/reverse-string/reverse_string_test.cpp:16:40: error: 'reverse_string' is not a member of 'reverse_string'; did you mean 'reverse_string'?
   16 |     REQUIRE("tobor" == reverse_string::reverse_string("robot"));
      |                                        ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:1:
/tmp/reverse-string/reverse_string.h:4:11: note: 'reverse_string' declared here
    4 | namespace reverse_string {
      |           ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:3:
/tmp/reverse-string/reverse_string_test.cpp: In function 'void ____C_A_T_C_H____T_E_S_T____4()':
/tmp/reverse-string/reverse_string_test.cpp:21:40: error: 'reverse_string' is not a member of 'reverse_string'; did you mean 'reverse_string'?
   21 |     REQUIRE("nemaR" == reverse_string::reverse_string("Ramen"));
      |                                        ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:1:
/tmp/reverse-string/reverse_string.h:4:11: note: 'reverse_string' declared here
    4 | namespace reverse_string {
      |           ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:3:
/tmp/reverse-string/reverse_string_test.cpp:21:40: error: 'reverse_string' is not a member of 'reverse_string'; did you mean 'reverse_string'?
   21 |     REQUIRE("nemaR" == reverse_string::reverse_string("Ramen"));
      |                                        ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:1:
/tmp/reverse-string/reverse_string.h:4:11: note: 'reverse_string' declared here
    4 | namespace reverse_string {
      |           ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:3:
/tmp/reverse-string/reverse_string_test.cpp:21:40: error: 'reverse_string' is not a member of 'reverse_string'; did you mean 'reverse_string'?
   21 |     REQUIRE("nemaR" == reverse_string::reverse_string("Ramen"));
      |                                        ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:1:
/tmp/reverse-string/reverse_string.h:4:11: note: 'reverse_string' declared here
    4 | namespace reverse_string {
      |           ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:3:
/tmp/reverse-string/reverse_string_test.cpp: In function 'void ____C_A_T_C_H____T_E_S_T____6()':
/tmp/reverse-string/reverse_string_test.cpp:26:46: error: 'reverse_string' is not a member of 'reverse_string'; did you mean 'reverse_string'?
   26 |     REQUIRE("!yrgnuh m'I" == reverse_string::reverse_string("I'm hungry!"));
      |                                              ^~~~~~~~~~~~~~
In file included from /tmp/reverse-string/reverse_string_test.cpp:1:
/tmp/reverse-string/reverse_string.h:4:11: note: 'reverse_string' declared here
    4 | namespace reverse_string {
      |           ^~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/reverse-string.dir/build.make:63: CMakeFiles/reverse-string.dir/reverse_string_test.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:77: CMakeFiles/reverse-string.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

It looks to me like the function should be named reverse_string rather than reverse.

The code highlighted in the errors are excerpts of the tests. They try to call your function, but the compiler finds there is no function by that name.