'Checks if the given count vectors match the given expected data.
:param conditions: String indicating which condition(s) to use (will
be fed to
ClangCountingConditions.counting_condition)
:param function:   String indicating which function from test file to
use. (i.e. "used(int, int)")
:param expected:   Dict with python lists of counts for all variables.'

def check_counting_condition(self, conditions, function, expected):

    counter = ClangCountVectorCreator(ClangCountingConditions.counting_condition(Setting('irrelevant', conditions)))
    vectors = counter.get_vectors_for_file(self.testfile)
    actual = vectors[function]
    self.assertEqual(len(actual), len(expected), ('Actual    dict:    ' + str(actual)))
    self.assertEqual(sorted(actual.keys()), sorted(expected.keys()))
    for variable in actual:
        self.assertEqual(actual[variable].count_vector, expected[variable], "Variable    '{}'    doesnt    match.".format(variable))
