Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / tests / unit / inference_engine_tests / alocator_tests.cpp
index 178f116..5ae1fb5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Intel Corporation
+// Copyright (C) 2018-2019 Intel Corporation
 // SPDX-License-Identifier: Apache-2.0
 //
 
@@ -25,7 +25,9 @@ public:
 };
 
 TEST_F(SystemAllocatorTests, canAllocate) {
-    EXPECT_NO_THROW(allocator->alloc(100));
+    void* handle = allocator->alloc(100);
+    EXPECT_NE(nullptr, handle);
+    allocator->free(handle);
 }
 
 TEST_F(SystemAllocatorTests, canLockAllocatedMemory) {
@@ -34,4 +36,6 @@ TEST_F(SystemAllocatorTests, canLockAllocatedMemory) {
     char * ptr = (char *)allocator->lock(handle);
     ptr [9999] = 11;
     ASSERT_EQ(ptr[9999], 11);
+    allocator->unlock(ptr);
+    allocator->free(handle);
 }