コード例 #1
0
ファイル: cpp_assertions.cpp プロジェクト: matthargett/cgreen
void assert_that_(const char *file, int line, const char *actual_string,
		const std::string& actual, Constraint* constraint) {

	// if they are using a string constraint, they are almost certainly meaning to do a deep comparison
	if (is_string_comparing(constraint)) {
		assert_that_(file, line, actual_string, (intptr_t) (actual.c_str()),
				constraint);
		return;
	}

	assert_that_(file, line, actual_string, (const std::string *) (&actual), constraint);
}
コード例 #2
0
bool is_comparing(const Constraint *constraint) {
    return is_string_comparing(constraint) ||
            is_content_comparing(constraint) ||
            is_double_comparing(constraint) ||
            constraint->type == VALUE_COMPARER;
}
コード例 #3
0
bool values_are_strings_in(const Constraint *constraint) {
    return is_string_comparing(constraint) && (constraint->expected_value != (intptr_t)NULL);
}