📄 test_osapi_memory.c
字号:
/*****************************************************************************
******************************************************************************
** **
** Copyright (c) 2006 Videon Central, Inc. **
** All rights reserved. **
** **
** The computer program contained herein contains proprietary information **
** which is the property of Videon Central, Inc. The program may be used **
** and/or copied only with the written permission of Videon Central, Inc. **
** or in accordance with the terms and conditions stipulated in the **
** agreement/contract under which the programs have been supplied. **
** **
******************************************************************************
*****************************************************************************/
/**
* @file test_osapi_memory.c
*
* $Revision: 1.3 $
*
* Operating System API (OSAPI) test file.
*
*
*/
#include "vdvd_types.h"
#include "osapi.h"
#include "dbgprint.h"
#include "test_osapi.h"
void OSAPIMemoryTests( void )
{
PVOID pMemory;
OS_STATUS status;
DbgPrint(("\nOSAPI MEMORY TEST\n"));
DbgPrint(("[running] Test 1: allocate memory of size 0"));
pMemory = OS_MemAlloc(0);
PassFail( (pMemory==NULL) );
DbgPrint(("[running] Test 2: free NULL pointer"));
status = OS_MemFree(NULL);
PassFail( (status!=OS_OK) );
DbgPrint(("[running] Test 3: allocate memory of size 1KB"));
pMemory = OS_MemAlloc(1024);
PassFail( (pMemory!=NULL) );
DbgPrint(("[running] Test 4: free memory of size 1KB"));
status = OS_MemFree(pMemory);
PassFail( (status==OS_OK) );
pMemory = NULL;
DbgPrint(("\nOSAPI MEMORY TEST FINISHED\n"));
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -