本文整理汇总了C++中CItemData::SetCTime方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemData::SetCTime方法的具体用法?C++ CItemData::SetCTime怎么用?C++ CItemData::SetCTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemData
的用法示例。
在下文中一共展示了CItemData::SetCTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void FileV3Test::SetUp()
{
fullItem.CreateUUID();
fullItem.SetTitle(title);
fullItem.SetPassword(password);
fullItem.SetUser(user);
fullItem.SetNotes(notes);
fullItem.SetGroup(group);
fullItem.SetURL(url);
fullItem.SetAutoType(at);
fullItem.SetEmail(email);
fullItem.SetPolicyName(polname);
fullItem.SetSymbols(symbols);
fullItem.SetRunCommand(runcmd);
fullItem.SetATime(aTime);
fullItem.SetCTime(cTime);
fullItem.SetXTime(xTime);
fullItem.SetPMTime(pmTime);
fullItem.SetRMTime(rmTime);
fullItem.SetDCA(iDCA);
fullItem.SetShiftDCA(iSDCA);
fullItem.SetKBShortcut(kbs);
smallItem.CreateUUID();
smallItem.SetTitle(_T("picollo"));
smallItem.SetPassword(_T("tiny-passw"));
}
示例2:
TEST_F(ItemDataTest, PasswordHistory)
{
size_t pwh_max, num_err;
PWHistList pwhl;
const StringX pw1(L"banana-0rchid");
const StringX pw2(L"banana-1rchid");
const StringX pw3(L"banana-2rchid");
const StringX pw4(L"banana-5rchid");
PWSprefs *prefs = PWSprefs::GetInstance();
prefs->SetPref(PWSprefs::SavePasswordHistory, true);
prefs->SetPref(PWSprefs::NumPWHistoryDefault, 3);
CItemData di;
di.SetCTime();
di.SetPassword(pw1); // first time must be Set, not Update!
di.UpdatePassword(pw2);
EXPECT_FALSE(di.GetPWHistory().empty());
EXPECT_TRUE(CreatePWHistoryList(di.GetPWHistory(), pwh_max, num_err,
pwhl, PWSUtil::TMC_ASC_UNKNOWN));
EXPECT_EQ(0, num_err);
EXPECT_EQ(3, pwh_max);
EXPECT_EQ(1, pwhl.size());
EXPECT_EQ(pw1, pwhl[0].password);
di.UpdatePassword(pw3);
EXPECT_TRUE(CreatePWHistoryList(di.GetPWHistory(), pwh_max, num_err,
pwhl, PWSUtil::TMC_ASC_UNKNOWN));
EXPECT_EQ(0, num_err);
EXPECT_EQ(3, pwh_max);
EXPECT_EQ(2, pwhl.size());
EXPECT_EQ(pw1, pwhl[0].password);
EXPECT_EQ(pw2, pwhl[1].password);
di.UpdatePassword(pw4);
EXPECT_TRUE(CreatePWHistoryList(di.GetPWHistory(), pwh_max, num_err,
pwhl, PWSUtil::TMC_ASC_UNKNOWN));
EXPECT_EQ(0, num_err);
EXPECT_EQ(3, pwh_max);
EXPECT_EQ(3, pwhl.size());
EXPECT_EQ(pw1, pwhl[0].password);
EXPECT_EQ(pw2, pwhl[1].password);
EXPECT_EQ(pw3, pwhl[2].password);
di.UpdatePassword(L"Last1");
EXPECT_TRUE(CreatePWHistoryList(di.GetPWHistory(), pwh_max, num_err,
pwhl, PWSUtil::TMC_ASC_UNKNOWN));
EXPECT_EQ(0, num_err);
EXPECT_EQ(3, pwh_max);
EXPECT_EQ(3, pwhl.size());
EXPECT_EQ(pw2, pwhl[0].password);
EXPECT_EQ(pw3, pwhl[1].password);
EXPECT_EQ(pw4, pwhl[2].password);
}
示例3: testAttFile
void FileV4Test::SetUp()
{
hdr.m_prefString = _T("aPrefString");
hdr.m_whenlastsaved = 1413129351; // overwritten in Open()
hdr.m_lastsavedby = _T("aUser");
hdr.m_lastsavedon = _T("aMachine");
hdr.m_whatlastsaved = _T("PasswordSafe test framework");
hdr.m_DB_Name = fname.c_str();
hdr.m_DB_Description = _T("Test the header's persistency");
fullItem.CreateUUID();
fullItem.SetTitle(title);
fullItem.SetPassword(password);
fullItem.SetUser(user);
fullItem.SetNotes(notes);
fullItem.SetGroup(group);
fullItem.SetURL(url);
fullItem.SetAutoType(at);
fullItem.SetEmail(email);
fullItem.SetSymbols(symbols);
fullItem.SetRunCommand(runcmd);
fullItem.SetATime(aTime);
fullItem.SetCTime(cTime);
fullItem.SetXTime(xTime);
fullItem.SetPMTime(pmTime);
fullItem.SetRMTime(rmTime);
fullItem.SetDCA(iDCA);
fullItem.SetShiftDCA(iSDCA);
smallItem.CreateUUID();
smallItem.SetTitle(_T("picollo"));
smallItem.SetPassword(_T("tiny-passw"));
attItem.CreateUUID();
attItem.SetTitle(L"I'm an attachment");
const stringT testAttFile(L"data/image1.jpg");
int status = attItem.Import(testAttFile);
ASSERT_EQ(PWSfile::SUCCESS, status);
}
示例4: SetUp
void ItemDataTest::SetUp()
{
fullItem.SetTitle(title);
fullItem.SetPassword(password);
fullItem.SetUser(user);
fullItem.SetNotes(notes);
fullItem.SetGroup(group);
fullItem.SetURL(url);
fullItem.SetAutoType(at);
fullItem.SetEmail(email);
fullItem.SetPolicyName(polname);
fullItem.SetSymbols(symbols);
fullItem.SetRunCommand(runcmd);
fullItem.SetATime(aTime);
fullItem.SetCTime(cTime);
fullItem.SetXTime(xTime);
fullItem.SetPMTime(pmTime);
fullItem.SetRMTime(rmTime);
fullItem.SetDCA(iDCA);
fullItem.SetShiftDCA(iSDCA);
fullItem.SetXTimeInt(xTimeInt);
fullItem.SetKBShortcut(kbs);
}