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

C++ ASSERT_NULL函数代码示例

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

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



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

示例1: test_create_destroy_writer

void test_create_destroy_writer(void)
{
    kaa_platform_message_writer_t *writer = NULL;
    char buffer[16];
    size_t buffer_size = sizeof(buffer) / sizeof(char);

    kaa_error_t error_code = KAA_ERR_NONE;
    error_code = kaa_platform_message_writer_create(NULL, buffer, buffer_size);
    ASSERT_EQUAL(error_code, KAA_ERR_BADPARAM);
    ASSERT_NULL(writer);

    error_code = kaa_platform_message_writer_create(&writer, NULL, buffer_size);
    ASSERT_EQUAL(error_code, KAA_ERR_BADPARAM);
    ASSERT_NULL(writer);

    error_code = kaa_platform_message_writer_create(&writer, buffer, 0);
    ASSERT_EQUAL(error_code, KAA_ERR_BADPARAM);
    ASSERT_NULL(writer);

    error_code = kaa_platform_message_writer_create(&writer, buffer, buffer_size);
    ASSERT_EQUAL(error_code, KAA_ERR_NONE);
    ASSERT_NOT_NULL(writer);
    ASSERT_EQUAL((writer->end - writer->begin), buffer_size);
    ASSERT_EQUAL(writer->begin, writer->current);

    kaa_platform_message_writer_destroy(writer);
}
开发者ID:ikbelkirasan,项目名称:kaa,代码行数:27,代码来源:test_platform_utils.c


示例2: test_string_move_create

static void test_string_move_create(void **state)
{
    (void)state;

    ASSERT_NULL(kaa_string_move_create(NULL, NULL));

    const char *plain_test_str1 = "test";

    kaa_string_t *kaa_str1 = kaa_string_move_create(plain_test_str1, NULL);

    ASSERT_NOT_NULL(kaa_str1);
    ASSERT_NOT_NULL(kaa_str1->data);
    ASSERT_NULL(kaa_str1->destroy);
    ASSERT_EQUAL(strcmp(kaa_str1->data, plain_test_str1), 0);

    kaa_string_destroy(kaa_str1);
    kaa_str1 = NULL;

    char *plain_test_str2 = (char *)KAA_MALLOC(strlen(plain_test_str1) + 1);
    ASSERT_NOT_NULL(plain_test_str2);
    strcpy(plain_test_str2, plain_test_str1);

    kaa_string_t *kaa_str2 = kaa_string_move_create(plain_test_str2, &kaa_data_destroy);

    ASSERT_NOT_NULL(kaa_str2);
    ASSERT_NOT_NULL(kaa_str2->data);
    ASSERT_EQUAL(kaa_str2->destroy, &kaa_data_destroy);
    ASSERT_EQUAL(strcmp(kaa_str2->data, plain_test_str1), 0);

    kaa_string_destroy(kaa_str2);
}
开发者ID:Kirill380,项目名称:kaa,代码行数:31,代码来源:test_kaa_common_schema.c


示例3: ASSERT_NULL

BOOL ISprite::Load(const char *filename, ResourceManager *res, IMemoryPool *pool)
{
	ASSERT_NULL(pool);
	ASSERT_NULL(filename);
	ASSERT_NULL(res);

	if (this->Unload())
	{
		pFilename = filename;
		pPool = pool;
		pRes = res;

		pSprite = static_cast<SpriteObject *>(res->Get(filename, Seed::ObjectSprite, pool));
		this->SetRotation(0);
		this->SetAnimation(0u);

		bChanged = TRUE;
		bInitialized = TRUE;

		pAnimation = pSprite->GetAnimation(iCurrentAnimation);
		pAnimationFrames = pSprite->GetFrames(pAnimation);
		pFrame = &pAnimationFrames[iCurrentFrame];
	}

	return TRUE;
}
开发者ID:fungos,项目名称:seed1,代码行数:26,代码来源:ISprite.cpp


示例4: UNUSED

