https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: c449fe1369347d617d50f25f0dd81fc7294f8fad authored by Dmitri Naumov on 09 March 2021, 13:48:03 UTC
[T/RM] Relax tolerances for failing CI job.
Tip revision: c449fe1
TestFilePathStringManipulation.cpp
/**
 * \file
 * \author
 * \date
 * \brief
 *
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 */

#include "gtest/gtest.h"

#include "BaseLib/FileTools.h"

#ifdef WIN32
TEST(BaseLib, CopyPathToFileNameWin)
{
    ASSERT_EQ("extend\\file", BaseLib::copyPathToFileName("file", "extend"));
    ASSERT_EQ("path\\file",
              BaseLib::copyPathToFileName("path\\file", "extend"));
    ASSERT_EQ("extend\\file", BaseLib::copyPathToFileName("file", "extend\\"));
    ASSERT_EQ("path\\file",
              BaseLib::copyPathToFileName("path\\file", "extend\\"));
    ASSERT_EQ("extend\\smth\\file",
              BaseLib::copyPathToFileName("file", "extend\\smth"));
    ASSERT_EQ("path\\file",
              BaseLib::copyPathToFileName("path\\file", "extend\\smth"));
}
#else
TEST(BaseLib, CopyPathToFileNameUnix)
{
    ASSERT_EQ("extend/file", BaseLib::copyPathToFileName("file", "extend"));
    ASSERT_EQ("path/file",
              BaseLib::copyPathToFileName("path/file", "extend"));
    ASSERT_EQ("extend/file", BaseLib::copyPathToFileName("file", "extend/"));
    ASSERT_EQ("path/file", BaseLib::copyPathToFileName("path/file", "extend/"));

    ASSERT_EQ("extend/smth/file",
              BaseLib::copyPathToFileName("file", "extend/smth"));
    ASSERT_EQ("path/file",
              BaseLib::copyPathToFileName("path/file", "extend/smth"));
}
#endif
back to top