diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2016-12-27 16:46:08 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2016-12-27 16:46:08 +0900 |
commit | db20f3f1bb8595633a7e16c8900fd401a453a6b5 (patch) | |
tree | e5435159cd1bf0519276363a6fe1663d1721bed3 /src/pal/tests/palsuite/file_io/SearchPathW | |
parent | 4b4aad7217d3292650e77eec2cf4c198ea9c3b4b (diff) | |
download | coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.gz coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.tar.bz2 coreclr-db20f3f1bb8595633a7e16c8900fd401a453a6b5.zip |
Imported Upstream version 1.0.0.9127upstream/1.0.0.9127
Diffstat (limited to 'src/pal/tests/palsuite/file_io/SearchPathW')
-rw-r--r-- | src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp (renamed from src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.c) | 15 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt index d0c6252472..a77d875505 100644 --- a/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt +++ b/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(SOURCES - SearchPathW.c + SearchPathW.cpp ) add_executable(paltest_searchpathw_test1 diff --git a/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.c b/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp index 2bc7694dc0..6880a864cb 100644 --- a/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.c +++ b/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp @@ -127,18 +127,13 @@ int __cdecl main(int argc, char *argv[]) { */ memset(fullPath, 0, _MAX_DIR); - /* Get the full path to the library (DLL). - */ - - if ( NULL != _fullpath( fullPath, argv[0], _MAX_DIR )) { - _splitpath(fullPath,drive,dir,fname,ext); - _makepath(fullPath,drive,dir,"",""); - } else { - Fail("ERROR: conversion from relative path \" %s \" to absolute path failed. _fullpath returned NULL\n",argv[0]); - } + if (GetTempPathA(_MAX_DIR, fullPath) == 0) + { + Fail("ERROR: GetTempPathA failed to get a path\n"); + } memset(fileloc, 0, _MAX_PATH); - sprintf(fileloc, "%s%s", fullPath, szFileNameExistsWithExt); + sprintf_s(fileloc, _countof(fileloc), "%s%s", fullPath, szFileNameExistsWithExt); RemoveAll(); |