Unit test for a maximum-finding function
I'm not a C++ developer, and can't comment on the details of the code. But I can comment on the test cases and the general style of the code.
A good test should be enough to recreate the code from reading just the test cases. Especially when you get the task to make sure the code works under any circumstance.
Successful test cases
Let's have a look at your first test case:
std::vector&lt;int&gt; vec = { 7, 50, 16, 8, 25, 9, 12,112 };
test (vec, 112);

You have a vector with a max number 112, and you test for that. If I were to implement the most simple way of accepting your test I would do this (using pseudocode):
return 112;

Let's change add another test to avoid that implementation:
std::vector&lt;int&gt; vec = { 7, 50, 16, 8, 25, 9, 12,113 };
test (vec, 113);

Now I can't just return 112, I have to actually do something else. I would use either of these as my implementation:
return vec.lastElement();
return vec[7];

More test cases needed to fix those problems. I could go on, but I think you understand. I think the following test cases could be a good base:
{ 111 }
{ 7, 50, 16, 8, 25, 9, 12, 112 }
{ 7, 50, 16, 8, 113, 25, 9, 12 }
{ 114, 7, 50, 16, 8, 25, 9, 12 }
{ -1, -2, -3 }
{ -1, 0, 1 }
{ -333, 0 }
{ 0, 123456 }

That's a good start, now we have a lot of test cases with numbers. But we're still missing one important test:
std::vector&lt;int&gt; vec = { };

I have no idea what you want to be returned in this case, but it is a valid case that needs to be handled.
Naming tests
Now we have 10 tests for that simple function. But we need to look at the code to see what the test is testing, and it might not be obvious in all cases. It would be better to have a name for each test that explains what the test is testing in plain English. This is easier with testing frameworks, but a comment would also make the intention clear.
Indent
Looking at your code I struggle to see where the functions begin and end. Make sure to indent properly.
Is this a failing test?
Your second test is:
std::vector&lt;int&gt; vec = { 7, 50, 16, 8, 25, 9, 12,112 };
test (vec, 7);

What is this testing? My understanding is that 7 shouldn't be returned, failing this test. I don't understand why this is added, please explain in a comment.