| 296 | } |
| 297 | |
| 298 | void function_arg_direction() const { |
| 299 | constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n" |
| 300 | "<def>\n" |
| 301 | "<function name=\"foo\">\n" |
| 302 | " <arg nr=\"1\" direction=\"in\"></arg>\n" |
| 303 | " <arg nr=\"2\" direction=\"out\"></arg>\n" |
| 304 | " <arg nr=\"3\" direction=\"inout\"></arg>\n" |
| 305 | " <arg nr=\"4\"></arg>\n" |
| 306 | "</function>\n" |
| 307 | "</def>"; |
| 308 | |
| 309 | Library library; |
| 310 | ASSERT(LibraryHelper::loadxmldata(library, xmldata, sizeof(xmldata))); |
| 311 | |
| 312 | const char code[] = "foo(a,b,c,d);"; |
| 313 | SimpleTokenList tokenList(code); |
| 314 | tokenList.front()->next()->astOperand1(tokenList.front()); |
| 315 | |
| 316 | ASSERT(Library::ArgumentChecks::Direction::DIR_IN == library.getArgDirection(tokenList.front(), 1)); |
| 317 | ASSERT(Library::ArgumentChecks::Direction::DIR_OUT == library.getArgDirection(tokenList.front(), 2)); |
| 318 | ASSERT(Library::ArgumentChecks::Direction::DIR_INOUT == library.getArgDirection(tokenList.front(), 3)); |
| 319 | ASSERT(Library::ArgumentChecks::Direction::DIR_UNKNOWN == library.getArgDirection(tokenList.front(), 4)); |
| 320 | } |
| 321 | |
| 322 | void function_arg_valid() const { |
| 323 | constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n" |
nothing calls this directly
no test coverage detected