Browse Source

correcting errors and warnings from static code check

tags/v0.2.0-alpha
yanghaoran 4 years ago
parent
commit
2bbe5a8213
3 changed files with 7 additions and 4 deletions
  1. +1
    -2
      CMakeLists.txt
  2. +2
    -2
      cmake/external_libs/gtest.cmake
  3. +4
    -0
      tests/ut/ge/single_op/stream_resource_unittest.cc

+ 1
- 2
CMakeLists.txt View File

@@ -17,7 +17,7 @@ cmake_minimum_required(VERSION 3.14)
project (GraphEngine[CXX])
set(CMAKE_CXX_STANDARD 14)

set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(GE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
set(GE_PROTO_DIR ${GE_SOURCE_DIR}/src)

@@ -71,7 +71,6 @@ elseif(DEFINED ENV{D_LINK_PATH})
find_library(msprof libmsprof.so ${GE_LIB_PATH})
find_library(register libregister.so ${GE_LIB_PATH})
find_library(hccl libhccl.so ${GE_LIB_PATH})
find_library(cce libcce.so ${GE_LIB_PATH})
find_library(resource libresource.so ${GE_LIB_PATH})
else()
# Ascend mode


+ 2
- 2
cmake/external_libs/gtest.cmake View File

@@ -1,5 +1,5 @@
set(ge_gtest_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(ge_gtest_CFLAGS "-D_FORTIFY_SOURCE=2 -O2")
set(ge_gtest_CXXFLAGS "-D_FORTIFY_SOURCE=2 -O2 -fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack")
set(ge_gtest_CFLAGS "-D_FORTIFY_SOURCE=2 -O2 -fstack-protector-all -Wl,-z,relro,-z,now,-z,noexecstack")

graphengine_add_pkg(ge_gtest
VER 1.8.0


+ 4
- 0
tests/ut/ge/single_op/stream_resource_unittest.cc View File

@@ -74,4 +74,8 @@ TEST_F(UtestStreamResource, test_do_malloc_memory) {
StreamResource::DoMallocMemory(101, max_allocated, allocated);
ASSERT_EQ(allocated.size(), 2);
ASSERT_EQ(max_allocated, 101);

for (auto res : allocated) {
rtFree(res);
}
}

Loading…
Cancel
Save