Commit 87779825 authored by Luke Halliwell's avatar Luke Halliwell Committed by Commit Bot

[Chromecast] Fix death test failures in official builds

CHECK macro strings are dropped in official builds to save space.

BUG=594632

Change-Id: Ic53faaa7480fa3c72a75e9af9c4a658cf05b4cc4
Reviewed-on: https://chromium-review.googlesource.com/530103Reviewed-by: default avatarStephen Lanham <slan@chromium.org>
Commit-Queue: Luke Halliwell <halliwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#478642}
parent c9bf7518
......@@ -131,7 +131,12 @@ class SlewVolumeBaseTest : public ::testing::Test {
};
TEST_F(SlewVolumeBaseTest, BadSampleRate) {
// String arguments aren't passed to CHECK() in official builds.
#if defined(OFFICIAL_BUILD) && defined(NDEBUG)
ASSERT_DEATH(slew_volume_->SetSampleRate(0), "");
#else
ASSERT_DEATH(slew_volume_->SetSampleRate(0), "sample_rate");
#endif
}
TEST_F(SlewVolumeBaseTest, BadSlewTime) {
......
......@@ -1137,14 +1137,24 @@ TEST_F(StreamMixerAlsaTest, InvalidStreamTypeCrashes) {
}
)json";
// String arguments aren't passed to CHECK() in official builds.
#if defined(OFFICIAL_BUILD) && defined(NDEBUG)
EXPECT_DEATH(StreamMixerAlsa::Get()->ResetPostProcessorsForTest(json), "");
#else
EXPECT_DEATH(StreamMixerAlsa::Get()->ResetPostProcessorsForTest(json),
"foobar is not a stream type");
#endif
}
TEST_F(StreamMixerAlsaTest, BadJsonCrashes) {
const std::string json("{{");
// String arguments aren't passed to CHECK() in official builds.
#if defined(OFFICIAL_BUILD) && defined(NDEBUG)
EXPECT_DEATH(StreamMixerAlsa::Get()->ResetPostProcessorsForTest(json), "");
#else
EXPECT_DEATH(StreamMixerAlsa::Get()->ResetPostProcessorsForTest(json),
"Invalid JSON");
#endif
}
TEST_F(StreamMixerAlsaTest, MultiplePostProcessorsInOneStream) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment