Ассерты и контрактное программирование
void method_name(Foo foo, Bar bar) {
/* Не обязательно, Vala делает это за вас:
return_if_fail(foo != null);
return_if_fail(bar != null);
*/
}double method_name(int x, double d)
requires (x > 0 && x < 10)
requires (d >= 0.0 && d <= 1.0)
ensures (result >= 0.0 && result <= 10.0)
{
return d * x;
}Last updated
Was this helpful?