46 lines
801 B
C
46 lines
801 B
C
#include "../xtest.h"
|
|
#include "source.h"
|
|
|
|
void test_simple() {
|
|
xtest_expect_assertion_failure();
|
|
div(10, 0);
|
|
}
|
|
|
|
void test_no_failure() {
|
|
div(10,1);
|
|
}
|
|
|
|
void test_no_failure_2() {
|
|
div(10,2);
|
|
}
|
|
|
|
void test_will_fail() {
|
|
xtest_expect_assertion_failure();
|
|
div(10,1);
|
|
}
|
|
|
|
void test_will_fail_2() {
|
|
div(10,0);
|
|
}
|
|
|
|
void test_other_failure() {
|
|
xtest_expect_assertion_failure();
|
|
xtest_assert(0);
|
|
div(10, 0);
|
|
}
|
|
|
|
void example_expect_assertions() {
|
|
xtest_run(test_simple);
|
|
xtest_run(test_no_failure);
|
|
xtest_run(test_other_failure);
|
|
xtest_run(test_will_fail);
|
|
xtest_run(test_will_fail_2);
|
|
xtest_run(test_no_failure_2);
|
|
}
|
|
|
|
#ifndef XTEST_ALL_EXAMPLES
|
|
int main(int argc, char **argv) {
|
|
example_expect_assertions();
|
|
return xtest_complete();
|
|
}
|
|
#endif |