BOOL Texture::Load(const char *filename, ResourceManager *res, IMemoryPool *pool)
{
	UNUSED(res);
	UNUSED(pool);
	ASSERT_NULL(res);
	ASSERT_NULL(filename);
	ASSERT_NULL(pool);

	if (this->Unload())
	{
		image = QImage(filename);

		if (image.isNull())
		{
			return FALSE;
		}

		image = image.convertToFormat(QImage::Format_ARGB32);

		iWidth = image.width();
		iHeight = image.height();

		iAtlasWidth = iWidth;
		iAtlasHeight = iHeight;
		//iHalfWidth = iWidth >> 1;
		//iHalfHeight = iHeight >> 1;

		fWidth = (f32)iWidth / (f32)pScreen->GetWidth();
		fHeight = (f32)iHeight / (f32)pScreen->GetHeight();
	}

	return TRUE;
}
开发者ID:doorxp,项目名称:seed,代码行数:33,代码来源:QtTexture.cpp


示例5: mon_init

PERIODIC_THREAD_END


void mon_init(void)
{
   ASSERT_ONCE();

   /* open monitoring socket: */
   mon_socket = scl_get_socket("ap_mon");
   ASSERT_NOT_NULL(mon_socket);
   int64_t hwm = 1;
   zmq_setsockopt(mon_socket, ZMQ_SNDHWM, &hwm, sizeof(hwm));

   /* create monitoring connection: */
   const struct timespec period = {0, 20 * NSEC_PER_MSEC};
   pthread_mutexattr_init(&mutexattr);
   pthread_mutexattr_setprotocol(&mutexattr, PTHREAD_PRIO_INHERIT);
   pthread_mutex_init(&mutex, &mutexattr);

   /* init msgpack buffer: */
   ASSERT_NULL(msgpack_buf);
   msgpack_buf = msgpack_sbuffer_new();
   ASSERT_NOT_NULL(msgpack_buf);
   ASSERT_NULL(pk);
   pk = msgpack_packer_new(msgpack_buf, msgpack_sbuffer_write);

   periodic_thread_start(&emitter_thread, mon_emitter, "mon_thread", THREAD_PRIORITY, period, NULL);
}
开发者ID:Aerobota,项目名称:PenguPilot,代码行数:28,代码来源:mon.c


示例6: ASSERT_NULL

    void StackTest::testPushPopTopSize()
    {
        adt::Stack<int> stack;

        ASSERT_NULL(stack.top());
        ASSERT_NULL(stack.pop());
        ASSERT_EQUAL(static_cast<size_t>(0), stack.size());

        size_t stackSizeToTest = adt::Stack<int>::DEFAULT_RESERVED_SIZE * 2 + 1;
        for (int n = 1; static_cast<size_t>(n) <= stackSizeToTest; n++)
        {
            std::stringstream detail;
            detail << "n: " << n;
            stack.push(n);
            ASSERT_EQUAL_DETAIL(static_cast<size_t>(n), stack.size(), detail);
        }

        for (int n = stackSizeToTest; static_cast<size_t>(n) > 0; n--)
        {
            std::stringstream detail;
            detail << "n: " << n;
            const int* lastTop = stack.pop();
            ASSERT_NOT_NULL(lastTop);
            if (lastTop)
            {
                ASSERT_EQUAL_DETAIL(n, *lastTop, detail);
            }
        }

        ASSERT_NULL(stack.top());
        ASSERT_NULL(stack.pop());
        ASSERT_EQUAL(static_cast<size_t>(0), stack.size());
    }
开发者ID:jwilges,项目名称:samples,代码行数:33,代码来源:stacktest.cpp


示例7: ASSERT_NULL

BOOL IFileSystem::Open(const char *fileName, File *file, IMemoryPool *pool)
{
	ASSERT_NULL(fileName);
	ASSERT_NULL(file);
	ASSERT_NULL(pool);

	BOOL ret = FALSE;

	file->pName = NULL;
	file->pData = NULL;
	file->pPool = NULL;
	file->iSize = 0;
	file->bPackaged = FALSE;

	if (pPackageManager->IsInitialized())
	{
		file->pData = pPackageManager->GetFile(fileName, &file->iSize);

		if (file->pData)
		{
			ret = TRUE;
			file->pName = fileName;
			file->pPool = pool;
			file->bPackaged = TRUE;
		}
	}

	return ret;
}
开发者ID:Patuti,项目名称:seed,代码行数:29,代码来源:IFileSystem.cpp


示例8: ASSERT_NULL

void WidgetContainer::OnInputPointerMove(const EventInputPointer *ev)
{
	ASSERT_NULL(ev);

	WidgetIterator it = vWidget.begin();
	WidgetIterator end = vWidget.end();

	for (; it != end; ++it)
	{
		IWidget *w = (*it);
		ASSERT_NULL(w);

		bEventConsumed = FALSE;

		if (w->IsDisabled())
			continue;

		if (w->GetObjectType() == Seed::ObjectGuiWidgetContainer)
		{
			WidgetContainer *wc = reinterpret_cast<WidgetContainer *>(w);
			wc->OnInputPointerMove(ev);

			bEventConsumed = wc->IsEventConsumed();
			if (bEventConsumed)
				break;
		}

		bEventConsumed = this->UpdateStates(ev, w);
		//if (UpdateStates(ev, w))
		if (bEventConsumed)
			break;
	}
}
开发者ID:doorxp,项目名称:seed,代码行数:33,代码来源:WidgetContainer.cpp


示例9: test_kaa_deque_first_last

void test_kaa_deque_first_last()
{
    kaa_error_t error_code = KAA_ERR_NONE;

    error_code = kaa_deque_first(NULL, NULL);
    ASSERT_EQUAL(error_code, KAA_ERR_BADPARAM);
    error_code = kaa_deque_last(NULL, NULL);
    ASSERT_EQUAL(error_code, KAA_ERR_BADPARAM);

    kaa_deque_t *deque = NULL;
    error_code = kaa_deque_create(&deque);
    ASSERT_EQUAL(error_code, KAA_ERR_NONE);
    ASSERT_NOT_NULL(deque);

    error_code = kaa_deque_first(deque, NULL);
    ASSERT_EQUAL(error_code, KAA_ERR_BADPARAM);
    error_code = kaa_deque_last(deque, NULL);
    ASSERT_EQUAL(error_code, KAA_ERR_BADPARAM);

    kaa_deque_iterator_t *it = NULL;
    error_code = kaa_deque_first(NULL, &it);
    ASSERT_EQUAL(error_code, KAA_ERR_BADPARAM);
    error_code = kaa_deque_last(NULL, &it);
    ASSERT_EQUAL(error_code, KAA_ERR_BADPARAM);

    error_code = kaa_deque_first(deque, &it);
    ASSERT_EQUAL(error_code, KAA_ERR_NONE);
    ASSERT_NULL(it);
    error_code = kaa_deque_last(deque, &it);
    ASSERT_EQUAL(error_code, KAA_ERR_NONE);
    ASSERT_NULL(it);

    kaa_deque_push_back_data(deque, "data");
    ASSERT_EQUAL(kaa_deque_size(deque), 1);

    kaa_deque_iterator_t *it1 = NULL;
    error_code = kaa_deque_first(deque, &it1);
    ASSERT_EQUAL(error_code, KAA_ERR_NONE);
    ASSERT_NOT_NULL(it1);
    kaa_deque_iterator_t *it2 = NULL;
    error_code = kaa_deque_last(deque, &it2);
    ASSERT_EQUAL(error_code, KAA_ERR_NONE);
    ASSERT_NOT_NULL(it2);
    ASSERT_EQUAL(it1, it2);

    kaa_deque_push_back_data(deque, "data");
    ASSERT_EQUAL(kaa_deque_size(deque), 2);

    error_code = kaa_deque_first(deque, &it1);
    ASSERT_EQUAL(error_code, KAA_ERR_NONE);
    ASSERT_NOT_NULL(it1);

    error_code = kaa_deque_last(deque, &it2);
    ASSERT_EQUAL(error_code, KAA_ERR_NONE);
    ASSERT_NOT_NULL(it2);
    ASSERT_NOT_EQUAL(it1, it2);

    kaa_deque_destroy(deque, &test_kaa_deque_destroy_stub);
}
开发者ID:BioSoundSystems,项目名称:kaa,代码行数:59,代码来源:test_kaa_deque.c


示例10: ASSERT_NULL

BOOL Font::Load(const char *filename, ResourceManager *res, IMemoryPool *pool)
{
	ASSERT_NULL(filename);
	ASSERT_NULL(res);
	ASSERT_NULL(pool);

	if (this->Unload())
	{
		this->pFilename = filename;
		this->pRes = res;
		this->pPool = pool;

		stFile.Close();
		SECURITY_CHECK(pFileSystem->Open(filename, &stFile, pool), "Could not open font file.");
		const u8 *ptr = static_cast<const u8 *>(stFile.GetData());
		ObjectHeader *block = NULL;
		READ_STRUCT(block, ObjectHeader, ptr);
		SECURITY_CHECK(seed_validate_block(&stFile, block, FONT_OBJECT_MAGIC, FONT_OBJECT_VERSION), "Invalid block header for font.");

		READ_F32(this->fTracking, ptr);
		READ_F32(this->fSpacing, ptr);
		READ_F32(this->fSpaceWidth, ptr);

	/*
		const char *file = NULL;
		READ_STR(file, ptr);
		ASSERT_NULL(file);

		const char *ext = NULL;
		READ_STR(ext, ptr);
	*/
		u32 file = 0;
		READ_U32(file, ptr);

		u32 ext = 0;
		READ_U32(ext, ptr);

		if (ext != SEED_INVALID_ID /*&& pSystem->GetLanguage() != Seed::en_US*/)
		{
			File extf;
			if (pFileSystem->Open(_F(ext), &extf, pool))
			{
				extf.Close();
				this->mFontExt.Load(_F(ext), res, pool);
				this->pGlyphs = pDictionary->GetGlyphTable(&this->iTotalGlyphs);
			}
		}

		this->mFont.Load(_F(file), res, pool);
		this->fHeight	= mFont.GetHeight();
		this->fWidth	= mFont.GetWidth();

		this->bLoaded	= TRUE;
	}

	return bLoaded;
}
开发者ID:doorxp,项目名称:seed,代码行数:57,代码来源:Font.cpp


示例11: ASSERT_NULL

void TerrainEffectorPropertytest::test_none_found()
{
    ASSERT_NULL(m_world->m_location.m_loc);
    ASSERT_EQUAL(m_entity->m_location.m_loc, m_world);

    const TerrainProperty * res = m_property->getTerrain(m_entity);

    ASSERT_NULL(res);
}
开发者ID:cyclefusion,项目名称:cyphesis,代码行数:9,代码来源:TerrainEffectorPropertytest.cpp


示例12: ASSERT_NULL

void IInputJoystick::SendEventJoystickDPadMove(const EventInputJoystick *ev)
{
	ASSERT_NULL(ev);

	for (u32 i = 0; i < arJoystickListeners.Size(); i++)
	{
		ASSERT_NULL(arJoystickListeners[i]);
		arJoystickListeners[i]->OnInputJoystickDPadMove(ev);
	}
}
开发者ID:doorxp,项目名称:seed,代码行数:10,代码来源:IInputJoystick.cpp


示例13: test_list_create

static void test_list_create()
{
    kaa_list_t *list = kaa_list_create();
    ASSERT_NOT_NULL(list);

    ASSERT_EQUAL(kaa_list_get_size(list), 0);
    ASSERT_NULL(kaa_list_begin(list));
    ASSERT_NULL(kaa_list_back(list));

    kaa_list_destroy(list, NULL);
}
开发者ID:Acarus,项目名称:kaa,代码行数:11,代码来源:test_kaa_list.c


示例14: CTEST2

CTEST2(tube, manager_getset_data)
{
	tube_manager *mgr = data->mgr;
	char mgr_data[] = "the manager data";

	ASSERT_NULL( tube_manager_get_data(mgr) );
	tube_manager_set_data(mgr, mgr_data);
	ASSERT_TRUE( tube_manager_get_data(mgr)== mgr_data );
	tube_manager_set_data(mgr, NULL);
	ASSERT_NULL( tube_manager_get_data(mgr) );
}
开发者ID:thomas-fossati,项目名称:SPUDlib,代码行数:11,代码来源:tube_test.c


示例15: CTEST

