当前位置: 首页>>代码示例>>C++>>正文


C++ SCXHandle::Get方法代码示例

本文整理汇总了C++中scxcorelib::SCXHandle::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ SCXHandle::Get方法的具体用法?C++ SCXHandle::Get怎么用?C++ SCXHandle::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scxcorelib::SCXHandle的用法示例。


在下文中一共展示了SCXHandle::Get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TestSetFilename

    void TestSetFilename(void)
    {
        // Check that only file name is changed.
        m_path->SetFilename(L"new.file");
#if defined(WIN32)
        CPPUNIT_ASSERT(m_path->Get() == L"some\\path\\new.file");
#else
        CPPUNIT_ASSERT(m_path->Get() == L"some/path/new.file");
#endif
        m_path->SetFilename(L"");
        // Check that empty filename removes filename...
        CPPUNIT_ASSERT(m_path->GetFilename() == L"");
        // ...but not directory
#if defined(WIN32)
        CPPUNIT_ASSERT(m_path->GetDirectory() == L"some\\path\\");
#else
        CPPUNIT_ASSERT(m_path->GetDirectory() == L"some/path/");
#endif

        // Check correct exception thrown when adding folder separators in file name.
        SCXUNIT_RESET_ASSERTION();
        CPPUNIT_ASSERT_THROW(m_path->SetFilename(L"not/valid"), SCXCoreLib::SCXInvalidArgumentException);
        SCXUNIT_ASSERTIONS_FAILED(2); // both in append function and in SCXInvalidArgumentException constructor
        CPPUNIT_ASSERT_THROW(m_path->SetFilename(L"not\\valid"), SCXCoreLib::SCXInvalidArgumentException);
        SCXUNIT_ASSERTIONS_FAILED(2); // both in append function and in SCXInvalidArgumentException constructor
    }
开发者ID:Microsoft,项目名称:pal,代码行数:26,代码来源:scxfilepath_test.cpp

示例2: TestAssign

    void TestAssign(void)
    {
        SCXCoreLib::SCXFilePath fp = *m_path;

        // Check may assign to itself.
        CPPUNIT_ASSERT_NO_THROW(*m_path = *m_path);
        // Check content after assign operation is equal.
        CPPUNIT_ASSERT(fp.Get() == m_path->Get());
    }
开发者ID:Microsoft,项目名称:pal,代码行数:9,代码来源:scxfilepath_test.cpp

示例3: TestCompare

    void TestCompare(void)
    {
        SCXCoreLib::SCXFilePath fp1 = *m_path;
        SCXCoreLib::SCXFilePath fp2 = m_path->Get();
        SCXCoreLib::SCXFilePath fp3 = *m_directory;
        SCXCoreLib::SCXFilePath fp4 = *m_file;

        // Check compare operators to match content.
        CPPUNIT_ASSERT(fp1 == fp2);
        CPPUNIT_ASSERT(fp3 == *m_directory);
        CPPUNIT_ASSERT(fp4 == *m_file);
        CPPUNIT_ASSERT(fp1 != fp3);
        CPPUNIT_ASSERT(fp1 != fp4);
        CPPUNIT_ASSERT(fp3 != fp4);
    }
开发者ID:Microsoft,项目名称:pal,代码行数:15,代码来源:scxfilepath_test.cpp

示例4: TestAppendDirectory

    void TestAppendDirectory(void)
    {
        // Test appending to empty folder.
        m_file->AppendDirectory(L"/some\\append/");
        // Test appending folder without trailing folder separator.
        m_directory->AppendDirectory(L"some_append");
        // Test removing starting folder separators and adding trailing folder separator.
        m_path->AppendDirectory(L"/some/append");
#if defined(WIN32)
        CPPUNIT_ASSERT(m_file->Get() == L"\\some\\append\\file");
        CPPUNIT_ASSERT(m_directory->Get() == L"dir\\some_append\\");
        CPPUNIT_ASSERT(m_path->Get() == L"some\\path\\some\\append\\file.ext");
#else
        CPPUNIT_ASSERT(m_file->Get() == L"/some/append/file");
        CPPUNIT_ASSERT(m_directory->Get() == L"dir/some_append/");
        CPPUNIT_ASSERT(m_path->Get() == L"some/path/some/append/file.ext");
#endif
    }
开发者ID:Microsoft,项目名称:pal,代码行数:18,代码来源:scxfilepath_test.cpp


注:本文中的scxcorelib::SCXHandle::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。