本文整理汇总了C++中ProjectDatabase::timestampCreate方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectDatabase::timestampCreate方法的具体用法?C++ ProjectDatabase::timestampCreate怎么用?C++ ProjectDatabase::timestampCreate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProjectDatabase
的用法示例。
在下文中一共展示了ProjectDatabase::timestampCreate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: problem
TEST_F(ProjectFixture, WorkflowRecord_Base) {
ProjectDatabase database = getCleanDatabase("WorkflowRecord_Base");
EXPECT_EQ(database.timestampCreate(), database.timestampLast());
EXPECT_EQ(database.handle(), database.uuidLast());
openstudio::System::msleep(1000);
EXPECT_EQ(static_cast<unsigned>(0), WorkflowRecord::getWorkflowRecords(database).size());
openstudio::runmanager::Workflow rmWorkflow;
rmWorkflow.addJob(openstudio::runmanager::JobType::Null, "");
// Fake ProblemRecord so can test WorkflowRecord
Problem problem("Dummy",WorkflowStepVector());
ProblemRecord problemRecord = ProblemRecord::factoryFromProblem(problem,database);
WorkflowRecord workflowRecord(rmWorkflow, problemRecord, 0);
EXPECT_EQ("", workflowRecord.name());
EXPECT_EQ("", workflowRecord.displayName());
EXPECT_EQ("", workflowRecord.description());
EXPECT_TRUE(workflowRecord.timestampCreate() > database.timestampCreate());
EXPECT_EQ(workflowRecord.timestampCreate(), workflowRecord.timestampLast());
EXPECT_EQ(workflowRecord.handle(), rmWorkflow.uuid());
EXPECT_EQ(database.timestampLast(), database.timestampCreate());
EXPECT_EQ(database.handle(), database.uuidLast());
openstudio::System::msleep(1000);
database.save();
EXPECT_TRUE(database.timestampLast() > database.timestampCreate());
EXPECT_NE(database.handle(), database.uuidLast());
DateTime databaseTimestampLast = database.timestampLast();
UUID databaseUUIDLast = database.uuidLast();
openstudio::System::msleep(1000);
database.save();
EXPECT_EQ(database.timestampLast(), databaseTimestampLast);
EXPECT_EQ(database.uuidLast(), databaseUUIDLast);
EXPECT_EQ(static_cast<unsigned>(1), WorkflowRecord::getWorkflowRecords(database).size());
EXPECT_EQ(database.timestampLast(), databaseTimestampLast);
EXPECT_EQ(database.uuidLast(), databaseUUIDLast);
EXPECT_EQ(workflowRecord.timestampCreate(), workflowRecord.timestampLast());
EXPECT_EQ(workflowRecord.handle(), rmWorkflow.uuid());
EXPECT_TRUE(workflowRecord.setDescription("A simple workflowRecord"));
EXPECT_EQ(database.timestampLast(), databaseTimestampLast);
EXPECT_EQ(database.uuidLast(), databaseUUIDLast);
EXPECT_TRUE(workflowRecord.timestampCreate() < workflowRecord.timestampLast());
EXPECT_NE(workflowRecord.handle(), workflowRecord.uuidLast());
openstudio::System::msleep(1000);
database.save();
EXPECT_TRUE(databaseTimestampLast < database.timestampLast());
EXPECT_NE(database.uuidLast(), databaseUUIDLast);
EXPECT_TRUE(workflowRecord.timestampCreate() < workflowRecord.timestampLast());
EXPECT_NE(workflowRecord.handle(), workflowRecord.uuidLast());
databaseTimestampLast = database.timestampLast();
databaseUUIDLast = database.uuidLast();
DateTime workflowTimestampLast = workflowRecord.timestampLast();
UUID workflowUUIDLast = workflowRecord.uuidLast();
EXPECT_EQ(static_cast<unsigned>(1), WorkflowRecord::getWorkflowRecords(database).size());
EXPECT_EQ(database.timestampLast(), databaseTimestampLast);
EXPECT_EQ(database.uuidLast(), databaseUUIDLast);
EXPECT_EQ(workflowRecord.timestampLast(), workflowTimestampLast);
EXPECT_EQ(workflowRecord.uuidLast(), workflowUUIDLast);
EXPECT_TRUE(database.removeRecord(workflowRecord));
EXPECT_EQ(static_cast<unsigned>(0), WorkflowRecord::getWorkflowRecords(database).size());
EXPECT_EQ(database.timestampLast(), databaseTimestampLast);
EXPECT_EQ(database.uuidLast(), databaseUUIDLast);
EXPECT_EQ(workflowTimestampLast, workflowRecord.timestampLast());
EXPECT_EQ(workflowUUIDLast, workflowRecord.uuidLast());
openstudio::System::msleep(1000);
database.save();
EXPECT_TRUE(databaseTimestampLast < database.timestampLast());
EXPECT_NE(database.uuidLast(), databaseUUIDLast);
EXPECT_EQ(workflowTimestampLast, workflowRecord.timestampLast());
EXPECT_EQ(workflowUUIDLast, workflowRecord.uuidLast());
}