CTEST(ls_htable, basics)
{
  ls_htable* table;
  ls_err     err;
  ASSERT_TRUE( ls_htable_create(7,
                                ls_str_hashcode,
                                ls_str_compare,
                                &table,
                                &err) );

  ASSERT_EQUAL(ls_htable_get_count(table), 0);
  ASSERT_NULL( ls_htable_get(table, "key1") );
  ASSERT_NULL( ls_htable_get(table, "key2") );

  pvalue = NULL;
  ASSERT_TRUE( ls_htable_put(table, "key1", "value one",
                             test_htable_store_pvalue, &err) );
  ASSERT_NULL(pvalue);
  ASSERT_EQUAL(ls_htable_get_count(table),                        1);
  ASSERT_EQUAL(strcmp(ls_htable_get(table, "key1"), "value one"), 0);
  ASSERT_NULL( ls_htable_get(table, "key2") );

  ASSERT_TRUE( ls_htable_put(table, "key2", "value two",
                             test_htable_store_pvalue, &err) );
  ASSERT_NULL(pvalue);
  ASSERT_EQUAL(ls_htable_get_count(table),                        2);
  ASSERT_EQUAL(strcmp(ls_htable_get(table, "key1"), "value one"), 0);
  ASSERT_EQUAL(strcmp(ls_htable_get(table, "key2"), "value two"), 0);

  ASSERT_TRUE( ls_htable_put(table, "key1", "val 1", test_htable_store_pvalue,
                             &err) );
  ASSERT_EQUAL(strcmp( (const char*)pvalue, "value one" ),        0);
  ASSERT_EQUAL(ls_htable_get_count(table),                        2);
  ASSERT_EQUAL(strcmp(ls_htable_get(table, "key1"), "val 1"),     0);
  ASSERT_EQUAL(strcmp(ls_htable_get(table, "key2"), "value two"), 0);

  pvalue = NULL;
  ls_htable_remove(table, "key1");
  ASSERT_EQUAL(strcmp(pvalue, "val 1"),    0);
  ASSERT_EQUAL(ls_htable_get_count(table), 1);
  ASSERT_NULL( ls_htable_get(table, "key1") );
  ASSERT_EQUAL(strcmp(ls_htable_get(table, "key2"), "value two"), 0);

  pvalue = NULL;
  ASSERT_TRUE( ls_htable_put(table, "key1", "first value",
                             test_htable_store_pvalue, &err) );
  ASSERT_NULL(pvalue);
  ASSERT_EQUAL(ls_htable_get_count(table),                          2);
  ASSERT_EQUAL(strcmp(ls_htable_get(table, "key1"), "first value"), 0);
  ASSERT_EQUAL(strcmp(ls_htable_get(table, "key2"), "value two"),   0);

  ls_htable_clear(table);
  ASSERT_EQUAL(ls_htable_get_count(table), 0);
  ASSERT_NULL( ls_htable_get(table, "key1") );
  ASSERT_NULL( ls_htable_get(table, "key2") );

  ls_htable_destroy(table);
}
开发者ID:britram,项目名称:SPUDlib,代码行数:58,代码来源:ls_htable_test.c


示例16: ASSERT_NULL

void SoundSource::Load(const char *filename, ResourceManager *res, IMemoryPool *pool)
{
	ASSERT_NULL(filename);
	ASSERT_NULL(pool);
	ASSERT_NULL(res);

	if (pSoundSystem->IsInitialized())
	{
		this->Unload();

		/* Open file .sound */
		SECURITY_CHECK(pFileSystem->Open(filename, &stFile, pool), "Sound object couldn't be opened");

		const u8 *ptr = static_cast<const u8 *>(stFile.GetData());
		ObjectHeader *block = NULL;
		READ_STRUCT(block, ObjectHeader, ptr);
		SECURITY_CHECK(seed_validate_block(&stFile, block, SOUND_OBJECT_MAGIC, SOUND_OBJECT_VERSION), "Invalid block header for sound.");

		u32 volume = 0;
		READ_U32(volume, ptr);
		this->fVolume  = volume / 100.0f;

		u32 flags = 0;
		READ_U32(flags, ptr);
		this->bLoop = ((flags & 0x01) == 0x01); // FIXME

		const char *fname = NULL;
		READ_STR(fname, ptr);
		ASSERT_NULL(fname);

		/* Get the resource */
		pSound = static_cast<Sound *>(res->Get(fname, Seed::ObjectSound, pool));

		if (iSource)
			alDeleteSources(1, &iSource);
		ALenum err = alGetError();

		alGenSources(1, &iSource);
		err = alGetError();
		if (err != AL_NO_ERROR)
			Info(TAG "Could not create OpenAL Source: %4x", err);

		const ALint *buffer = static_cast<const ALint *>(pSound->GetData());

		alSourcef(iSource, AL_PITCH, 1.0f);
		alSource3f(iSource, AL_POSITION, cPosition.x, cPosition.y, cPosition.z);
		alSource3f(iSource, AL_VELOCITY, cVelocity.x, cVelocity.y, cVelocity.z);
		alSourcei(iSource, AL_LOOPING, this->bLoop);
		alSourcei(iSource, AL_BUFFER, *buffer);
		this->SetVolume(this->fVolume);
	}
}
开发者ID:Patuti,项目名称:seed,代码行数:52,代码来源:OalOggSoundSource.cpp


示例17: test_list_create

