MCPcopy Create free account
hub / github.com/TortoiseGit/TortoiseGit / GetOneFile_utf8

Function GetOneFile_utf8

test/UnitTests/GitTest.cpp:1442–1455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1440}
1441
1442static void GetOneFile_utf8(CGit& m_Git)
1443{
1444 CString tmpFile = GetTempFile();
1445 ASSERT_STRNE(L"", tmpFile);
1446 EXPECT_EQ(0, m_Git.GetOneFile(L"4c5c93d2a0b368bc4570d5ec02ab03b9c4334d44", CTGitPath(L"newfiles2 - Cöpy.txt"), tmpFile));
1447 CString fileContents;
1448 EXPECT_EQ(true, CStringUtils::ReadStringFromTextFile(tmpFile, fileContents));
1449 struct _stat32 stat_buf {};
1450 EXPECT_EQ(0, _wstat32(tmpFile, &stat_buf));
1451 EXPECT_EQ(14, stat_buf.st_size);
1452 EXPECT_EQ(14, fileContents.GetLength());
1453 EXPECT_STREQ(L"more new stuff", fileContents);
1454 ::DeleteFile(tmpFile);
1455}
1456
1457TEST_P(CBasicGitWithTestRepoFixture, GetOneFile)
1458{

Callers 1

TEST_PFunction · 0.85

Calls 4

GetTempFileFunction · 0.85
GetOneFileMethod · 0.80
CTGitPathClass · 0.50
GetLengthMethod · 0.45

Tested by

no test coverage detected