全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Assertion?

Definition 1.6 High School Computer Science · 第 1 章 — Specifications, Assertions and Tests

An assertion is a statement assert condition, message that evaluates the condition. If it is true, the program goes on; if it is false, the program stops with an AssertionError that carries the message.

在原文中阅读 →
Definition 7.10 University Computer Science — Year 1 · 第 7 章 — Modular Programs, Makefiles and Tests

An assertion is a condition that the programmer states must hold at a point of the program. In C, assert(cond) from <assert.h> evaluates cond; if it is false, it prints the condition, the file, the line and the function on standard error and stops the program with abort. If the macro NDEBUG is defined, every assert expands to nothing.

在原文中阅读 →