summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/file_io/SearchPathA
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal/tests/palsuite/file_io/SearchPathA')
-rw-r--r--src/pal/tests/palsuite/file_io/SearchPathA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp (renamed from src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.c)13
2 files changed, 5 insertions, 10 deletions
diff --git a/src/pal/tests/palsuite/file_io/SearchPathA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SearchPathA/test1/CMakeLists.txt
index d1ac975d18..c020a86b61 100644
--- a/src/pal/tests/palsuite/file_io/SearchPathA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SearchPathA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SearchPathA.c
+ SearchPathA.cpp
)
add_executable(paltest_searchpatha_test1
diff --git a/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.c b/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp
index ab9eecdebc..57afdefc7b 100644
--- a/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.c
+++ b/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp
@@ -84,18 +84,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();