• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pcu_check_true函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中pcu_check_true函数的典型用法代码示例。如果您正苦于以下问题:C++ pcu_check_true函数的具体用法?C++ pcu_check_true怎么用?C++ pcu_check_true使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pcu_check_true函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SetSuite_TestUnion

void SetSuite_TestUnion( SetSuiteData* data ) {
   Set*        setC=NULL;
   unsigned    int_I;

   pcu_docstring( "Checks that the Union of two overlapping sets results in a new set that "
      "contains correct Union of set elements." );

   for( int_I = NUM_ITEMS*1/4; int_I < NUM_ITEMS*5/8; int_I++ ) {
      Set_Insert( data->setA, &int_I );
   }
   for( int_I = NUM_ITEMS*3/8; int_I < NUM_ITEMS*3/4; int_I++ ) {
      Set_Insert( data->setB, &int_I );
   }

   setC = (Set*)Set_Union( data->setA, data->setB );
   Set_Traverse( setC, markArray, data );
   
   for( int_I = 0; int_I < NUM_ITEMS*1/4; int_I++ ) {
      pcu_check_true( data->inSet[int_I] == False );
   }
   for( int_I = NUM_ITEMS*1/4; int_I < NUM_ITEMS*3/4; int_I++ ) {
      pcu_check_true( data->inSet[int_I] == True );
   }
   for( int_I = NUM_ITEMS*3/4; int_I < NUM_ITEMS; int_I++ ) {
      pcu_check_true( data->inSet[int_I] == False );
   }
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:27,代码来源:SetSuite.c


示例2: Variable_RegisterSuite_TestAddGet

void Variable_RegisterSuite_TestAddGet( Variable_RegisterSuiteData* data ) {
   Variable*		var[10];
   #define ARRAY_SIZE	4
   #define STRUCT_SIZE	4
   double			array[ARRAY_SIZE];
   Index			   arraySize = ARRAY_SIZE;
   char*			   name[10] = {"testVar0", "testVar1", "testVar2", "testVar3",
                  "testVar4", "testVar5", "testVar6", "testVar7",
                  "testVar8", "testVar9"};
   Index		   	i;

   for (i = 0; i < 10; i++) {
      var[i] = Variable_NewVector( name[i], NULL, Variable_DataType_Double, 4, &arraySize, NULL, (void**)&array, 0 );
   }

   for (i = 0; i < 10; i++)
   {
      Variable_Register_Add(data->reg, var[i]);
   }

   for (i = 0; i < 10; i++) {
      pcu_check_true( i == Variable_Register_GetIndex(data->reg, name[i]));
   }

   for (i = 0; i < 10; i++) {
      pcu_check_true( var[i] == Variable_Register_GetByName(data->reg, name[i]));
   }

   for (i = 0; i < 10; i++) {
      Stg_Class_Delete(var[i]);
   }
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:32,代码来源:Variable_RegisterSuite.c


示例3: ProgressSuite_TestSetStream

void ProgressSuite_TestSetStream( ProgressSuiteData* data ) {
   Progress_SetStream( data->prog, NULL );
   pcu_check_true( data->prog->strm == NULL );
   Progress_SetStream( data->prog, (Stream*)1 );
   pcu_check_true( data->prog->strm == (void*)1 );
   Progress_SetStream( data->prog, NULL );
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:7,代码来源:ProgressSuite.c


示例4: ElementCellLayoutSuite_TestElementCellLayout

void ElementCellLayoutSuite_TestElementCellLayout( ElementCellLayoutSuiteData* data ) {
   int                 procToWatch = data->nProcs > 1 ? 1 : 0;
   Cell_Index          cell;
   Element_DomainIndex element;
   GlobalParticle      testParticle;
      
   if( data->rank == procToWatch ) {
      for( element = 0; element < Mesh_GetLocalSize( data->mesh, data->nDims ); element++ ) {
         Cell_PointIndex   count;
         Cell_Points       cellPoints;
   
         cell = CellLayout_MapElementIdToCellId( data->elementCellLayout, element );

         pcu_check_true( cell == element );

         count = data->elementCellLayout->_pointCount( data->elementCellLayout, cell );
         cellPoints = Memory_Alloc_Array( Cell_Point, count, "cellPoints" );
         /* for the element cell layout, the elements map to cells as 1:1, as such the "points" which define the cell as the
          * same as the "nodes" which define the element */
         data->elementCellLayout->_initialisePoints( data->elementCellLayout, cell, count, cellPoints );

         testParticle.coord[0] = ( (cellPoints[0])[0] + (cellPoints[1])[0] ) / 2;
         testParticle.coord[1] = ( (cellPoints[0])[1] + (cellPoints[2])[1] ) / 2;
         testParticle.coord[2] = ( (cellPoints[0])[2] + (cellPoints[4])[2] ) / 2;
         pcu_check_true( CellLayout_IsInCell( data->elementCellLayout, cell, &testParticle ) );

         testParticle.coord[0] = (cellPoints[count-2])[0] + 1;
         testParticle.coord[1] = (cellPoints[count-2])[1] + 1;
         testParticle.coord[2] = (cellPoints[count-2])[2] + 1;
         pcu_check_true( !CellLayout_IsInCell( data->elementCellLayout, cell, &testParticle ) );

         Memory_Free( cellPoints );
      }
   }
}
开发者ID:AngelValverdePerez,项目名称:underworld2,代码行数:35,代码来源:ElementCellLayoutSuite.c


示例5: MemoryPoolSuite_TestIllegalDeallocation

void MemoryPoolSuite_TestIllegalDeallocation( MemoryPoolSuiteData* data ) {
   Plane*      p = NULL;
   int         i = 0;
   Bool        passed = False;
   int         objCounter = 0;
   int*        junkRefs[CACHE_SIZE];
   int         testData[CACHE_SIZE];

   for( i=0; i<CACHE_SIZE; i++ ){
      p = NULL;
      p = MemoryPool_NewObject( Plane, data->pool );
      objCounter++;
      data->planeRefs[i] = p;
   }

   passed = True;
   for( i=0; i<CACHE_SIZE; i++ ){
      junkRefs[i] = &testData[i];
   }

   for( i=0; i<CACHE_SIZE/4; i++ ){
      junkRefs[i] = (int*)(junkRefs+i+1);
      pcu_check_true(False == MemoryPool_DeleteObject( data->pool, junkRefs[i] ));
   }

   pcu_check_true( data->pool->numInitialElements == CACHE_SIZE );
   pcu_check_true( data->pool->numElements == CACHE_SIZE );
   pcu_check_true( data->pool->numElementsFree == 0 );
   pcu_check_true( data->pool->numMemChunks == 1 );
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:30,代码来源:MemoryPoolSuite.c


示例6: MemoryPoolSuite_TestDeallocation

void MemoryPoolSuite_TestDeallocation( MemoryPoolSuiteData* data ) {
   Plane*      p = NULL;
   int         i = 0;
   Bool        passed = False;
   int         objCounter = 0;

   passed = True;

   for( i=0; i<CACHE_SIZE; i++ ){
      p = NULL;
      p = MemoryPool_NewObject( Plane, data->pool );
      objCounter++;
      data->planeRefs[i] = p;
   }

   for( i=0; i<CACHE_SIZE; i++ ){
      if(False == MemoryPool_DeleteObject( data->pool, data->planeRefs[i] )){
         passed = False;
         break;
      }
   }
   pcu_check_true( passed );

   pcu_check_true( data->pool->numInitialElements == CACHE_SIZE );
   pcu_check_true( data->pool->numElements == 0 );
   pcu_check_true( data->pool->numElementsFree == 0 );
   pcu_check_true( data->pool->numMemChunks == 0 );
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:28,代码来源:MemoryPoolSuite.c


示例7: IMapSuite_TestSetMaxSize

void IMapSuite_TestSetMaxSize( IMapSuiteData* data ) {
   IMap_SetMaxSize( data->iMap, 10 );
   pcu_check_true( data->iMap->maxSize == 10 );
   pcu_check_true( data->iMap->tblSize >= 10 );
   IMap_SetMaxSize( data->iMap, 20 );
   pcu_check_true( data->iMap->maxSize == 20 );
   pcu_check_true( data->iMap->tblSize >= 20 );
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:8,代码来源:IMapSuite.c


示例8: ProgressSuite_TestSetPrefix

void ProgressSuite_TestSetPrefix( ProgressSuiteData* data ) {
   Progress_SetPrefix( data->prog, NULL );
   pcu_check_true( data->prog->preStr == NULL );
   Progress_SetPrefix( data->prog, "foo" );
   pcu_check_streq( data->prog->preStr, "foo" );
   Progress_SetPrefix( data->prog, NULL );
   pcu_check_true( data->prog->preStr == NULL );
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:8,代码来源:ProgressSuite.c


示例9: ProgressSuite_TestSetTitle

void ProgressSuite_TestSetTitle( ProgressSuiteData* data ) {
   Progress_SetTitle( data->prog, NULL );
   pcu_check_true( data->prog->title == NULL );
   Progress_SetTitle( data->prog, "foo" );
   pcu_check_streq( data->prog->title, "foo" );
   Progress_SetTitle( data->prog, NULL );
   pcu_check_true( data->prog->title == NULL );
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:8,代码来源:ProgressSuite.c


示例10: STreeSuite_TestInsert

void STreeSuite_TestInsert( STreeSuiteData* data ) {
   int depth = 0, curDepth = 0;
   int i_i;

   for( i_i = 0; i_i < 15; i_i++ )
      STree_Insert( data->sTree, &i_i );
   pcu_check_true( STree_GetSize( data->sTree ) == 15 );
   pcu_check_true( (calcDepth( STree_GetRoot( data->sTree ), &curDepth, &depth), depth) == 4 );
}
开发者ID:AngelValverdePerez,项目名称:underworld2,代码行数:9,代码来源:STreeSuite.c


示例11: EscapedRoutineSuite_TestCompareParticles

void EscapedRoutineSuite_TestCompareParticles( EscapedRoutineSuiteData* data ) {
   unsigned pToRemoveList[3] = { 1, 4, 7 };

   /* This function is needed for sorting plists into order. Should just be based on value of ptrs, which
    *  implies position in particle array */
   pcu_check_true( _EscapedRoutine_CompareParticles( &pToRemoveList[0], &pToRemoveList[1] ) < 0 );
   pcu_check_true( _EscapedRoutine_CompareParticles( &pToRemoveList[2], &pToRemoveList[1] ) > 0 );
   pcu_check_true( _EscapedRoutine_CompareParticles( &pToRemoveList[1], &pToRemoveList[1] ) == 0 );
}
开发者ID:AngelValverdePerez,项目名称:underworld2,代码行数:9,代码来源:EscapedRoutineSuite.c


示例12: ProgressSuite_TestSetRange

void ProgressSuite_TestSetRange( ProgressSuiteData* data ) {
   Progress_SetRange( data->prog, 5, 10 );
   pcu_check_true( data->prog->start == 5 );
   pcu_check_true( data->prog->end == 10 );
   Progress_SetPrefix( data->prog, "foo" );
   pcu_check_streq( data->prog->preStr, "foo" );
   Progress_SetPrefix( data->prog, NULL );
   pcu_check_true( data->prog->preStr == NULL );
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:9,代码来源:ProgressSuite.c


示例13: DVCWeightsSuite_TestInitialiseStructs2D

void DVCWeightsSuite_TestInitialiseStructs2D( DVCWeightsSuiteData* data ) {
   unsigned int ii;   

   _DVCWeights_InitialiseStructs2D( &data->bchain2D, &data->pList2D, data->nump2D);

   for (ii = 0; ii < data->nump2D; ii++) {
      pcu_check_true( data->bchain2D[ii].new_claimed_cells_malloced == DVC_INC );
      pcu_check_true( data->bchain2D[ii].new_bound_cells_malloced == DVC_INC );
   }
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:10,代码来源:DVCWeightsSuite.c


示例14: ProgressSuite_TestCalcStatus

void ProgressSuite_TestCalcStatus( ProgressSuiteData* data ) {
   int ii;

   Progress_SetRange( data->prog, 0, 100 );
   pcu_check_true( data->prog->perc == 0 );
   for( ii = 0; ii < 99; ii++ ) {
      Progress_Increment( data->prog );
      pcu_check_true( data->prog->perc == ii );
   }
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:10,代码来源:ProgressSuite.c


示例15: ListSuite_TestClear

void ListSuite_TestClear( ListSuiteData* data ) {
   Index idx;

   for( idx = 0; idx < NUM_ITEMS; idx++ ) {
      List_Append( data->list, &data->arrayData[idx] );
   }
   List_Clear( data->list );
   pcu_check_true( data->list->nItems == 0 );
   List_Clear( data->list );
   pcu_check_true( data->list->nItems == 0 );
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:11,代码来源:ListSuite.c


示例16: IArraySuite_TestSet

void IArraySuite_TestSet( IArraySuiteData* data ) {
   const int* ptr;
   int i_i;

   IArray_Set( data->iArray, NUM_ITEMS, data->arrayData );
   pcu_check_true( IArray_GetSize( data->iArray ) == NUM_ITEMS );
   pcu_check_true( (ptr = IArray_GetPtr( data->iArray )) != 0 );
   for( i_i = 0; i_i < NUM_ITEMS; i_i++ ) {
      pcu_check_true( ptr[i_i] == i_i );
   }
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:11,代码来源:IArraySuite.c


示例17: DVCWeightsSuite_TestResetGrid2D

void DVCWeightsSuite_TestResetGrid2D( DVCWeightsSuiteData* data ) {
   unsigned int   i;
   
   _DVCWeights_ConstructGrid2D(&data->cells2D,data->numy,data->numx, BBXMIN,BBYMIN,BBXMAX,BBYMAX);
   _DVCWeights_ResetGrid2D(&data->cells2D,data->numx*data->numy);

   for ( i = 0; i < data->numx*data->numy; i++) {
      pcu_check_true( data->cells2D[i].p == -1 );
      pcu_check_true( data->cells2D[i].done == 0 );
   }
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:11,代码来源:DVCWeightsSuite.c


示例18: STreeSuite_TestHas

void STreeSuite_TestHas( STreeSuiteData* data ) {
   int i_i;

   for( i_i = 0; i_i < 15; i_i++ )
      STree_Insert( data->sTree, &i_i );
   for( i_i = 0; i_i < 15; i_i++ ) {
      pcu_check_true( STree_Has( data->sTree, &i_i ) );
   }
   for( i_i = 15; i_i < 30; i_i++ ) {
      pcu_check_true( !STree_Has( data->sTree, &i_i ) );
   }
}
开发者ID:AngelValverdePerez,项目名称:underworld2,代码行数:12,代码来源:STreeSuite.c


示例19: ListSuite_TestPrepend

void ListSuite_TestPrepend( ListSuiteData* data ) {
   Index idx;

   for( idx = 0; idx < NUM_ITEMS; idx++ ) {
      List_Prepend( data->list, &data->arrayData[idx] );
   }

   pcu_check_true( data->list->nItems == NUM_ITEMS );
   for( idx = 0; idx < NUM_ITEMS; idx++ ) {
      pcu_check_true( *(int*)List_GetItem( data->list, idx ) == ((NUM_ITEMS-1) - idx) );
   }
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:12,代码来源:ListSuite.c


示例20: IMapSuite_TestInsert

void IMapSuite_TestInsert( IMapSuiteData* data ) {
   int i_i;

   IMap_SetMaxSize( data->iMap, 10 );
   for( i_i = 0; i_i < 20; i_i += 2 ) {
      IMap_Insert( data->iMap, i_i, i_i + 100 );
   }
   pcu_check_assert( IMap_Insert( data->iMap, 0, 100 ) );
   pcu_check_true( IMap_GetSize( data->iMap ) == 10 );
   for( i_i = 0; i_i < 20; i_i += 2 ) {
      pcu_check_true( IMap_Has( data->iMap, i_i ) );
   }
}
开发者ID:OlympusMonds,项目名称:EarthByte_Underworld,代码行数:13,代码来源:IMapSuite.c



注:本文中的pcu_check_true函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pdMS_TO_TICKS函数代码示例发布时间:2022-05-30
下一篇:
C++ pcsl_string_free函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap