FunctionTest: Fix some test failure checks
This corrects a long-standing (14 years!) issue with two of the tests in Tests/FunctionTest/CMakeLists.txt, by adding failure conditions. Previously the tests would always issue a pass() result, regardless of actual success or failure.
Fixes: #23584 (closed)