本文整理汇总了C++中OpenDDLExportMock类的典型用法代码示例。如果您正苦于以下问题:C++ OpenDDLExportMock类的具体用法?C++ OpenDDLExportMock怎么用?C++ OpenDDLExportMock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OpenDDLExportMock类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TEST_F
TEST_F( OpenDDLExportTest, writeValueArrayTest ) {
OpenDDLExportMock myExporter;
bool ok( true );
std::string statement;
ok = myExporter.writeValueArrayTester( ddl_nullptr, statement );
EXPECT_FALSE( ok );
EXPECT_TRUE( statement.empty() );
char token [] =
"float[ 3 ]\n"
"{\n"
" {1, 2, 3}\n"
"}\n";
size_t len( 0 );
char *end = findEnd( token, len );
DataArrayList *dataArrayList( ddl_nullptr );
Value::ValueType type;
char *in = OpenDDLParser::parsePrimitiveDataType( token, end, type, len );
ASSERT_EQ( Value::ddl_float, type );
ASSERT_EQ( 3U, len );
in = OpenDDLParser::parseDataArrayList( in, end, type, &dataArrayList );
ASSERT_FALSE( ddl_nullptr == dataArrayList );
ok = myExporter.writeValueArrayTester( dataArrayList, statement );
EXPECT_TRUE( ok );
EXPECT_EQ( "{ 1, 2, 3 }", statement );
delete dataArrayList;
}
示例2: TEST_F
TEST_F( OpenDDLExportTest, writeStringTest ) {
OpenDDLExportMock myExport;
Value *v = ValueAllocator::allocPrimData( Value::ddl_string );
v->setString( "huhu" );
bool ok( true );
std::string statement;
ok = myExport.writeValueTester( v, statement );
EXPECT_TRUE( ok );
EXPECT_EQ( "\"huhu\"", statement );
ValueAllocator::releasePrimData( &v );
}