Functions that provide a "name" member don't need aliases; functions that do not have a "name" member do.
| 132 | // Functions that provide a "name" member don't need aliases; functions that do |
| 133 | // not have a "name" member do. |
| 134 | TEST_F(SimpleFunctionTest, nameOrAliasRegistration) { |
| 135 | // This one needs alias; will throw. |
| 136 | auto registerThrow = [&]() { |
| 137 | registerFunction<UnnamedFunction, bool, int64_t>(); |
| 138 | }; |
| 139 | EXPECT_THROW(registerThrow(), std::runtime_error); |
| 140 | |
| 141 | // These are good. |
| 142 | auto registerNoThrow = [&]() { |
| 143 | registerFunction<UnnamedFunction, bool, int64_t>({"my_alias"}); |
| 144 | }; |
| 145 | EXPECT_NO_THROW(registerNoThrow()); |
| 146 | |
| 147 | auto registerNoThrow2 = [&]() { |
| 148 | registerFunction<NamedFunction, bool, int64_t>(); |
| 149 | }; |
| 150 | EXPECT_NO_THROW(registerNoThrow2()); |
| 151 | } |
| 152 | |
| 153 | // Some input data. |
| 154 | static std::vector<std::vector<int64_t>> arrayData = { |
nothing calls this directly
no test coverage detected