当前位置: 首页>>代码示例>>C++>>正文


C++ TEST_TYPE函数代码示例

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


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

示例1: do_test

static int
do_test (void)
{
  int result = 0;

#define TEST_TYPE(name) \
  printf ("%s: ", #name);						      \
  if (sizeof (name) != sizeof (((name *) 0)->__size))			      \
    {									      \
      printf ("expected %zu, is %zu\n",					      \
	      sizeof (((name *) 0)->__size), sizeof (name));		      \
      result = 1;							      \
    }									      \
  else									      \
    puts ("OK")

  TEST_TYPE (pthread_mutex_t);
  TEST_TYPE (pthread_cond_t);
  TEST_TYPE (pthread_rwlock_t);

#define TEST_TYPE2(name, internal)					      \
  printf ("%s: ", #name);						      \
  if (sizeof (((name *) 0)->__size) < sizeof (internal))		      \
    {									      \
      printf ("expected %zu, is %zu\n",					      \
	      sizeof (((name *) 0)->__size), sizeof (internal));	      \
      result = 1;							      \
    }									      \
  else									      \
    puts ("OK")

  TEST_TYPE2 (pthread_attr_t, struct pthread_attr);
  TEST_TYPE2 (pthread_mutexattr_t, struct pthread_mutexattr);
  TEST_TYPE2 (pthread_condattr_t, struct pthread_condattr);
  TEST_TYPE2 (pthread_rwlockattr_t, struct pthread_rwlockattr);
  TEST_TYPE2 (pthread_barrier_t, struct pthread_barrier);
  TEST_TYPE2 (pthread_barrierattr_t, struct pthread_barrierattr);
  TEST_TYPE2 (sem_t, struct new_sem);
  TEST_TYPE2 (sem_t, struct old_sem);

  for (size_t i = 0; i < sizeof (types) / sizeof (types[0]); ++i)
    if (types[i].expected != types[i].is)
      {
	printf ("%s: expected %zu, is %zu\n",
		types[i].name, types[i].expected, types[i].is);
	result = 1;
      }

  return result;
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:50,代码来源:tst-typesizes.c

示例2: test_pack_COMM_FAULT_OFFSETS

static void test_pack_COMM_FAULT_OFFSETS(void)
{
    /* COMM_FAULT_OFFSETS (pack 4) */
    TEST_TYPE(COMM_FAULT_OFFSETS, 4, 2);
    TEST_FIELD(COMM_FAULT_OFFSETS, short, CommOffset, 0, 2, 2);
    TEST_FIELD(COMM_FAULT_OFFSETS, short, FaultOffset, 2, 2, 2);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例3: test_pack_SCONTEXT_QUEUE

static void test_pack_SCONTEXT_QUEUE(void)
{
    /* SCONTEXT_QUEUE (pack 4) */
    TEST_TYPE(SCONTEXT_QUEUE, 8, 4);
    TEST_FIELD(SCONTEXT_QUEUE, ULONG, NumberOfObjects, 0, 4, 4);
    TEST_FIELD(SCONTEXT_QUEUE, NDR_SCONTEXT *, ArrayOfObjects, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例4: test_pack_GOPHER_ASK_ATTRIBUTE_TYPEW

static void test_pack_GOPHER_ASK_ATTRIBUTE_TYPEW(void)
{
    /* GOPHER_ASK_ATTRIBUTE_TYPEW (pack 4) */
    TEST_TYPE(GOPHER_ASK_ATTRIBUTE_TYPEW, 8, 4);
    TEST_FIELD(GOPHER_ASK_ATTRIBUTE_TYPEW, LPCWSTR, QuestionType, 0, 4, 4);
    TEST_FIELD(GOPHER_ASK_ATTRIBUTE_TYPEW, LPCWSTR, QuestionText, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例5: test_pack_GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE

static void test_pack_GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE(void)
{
    /* GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE (pack 4) */
    TEST_TYPE(GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, 8, 4);
    TEST_FIELD(GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, INT, LowerBound, 0, 4, 4);
    TEST_FIELD(GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, INT, UpperBound, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例6: test_pack_INTERNET_ASYNC_RESULT

static void test_pack_INTERNET_ASYNC_RESULT(void)
{
    /* INTERNET_ASYNC_RESULT (pack 4) */
    TEST_TYPE(INTERNET_ASYNC_RESULT, 8, 4);
    TEST_FIELD(INTERNET_ASYNC_RESULT, DWORD_PTR, dwResult, 0, 4, 4);
    TEST_FIELD(INTERNET_ASYNC_RESULT, DWORD, dwError, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例7: test_pack_RPC_PROTSEQ_ENDPOINT

static void test_pack_RPC_PROTSEQ_ENDPOINT(void)
{
    /* RPC_PROTSEQ_ENDPOINT (pack 4) */
    TEST_TYPE(RPC_PROTSEQ_ENDPOINT, 8, 4);
    TEST_FIELD(RPC_PROTSEQ_ENDPOINT, unsigned char*, RpcProtocolSequence, 0, 4, 4);
    TEST_FIELD(RPC_PROTSEQ_ENDPOINT, unsigned char*, Endpoint, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例8: test_pack_GOPHER_ABSTRACT_ATTRIBUTE_TYPEW

static void test_pack_GOPHER_ABSTRACT_ATTRIBUTE_TYPEW(void)
{
    /* GOPHER_ABSTRACT_ATTRIBUTE_TYPEW (pack 4) */
    TEST_TYPE(GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, 8, 4);
    TEST_FIELD(GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, LPCWSTR, ShortAbstract, 0, 4, 4);
    TEST_FIELD(GOPHER_ABSTRACT_ATTRIBUTE_TYPEW, LPCWSTR, AbstractFile, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例9: test_pack_UUID_VECTOR

static void test_pack_UUID_VECTOR(void)
{
    /* UUID_VECTOR (pack 4) */
    TEST_TYPE(UUID_VECTOR, 8, 4);
    TEST_FIELD(UUID_VECTOR, unsigned long, Count, 0, 4, 4);
    TEST_FIELD(UUID_VECTOR, UUID *[1], Uuid, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例10: test_pack_RPC_BINDING_VECTOR

static void test_pack_RPC_BINDING_VECTOR(void)
{
    /* RPC_BINDING_VECTOR (pack 4) */
    TEST_TYPE(RPC_BINDING_VECTOR, 8, 4);
    TEST_FIELD(RPC_BINDING_VECTOR, unsigned long, Count, 0, 4, 4);
    TEST_FIELD(RPC_BINDING_VECTOR, RPC_BINDING_HANDLE[1], BindingH, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例11: test_pack_GOPHER_ADMIN_ATTRIBUTE_TYPEW

static void test_pack_GOPHER_ADMIN_ATTRIBUTE_TYPEW(void)
{
    /* GOPHER_ADMIN_ATTRIBUTE_TYPEW (pack 4) */
    TEST_TYPE(GOPHER_ADMIN_ATTRIBUTE_TYPEW, 8, 4);
    TEST_FIELD(GOPHER_ADMIN_ATTRIBUTE_TYPEW, LPCWSTR, Comment, 0, 4, 4);
    TEST_FIELD(GOPHER_ADMIN_ATTRIBUTE_TYPEW, LPCWSTR, EmailAddress, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例12: test_pack_INTERNET_CONNECTED_INFO

static void test_pack_INTERNET_CONNECTED_INFO(void)
{
    /* INTERNET_CONNECTED_INFO (pack 4) */
    TEST_TYPE(INTERNET_CONNECTED_INFO, 8, 4);
    TEST_FIELD(INTERNET_CONNECTED_INFO, DWORD, dwConnectedState, 0, 4, 4);
    TEST_FIELD(INTERNET_CONNECTED_INFO, DWORD, dwFlags, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例13: test_pack_INTERNET_VERSION_INFO

static void test_pack_INTERNET_VERSION_INFO(void)
{
    /* INTERNET_VERSION_INFO (pack 4) */
    TEST_TYPE(INTERNET_VERSION_INFO, 8, 4);
    TEST_FIELD(INTERNET_VERSION_INFO, DWORD, dwMajorVersion, 0, 4, 4);
    TEST_FIELD(INTERNET_VERSION_INFO, DWORD, dwMinorVersion, 4, 4, 4);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例14: test_pack_RPC_VERSION

static void test_pack_RPC_VERSION(void)
{
    /* RPC_VERSION (pack 4) */
    TEST_TYPE(RPC_VERSION, 4, 2);
    TEST_FIELD(RPC_VERSION, unsigned short, MajorVersion, 0, 2, 2);
    TEST_FIELD(RPC_VERSION, unsigned short, MinorVersion, 2, 2, 2);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c

示例15: test_pack_RPC_SYNTAX_IDENTIFIER

static void test_pack_RPC_SYNTAX_IDENTIFIER(void)
{
    /* RPC_SYNTAX_IDENTIFIER (pack 4) */
    TEST_TYPE(RPC_SYNTAX_IDENTIFIER, 20, 4);
    TEST_FIELD(RPC_SYNTAX_IDENTIFIER, GUID, SyntaxGUID, 0, 16, 4);
    TEST_FIELD(RPC_SYNTAX_IDENTIFIER, RPC_VERSION, SyntaxVersion, 16, 4, 2);
}
开发者ID:iamfil,项目名称:wine,代码行数:7,代码来源:generated.c


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