Cannot create a coding exercise.

Hello,

I am trying to create a coding exercise and I keep getting this warning when I press the "preview" button in the top right corner. It says thet I should make sure this happens:

  • Your Solution passes the tests you wrote in the evaluation File

However I am sure my solution has to pass the test. I have implemented this simple function in C++:

void add_two ( int n, int &d ){

d = n + 2;

}

and here is my test:

TEST_F(Evaluate, ExampleTest) {
int d;
add_two(4,d);
ASSERT_EQ(6,d) << " If n is 4 you should get 6 ";</strong>
}

What am I doing wrong here? I've been stuck for several days now and I could really use your help. Thanks in advance! :smileyhappy:

Comments

  • Abbie
    Abbie Posts: 3,191 traveler rank

    Hey @Ale0311
    , have you reached instructorsupport@udemy.com yet? The team is best equipped to look into this for you.