Add negative testing for memory full condition.

이 커밋은 다음에 포함됨:
Ben Sander가 2017-04-24 22:30:54 -05:00를 커밋했습니다
1 부모 dfacfbb641
커밋 693e5abc1c
1 파일이 변경됨
+10
+10
파일 보기
@@ -56,5 +56,15 @@ int main(){
HIPCHECK_API(hipFree(NULL) , hipSuccess);
HIPCHECK_API(hipHostFree(NULL) , hipSuccess);
{
// Some negative testing - request a too-big allocation and verify it fails:
// Someday when we support virtual memory may need to refactor these:
size_t tooBig = 128LL*1024*1024*1024*1024; // 128 TB;
void *p;
HIPCHECK_API ( hipMalloc(&p, tooBig), hipErrorMemoryAllocation );
HIPCHECK_API ( hipHostMalloc(&p, tooBig), hipErrorMemoryAllocation );
}
passed();
}