blob: 5619bc1e035fa309805ca0b7158003579f0d7225 [file] [log] [blame]
// Copyright 2015 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include <base/location.h>
namespace chromeos_dbus_bindings {
namespace test_utils {
// Helper macro to call ExpectTextContained().
#define EXPECT_TEXT_CONTAINED(expected, actual) \
ExpectTextContained(FROM_HERE, expected, #expected, actual, #actual)
// Checks that the text |actual_str| is contained in the text |expected_str| and
// fails the current test if not. If the |actual_str| text is not contained, a
// meaningful line diff between |actual_str| and |expected_str| is displayed in
// stderr. Use this function instead of EXPECT_EQ() when the compared values are
// long texts.
void ExpectTextContained(const tracked_objects::Location& from_here,
const std::string& expected_str,
const std::string& expected_expr,
const std::string& actual_str,
const std::string& actual_expr);
} // namespace test_utils
} // namespace chromeos_dbus_bindings