()
| 398 | |
| 399 | |
| 400 | def test_FunctionChain(): |
| 401 | |
| 402 | f1 = Function("void f1(){}") |
| 403 | f2 = Function("void f2(){}") |
| 404 | f3 = Function("float f3(vec3 x){}") |
| 405 | f4 = Function("vec3 f4(vec3 y){}") |
| 406 | f5 = Function("vec3 f5(vec4 z){}") |
| 407 | |
| 408 | ch = FunctionChain('chain', [f1, f2]) |
| 409 | assert ch.name == 'chain' |
| 410 | assert ch.args == [] |
| 411 | assert ch.rtype == 'void' |
| 412 | |
| 413 | assert_in('f1', ch.compile()) |
| 414 | assert_in('f2', ch.compile()) |
| 415 | |
| 416 | ch.remove(f2) |
| 417 | assert_not_in('f2', ch.compile()) |
| 418 | |
| 419 | ch.append(f2) |
| 420 | assert_in('f2', ch.compile()) |
| 421 | |
| 422 | ch = FunctionChain(funcs=[f5, f4, f3]) |
| 423 | assert_equal('float', ch.rtype) |
| 424 | assert_equal([('vec4', 'z')], ch.args) |
| 425 | assert_in('f3', ch.compile()) |
| 426 | assert_in('f4', ch.compile()) |
| 427 | assert_in('f5', ch.compile()) |
| 428 | assert_in(f3, ch.dependencies()) |
| 429 | assert_in(f4, ch.dependencies()) |
| 430 | assert_in(f5, ch.dependencies()) |
| 431 | |
| 432 | |
| 433 | def test_StatementList(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…