Skip to content

Commit

Permalink
Enable table I/O test, passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
kkm authored and kkm000 committed May 12, 2015
1 parent 369b3f6 commit 0a17a84
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
9 changes: 1 addition & 8 deletions src/base/kaldi-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,10 @@ void Sleep(float seconds);


// Makes copy constructor and operator= private. Same as in compat.h of OpenFst
// toolkit. If using VS, for which this results in compilation errors, we
// do it differently.

#if defined(_MSC_VER)
#define KALDI_DISALLOW_COPY_AND_ASSIGN(type) \
void operator = (const type&)
#else
// toolkit.
#define KALDI_DISALLOW_COPY_AND_ASSIGN(type) \
type(const type&); \
void operator = (const type&)
#endif

template<bool B> class KaldiCompileTimeAssert { };
template<> class KaldiCompileTimeAssert<true> {
Expand Down
9 changes: 2 additions & 7 deletions src/util/kaldi-table-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#include "util/kaldi-table.h"
#include "util/kaldi-holder.h"
#include "util/table-types.h"
#ifndef _MSC_VER
#include <unistd.h> // for sleep.
#endif

namespace kaldi {

Expand Down Expand Up @@ -60,13 +57,12 @@ void UnitTestReadScriptFile() {
// suppress the warning since I already checked it's OK.
KALDI_ASSERT(!ReadScriptFile(ss, false, &script));
}
#ifndef _MSC_VER
{
Output ko("| gzip -c > tmpf.gz", false); // text mode.
ko.Stream() << "a b\n";
ko.Close();
std::vector<pr> script;
sleep(1); // This test does not work without this sleep:
Sleep(1); // This test does not work without this sleep:
bool ans = ReadScriptFile("gunzip -c tmpf.gz |", true, &script);
KALDI_ASSERT(ans);
std::vector<pr> script2;
Expand All @@ -80,14 +76,13 @@ void UnitTestReadScriptFile() {
ko.Stream() << "a b\n";
bool ans = ko.Close();
KALDI_ASSERT(ans);
sleep(1); // This test does not work without this sleep:
Sleep(1); // This test does not work without this sleep:
// seems to be some kind of file-system latency.
std::vector<pr> script;
ans = ReadScriptFile("gunzip -c tmpf.gz |", false, &script);
KALDI_ASSERT(!ans);
}
unlink("tmpf.gz");
#endif
}


Expand Down

0 comments on commit 0a17a84

Please sign in to comment.