let count results f =
  List.fold_left
    (fun count (_, test_result, _) -> 
       if f test_result then count + 1 else count)
    0 results