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

Function GetOneFile

test/UnitTests/GitTest.cpp:1427–1440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1425}
1426
1427static void GetOneFile(CGit& m_Git)
1428{
1429 CString tmpFile = GetTempFile();
1430 ASSERT_STRNE(L"", tmpFile);
1431 EXPECT_EQ(0, m_Git.GetOneFile(L"b9ef30183497cdad5c30b88d32dc1bed7951dfeb", CTGitPath(L"utf8-nobom.txt"), tmpFile));
1432 CString fileContents;
1433 EXPECT_EQ(true, CStringUtils::ReadStringFromTextFile(tmpFile, fileContents));
1434 struct _stat32 stat_buf = { 0 };
1435 EXPECT_EQ(0, _wstat32(tmpFile, &stat_buf));
1436 EXPECT_EQ(139, stat_buf.st_size);
1437 EXPECT_EQ(108, fileContents.GetLength());
1438 EXPECT_STREQ(L"ä#äf34ööcöä߀9875oe\r\nfgdjkglsfdg\r\nöäöü45g\r\nfdgi&§$%&hfdsgä\r\nä#äf34öööä߀9875oe\r\nöäcüpfgmfdg\r\n€fgfdsg\r\n45\r\näü", fileContents);
1439 ::DeleteFile(tmpFile);
1440}
1441
1442static void GetOneFile_utf8(CGit& m_Git)
1443{

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