kaldi-error-test.cc File Reference
Include dependency graph for kaldi-error-test.cc:

Go to the source code of this file.

Namespaces

 kaldi
 This code computes Goodness of Pronunciation (GOP) and extracts phone-level pronunciation feature for mispronunciations detection tasks, the reference:
 

Functions

void MyFunction2 ()
 
void MyFunction1 ()
 
void UnitTestError ()
 
void VerifySymbolRange (const std::string &trace, const bool want_found, const std::string &want_symbol)
 
void TestLocateSymbolRange ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 71 of file kaldi-error-test.cc.

References KALDI_ASSERT, KaldiFatalError::KaldiMessage(), kaldi::SetProgramName(), kaldi::TestLocateSymbolRange(), and kaldi::UnitTestError().

71  {
73 
74  kaldi::SetProgramName("/foo/bar/kaldi-error-test");
75  try {
77  KALDI_ASSERT(0); // should not happen.
78  exit(1);
79  } catch (kaldi::KaldiFatalError &e) {
80  std::cout << "The error we generated was: '" << e.KaldiMessage() << "'\n";
81  }
82 }
void SetProgramName(const char *basename)
Called by ParseOptions to set base name (no directory) of the executing program.
Definition: kaldi-error.cc:50
Kaldi fatal runtime error exception.
Definition: kaldi-error.h:89
void TestLocateSymbolRange()
const char * KaldiMessage() const
Returns the Kaldi error message logged by KALDI_ERR.
Definition: kaldi-error.h:101
void UnitTestError()
#define KALDI_ASSERT(cond)
Definition: kaldi-error.h:185