void test_list_create()
{
    KAA_TRACE_IN(logger);

    kaa_list_t *list = kaa_list_create();
    ASSERT_NOT_NULL(list);

    ASSERT_EQUAL(kaa_list_get_size(list), 0);
    ASSERT_NULL(kaa_list_begin(list));
    ASSERT_NULL(kaa_list_back(list));

    kaa_list_destroy(list, NULL);

    KAA_TRACE_OUT(logger);
}
开发者ID:nthevu,项目名称:kaa,代码行数:15,代码来源:test_kaa_list.c


示例18: test_parse_grammar

static void test_parse_grammar(void)
{
  struct cspeech_srgs_parser *parser;

  parser = cspeech_srgs_parser_new("1234");

  ASSERT_NOT_NULL(cspeech_srgs_parse(parser, adhearsion_ask_grammar));
  ASSERT_NULL(cspeech_srgs_parse(parser, adhearsion_ask_grammar_bad));
  ASSERT_NULL(cspeech_srgs_parse(parser, NULL));
  ASSERT_NULL(cspeech_srgs_parse(NULL, adhearsion_ask_grammar));
  ASSERT_NULL(cspeech_srgs_parse(NULL, adhearsion_ask_grammar_bad));
  ASSERT_NULL(cspeech_srgs_parse(parser, bad_ref_grammar));

  cspeech_srgs_parser_destroy(parser);
}
开发者ID:crienzo,项目名称:cspeech,代码行数:15,代码来源:test_srgs.c


示例19: CTEST

CTEST(txn, begin_with_no_parent)
{
	int r;
	struct txn *tx1;
	struct txn *tx2;
	struct txn *tx3;
	struct txnmgr *tm = txnmgr_new();
	LOGGER *logger = logger_new(NULL, tm);

	/* transaction 1 */
	r = txn_begin(NULL, logger, TXN_ISO_REPEATABLE, &tx1);
	ASSERT_EQUAL(1, r);
	ASSERT_EQUAL(0, tx1->txnid);
	ASSERT_EQUAL(1, tm->live_root_txnids->used);
	ASSERT_EQUAL(tx1->txnid, tm->live_root_txnids->txnids[0]);

	/* transaction 2 */
	r = txn_begin(NULL, logger, TXN_ISO_REPEATABLE, &tx2);
	ASSERT_EQUAL(1, r);
	ASSERT_EQUAL(1, tx2->txnid);
	ASSERT_EQUAL(tx1->txnid, tx2->txnid_clone->txnids[0]);
	ASSERT_EQUAL(tx2->txnid, tx2->txnid_clone->txnids[1]);

	/* transaction 3 */
	r = txn_begin(NULL, logger, TXN_ISO_SERIALIZABLE, &tx3);
	ASSERT_EQUAL(1, r);
	ASSERT_EQUAL(2, tx3->txnid);
	ASSERT_NULL(tx3->txnid_clone);

	logger_free(logger);
	txnmgr_free(tm);
}
开发者ID:CCoder123,项目名称:nessDB,代码行数:32,代码来源:txn-test.c


示例20: test_allocate_log_record_buffer

void test_allocate_log_record_buffer(void)
{
    KAA_TRACE_IN(logger);

    kaa_error_t error_code;
    void *storage;

    error_code = ext_unlimited_log_storage_create(&storage, logger);
    ASSERT_EQUAL(error_code, KAA_ERR_NONE);

    error_code = ext_log_storage_allocate_log_record_buffer(storage, NULL);
    ASSERT_NOT_EQUAL(error_code, KAA_ERR_NONE);

    kaa_log_record_t record1 = { NULL, 0 };
    error_code = ext_log_storage_allocate_log_record_buffer(storage, &record1);
    ASSERT_NOT_EQUAL(error_code, KAA_ERR_NONE);
    ASSERT_NULL(record1.data);

    kaa_log_record_t record2 = { NULL, 256 };
    error_code = ext_log_storage_allocate_log_record_buffer(storage, &record2);
    ASSERT_EQUAL(error_code, KAA_ERR_NONE);
    ASSERT_NOT_NULL(record2.data);

    ext_log_storage_deallocate_log_record_buffer(storage, &record2);
    ext_log_storage_destroy(storage);

    KAA_TRACE_OUT(logger);
}
开发者ID:nthevu,项目名称:kaa,代码行数:28,代码来源:test_ext_log_storage_memory.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ASSERT_OK函数代码示例发布时间:2022-05-30
下一篇:
C++ ASSERT_NO_THROW函数代码示例发布时间: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