Commit 51954d8f authored by Kirill Katsnelson's avatar Kirill Katsnelson
Browse files

trunk: Compilation fix for a Windows-only KALDI_CYGWIN_COMPAT mode test


git-svn-id: https://svn.code.sf.net/p/kaldi/code/trunk@5236 5e6a8d80-dfce-4ca6-a32a-6e07a63d50c8
parent c048bd7e
...@@ -299,19 +299,19 @@ void UnitTestIoStandard() { ...@@ -299,19 +299,19 @@ void UnitTestIoStandard() {
// This is Windows-specific. // This is Windows-specific.
void UnitTestNativeFilename() { void UnitTestNativeFilename() {
#ifdef _MSC_VER #ifdef KALDI_CYGWIN_COMPAT
extern std::string map_os_path(const std::string &filename); extern std::string MapCygwinPath(const std::string &filename);
KALDI_ASSERT(map_os_path("") == ""); KALDI_ASSERT(MapCygwinPath("") == "");
KALDI_ASSERT(map_os_path(".") == "."); KALDI_ASSERT(MapCygwinPath(".") == ".");
KALDI_ASSERT(map_os_path("..") == ".."); KALDI_ASSERT(MapCygwinPath("..") == "..");
KALDI_ASSERT(map_os_path("/dev/null")[0] != '/'); KALDI_ASSERT(MapCygwinPath("/dev/null")[0] != '/');
KALDI_ASSERT(map_os_path("/tmp")[1] == ':'); KALDI_ASSERT(MapCygwinPath("/tmp")[1] == ':');
KALDI_ASSERT(map_os_path("/tmp/")[1] == ':'); KALDI_ASSERT(MapCygwinPath("/tmp/")[1] == ':');
KALDI_ASSERT(map_os_path("/tmp/foo")[1] == ':'); KALDI_ASSERT(MapCygwinPath("/tmp/foo")[1] == ':');
KALDI_ASSERT(map_os_path("/cygdrive/c") == "c:/"); KALDI_ASSERT(MapCygwinPath("/cygdrive/c") == "c:/");
KALDI_ASSERT(map_os_path("/cygdrive/c/") == "c:/"); KALDI_ASSERT(MapCygwinPath("/cygdrive/c/") == "c:/");
KALDI_ASSERT(map_os_path("/cygdrive/c/foo") == "c:/foo"); KALDI_ASSERT(MapCygwinPath("/cygdrive/c/foo") == "c:/foo");
#endif #endif
} }
......
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