Files
codeql/csharp/ql/test/library-tests/statements/TryCatch3.ql
2018-12-20 10:19:59 +01:00

16 lines
411 B
Plaintext

/**
* @name Test for try catches
*/
import csharp
from Method m, TryStmt s
where
s.getEnclosingCallable() = m and
m.getName() = "MainTryThrow" and
count(s.getACatchClause().(GeneralCatchClause)) = 1 and
count(s.getACatchClause().(SpecificCatchClause)) = 1 and
s.getCatchClause(0) instanceof SpecificCatchClause and
s.getCatchClause(1) instanceof GeneralCatchClause
select s, s.getACatchClause()