Exemple #1
0
void test_assert_function(Block* block, int line, const char* file)
{
    if (!block_check_invariants_print_result(block, std::cout)) {
        std::cout << "Block failed invariant check in " << file << ", line " << line << std::endl;
        declare_current_test_failed();
    }

    List errors;
    check_for_static_errors(&errors, block);
    if (!errors.empty()) {
        std::cout << "Block has static errors at " << file << ", line " << line << std::endl;
        print_static_errors_formatted(&errors, std::cout);
        declare_current_test_failed();
    }
}
Exemple #2
0
void test_assert_function(Block* block, int line, const char* file)
{
    Value str;
    if (!block_check_invariants_print_result(block, &str)) {
        std::cout << as_cstring(&str) << std::endl;
        std::cout << "Block failed invariant check in " << file << ", line " << line << std::endl;
        declare_current_test_failed();
    }

    Value errors;
    check_for_static_errors(&errors, block);
    if (!errors.isEmpty()) {
        std::cout << "Block has static errors at " << file << ", line " << line << std::endl;
        print_static_errors_formatted(&errors, &str);
        std::cout << as_cstring(&str) << std::endl;
        declare_current_test_failed();
    }
}