voice_engine/test/auto_test/standard/file_before_streaming_test.cc
TEST_F(FileBeforeStreamingTest, TestStartPlayingFileLocallyWithStartPlayout) {
  GenerateInputFile();

  TEST_LOG("Playout is not started. File will not be played out.\n");
  EXPECT_EQ(0, voe_file_->StartPlayingFileLocally(
      channel_, input_filename_.c_str(), true));
  EXPECT_EQ(1, voe_file_->IsPlayingFileLocally(channel_));
  RecordOutput();
  VerifyEmptyOutput();

  TEST_LOG("Playout is now started. File will be played out.\n");
  EXPECT_EQ(0, voe_base_->StartPlayout(channel_));
  RecordOutput();
  VerifyOutput(kInputValue);

  TEST_LOG("Stop playing file. Only silence will be played out.\n");
  EXPECT_EQ(0, voe_file_->StopPlayingFileLocally(channel_));
  EXPECT_EQ(0, voe_file_->IsPlayingFileLocally(channel_));
  RecordOutput();
  VerifyOutput(kSilenceValue);

  TEST_LOG("Start playing file again. File will be played out.\n");
  EXPECT_EQ(0, voe_file_->StartPlayingFileLocally(
      channel_, input_filename_.c_str(), true));
  EXPECT_EQ(1, voe_file_->IsPlayingFileLocally(channel_));
  RecordOutput();
  VerifyOutput(kInputValue);

  EXPECT_EQ(0, voe_base_->StopPlayout(channel_));
  EXPECT_EQ(0, voe_file_->StopPlayingFileLocally(channel_));
}
// This test case is to ensure that StartPlayingFileLocally() and
// StartPlayout() can be called in any order.
// A DC signal is used as input. And the output of mixer is supposed to be:
// 1. the same DC signal if file is played out,
// 2. total silence if file is not played out,
// 3. no output if playout is not started.
This test case is to ensure that StartPlayingFileLocally() and
StartPlayout() can be called in any order.
A DC signal is used as input. And the output of mixer is supposed to be:
1. the same DC signal if file is played out,
2. total silence if file is not played out,
3. no output if playout is not started.
This test case is to ensure that StartPlayingFileLocally () and StartPlayout () can be called in any order . A DC signal is used as input . And the output of mixer is supposed to be : 1 . the same DC signal if file is played out 2 . total silence if file is not played out 3 . no output if playout is not started .
TEST_F(FileBeforeStreamingTest, TestStartPlayingFileLocallyWithStartPlayout) {
  GenerateInputFile();
  TEST_LOG("Playout is not started. File will not be played out.\n");
  EXPECT_EQ(0, voe_file_->StartPlayingFileLocally(
      channel_, input_filename_.c_str(), true));
  EXPECT_EQ(1, voe_file_->IsPlayingFileLocally(channel_));
  RecordOutput();
  VerifyEmptyOutput();
  TEST_LOG("Playout is now started. File will be played out.\n");
  EXPECT_EQ(0, voe_base_->StartPlayout(channel_));
  RecordOutput();
  VerifyOutput(kInputValue);
  TEST_LOG("Stop playing file. Only silence will be played out.\n");
  EXPECT_EQ(0, voe_file_->StopPlayingFileLocally(channel_));
  EXPECT_EQ(0, voe_file_->IsPlayingFileLocally(channel_));
  RecordOutput();
  VerifyOutput(kSilenceValue);
  TEST_LOG("Start playing file again. File will be played out.\n");
  EXPECT_EQ(0, voe_file_->StartPlayingFileLocally(
      channel_, input_filename_.c_str(), true));
  EXPECT_EQ(1, voe_file_->IsPlayingFileLocally(channel_));
  RecordOutput();
  VerifyOutput(kInputValue);
  EXPECT_EQ(0, voe_base_->StopPlayout(channel_));
  EXPECT_EQ(0, voe_file_->StopPlayingFileLocally(channel_));
}
TEST_F ( FileBeforeStreamingTest , TestStartPlayingFileLocallyWithStartPlayout ) { GenerateInputFile ( ) ; TEST_LOG ( " \n " ) ; EXPECT_EQ ( 0 , voe_file_ -> StartPlayingFileLocally ( channel_ , input_filename_ . c_str ( ) , true ) ) ; EXPECT_EQ ( 1 , voe_file_ -> IsPlayingFileLocally ( channel_ ) ) ; RecordOutput ( ) ; VerifyEmptyOutput ( ) ; TEST_LOG ( " \n " ) ; EXPECT_EQ ( 0 , voe_base_ -> StartPlayout ( channel_ ) ) ; RecordOutput ( ) ; VerifyOutput ( kInputValue ) ; TEST_LOG ( " \n " ) ; EXPECT_EQ ( 0 , voe_file_ -> StopPlayingFileLocally ( channel_ ) ) ; EXPECT_EQ ( 0 , voe_file_ -> IsPlayingFileLocally ( channel_ ) ) ; RecordOutput ( ) ; VerifyOutput ( kSilenceValue ) ; TEST_LOG ( " \n " ) ; EXPECT_EQ ( 0 , voe_file_ -> StartPlayingFileLocally ( channel_ , input_filename_ . c_str ( ) , true ) ) ; EXPECT_EQ ( 1 , voe_file_ -> IsPlayingFileLocally ( channel_ ) ) ; RecordOutput ( ) ; VerifyOutput ( kInputValue ) ; EXPECT_EQ ( 0 , voe_base_ -> StopPlayout ( channel_ ) ) ; EXPECT_EQ ( 0 , voe_file_ -> StopPlayingFileLocally ( channel_ ) ) ; }
This test case is to ensure that StartPlayingFileLocally() and
StartPlayout() can be called in any order.
This test case is to ensure that StartPlayingFileLocally () and StartPlayout () can be called in any order .