summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/inc/mbusafecrt.h16
-rw-r--r--src/pal/inc/pal.h196
-rw-r--r--src/pal/inc/pal_char16.h3
-rw-r--r--src/pal/inc/pal_mstypes.h11
-rw-r--r--src/pal/inc/rt/palrt.h180
-rw-r--r--src/pal/inc/rt/safecrt.h13
-rw-r--r--src/pal/inc/strsafe.h1512
-rw-r--r--src/pal/inc/unixasmmacros.inc4
-rw-r--r--src/pal/inc/unixasmmacrosamd64.inc2
-rw-r--r--src/pal/inc/unixasmmacrosarm.inc3
-rw-r--r--src/pal/inc/unixasmmacrosarm64.inc2
-rw-r--r--src/pal/inc/unixasmmacrosx86.inc87
-rw-r--r--src/pal/prebuilt/idl/clrdata_i.cpp (renamed from src/pal/prebuilt/idl/clrdata_i.c)0
-rw-r--r--src/pal/prebuilt/idl/clrinternal_i.cpp (renamed from src/pal/prebuilt/idl/clrinternal_i.c)0
-rw-r--r--src/pal/prebuilt/idl/clrprivappxhosting_i.cpp (renamed from src/pal/prebuilt/idl/clrprivappxhosting_i.c)0
-rw-r--r--src/pal/prebuilt/idl/clrprivbinding_i.cpp (renamed from src/pal/prebuilt/idl/clrprivbinding_i.c)0
-rw-r--r--src/pal/prebuilt/idl/clrprivhosting_i.cpp (renamed from src/pal/prebuilt/idl/clrprivhosting_i.c)0
-rw-r--r--src/pal/prebuilt/idl/clrprivruntimebinders_i.cpp (renamed from src/pal/prebuilt/idl/clrprivruntimebinders_i.c)0
-rw-r--r--src/pal/prebuilt/idl/cordebug_i.c451
-rw-r--r--src/pal/prebuilt/idl/cordebug_i.cpp463
-rw-r--r--src/pal/prebuilt/idl/corprof_i.c134
-rw-r--r--src/pal/prebuilt/idl/corprof_i.cpp140
-rw-r--r--src/pal/prebuilt/idl/corpub_i.cpp (renamed from src/pal/prebuilt/idl/corpub_i.c)0
-rw-r--r--src/pal/prebuilt/idl/corsym_i.cpp (renamed from src/pal/prebuilt/idl/corsym_i.c)0
-rw-r--r--src/pal/prebuilt/idl/fusionpriv_i.cpp (renamed from src/pal/prebuilt/idl/fusionpriv_i.c)0
-rw-r--r--src/pal/prebuilt/idl/gchost_i.cpp (renamed from src/pal/prebuilt/idl/gchost_i.c)0
-rw-r--r--src/pal/prebuilt/idl/ivalidator_i.cpp (renamed from src/pal/prebuilt/idl/ivalidator_i.c)0
-rw-r--r--src/pal/prebuilt/idl/ivehandler_i.cpp (renamed from src/pal/prebuilt/idl/ivehandler_i.c)0
-rw-r--r--src/pal/prebuilt/idl/mscorsvc_i.cpp (renamed from src/pal/prebuilt/idl/mscorsvc_i.c)0
-rw-r--r--src/pal/prebuilt/idl/sospriv_i.c100
-rw-r--r--src/pal/prebuilt/idl/sospriv_i.cpp98
-rw-r--r--src/pal/prebuilt/idl/tlbimpexp_i.cpp (renamed from src/pal/prebuilt/idl/tlbimpexp_i.c)0
-rw-r--r--src/pal/prebuilt/idl/xclrdata_i.cpp (renamed from src/pal/prebuilt/idl/xclrdata_i.c)0
-rw-r--r--src/pal/prebuilt/idl/xcordebug_i.cpp (renamed from src/pal/prebuilt/idl/xcordebug_i.c)0
-rw-r--r--src/pal/prebuilt/inc/cordebug.h485
-rw-r--r--src/pal/prebuilt/inc/corprof.h1714
-rw-r--r--src/pal/prebuilt/inc/xclrdata.h12
-rw-r--r--src/pal/src/CMakeLists.txt108
-rw-r--r--src/pal/src/arch/amd64/activationhandlerwrapper.S (renamed from src/pal/src/arch/i386/activationhandlerwrapper.S)0
-rw-r--r--src/pal/src/arch/amd64/asmconstants.h106
-rw-r--r--src/pal/src/arch/amd64/context.S (renamed from src/pal/src/arch/i386/context.S)0
-rw-r--r--src/pal/src/arch/amd64/context2.S259
-rw-r--r--src/pal/src/arch/amd64/debugbreak.S12
-rw-r--r--src/pal/src/arch/amd64/dispatchexceptionwrapper.S (renamed from src/pal/src/arch/i386/dispatchexceptionwrapper.S)0
-rw-r--r--src/pal/src/arch/amd64/exceptionhelper.S42
-rw-r--r--src/pal/src/arch/amd64/optimizedtls.cpp237
-rw-r--r--src/pal/src/arch/amd64/processor.cpp64
-rw-r--r--src/pal/src/arch/arm/exceptionhelper.S2
-rw-r--r--src/pal/src/arch/i386/asmconstants.h76
-rw-r--r--src/pal/src/arch/i386/context2.S354
-rw-r--r--src/pal/src/arch/i386/exceptionhelper.S47
-rw-r--r--src/pal/src/arch/i386/optimizedtls.cpp237
-rw-r--r--src/pal/src/config.h.in1
-rw-r--r--src/pal/src/configure.cmake11
-rw-r--r--src/pal/src/cruntime/lstr.cpp210
-rw-r--r--src/pal/src/cruntime/math.cpp367
-rw-r--r--src/pal/src/cruntime/mbstring.cpp54
-rw-r--r--src/pal/src/cruntime/path.cpp482
-rw-r--r--src/pal/src/cruntime/printf.cpp202
-rw-r--r--src/pal/src/cruntime/string.cpp55
-rw-r--r--src/pal/src/cruntime/wchar.cpp211
-rw-r--r--src/pal/src/debug/debug.cpp1087
-rw-r--r--src/pal/src/examples/CMakeLists.txt2
-rw-r--r--src/pal/src/examples/example1.cpp (renamed from src/pal/src/examples/example1.c)0
-rw-r--r--src/pal/src/exception/machexception.cpp7
-rw-r--r--src/pal/src/exception/machmessage.cpp2
-rw-r--r--src/pal/src/exception/machmessage.h4
-rw-r--r--src/pal/src/exception/seh-unwind.cpp76
-rw-r--r--src/pal/src/exception/seh.cpp8
-rw-r--r--src/pal/src/exception/signal.cpp6
-rw-r--r--src/pal/src/file/find.cpp10
-rw-r--r--src/pal/src/include/pal/context.h24
-rw-r--r--src/pal/src/include/pal/palinternal.h45
-rw-r--r--src/pal/src/init/pal.cpp3
-rw-r--r--src/pal/src/map/virtual.cpp5
-rw-r--r--src/pal/src/misc/sysinfo.cpp2
-rw-r--r--src/pal/src/safecrt/input.inl4
-rw-r--r--src/pal/src/safecrt/makepath_s.cpp (renamed from src/pal/src/safecrt/makepath_s.c)0
-rw-r--r--src/pal/src/safecrt/mbusafecrt.c254
-rw-r--r--src/pal/src/safecrt/mbusafecrt.cpp249
-rw-r--r--src/pal/src/safecrt/memcpy_s.cpp (renamed from src/pal/src/safecrt/memcpy_s.c)0
-rw-r--r--src/pal/src/safecrt/memmove_s.cpp (renamed from src/pal/src/safecrt/memmove_s.c)0
-rw-r--r--src/pal/src/safecrt/output.inl39
-rw-r--r--src/pal/src/safecrt/safecrt_input_s.cpp (renamed from src/pal/src/safecrt/safecrt_input_s.c)0
-rw-r--r--src/pal/src/safecrt/safecrt_output_l.cpp (renamed from src/pal/src/safecrt/safecrt_output_l.c)0
-rw-r--r--src/pal/src/safecrt/safecrt_output_s.cpp (renamed from src/pal/src/safecrt/safecrt_output_s.c)0
-rw-r--r--src/pal/src/safecrt/safecrt_winput_s.cpp (renamed from src/pal/src/safecrt/safecrt_winput_s.c)0
-rw-r--r--src/pal/src/safecrt/safecrt_woutput_s.cpp (renamed from src/pal/src/safecrt/safecrt_woutput_s.c)0
-rw-r--r--src/pal/src/safecrt/snprintf.c18
-rw-r--r--src/pal/src/safecrt/snprintf.cpp18
-rw-r--r--src/pal/src/safecrt/splitpath_s.cpp (renamed from src/pal/src/safecrt/splitpath_s.c)0
-rw-r--r--src/pal/src/safecrt/sprintf.c98
-rw-r--r--src/pal/src/safecrt/sprintf_s.cpp98
-rw-r--r--src/pal/src/safecrt/sscanf.c249
-rw-r--r--src/pal/src/safecrt/sscanf_s.cpp249
-rw-r--r--src/pal/src/safecrt/strcat_s.cpp (renamed from src/pal/src/safecrt/strcat_s.c)0
-rw-r--r--src/pal/src/safecrt/strcpy_s.cpp (renamed from src/pal/src/safecrt/strcpy_s.c)0
-rw-r--r--src/pal/src/safecrt/strlen_s.c58
-rw-r--r--src/pal/src/safecrt/strlen_s.cpp58
-rw-r--r--src/pal/src/safecrt/strncat_s.cpp (renamed from src/pal/src/safecrt/strncat_s.c)0
-rw-r--r--src/pal/src/safecrt/strncpy_s.cpp (renamed from src/pal/src/safecrt/strncpy_s.c)0
-rw-r--r--src/pal/src/safecrt/strtok_s.cpp (renamed from src/pal/src/safecrt/strtok_s.c)0
-rw-r--r--src/pal/src/safecrt/swprintf.c120
-rw-r--r--src/pal/src/safecrt/swprintf.cpp120
-rw-r--r--src/pal/src/safecrt/vsprintf.c268
-rw-r--r--src/pal/src/safecrt/vsprintf.cpp268
-rw-r--r--src/pal/src/safecrt/vswprint.c282
-rw-r--r--src/pal/src/safecrt/vswprint.cpp211
-rw-r--r--src/pal/src/safecrt/wcscat_s.cpp (renamed from src/pal/src/safecrt/wcscat_s.c)0
-rw-r--r--src/pal/src/safecrt/wcscpy_s.cpp (renamed from src/pal/src/safecrt/wcscpy_s.c)0
-rw-r--r--src/pal/src/safecrt/wcslen_s.cpp (renamed from src/pal/src/safecrt/wcslen_s.c)0
-rw-r--r--src/pal/src/safecrt/wcsncat_s.cpp (renamed from src/pal/src/safecrt/wcsncat_s.c)0
-rw-r--r--src/pal/src/safecrt/wcsncpy_s.cpp (renamed from src/pal/src/safecrt/wcsncpy_s.c)0
-rw-r--r--src/pal/src/safecrt/wcstok_s.cpp (renamed from src/pal/src/safecrt/wcstok_s.c)0
-rw-r--r--src/pal/src/safecrt/wmakepath_s.cpp (renamed from src/pal/src/safecrt/wmakepath_s.c)0
-rw-r--r--src/pal/src/safecrt/wsplitpath_s.cpp (renamed from src/pal/src/safecrt/wsplitpath_s.c)0
-rw-r--r--src/pal/src/safecrt/xtoa_s.cpp (renamed from src/pal/src/safecrt/xtoa_s.c)0
-rw-r--r--src/pal/src/safecrt/xtow_s.cpp (renamed from src/pal/src/safecrt/xtow_s.c)0
-rw-r--r--src/pal/src/safecrt/xtox_s.inl29
-rw-r--r--src/pal/src/synchmgr/synchmanager.cpp2
-rw-r--r--src/pal/src/thread/context.cpp108
-rw-r--r--src/pal/src/thread/process.cpp12
-rw-r--r--src/pal/tests/CMakeLists.txt15
-rw-r--r--src/pal/tests/palsuite/c_runtime/CMakeLists.txt35
-rw-r--r--src/pal/tests/palsuite/c_runtime/__iscsym/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/__iscsym/test1/__iscsym.cpp (renamed from src/pal/tests/palsuite/c_runtime/__iscsym/test1/__iscsym.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_alloca/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_ecvt/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_ecvt/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_ecvt/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_fdopen/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_fdopen/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_fdopen/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_finite/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_finite/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_finite/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_finitef/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/_finitef/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_finitef/test1/test1.c119
-rw-r--r--src/pal/tests/palsuite/c_runtime/_finitef/test1/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/c_runtime/_fullpath/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_fullpath/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_fullpath/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_gcvt/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_gcvt/test1/_gcvt.cpp (renamed from src/pal/tests/palsuite/c_runtime/_gcvt/test1/_gcvt.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_gcvt/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_gcvt/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/_gcvt/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_getw/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_getw/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_getw/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_isnan/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_isnan/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_isnan/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_isnanf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/_isnanf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_isnanf/test1/test1.c115
-rw-r--r--src/pal/tests/palsuite/c_runtime/_isnanf/test1/testinfo.dat16
-rw-r--r--src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_itow/test1/test1.c102
-rw-r--r--src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp101
-rw-r--r--src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat6
-rw-r--r--src/pal/tests/palsuite/c_runtime/_makepath/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_makepath/test1/test1.c65
-rw-r--r--src/pal/tests/palsuite/c_runtime/_makepath/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_mbsdec/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_mbsdec/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_mbsdec/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_mbsinc/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_mbsinc/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_mbsinc/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_mbslen/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/c_runtime/_mbslen/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_mbslen/test1/test1.c66
-rw-r--r--src/pal/tests/palsuite/c_runtime/_mbslen/test1/testinfo.dat15
-rw-r--r--src/pal/tests/palsuite/c_runtime/_mbsninc/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_mbsninc/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_mbsninc/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putenv/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putenv/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_putenv/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putenv/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putenv/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/_putenv/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putenv/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putenv/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/_putenv/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putenv/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putenv/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/_putenv/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putw/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putw/test1/test1.c112
-rw-r--r--src/pal/tests/palsuite/c_runtime/_putw/test1/test1.cpp112
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/CMakeLists.txt22
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/_snprintf.h194
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test1/test1.c58
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test10/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test10/test10.c55
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test10/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test11/test11.c54
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test11/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test12/test12.c55
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test12/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test13/test13.c55
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test13/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test14/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test14/test14.c57
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test14/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test15/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test15/test15.c56
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test15/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test16/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test16/test16.c52
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test16/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test17/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test17/test17.c53
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test17/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test18/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test18/test18.c53
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test18/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test19/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test19/test19.c76
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test19/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test2/test2.c44
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test2/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test3/test3.c45
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test3/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test4/test4.c69
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test4/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test5/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test5/test5.c61
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test5/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test6/test6.c47
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test6/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test7/test7.c47
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test7/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test8/test8.c56
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test8/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test9/test9.c55
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf/test9/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/CMakeLists.txt21
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/_snprintf_s.h194
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/test1.cpp58
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/test10.cpp55
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/test11.cpp54
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/test12.cpp55
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/test13.cpp55
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/test14.cpp57
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/test15.cpp56
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/test16.cpp52
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/test17.cpp53
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/test18.cpp53
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/test19.cpp70
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/test2.cpp44
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/test3.cpp45
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/test4.cpp69
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/test6.cpp47
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/test7.cpp47
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/test8.cpp56
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/test9.cpp55
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/CMakeLists.txt22
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/_snwprintf.h199
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test1/test1.c62
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test10/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test10/test10.c54
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test10/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test11/test11.c54
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test11/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test12/test12.c54
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test12/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test13/test13.c54
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test13/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test14/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test14/test14.c66
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test14/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test15/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test15/test15.c67
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test15/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test16/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test16/test16.c65
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test16/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test17/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test17/test17.c68
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test17/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test18/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test18/test18.c69
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test18/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test19/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test19/test19.c90
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test19/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test2/test2.c44
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test2/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test3/test3.c44
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test3/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test4/test4.c71
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test4/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test5/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test5/test5.c63
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test5/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test6/test6.c46
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test6/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test7/test7.c46
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test7/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test8/test8.c53
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test8/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test9/test9.c53
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf/test9/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/CMakeLists.txt21
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/_snwprintf_s.h199
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/test1.cpp62
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/test10.cpp54
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/test11.cpp54
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/test12.cpp54
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/test13.cpp54
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/test14.cpp66
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/test15.cpp67
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/test16.cpp65
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/test17.cpp68
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/test18.cpp69
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/test19.cpp82
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/test2.cpp44
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/test3.cpp44
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/test4.cpp71
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/test6.cpp46
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/test7.cpp46
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/test8.cpp53
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/test9.cpp53
-rw-r--r--src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/_splitpath/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/c_runtime/_splitpath/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_splitpath/test1/test1.c108
-rw-r--r--src/pal/tests/palsuite/c_runtime/_splitpath/test1/testinfo.dat15
-rw-r--r--src/pal/tests/palsuite/c_runtime/_stricmp/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_stricmp/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_stricmp/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_strlwr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_strlwr/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_strlwr/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_strnicmp/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_strnicmp/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_strnicmp/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_swab/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/c_runtime/_swab/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_swab/test1/test1.c45
-rw-r--r--src/pal/tests/palsuite/c_runtime/_swab/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/_vsnprintf.h14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/test13.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/test14.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/test15.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/test16.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/test17.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/test18.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/test18.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.c103
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.cpp103
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/testinfo.dat2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/CMakeLists.txt22
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/_vsnwprintf.h133
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/test1.c60
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/test10.c50
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/test11.c50
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/test12.c50
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/test13.c50
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/test14.c63
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/test15.c64
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/test16.c63
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/test17.c65
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/test18.c65
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/test19.c139
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/test2.c40
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/test3.c40
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/test4.c121
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/test5.c81
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/test6.c43
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/test7.c43
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/test8.c49
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/test9.c49
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/CMakeLists.txt21
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/_vsnwprintf_s.h133
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/test1.cpp60
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/test10.cpp50
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/test11.cpp50
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/test12.cpp50
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/test13.cpp50
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/test14.cpp63
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/test15.cpp64
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/test16.cpp63
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/test17.cpp65
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/test18.cpp65
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/test19.cpp139
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/test2.cpp40
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/test3.cpp40
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/test4.cpp121
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/test6.cpp43
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/test7.cpp43
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/test8.cpp49
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/test9.cpp49
-rw-r--r--src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wcslwr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wfopen/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wfopen/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wfopen/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wfopen/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wfopen/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wfopen/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wfopen/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wfopen/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wmakepath/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wmakepath/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wmakepath/test1/test1.c76
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wmakepath/test1/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wsplitpath/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/test1.c151
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/testinfo.dat15
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wtoi/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/_wtoi/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/_wtoi/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/abs/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/abs/test1/abs.cpp (renamed from src/pal/tests/palsuite/c_runtime/abs/test1/abs.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/acos/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/acos/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/acos/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/acosf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/acosf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/acosf/test1/test1.c129
-rw-r--r--src/pal/tests/palsuite/c_runtime/acosf/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/asin/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/asin/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/asin/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/asinf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/asinf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/asinf/test1/test1.c145
-rw-r--r--src/pal/tests/palsuite/c_runtime/asinf/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/atan/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/atan/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/atan/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/atan2/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/atan2/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/atan2/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/atan2f/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/atan2f/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/atan2f/test1/test1.c147
-rw-r--r--src/pal/tests/palsuite/c_runtime/atan2f/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/atanf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/atanf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/atanf/test1/test1.c127
-rw-r--r--src/pal/tests/palsuite/c_runtime/atanf/test1/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/c_runtime/atof/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/atof/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/atof/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/atoi/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/atoi/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/atoi/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/atol/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/atol/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/atol/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/bsearch/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/bsearch/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/bsearch/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/bsearch/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/bsearch/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/bsearch/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/ceil/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/ceil/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/ceil/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/ceilf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/ceilf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/ceilf/test1/test1.c131
-rw-r--r--src/pal/tests/palsuite/c_runtime/ceilf/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/cos/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/cos/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/cos/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/cosf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/cosf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/cosf/test1/test1.c130
-rw-r--r--src/pal/tests/palsuite/c_runtime/cosf/test1/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/c_runtime/cosh/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/cosh/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/cosh/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/coshf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/coshf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/coshf/test1/test1.c129
-rw-r--r--src/pal/tests/palsuite/c_runtime/coshf/test1/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/c_runtime/ctime/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/ctime/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/ctime/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/errno/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/errno/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/errno/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/errno/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/errno/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/errno/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/exit/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/exit/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/exit/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/exit/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/exit/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/exit/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/exp/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/exp/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/exp/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/expf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/expf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/expf/test1/test1.c137
-rw-r--r--src/pal/tests/palsuite/c_runtime/expf/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/fabs/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fabs/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fabs/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fabsf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fabsf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fabsf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fclose/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fclose/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fclose/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fclose/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fclose/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/fclose/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/feof/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/feof/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/feof/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/ferror/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/ferror/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/ferror/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/ferror/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/ferror/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/ferror/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fflush/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fflush/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fflush/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fgets/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fgets/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fgets/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fgets/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fgets/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/fgets/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fgets/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fgets/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/fgets/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/floor/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/floor/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/floor/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/floorf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/floorf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/floorf/test1/test1.c131
-rw-r--r--src/pal/tests/palsuite/c_runtime/floorf/test1/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/c_runtime/fmod/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fmod/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fmod/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fmodf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fmodf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fmodf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fopen/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/fopen/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/fopen/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/fopen/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/fopen/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/fopen/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fopen/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/fopen/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/fprintf.h14
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test13/test13.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test14/test14.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test15/test15.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test16/test16.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test17/test17.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test18/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test18/test18.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test18/test18.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test19/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test19/test19.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test19/test19.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fprintf/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/fprintf/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fputs/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fputs/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fputs/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fputs/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fputs/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/fputs/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fread/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fread/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fread/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fread/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fread/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/fread/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fread/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fread/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/fread/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/free/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/free/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/free/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fseek/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fseek/test1/test1.c193
-rw-r--r--src/pal/tests/palsuite/c_runtime/fseek/test1/test1.cpp193
-rw-r--r--src/pal/tests/palsuite/c_runtime/ftell/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/ftell/test1/ftell.cpp (renamed from src/pal/tests/palsuite/c_runtime/ftell/test1/ftell.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/fwprintf.h34
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test13/test13.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test14/test14.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test15/test15.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test16/test16.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test17/test17.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test18/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test18/test18.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test18/test18.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test19/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.c81
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.cpp81
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwprintf/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwprintf/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwrite/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/fwrite/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/fwrite/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/getc/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/getc/test1/getc.cpp (renamed from src/pal/tests/palsuite/c_runtime/getc/test1/getc.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/getenv/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/getenv/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/getenv/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/getenv/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/getenv/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/getenv/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/getenv/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/getenv/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/getenv/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/isalnum/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/isalnum/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/isalnum/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/isalpha/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/isalpha/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/isalpha/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/isdigit/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/isdigit/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/isdigit/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/islower/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/islower/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/islower/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/isprint/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/isprint/test1/isprint.cpp (renamed from src/pal/tests/palsuite/c_runtime/isprint/test1/isprint.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/isprint/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/isprint/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/isprint/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/isspace/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/isspace/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/isspace/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/isupper/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/isupper/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/isupper/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/iswdigit/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/iswdigit/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/iswdigit/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/iswprint/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/iswprint/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/iswprint/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/iswspace/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/iswspace/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/iswspace/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/iswupper/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/iswupper/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/iswupper/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/iswxdigit/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/iswxdigit/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/iswxdigit/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/isxdigit/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/isxdigit/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/isxdigit/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/labs/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/labs/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/labs/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/llabs/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/llabs/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/llabs/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/localtime/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/localtime/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/localtime/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/log/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/log/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/log/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/log10/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/log10/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/log10/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/log10f/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/log10f/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/log10f/test1/test1.c144
-rw-r--r--src/pal/tests/palsuite/c_runtime/log10f/test1/testinfo.dat17
-rw-r--r--src/pal/tests/palsuite/c_runtime/logf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/logf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/logf/test1/test1.c139
-rw-r--r--src/pal/tests/palsuite/c_runtime/logf/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/c_runtime/malloc/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/malloc/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/malloc/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/malloc/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/malloc/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/memchr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/memchr/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/memchr/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/memcmp/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/memcmp/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/memcmp/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/memcpy/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/memcpy/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/memcpy/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/memmove/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/memmove/test1/test1.c116
-rw-r--r--src/pal/tests/palsuite/c_runtime/memmove/test1/test1.cpp116
-rw-r--r--src/pal/tests/palsuite/c_runtime/memset/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/memset/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/memset/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/modf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/modf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/modf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/modff/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/modff/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/modff/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/pow/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/pow/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/pow/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/powf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/powf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/powf/test1/test1.c229
-rw-r--r--src/pal/tests/palsuite/c_runtime/powf/test1/testinfo.dat17
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/printf.h34
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test13/test13.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test14/test14.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test15/test15.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test16/test16.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test17/test17.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test18/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test18/test18.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test18/test18.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test19/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test19/test19.c76
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test19/test19.cpp76
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/printf/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/printf/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/qsort/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/qsort/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/qsort/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/qsort/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/qsort/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/qsort/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/rand_srand/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/rand_srand/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/rand_srand/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/realloc/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/realloc/test1/test1.c66
-rw-r--r--src/pal/tests/palsuite/c_runtime/realloc/test1/test1.cpp66
-rw-r--r--src/pal/tests/palsuite/c_runtime/sin/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/sin/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/sin/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sinf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/sinf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sinf/test1/test1.c130
-rw-r--r--src/pal/tests/palsuite/c_runtime/sinf/test1/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/c_runtime/sinh/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/sinh/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/sinh/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sinhf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/sinhf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sinhf/test1/test1.c129
-rw-r--r--src/pal/tests/palsuite/c_runtime/sinhf/test1/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/CMakeLists.txt22
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/sprintf.h195
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test1/test1.c45
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test10/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test10/test10.c55
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test10/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test11/test11.c55
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test11/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test12/test12.c56
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test12/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test13/test13.c56
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test13/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test14/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test14/test14.c53
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test14/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test15/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test15/test15.c53
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test15/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test16/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test16/test16.c52
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test16/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test17/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test17/test17.c54
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test17/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test18/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test18/test18.c53
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test18/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test19/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test19/test19.c78
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test19/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test2/test2.c47
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test2/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test3/test3.c47
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test3/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test4/test4.c69
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test4/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test5/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test5/test5.c62
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test5/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test6/test6.c50
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test6/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test7/test7.c49
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test7/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test8/test8.c55
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test8/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test9/test9.c55
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test9/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/CMakeLists.txt21
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h195
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp45
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test10/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp55
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test10/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp55
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test11/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp56
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test12/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp56
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test13/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test14/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp53
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test14/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test15/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp53
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test15/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test16/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp52
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test16/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test17/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp54
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test17/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test18/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp53
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test18/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test19/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp71
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test19/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp47
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test2/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp47
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test3/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp69
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test4/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp50
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test6/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp49
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test7/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp55
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test8/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp55
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test9/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sqrt/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/sqrt/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/sqrt/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sqrtf/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/_makepath/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sqrtf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sqrtf/test1/test1.c122
-rw-r--r--src/pal/tests/palsuite/c_runtime/sqrtf/test1/testinfo.dat17
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/sscanf.h246
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test1/test1.c53
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test10/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test10/test10.c37
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test10/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test11/test11.c36
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test11/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test12/test12.c35
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test12/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test13/test13.c37
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test13/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test14/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test14/test14.c36
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test14/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test15/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test15/test15.c36
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test15/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test16/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test16/test16.c37
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test16/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test17/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test17/test17.c37
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test17/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test2/test2.c44
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test2/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test3/test3.c35
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test3/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test4/test4.c44
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test4/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test5/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test5/test5.c43
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test5/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test6/test6.c43
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test6/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test7/test7.c43
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test7/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test8/test8.c43
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test8/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test9/test9.c38
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf/test9/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h246
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp53
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test10/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp37
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test10/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp36
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test11/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp35
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test12/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp37
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test13/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test14/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp36
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test14/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test15/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp36
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test15/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test16/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp37
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test16/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test17/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp37
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test17/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp44
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test2/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp35
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test3/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp44
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test4/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test5/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp43
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test5/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp43
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test6/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp43
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test7/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp43
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test8/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp38
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test9/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/strcat/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strcat/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strcat/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strchr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strchr/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strchr/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strcmp/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strcmp/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strcmp/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strcpy/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strcpy/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strcpy/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strcspn/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strcspn/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strcspn/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strlen/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strlen/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strlen/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strncat/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strncat/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strncat/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strncmp/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strncmp/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strncmp/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strncpy/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strncpy/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strncpy/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strpbrk/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strpbrk/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strpbrk/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strrchr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strrchr/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strrchr/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strspn/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strspn/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strspn/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strstr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strstr/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strstr/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strtod/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strtod/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strtod/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strtod/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strtod/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/strtod/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strtok/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strtok/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strtok/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/strtoul/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/strtoul/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/strtoul/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h32
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test13/test13.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test14/test14.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test15/test15.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test16/test16.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test17/test17.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test18/test18.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test18/test18.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.c109
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp109
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swprintf/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/swprintf/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h22
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test13/test13.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test14/test14.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test15/test15.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test16/test16.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/swscanf/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/tan/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/tan/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/tan/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/tanf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/tanf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/tanf/test1/test1.c136
-rw-r--r--src/pal/tests/palsuite/c_runtime/tanf/test1/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/c_runtime/tanh/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/tanh/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/tanh/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/tanhf/CMakeLists.txt3
-rw-r--r--src/pal/tests/palsuite/c_runtime/tanhf/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/tanhf/test1/test1.c129
-rw-r--r--src/pal/tests/palsuite/c_runtime/tanhf/test1/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/c_runtime/time/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/time/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/time/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/tolower/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/tolower/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/tolower/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/toupper/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/toupper/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/toupper/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/towlower/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/towlower/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/towlower/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/towupper/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/towupper/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/towupper/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/ungetc/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/ungetc/test1/ungetc.cpp (renamed from src/pal/tests/palsuite/c_runtime/ungetc/test1/ungetc.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/ungetc/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/ungetc/test2/ungetc.cpp (renamed from src/pal/tests/palsuite/c_runtime/ungetc/test2/ungetc.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test13/test13.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test14/test14.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test15/test15.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test16/test16.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test17/test17.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test18/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test18/test18.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test18/test18.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test19/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.c76
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.cpp76
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/vfprintf/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vfprintf/vfprintf.h34
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test13/test13.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test14/test14.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test15/test15.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test16/test16.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test17/test17.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test18/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test18/test18.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test18/test18.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test19/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.c76
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.cpp76
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/vprintf/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vprintf/vprintf.h34
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test13/test13.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test14/test14.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test15/test15.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test16/test16.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test17/test17.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test18/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test18/test18.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test18/test18.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test19/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.c67
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.cpp67
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/vsprintf/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h34
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test13/test13.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test14/test14.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test15/test15.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test16/test16.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test17/test17.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test18/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test18/test18.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test18/test18.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test19/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.c137
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp137
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/vswprintf/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h14
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcscat/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.c71
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp71
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcschr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcschr/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcschr/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcscmp/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcscmp/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcscmp/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcscpy/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.c47
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp47
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcslen/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcslen/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcslen/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcsncat/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcsncat/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcsncat/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcsncmp/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcsncmp/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcsncmp/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcsncpy/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcsncpy/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcsncpy/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcspbrk/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcspbrk/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcspbrk/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcsrchr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcsrchr/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcsrchr/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcsstr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcsstr/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcsstr/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstod/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstod/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstod/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstod/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstod/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstod/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstok/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstok/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstok/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstol/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstol/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstol/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstol/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstol/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstol/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstol/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstoul/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstoul/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstoul/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstoul/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstoul/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcstoul/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/wcstoul/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wprintf/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wprintf/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/wprintf/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wprintf/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/c_runtime/wprintf/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/wprintf/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/wprintf/wprintf.h32
-rw-r--r--src/pal/tests/palsuite/common/palsuite.h6
-rw-r--r--src/pal/tests/palsuite/composite/object_management/event/nonshared/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp (renamed from src/pal/tests/palsuite/composite/object_management/event/nonshared/event.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp (renamed from src/pal/tests/palsuite/composite/object_management/event/nonshared/main.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/event/shared/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/composite/object_management/event/shared/event.cpp (renamed from src/pal/tests/palsuite/composite/object_management/event/shared/event.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/event/shared/main.cpp (renamed from src/pal/tests/palsuite/composite/object_management/event/shared/main.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/mutex/nonshared/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/composite/object_management/mutex/nonshared/main.cpp (renamed from src/pal/tests/palsuite/composite/object_management/mutex/nonshared/main.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/mutex/nonshared/mutex.cpp (renamed from src/pal/tests/palsuite/composite/object_management/mutex/nonshared/mutex.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/mutex/shared/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/composite/object_management/mutex/shared/main.cpp (renamed from src/pal/tests/palsuite/composite/object_management/mutex/shared/main.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/mutex/shared/mutex.cpp (renamed from src/pal/tests/palsuite/composite/object_management/mutex/shared/mutex.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp (renamed from src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp (renamed from src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/semaphore/shared/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp (renamed from src/pal/tests/palsuite/composite/object_management/semaphore/shared/main.c)0
-rw-r--r--src/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp (renamed from src/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.c)0
-rw-r--r--src/pal/tests/palsuite/composite/synchronization/criticalsection/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/composite/synchronization/criticalsection/criticalsection.cpp (renamed from src/pal/tests/palsuite/composite/synchronization/criticalsection/criticalsection.c)0
-rw-r--r--src/pal/tests/palsuite/composite/synchronization/criticalsection/mainWrapper.cpp (renamed from src/pal/tests/palsuite/composite/synchronization/criticalsection/mainWrapper.c)0
-rw-r--r--src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp (renamed from src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.c)0
-rw-r--r--src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp (renamed from src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.c)0
-rw-r--r--src/pal/tests/palsuite/composite/threading/threadsuspension/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/composite/threading/threadsuspension/mainWrapper.cpp (renamed from src/pal/tests/palsuite/composite/threading/threadsuspension/mainWrapper.c)0
-rw-r--r--src/pal/tests/palsuite/composite/threading/threadsuspension/threadsuspension.cpp (renamed from src/pal/tests/palsuite/composite/threading/threadsuspension/threadsuspension.c)0
-rw-r--r--src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/mainWrapper.cpp (renamed from src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/mainWrapper.c)0
-rw-r--r--src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/threadsuspension.cpp (renamed from src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/threadsuspension.c)0
-rw-r--r--src/pal/tests/palsuite/composite/wfmo/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/composite/wfmo/main.cpp (renamed from src/pal/tests/palsuite/composite/wfmo/main.c)0
-rw-r--r--src/pal/tests/palsuite/composite/wfmo/mutex.cpp (renamed from src/pal/tests/palsuite/composite/wfmo/mutex.c)0
-rw-r--r--src/pal/tests/palsuite/debug_api/DebugBreak/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/debug_api/DebugBreak/test1/test1.cpp (renamed from src/pal/tests/palsuite/debug_api/DebugBreak/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/helper.cpp (renamed from src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/helper.c)0
-rw-r--r--src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/test1.cpp (renamed from src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/test1.cpp (renamed from src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.c243
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp243
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.c189
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp189
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp (renamed from src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.c)0
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.c205
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp205
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp (renamed from src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.c)0
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp (renamed from src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.cpp (renamed from src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/test1.cpp (renamed from src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test1/test1.cpp (renamed from src/pal/tests/palsuite/exception_handling/pal_except/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test2/test2.cpp (renamed from src/pal/tests/palsuite/exception_handling/pal_except/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test3/test3.cpp (renamed from src/pal/tests/palsuite/exception_handling/pal_except/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test4/test4.cpp (renamed from src/pal/tests/palsuite/exception_handling/pal_except/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test5/test5.cpp (renamed from src/pal/tests/palsuite/exception_handling/pal_except/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test6/test6.cpp (renamed from src/pal/tests/palsuite/exception_handling/pal_except/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_except/test7/test7.cpp (renamed from src/pal/tests/palsuite/exception_handling/pal_except/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_finally/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_finally/test1/pal_finally.cpp (renamed from src/pal/tests/palsuite/exception_handling/pal_finally/test1/pal_finally.c)0
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_sxs/test1/dlltest1.cpp14
-rw-r--r--src/pal/tests/palsuite/exception_handling/pal_sxs/test1/dlltest2.cpp14
-rw-r--r--src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/AreFileApisANSI.cpp (renamed from src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/AreFileApisANSI.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CompareFileTime/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CompareFileTime/test1/CompareFileTime.cpp (renamed from src/pal/tests/palsuite/file_io/CompareFileTime/test1/CompareFileTime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileA/test1/CopyFileA.cpp (renamed from src/pal/tests/palsuite/file_io/CopyFileA/test1/CopyFileA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileA/test2/test2.cpp (renamed from src/pal/tests/palsuite/file_io/CopyFileA/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileA/test3/test3.cpp (renamed from src/pal/tests/palsuite/file_io/CopyFileA/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileA/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileA/test4/test4.cpp (renamed from src/pal/tests/palsuite/file_io/CopyFileA/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileW/test1/CopyFileW.cpp (renamed from src/pal/tests/palsuite/file_io/CopyFileW/test1/CopyFileW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileW/test2/test2.cpp (renamed from src/pal/tests/palsuite/file_io/CopyFileW/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CopyFileW/test3/test3.cpp (renamed from src/pal/tests/palsuite/file_io/CopyFileW/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.c296
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.cpp296
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/createdirectorya.cpp (renamed from src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/createdirectorya.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.c347
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.cpp347
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/createdirectoryw.cpp (renamed from src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/createdirectoryw.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/CreateFileA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.c145
-rw-r--r--src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp145
-rw-r--r--src/pal/tests/palsuite/file_io/CreateFileW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.c152
-rw-r--r--src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp152
-rw-r--r--src/pal/tests/palsuite/file_io/DeleteFileW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/DeleteFileW/test1/DeleteFileW.cpp (renamed from src/pal/tests/palsuite/file_io/DeleteFileW/test1/DeleteFileW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/FILECanonicalizePath/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.c83
-rw-r--r--src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.cpp83
-rw-r--r--src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/test1.cpp (renamed from src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/FindClose/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/FindClose/test1/FindClose.cpp (renamed from src/pal/tests/palsuite/file_io/FindClose/test1/FindClose.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/FindFirstFileA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/FindFirstFileA/test1/FindFirstFileA.cpp (renamed from src/pal/tests/palsuite/file_io/FindFirstFileA/test1/FindFirstFileA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/FindFirstFileW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/FindFirstFileW/test1/FindFirstFileW.cpp (renamed from src/pal/tests/palsuite/file_io/FindFirstFileW/test1/FindFirstFileW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/FindNextFileA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/FindNextFileA/test1/FindNextFileA.cpp (renamed from src/pal/tests/palsuite/file_io/FindNextFileA/test1/FindNextFileA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/FindNextFileA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/FindNextFileA/test2/findnextfilea.cpp (renamed from src/pal/tests/palsuite/file_io/FindNextFileA/test2/findnextfilea.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/FindNextFileW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/FindNextFileW/test1/FindNextFileW.cpp (renamed from src/pal/tests/palsuite/file_io/FindNextFileW/test1/FindNextFileW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/FindNextFileW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/FindNextFileW/test2/findnextfilew.cpp (renamed from src/pal/tests/palsuite/file_io/FindNextFileW/test2/findnextfilew.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/FlushFileBuffers.cpp (renamed from src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/FlushFileBuffers.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetConsoleCP/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetConsoleCP/test1/GetConsoleCP.cpp (renamed from src/pal/tests/palsuite/file_io/GetConsoleCP/test1/GetConsoleCP.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.cpp (renamed from src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.cpp (renamed from src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.cpp (renamed from src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/GetDiskFreeSpaceW.cpp (renamed from src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/GetDiskFreeSpaceW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/getdiskfreespacew.cpp (renamed from src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/getdiskfreespacew.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/GetFileAttributesA.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/GetFileAttributesA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/test1.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/test2.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/GetFileAttributesW.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/GetFileAttributesW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileSize/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileSize/test1/GetFileSize.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileSize/test1/GetFileSize.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/GetFileSizeEx.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/GetFileSizeEx.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test1/GetFileTime.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileTime/test1/GetFileTime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test2/GetFileTime.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileTime/test2/GetFileTime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test3/GetFileTime.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileTime/test3/GetFileTime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test4/GetFileTime.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileTime/test4/GetFileTime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test5/getfiletime.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileTime/test5/getfiletime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test6/getfiletime.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileTime/test6/getfiletime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileTime/test7/getfiletime.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileTime/test7/getfiletime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileType/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileType/test1/GetFileType.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileType/test1/GetFileType.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileType/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileType/test2/getfiletype.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileType/test2/getfiletype.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileType/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFileType/test3/getfiletype.cpp (renamed from src/pal/tests/palsuite/file_io/GetFileType/test3/getfiletype.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/GetFullPathNameA.cpp (renamed from src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/GetFullPathNameA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/test2.cpp (renamed from src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.cpp (renamed from src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/test4.cpp (renamed from src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/GetFullPathNameW.cpp (renamed from src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/GetFullPathNameW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.cpp (renamed from src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.cpp (renamed from src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/test4.cpp (renamed from src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/GetLongPathNameW.cpp (renamed from src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/GetLongPathNameW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/getlongpathnamew.cpp (renamed from src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/getlongpathnamew.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetStdHandle/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetStdHandle/test1/GetStdHandle.cpp (renamed from src/pal/tests/palsuite/file_io/GetStdHandle/test1/GetStdHandle.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetStdHandle/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetStdHandle/test2/GetStdHandle.cpp (renamed from src/pal/tests/palsuite/file_io/GetStdHandle/test2/GetStdHandle.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetSystemTime/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp (renamed from src/pal/tests/palsuite/file_io/GetSystemTime/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp (renamed from src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.c125
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp125
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/GetTempFileNameA.cpp (renamed from src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/GetTempFileNameA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/gettempfilenamea.cpp (renamed from src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/gettempfilenamea.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp (renamed from src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/GetTempFileNameW.cpp (renamed from src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/GetTempFileNameW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/gettempfilenamew.cpp (renamed from src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/gettempfilenamew.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempPathW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.c103
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.cpp103
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.c469
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.cpp469
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileExA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileExA/test1/MoveFileExA.cpp (renamed from src/pal/tests/palsuite/file_io/MoveFileExA/test1/MoveFileExA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileExW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileExW/test1/MoveFileExW.cpp (renamed from src/pal/tests/palsuite/file_io/MoveFileExW/test1/MoveFileExW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.c478
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.cpp478
-rw-r--r--src/pal/tests/palsuite/file_io/ReadFile/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/ReadFile/test1/ReadFile.cpp (renamed from src/pal/tests/palsuite/file_io/ReadFile/test1/ReadFile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/ReadFile/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp (renamed from src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/ReadFile/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/ReadFile/test3/ReadFile.cpp (renamed from src/pal/tests/palsuite/file_io/ReadFile/test3/ReadFile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/ReadFile/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/ReadFile/test4/readfile.cpp (renamed from src/pal/tests/palsuite/file_io/ReadFile/test4/readfile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/RemoveDirectoryA/test1/RemoveDirectoryA.cpp12
-rw-r--r--src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.c282
-rw-r--r--src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.cpp282
-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.c144
-rw-r--r--src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp139
-rw-r--r--src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.c198
-rw-r--r--src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp193
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.c215
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.cpp215
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.c142
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.cpp142
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/setcurrentdirectorya.cpp (renamed from src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/setcurrentdirectorya.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.c178
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp178
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.c147
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp147
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.cpp (renamed from src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetEndOfFile/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetEndOfFile/test1/SetEndOfFile.cpp (renamed from src/pal/tests/palsuite/file_io/SetEndOfFile/test1/SetEndOfFile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetEndOfFile/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetEndOfFile/test2/SetEndOfFile.cpp (renamed from src/pal/tests/palsuite/file_io/SetEndOfFile/test2/SetEndOfFile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetEndOfFile/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetEndOfFile/test3/SetEndOfFile.cpp (renamed from src/pal/tests/palsuite/file_io/SetEndOfFile/test3/SetEndOfFile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetEndOfFile/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetEndOfFile/test4/setendoffile.cpp (renamed from src/pal/tests/palsuite/file_io/SetEndOfFile/test4/setendoffile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetEndOfFile/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetEndOfFile/test5/test5.cpp (renamed from src/pal/tests/palsuite/file_io/SetEndOfFile/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/SetFileAttributesA.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/SetFileAttributesA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/SetFileAttributesA.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/SetFileAttributesA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/SetFileAttributesA.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/SetFileAttributesA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/SetFileAttributesA.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/SetFileAttributesA.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/SetFileAttributesW.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/SetFileAttributesW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/SetFileAttributesW.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/SetFileAttributesW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/SetFileAttributesW.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/SetFileAttributesW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/SetFileAttributesW.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/SetFileAttributesW.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test1/SetFilePointer.cpp (renamed from src/pal/tests/palsuite/file_io/SetFilePointer/test1/SetFilePointer.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test2/SetFilePointer.cpp (renamed from src/pal/tests/palsuite/file_io/SetFilePointer/test2/SetFilePointer.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test3/SetFilePointer.cpp (renamed from src/pal/tests/palsuite/file_io/SetFilePointer/test3/SetFilePointer.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test4/SetFilePointer.cpp (renamed from src/pal/tests/palsuite/file_io/SetFilePointer/test4/SetFilePointer.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test5/SetFilePointer.cpp (renamed from src/pal/tests/palsuite/file_io/SetFilePointer/test5/SetFilePointer.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test6/SetFilePointer.cpp (renamed from src/pal/tests/palsuite/file_io/SetFilePointer/test6/SetFilePointer.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFilePointer/test7/SetFilePointer.cpp (renamed from src/pal/tests/palsuite/file_io/SetFilePointer/test7/SetFilePointer.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileTime/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileTime/test1/SetFileTime.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileTime/test1/SetFileTime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileTime/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileTime/test2/SetFileTime.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileTime/test2/SetFileTime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileTime/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileTime/test3/SetFileTime.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileTime/test3/SetFileTime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileTime/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetFileTime/test4/SetFileTime.cpp (renamed from src/pal/tests/palsuite/file_io/SetFileTime/test4/SetFileTime.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/WriteFile/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/WriteFile/test1/WriteFile.cpp (renamed from src/pal/tests/palsuite/file_io/WriteFile/test1/WriteFile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/WriteFile/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp (renamed from src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/WriteFile/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/WriteFile/test3/WriteFile.cpp (renamed from src/pal/tests/palsuite/file_io/WriteFile/test3/WriteFile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/WriteFile/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/WriteFile/test4/writefile.cpp (renamed from src/pal/tests/palsuite/file_io/WriteFile/test4/writefile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/WriteFile/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/WriteFile/test5/writefile.cpp (renamed from src/pal/tests/palsuite/file_io/WriteFile/test5/writefile.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/errorpathnotfound/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/errorpathnotfound/test1/test1.cpp (renamed from src/pal/tests/palsuite/file_io/errorpathnotfound/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/errorpathnotfound/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/errorpathnotfound/test2/test2.cpp (renamed from src/pal/tests/palsuite/file_io/errorpathnotfound/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/errorpathnotfound/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/errorpathnotfound/test3/test3.cpp (renamed from src/pal/tests/palsuite/file_io/errorpathnotfound/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/errorpathnotfound/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/errorpathnotfound/test4/test4.cpp (renamed from src/pal/tests/palsuite/file_io/errorpathnotfound/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/file_io/gettemppatha/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/gettemppatha/test1/gettemppatha.cpp (renamed from src/pal/tests/palsuite/file_io/gettemppatha/test1/gettemppatha.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CreateFileMapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CreateFileMapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CreateFileMapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CreateFileMapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CreateFileMapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CreateFileMapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CreateFileMapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CreateFileMapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CreateFileMapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CreateFileMapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/createfilemapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/createfilemapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/createfilemapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/createfilemapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/createfilemapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/createfilemapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.c124
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp124
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/FreeLibrary.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/FreeLibrary.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/dlltest.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/dlltest.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/test2.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/dlltest.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/dlltest.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.c183
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.cpp183
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.c112
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.cpp112
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.c57
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.cpp57
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/test1.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/testlib.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/testlib.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/test2.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/testlib.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/testlib.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/GetProcessHeap.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/GetProcessHeap.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/HeapAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/HeapAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/HeapAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/HeapAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/HeapAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/HeapAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/HeapFree.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/HeapFree.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/test1.c72
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/test1.cpp72
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/test2.c79
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/test2.cpp79
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/test3.c78
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/test3.cpp78
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/test4.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/test5.c69
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/test5.cpp69
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/LocalAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/LocalAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/LocalFree.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/LocalFree.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/LocalFree.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/LocalFree.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/helper.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/helper.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/test1.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/test2.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/helper.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/helper.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/test3.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/test4.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/helper.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/helper.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/test5.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/helper.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/helper.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/test6.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/test7.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/OpenFileMappingA.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/OpenFileMappingA.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/OpenFileMappingA.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/OpenFileMappingA.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/OpenFileMappingA.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/OpenFileMappingA.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/CMakeLists.txt5
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/ProbeMemory_neg.cpp95
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/ProbeMemory.cpp94
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/CMakeLists.txt6
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/ReadProcessMemory_neg.c127
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/ReadProcessMemory.c126
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/CMakeLists.txt36
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/commonconsts.h48
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/helper.c249
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/test2.c258
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/testinfo.dat18
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/test1.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/test3.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/test4.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/test5.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/helper.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/helper.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/test1.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/test2.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/helper.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/helper.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/test3.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/test4.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/CMakeLists.txt1
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/virtualalloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/virtualalloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/virtualalloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/virtualalloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/VirtualAlloc.cpp44
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/VirtualFree.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/VirtualFree.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/VirtualFree.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/VirtualFree.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/VirtualFree.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/VirtualFree.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/VirtualProtect.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/VirtualProtect.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/VirtualProtect.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/VirtualProtect.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/VirtualProtect.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/VirtualProtect.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/VirtualProtect.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/VirtualProtect.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/VirtualProtect.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/VirtualProtect.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/VirtualProtect.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/VirtualProtect.c)0
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/VirtualQuery.cpp (renamed from src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/VirtualQuery.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test1/LoadLibraryA.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryA/test1/LoadLibraryA.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test2/LoadLibraryA.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryA/test2/LoadLibraryA.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test2/MyModule.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryA/test2/MyModule.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test3/loadlibrarya.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryA/test3/loadlibrarya.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.c67
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp67
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test6/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test6/dlltest.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryA/test6/dlltest.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test6/loadlibrarya.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryA/test6/loadlibrarya.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test7/LoadLibraryA.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryA/test7/LoadLibraryA.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test8/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test8/dlltest.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryA/test8/dlltest.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test8/loadlibrarya.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryA/test8/loadlibrarya.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test1/LoadLibraryW.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryW/test1/LoadLibraryW.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test2/loadlibraryw.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryW/test2/loadlibraryw.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp (renamed from src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.c)0
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.c71
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp71
-rw-r--r--src/pal/tests/palsuite/locale_info/CompareStringA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/CompareStringA/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/CompareStringA/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/CompareStringW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/CompareStringW/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/CompareStringW/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetACP/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetACP/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/GetACP/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetCPInfo/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetCPInfo/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/GetCPInfo/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetCPInfo/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetCPInfo/test2/test2.cpp (renamed from src/pal/tests/palsuite/locale_info/GetCPInfo/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetCPInfo/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetCPInfo/test3/test3.cpp (renamed from src/pal/tests/palsuite/locale_info/GetCPInfo/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/test2.cpp (renamed from src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/test2.cpp (renamed from src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/test2.cpp (renamed from src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/IsValidLocale/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/IsValidLocale/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/IsValidLocale/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/test2.cpp (renamed from src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/test3.cpp (renamed from src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.c230
-rw-r--r--src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.cpp230
-rw-r--r--src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/test1.cpp (renamed from src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/test2.cpp (renamed from src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/test3.cpp (renamed from src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/test4.cpp (renamed from src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.c154
-rw-r--r--src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.cpp154
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CMakeLists.txt6
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CharNextA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CharNextA/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/CharNextA/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CharNextA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CharNextA/test2/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/CharNextA/test2/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.c64
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.cpp64
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/test1.cpp (renamed from src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/test1.cpp (renamed from src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/GetCalendarInfoW.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/GetCalendarInfoW.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/GetCalendarInfoW.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/GetCalendarInfoW.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.c71
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.cpp71
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.c85
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.cpp85
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.c98
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.cpp98
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.c100
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.cpp100
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.c84
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.cpp84
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.c75
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.cpp75
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.c145
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.cpp145
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.c99
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.cpp99
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.c79
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.cpp79
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.c63
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.cpp63
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.c144
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.cpp144
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.c99
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.cpp99
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetLastError/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetLastError/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetLastError/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/test1.cpp (renamed from src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/test2.cpp (renamed from src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp (renamed from src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/test1.cpp (renamed from src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/test2.cpp (renamed from src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.c144
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.cpp144
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.c100
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.cpp100
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.c143
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.cpp143
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.c99
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.cpp99
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetLastError/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/SetLastError/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/SetLastError/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_i64tow/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.c76
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp76
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_i64tow/test1/testinfo.dat6
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_ui64tow/CMakeLists.txt5
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/_ui64tow.c101
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/_ui64tow.c88
-rw-r--r--src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/testinfo.dat13
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/CMakeLists.txt7
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/test.c59
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/testinfo.dat16
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/test2.c53
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/test3.c46
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/testinfo.dat26
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/test4.c101
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/testinfo.dat28
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcpyW/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/test.c66
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/testinfo.dat16
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcpynW/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/test.c73
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/testinfo.dat16
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/test.cpp (renamed from src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/test1.cpp (renamed from src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/test1.cpp (renamed from src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/CMakeLists.txt13
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/test.c58
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/test.c128
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/test.c119
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/test.c120
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/test.c123
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/test.c121
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/test.c114
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/test.c112
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/test.c120
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/test.c122
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/CMakeLists.txt13
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/test.c64
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/test.c139
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/test.c128
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/test.c126
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/test.c108
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/test.c127
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/test.c115
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/test.c117
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/test.c128
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/test.c128
-rw-r--r--src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/testinfo.dat14
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.c78
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp78
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.cpp (renamed from src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.c)0
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.cpp (renamed from src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.c)0
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.cpp (renamed from src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.c)0
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.c64
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp64
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.c62
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp62
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_errno/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_errno/test1/PAL_errno.cpp (renamed from src/pal/tests/palsuite/pal_specific/PAL_errno/test1/PAL_errno.c)0
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/PAL_get_stderr.cpp (renamed from src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/PAL_get_stderr.c)0
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/PAL_get_stdin.cpp (renamed from src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/PAL_get_stdin.c)0
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/PAL_get_stdout.cpp (renamed from src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/PAL_get_stdout.c)0
-rw-r--r--src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/pal_entrypoint.cpp (renamed from src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/pal_entrypoint.c)0
-rw-r--r--src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/pal_initializedebug.cpp (renamed from src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/pal_initializedebug.c)0
-rw-r--r--src/pal/tests/palsuite/paltestlist.txt226
-rw-r--r--src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt9
-rw-r--r--src/pal/tests/palsuite/palverify.dat210
-rw-r--r--src/pal/tests/palsuite/samples/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/samples/test1/test.cpp (renamed from src/pal/tests/palsuite/samples/test1/test.c)0
-rw-r--r--src/pal/tests/palsuite/samples/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/samples/test2/test.cpp (renamed from src/pal/tests/palsuite/samples/test2/test.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventA/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventA/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/CreateEventA/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventA/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventA/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/CreateEventA/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventA/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventA/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/CreateEventA/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventW/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/CreateEventW/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventW/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/CreateEventW/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateEventW/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/CreateEventW/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CreateMutexA.cpp (renamed from src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CreateMutexA.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CreateMutexA.c331
-rw-r--r--src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CreateMutexA.cpp331
-rw-r--r--src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.cpp (renamed from src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.cpp (renamed from src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessA/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessA/test1/childProcess.cpp (renamed from src/pal/tests/palsuite/threading/CreateProcessA/test1/childProcess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessA/test1/parentProcess.cpp (renamed from src/pal/tests/palsuite/threading/CreateProcessA/test1/parentProcess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessA/test2/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessA/test2/childprocess.cpp (renamed from src/pal/tests/palsuite/threading/CreateProcessA/test2/childprocess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessA/test2/parentprocess.cpp (renamed from src/pal/tests/palsuite/threading/CreateProcessA/test2/parentprocess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessW/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.c150
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.cpp150
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessW/test1/parentProcess.cpp (renamed from src/pal/tests/palsuite/threading/CreateProcessW/test1/parentProcess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessW/test2/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessW/test2/childprocess.cpp (renamed from src/pal/tests/palsuite/threading/CreateProcessW/test2/childprocess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp (renamed from src/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CreateSemaphore.cpp (renamed from src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CreateSemaphore.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CreateSemaphore.cpp (renamed from src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CreateSemaphore.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/createsemaphore.cpp (renamed from src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/createsemaphore.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.cpp (renamed from src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.cpp (renamed from src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.cpp (renamed from src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CreateThread/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateThread/test1/test1.c119
-rw-r--r--src/pal/tests/palsuite/threading/CreateThread/test1/test1.cpp119
-rw-r--r--src/pal/tests/palsuite/threading/CreateThread/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateThread/test2/test2.c184
-rw-r--r--src/pal/tests/palsuite/threading/CreateThread/test2/test2.cpp184
-rw-r--r--src/pal/tests/palsuite/threading/CreateThread/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CreateThread/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/CreateThread/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/InitializeCriticalSection.cpp (renamed from src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/InitializeCriticalSection.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/test4.cpp (renamed from src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/test5.cpp (renamed from src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/test6.cpp (renamed from src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/test7.cpp (renamed from src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/test8.cpp (renamed from src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/testlib.cpp (renamed from src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/testlib.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain1.cpp (renamed from src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain2.cpp (renamed from src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/CMakeLists.txt1
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test10/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test10/test10.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test10/test10.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test11/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test11/childprocess.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test11/childprocess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test11/test11.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test11/test11.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test12/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test12/test12.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test12/test12.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test4/test4.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test5/test5.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test6/test6.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test8/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test8/test8.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test8/test8.c)0
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test9/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/DuplicateHandle/test9/test9.cpp (renamed from src/pal/tests/palsuite/threading/DuplicateHandle/test9/test9.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.cpp (renamed from src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ExitProcess/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/ExitProcess/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ExitProcess/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/ExitProcess/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ExitThread/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ExitThread/test1/test1.c114
-rw-r--r--src/pal/tests/palsuite/threading/ExitThread/test1/test1.cpp114
-rw-r--r--src/pal/tests/palsuite/threading/ExitThread/test2/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/ExitThread/test2/childprocess.cpp (renamed from src/pal/tests/palsuite/threading/ExitThread/test2/childprocess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ExitThread/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/ExitThread/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ExitThread/test3/dllmain.cpp (renamed from src/pal/tests/palsuite/threading/ExitThread/test3/dllmain.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ExitThread/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/ExitThread/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.cpp (renamed from src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.c)0
-rw-r--r--src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/processId.cpp (renamed from src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/processId.c)0
-rw-r--r--src/pal/tests/palsuite/threading/GetCurrentThread/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/GetCurrentThread/test1/thread.cpp (renamed from src/pal/tests/palsuite/threading/GetCurrentThread/test1/thread.c)0
-rw-r--r--src/pal/tests/palsuite/threading/GetCurrentThread/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/GetCurrentThread/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/GetCurrentThread/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/threadId.cpp (renamed from src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/threadId.c)0
-rw-r--r--src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/childProcess.cpp (renamed from src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/childProcess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/GetProcessTimes/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.c122
-rw-r--r--src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.cpp122
-rw-r--r--src/pal/tests/palsuite/threading/GetThreadTimes/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.c102
-rw-r--r--src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.cpp102
-rw-r--r--src/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp12
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/OpenEventW/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/OpenEventW/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test3/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test3/childprocess.cpp (renamed from src/pal/tests/palsuite/threading/OpenEventW/test3/childprocess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test3/test3.c187
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test3/test3.cpp187
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test4/test4.cpp (renamed from src/pal/tests/palsuite/threading/OpenEventW/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/OpenEventW/test5/test5.cpp (renamed from src/pal/tests/palsuite/threading/OpenEventW/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/threading/OpenProcess/test1/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.cpp (renamed from src/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/OpenProcess/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/OpenProcess/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.c98
-rw-r--r--src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.cpp98
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/QueueUserAPC/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/QueueUserAPC/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/QueueUserAPC/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test4/test4.cpp (renamed from src/pal/tests/palsuite/threading/QueueUserAPC/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test5/test5.cpp (renamed from src/pal/tests/palsuite/threading/QueueUserAPC/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test6/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test6/test6.cpp (renamed from src/pal/tests/palsuite/threading/QueueUserAPC/test6/test6.c)0
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test7/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/QueueUserAPC/test7/test7.cpp (renamed from src/pal/tests/palsuite/threading/QueueUserAPC/test7/test7.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ReleaseMutex/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ReleaseMutex/test3/ReleaseMutex.cpp (renamed from src/pal/tests/palsuite/threading/ReleaseMutex/test3/ReleaseMutex.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/ResetEvent/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/ResetEvent/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/ResetEvent/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ResetEvent/test4/test4.cpp (renamed from src/pal/tests/palsuite/threading/ResetEvent/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ResumeThread/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ResumeThread/test1/test1.c141
-rw-r--r--src/pal/tests/palsuite/threading/ResumeThread/test1/test1.cpp141
-rw-r--r--src/pal/tests/palsuite/threading/SetErrorMode/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/SetErrorMode/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/SetErrorMode/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/SetEvent/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/SetEvent/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/SetEvent/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/SetEvent/test4/test4.cpp (renamed from src/pal/tests/palsuite/threading/SetEvent/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/threading/Sleep/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp (renamed from src/pal/tests/palsuite/threading/Sleep/test1/Sleep.c)0
-rw-r--r--src/pal/tests/palsuite/threading/Sleep/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/Sleep/test2/sleep.cpp (renamed from src/pal/tests/palsuite/threading/Sleep/test2/sleep.c)0
-rw-r--r--src/pal/tests/palsuite/threading/SleepEx/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/SleepEx/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/SleepEx/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/SleepEx/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/SleepEx/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/SleepEx/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/SwitchToThread/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/SwitchToThread/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/SwitchToThread/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test1/TLS.cpp (renamed from src/pal/tests/palsuite/threading/TLS/test1/TLS.c)0
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test2/TLS.cpp (renamed from src/pal/tests/palsuite/threading/TLS/test2/TLS.c)0
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test3/TLS.cpp (renamed from src/pal/tests/palsuite/threading/TLS/test3/TLS.c)0
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test4/test4.cpp (renamed from src/pal/tests/palsuite/threading/TLS/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test5/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test5/test5.cpp (renamed from src/pal/tests/palsuite/threading/TLS/test5/test5.c)0
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/test.cpp (renamed from src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/test.c)0
-rw-r--r--src/pal/tests/palsuite/threading/TerminateProcess/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.cpp (renamed from src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/ThreadPriority/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/ThreadPriority/test1/ThreadPriority.cpp (renamed from src/pal/tests/palsuite/threading/ThreadPriority/test1/ThreadPriority.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.cpp (renamed from src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/test3.cpp (renamed from src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/test3.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/test4.cpp (renamed from src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/test4.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.c122
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.cpp122
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.c506
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.cpp506
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.c211
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.cpp211
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.c709
-rw-r--r--src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.cpp709
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.cpp (renamed from src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp (renamed from src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp (renamed from src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c184
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.cpp184
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/ChildProcess.cpp (renamed from src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/ChildProcess.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.cpp (renamed from src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.c)0
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.c183
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp183
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/WFSOThreadTest.c179
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/WFSOThreadTest.cpp179
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/YieldProcessor/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/YieldProcessor/test1/test1.cpp (renamed from src/pal/tests/palsuite/threading/YieldProcessor/test1/test1.c)0
-rw-r--r--src/pal/tests/palsuite/threading/releasesemaphore/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/threading/releasesemaphore/test1/test.cpp (renamed from src/pal/tests/palsuite/threading/releasesemaphore/test1/test.c)0
-rwxr-xr-xsrc/pal/tools/gen-buildsys-clang.sh19
-rw-r--r--src/pal/tools/gen-buildsys-win.bat2
2784 files changed, 32084 insertions, 35304 deletions
diff --git a/src/pal/inc/mbusafecrt.h b/src/pal/inc/mbusafecrt.h
index c25676c499..8cf050f419 100644
--- a/src/pal/inc/mbusafecrt.h
+++ b/src/pal/inc/mbusafecrt.h
@@ -31,16 +31,6 @@ typedef int errno_t;
// define the return value for success
#define SAFECRT_SUCCESS 0
-/*
- * Sizes for buffers used by the _makepath() and _splitpath() functions.
- * note that the sizes include space for 0-terminator
- */
-//#define _MAX_PATH 260 /* max. length of full pathname */
-//#define _MAX_DRIVE 3 /* max. length of drive component */
-//#define _MAX_DIR 256 /* max. length of path component */
-//#define _MAX_FNAME 256 /* max. length of file name component */
-//#define _MAX_EXT 256 /* max. length of extension component */
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -65,7 +55,7 @@ extern WCHAR* wcstok_s( WCHAR* inString, const WCHAR* inControl, WCHAR** ioConte
// strnlen is not required unless the source string is completely untrusted (e.g. anonymous input on a website)
#ifndef SUPPRESS_STRNLEN
- extern size_t strnlen( const char* inString, size_t inMaxSize );
+ extern size_t PAL_strnlen( const char* inString, size_t inMaxSize );
extern size_t wcsnlen( const WCHAR* inString, size_t inMaxSize );
#endif
@@ -96,10 +86,10 @@ extern int swprintf_s( WCHAR *string, size_t sizeInWords, const WCHAR *format, .
extern int _snprintf_s( char *string, size_t sizeInBytes, size_t count, const char *format, ... );
extern int _snwprintf_s( WCHAR *string, size_t sizeInWords, size_t count, const WCHAR *format, ... );
-extern int _vsprintf_s( char* string, size_t sizeInBytes, const char* format, va_list arglist );
+extern int vsprintf_s( char* string, size_t sizeInBytes, const char* format, va_list arglist );
extern int _vsnprintf_s( char* string, size_t sizeInBytes, size_t count, const char* format, va_list arglist );
-extern int _vswprintf_s( WCHAR* string, size_t sizeInWords, const WCHAR* format, va_list arglist );
+extern int vswprintf_s( WCHAR* string, size_t sizeInWords, const WCHAR* format, va_list arglist );
extern int _vsnwprintf_s( WCHAR* string, size_t sizeInWords, size_t count, const WCHAR* format, va_list arglist );
extern int sscanf_s( const char *string, const char *format, ... );
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index 260528285e..0d7c89e6fa 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -331,7 +331,7 @@ typedef char * va_list;
PALIMPORT
BOOL
PALAPI
-PAL_IsDebuggerPresent();
+PAL_IsDebuggerPresent(VOID);
#define MAXIMUM_SUSPEND_COUNT MAXCHAR
@@ -507,7 +507,7 @@ PAL_Initialize(
PALIMPORT
int
PALAPI
-PAL_InitializeDLL();
+PAL_InitializeDLL(VOID);
PALIMPORT
DWORD
@@ -581,7 +581,7 @@ PAL_UnregisterForRuntimeStartup(
PALIMPORT
BOOL
PALAPI
-PAL_NotifyRuntimeStarted();
+PAL_NotifyRuntimeStarted(VOID);
static const int MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH = 64;
@@ -648,6 +648,13 @@ PAL_DeleteExecWatchpoint(
#endif
+PALIMPORT
+BOOL
+PALAPI
+PAL_ProbeMemory(
+ PVOID pBuffer,
+ DWORD cbBuffer,
+ BOOL fWriteAccess);
/******************* winuser.h Entrypoints *******************************/
@@ -671,28 +678,6 @@ CharNextExA(
#endif
-PALIMPORT
-int
-PALAPIV
-wsprintfA(
- OUT LPSTR,
- IN LPCSTR,
- ...);
-
-PALIMPORT
-int
-PALAPIV
-wsprintfW(
- OUT LPWSTR,
- IN LPCWSTR,
- ...);
-
-#ifdef UNICODE
-#define wsprintf wsprintfW
-#else
-#define wsprintf wsprintfA
-#endif
-
#define MB_OK 0x00000000L
#define MB_OKCANCEL 0x00000001L
#define MB_ABORTRETRYIGNORE 0x00000002L
@@ -1853,6 +1838,13 @@ QueueUserAPC(
#define MAXIMUM_SUPPORTED_EXTENSION 512
+#define CONTEXT_XSTATE (CONTEXT_i386 | 0x40L)
+
+#define CONTEXT_EXCEPTION_ACTIVE 0x8000000L
+#define CONTEXT_SERVICE_ACTIVE 0x10000000L
+#define CONTEXT_EXCEPTION_REQUEST 0x40000000L
+#define CONTEXT_EXCEPTION_REPORTING 0x80000000L
+
typedef struct _FLOATING_SAVE_AREA {
DWORD ControlWord;
DWORD StatusWord;
@@ -1911,6 +1903,16 @@ typedef struct _CONTEXT {
// support any other values in the ExtendedRegisters) but we might as well be as accurate as we can.
#define CONTEXT_EXREG_XMM_OFFSET 160
+typedef struct _KNONVOLATILE_CONTEXT_POINTERS {
+
+ // TODO WIP x86/Linux, need to fix this.
+ PDWORD Ebx;
+ PDWORD Esi;
+ PDWORD Edi;
+ PDWORD Ebp;
+
+} KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS;
+
#elif defined(_PPC_)
//
@@ -3256,22 +3258,22 @@ TlsFree(
PALIMPORT
void *
PALAPI
-PAL_GetStackBase();
+PAL_GetStackBase(VOID);
PALIMPORT
void *
PALAPI
-PAL_GetStackLimit();
+PAL_GetStackLimit(VOID);
PALIMPORT
DWORD
PALAPI
-PAL_GetLogicalCpuCountFromOS();
+PAL_GetLogicalCpuCountFromOS(VOID);
PALIMPORT
size_t
PALAPI
-PAL_GetLogicalProcessorCacheSizeFromOS();
+PAL_GetLogicalProcessorCacheSizeFromOS(VOID);
typedef BOOL (*ReadMemoryWordCallback)(SIZE_T address, SIZE_T *value);
@@ -3304,6 +3306,8 @@ PALIMPORT BOOL PALAPI PAL_VirtualUnwindOutOfProc(CONTEXT *context,
#define PAL_CS_NATIVE_DATA_SIZE 80
#elif defined(__linux__) && defined(_ARM64_)
#define PAL_CS_NATIVE_DATA_SIZE 116
+#elif defined(__linux__) && defined(__i386__)
+#define PAL_CS_NATIVE_DATA_SIZE 76
#elif defined(__linux__) && defined(__x86_64__)
#define PAL_CS_NATIVE_DATA_SIZE 96
#elif defined(__NetBSD__) && defined(__amd64__)
@@ -3656,16 +3660,6 @@ VirtualQuery(
IN SIZE_T dwLength);
PALIMPORT
-BOOL
-PALAPI
-ReadProcessMemory(
- IN HANDLE hProcess,
- IN LPCVOID lpBaseAddress,
- OUT LPVOID lpBuffer,
- IN SIZE_T nSize,
- OUT SIZE_T * lpNumberOfBytesRead);
-
-PALIMPORT
VOID
PALAPI
RtlMoveMemory(
@@ -4712,19 +4706,12 @@ enum {
//
typedef struct _RUNTIME_FUNCTION {
DWORD BeginAddress;
+#ifdef _AMD64_
DWORD EndAddress;
+#endif
DWORD UnwindData;
} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
-PALIMPORT
-BOOL
-PALAPI
-WriteProcessMemory(IN HANDLE hProcess,
- IN LPVOID lpBaseAddress,
- IN LPCVOID lpBuffer,
- IN SIZE_T nSize,
- OUT SIZE_T * lpNumberOfBytesWritten);
-
#define STANDARD_RIGHTS_REQUIRED (0x000F0000L)
#define SYNCHRONIZE (0x00100000L)
#define READ_CONTROL (0x00020000L)
@@ -4801,28 +4788,6 @@ DebugBreak(
VOID);
PALIMPORT
-LPWSTR
-PALAPI
-lstrcatW(
- IN OUT LPWSTR lpString1,
- IN LPCWSTR lpString2);
-
-#ifdef UNICODE
-#define lstrcat lstrcatW
-#endif
-
-PALIMPORT
-LPWSTR
-PALAPI
-lstrcpyW(
- OUT LPWSTR lpString1,
- IN LPCWSTR lpString2);
-
-#ifdef UNICODE
-#define lstrcpy lstrcpyW
-#endif
-
-PALIMPORT
int
PALAPI
lstrlenA(
@@ -4841,19 +4806,6 @@ lstrlenW(
#endif
PALIMPORT
-LPWSTR
-PALAPI
-lstrcpynW(
- OUT LPWSTR lpString1,
- IN LPCWSTR lpString2,
- IN int iMaxLength);
-
-#ifdef UNICODE
-#define lstrcpyn lstrcpynW
-#endif
-
-
-PALIMPORT
DWORD
PALAPI
GetEnvironmentVariableW(
@@ -4937,7 +4889,7 @@ GetTickCount(
PALIMPORT
ULONGLONG
PALAPI
-GetTickCount64();
+GetTickCount64(VOID);
PALIMPORT
BOOL
@@ -5377,7 +5329,7 @@ YieldProcessor(
PALIMPORT
DWORD
PALAPI
-GetCurrentProcessorNumber();
+GetCurrentProcessorNumber(VOID);
/*++
Function:
@@ -5389,7 +5341,7 @@ Checks if GetCurrentProcessorNumber is available in the current environment
PALIMPORT
BOOL
PALAPI
-PAL_HasGetCurrentProcessorNumber();
+PAL_HasGetCurrentProcessorNumber(VOID);
#define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100
#define FORMAT_MESSAGE_IGNORE_INSERTS 0x00000200
@@ -5475,7 +5427,7 @@ ResetWriteWatch(
PALIMPORT
VOID
PALAPI
-FlushProcessWriteBuffers();
+FlushProcessWriteBuffers(VOID);
typedef void (*PAL_ActivationFunction)(CONTEXT *context);
typedef BOOL (*PAL_SafeActivationCheckFunction)(SIZE_T ip, BOOL checkingCurrentThread);
@@ -5715,9 +5667,7 @@ CoCreateGuid(OUT GUID * pguid);
#define printf PAL_printf
#define vprintf PAL_vprintf
#define wprintf PAL_wprintf
-#define sprintf PAL_sprintf
#define swprintf PAL_swprintf
-#define sscanf PAL_sscanf
#define wcsspn PAL_wcsspn
#define wcstod PAL_wcstod
#define wcstol PAL_wcstol
@@ -5791,6 +5741,13 @@ CoCreateGuid(OUT GUID * pguid);
#define log PAL_log
#define log10 PAL_log10
#define pow PAL_pow
+#define acosf PAL_acosf
+#define asinf PAL_asinf
+#define atan2f PAL_atan2f
+#define expf PAL_expf
+#define logf PAL_logf
+#define log10f PAL_log10f
+#define powf PAL_powf
#define malloc PAL_malloc
#define free PAL_free
#define mkstemp PAL_mkstemp
@@ -5802,6 +5759,7 @@ CoCreateGuid(OUT GUID * pguid);
#define _wcstoui64 PAL__wcstoui64
#define _flushall PAL__flushall
#define _vsnprintf PAL__vsnprintf
+#define strnlen PAL_strnlen
#ifdef _AMD64_
#define _mm_getcsr PAL__mm_getcsr
@@ -5878,9 +5836,7 @@ PALIMPORT char * __cdecl strstr(const char *, const char *);
PALIMPORT char * __cdecl strtok(char *, const char *);
PALIMPORT size_t __cdecl strspn(const char *, const char *);
PALIMPORT size_t __cdecl strcspn(const char *, const char *);
-PALIMPORT int __cdecl sprintf(char *, const char *, ...);
PALIMPORT int __cdecl vsprintf(char *, const char *, va_list);
-PALIMPORT int __cdecl sscanf(const char *, const char *, ...);
PALIMPORT int __cdecl atoi(const char *);
PALIMPORT LONG __cdecl atol(const char *);
PALIMPORT ULONG __cdecl strtoul(const char *, char **, int);
@@ -5899,23 +5855,35 @@ PALIMPORT int __cdecl toupper(int);
#endif // PAL_STDCPP_COMPAT
+/* _TRUNCATE */
+#if !defined(_TRUNCATE)
+#define _TRUNCATE ((size_t)-1)
+#endif
+
PALIMPORT errno_t __cdecl memcpy_s(void *, size_t, const void *, size_t);
PALIMPORT errno_t __cdecl memmove_s(void *, size_t, const void *, size_t);
PALIMPORT char * __cdecl _strlwr(char *);
PALIMPORT int __cdecl _stricmp(const char *, const char *);
-PALIMPORT int __cdecl _snprintf(char *, size_t, const char *, ...);
+PALIMPORT int __cdecl vsprintf_s(char *, size_t, const char *, va_list);
PALIMPORT char * __cdecl _gcvt_s(char *, int, double, int);
PALIMPORT char * __cdecl _ecvt(double, int, int *, int *);
PALIMPORT int __cdecl __iscsym(int);
-PALIMPORT size_t __cdecl _mbslen(const unsigned char *);
PALIMPORT unsigned char * __cdecl _mbsinc(const unsigned char *);
PALIMPORT unsigned char * __cdecl _mbsninc(const unsigned char *, size_t);
PALIMPORT unsigned char * __cdecl _mbsdec(const unsigned char *, const unsigned char *);
PALIMPORT int __cdecl _wcsicmp(const WCHAR *, const WCHAR*);
PALIMPORT int __cdecl _wcsnicmp(const WCHAR *, const WCHAR *, size_t);
PALIMPORT int __cdecl _vsnprintf(char *, size_t, const char *, va_list);
-PALIMPORT int __cdecl _vsnwprintf(WCHAR *, size_t, const WCHAR *, va_list);
-PALIMPORT WCHAR * __cdecl _itow(int, WCHAR *, int);
+PALIMPORT int __cdecl _vsnprintf_s(char *, size_t, size_t, const char *, va_list);
+PALIMPORT int __cdecl _vsnwprintf_s(WCHAR *, size_t, size_t, const WCHAR *, va_list);
+PALIMPORT int __cdecl _snwprintf_s(WCHAR *, size_t, size_t, const WCHAR *, ...);
+PALIMPORT int __cdecl _snprintf_s(char *, size_t, size_t, const char *, ...);
+PALIMPORT int __cdecl sprintf_s(char *, size_t, const char *, ... );
+PALIMPORT int __cdecl swprintf_s(WCHAR *, size_t, const WCHAR *, ... );
+PALIMPORT int __cdecl _snwprintf_s(WCHAR *, size_t, size_t, const WCHAR *, ...);
+PALIMPORT int __cdecl vswprintf_s( WCHAR *, size_t, const WCHAR *, va_list);
+PALIMPORT int __cdecl sscanf_s(const char *, const char *, ...);
+PALIMPORT errno_t __cdecl _itow_s(int, WCHAR *, size_t, int);
PALIMPORT size_t __cdecl PAL_wcslen(const WCHAR *);
PALIMPORT int __cdecl PAL_wcscmp(const WCHAR*, const WCHAR*);
@@ -5933,7 +5901,6 @@ PALIMPORT size_t __cdecl PAL_wcscspn(const WCHAR *, const WCHAR *);
PALIMPORT int __cdecl PAL_swprintf(WCHAR *, const WCHAR *, ...);
PALIMPORT int __cdecl PAL_vswprintf(WCHAR *, const WCHAR *, va_list);
PALIMPORT int __cdecl PAL__vsnprintf(LPSTR Buffer, size_t Count, LPCSTR Format, va_list ap);
-PALIMPORT int __cdecl _snwprintf(WCHAR *, size_t, const WCHAR *, ...);
PALIMPORT int __cdecl PAL_swscanf(const WCHAR *, const WCHAR *, ...);
PALIMPORT LONG __cdecl PAL_wcstol(const WCHAR *, WCHAR **, int);
PALIMPORT ULONG __cdecl PAL_wcstoul(const WCHAR *, WCHAR **, int);
@@ -5950,8 +5917,7 @@ PALIMPORT WCHAR __cdecl PAL_towupper(WCHAR);
PALIMPORT WCHAR * __cdecl _wcslwr(WCHAR *);
PALIMPORT ULONGLONG _wcstoui64(const WCHAR *, WCHAR **, int);
-PALIMPORT WCHAR * __cdecl _i64tow(__int64, WCHAR *, int);
-PALIMPORT WCHAR * __cdecl _ui64tow(unsigned __int64, WCHAR *, int);
+PALIMPORT errno_t __cdecl _i64tow_s(long long, WCHAR *, size_t, int);
PALIMPORT int __cdecl _wtoi(const WCHAR *);
#ifdef __cplusplus
@@ -6039,9 +6005,29 @@ PALIMPORT double __cdecl sqrt(double);
PALIMPORT double __cdecl tan(double);
PALIMPORT double __cdecl tanh(double);
+PALIMPORT int __cdecl _finitef(float);
+PALIMPORT int __cdecl _isnanf(float);
+PALIMPORT float __cdecl _copysignf(float, float);
+PALIMPORT float __cdecl acosf(float);
+PALIMPORT float __cdecl asinf(float);
+PALIMPORT float __cdecl atanf(float);
+PALIMPORT float __cdecl atan2f(float, float);
+PALIMPORT float __cdecl ceilf(float);
+PALIMPORT float __cdecl cosf(float);
+PALIMPORT float __cdecl coshf(float);
+PALIMPORT float __cdecl expf(float);
PALIMPORT float __cdecl fabsf(float);
+PALIMPORT float __cdecl floorf(float);
PALIMPORT float __cdecl fmodf(float, float);
+PALIMPORT float __cdecl logf(float);
+PALIMPORT float __cdecl log10f(float);
PALIMPORT float __cdecl modff(float, float*);
+PALIMPORT float __cdecl powf(float, float);
+PALIMPORT float __cdecl sinf(float);
+PALIMPORT float __cdecl sinhf(float);
+PALIMPORT float __cdecl sqrtf(float);
+PALIMPORT float __cdecl tanf(float);
+PALIMPORT float __cdecl tanhf(float);
#ifndef PAL_STDCPP_COMPAT
@@ -6086,14 +6072,8 @@ PALIMPORT void __cdecl qsort(void *, size_t, size_t, int (__cdecl *)(const void
PALIMPORT void * __cdecl bsearch(const void *, const void *, size_t, size_t,
int (__cdecl *)(const void *, const void *));
-PALIMPORT void __cdecl _splitpath(const char *, char *, char *, char *, char *);
-PALIMPORT void __cdecl _wsplitpath(const WCHAR *, WCHAR *, WCHAR *, WCHAR *, WCHAR *);
-PALIMPORT void __cdecl _makepath(char *, const char *, const char *, const char *, const char *);
-PALIMPORT void __cdecl _wmakepath(WCHAR *, const WCHAR *, const WCHAR *, const WCHAR *, const WCHAR *);
PALIMPORT char * __cdecl _fullpath(char *, const char *, size_t);
-PALIMPORT void __cdecl _swab(char *, char *, int);
-
#ifndef PAL_STDCPP_COMPAT
PALIMPORT time_t __cdecl time(time_t *);
@@ -6307,14 +6287,14 @@ PAL_Enter(PAL_Boundary boundary);
PALIMPORT
BOOL
PALAPI
-PAL_HasEntered();
+PAL_HasEntered(VOID);
// Equivalent to PAL_Enter(PAL_BoundaryTop) and is for stub
// code generation use.
PALIMPORT
DWORD
PALAPI
-PAL_EnterTop();
+PAL_EnterTop(VOID);
// This function needs to be called on a thread when it enters
// a region of code that depends on this instance of the PAL
@@ -6349,14 +6329,14 @@ PAL_Leave(PAL_Boundary boundary);
PALIMPORT
VOID
PALAPI
-PAL_LeaveBottom();
+PAL_LeaveBottom(VOID);
// This function is equivalent to PAL_Leave(PAL_BoundaryTop)
// and is available to limit the creation of stub code.
PALIMPORT
VOID
PALAPI
-PAL_LeaveTop();
+PAL_LeaveTop(VOID);
#ifdef __cplusplus
//
diff --git a/src/pal/inc/pal_char16.h b/src/pal/inc/pal_char16.h
index b118e98e31..4600cc7ff6 100644
--- a/src/pal/inc/pal_char16.h
+++ b/src/pal/inc/pal_char16.h
@@ -37,7 +37,8 @@ This file is used to define the wchar_t type as a 16-bit type on Unix.
// Set up the wchar_t type (which got preprocessed to __wchar_16_cpp__).
// In C++11, the standard gives us char16_t, which is what we want (and matches types with u"")
// In C, this doesn't exist, so use unsigned short.
-
+// **** WARNING: Linking C and C++ objects will break with -fstrict-aliasing with GCC/Clang
+// due to conditional typedef
#if !defined(_WCHAR_T_DEFINED) || !defined(_MSC_VER)
#if defined (PLATFORM_UNIX)
#if defined(__cplusplus)
diff --git a/src/pal/inc/pal_mstypes.h b/src/pal/inc/pal_mstypes.h
index df17767747..b9c3ac2e4a 100644
--- a/src/pal/inc/pal_mstypes.h
+++ b/src/pal/inc/pal_mstypes.h
@@ -56,12 +56,6 @@ extern "C" {
#define CDECL __cdecl
#endif
-#ifndef PAL_STDCPP_COMPAT
-#undef __fastcall
-#define __fastcall __stdcall
-#undef _fastcall
-#define _fastcall __fastcall
-#endif // PAL_STDCPP_COMPAT
#else // !defined(__i386__)
@@ -215,6 +209,9 @@ extern "C" {
// Defined in gnu's types.h. For non PAL_IMPLEMENTATION system
// includes are not included, so we need to define them.
#ifndef PAL_IMPLEMENTATION
+
+// OS X already defines these types in 64 bit
+#if !defined(_TARGET_MAC64)
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef __int32 int32_t;
@@ -223,6 +220,8 @@ typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
+#endif
+
#endif // PAL_IMPLEMENTATION
#ifndef _MSC_VER
diff --git a/src/pal/inc/rt/palrt.h b/src/pal/inc/rt/palrt.h
index 336a13f529..c181f38c2b 100644
--- a/src/pal/inc/rt/palrt.h
+++ b/src/pal/inc/rt/palrt.h
@@ -834,7 +834,6 @@ enum tagMIMECONTF {
// note: diff in NULL handing and calling convetion
#define StrCpyW PAL_wcscpy
-#define StrCpyNW lstrcpynW // note: can't be wcsncpy!
#define StrCatW PAL_wcscat
#define StrChrW (WCHAR*)PAL_wcschr
#define StrCmpW PAL_wcscmp
@@ -850,12 +849,9 @@ STDAPI_(LPWSTR) StrCatBuffW(LPWSTR pszDest, LPCWSTR pszSrc, int cchDestBuffSize)
#define lstrcmpW PAL_wcscmp
#define lstrcmpiW _wcsicmp
-#define wnsprintfW _snwprintf // note: not 100% compatible (wsprintf should be subset of sprintf...)
-#define wvnsprintfW _vsnwprintf // note: not 100% compatible (wsprintf should be subset of sprintf...)
#ifdef UNICODE
#define StrCpy StrCpyW
-#define StrCpyN StrCpyNW
#define StrCat StrCatW
#define StrNCat StrNCatW
#define StrChr StrChrW
@@ -871,7 +867,6 @@ STDAPI_(LPWSTR) StrCatBuffW(LPWSTR pszDest, LPCWSTR pszSrc, int cchDestBuffSize)
#define lstrcmp lstrcmpW
#define lstrcmpi lstrcmpiW
-#define wnsprintf wnsprintfW
#endif
@@ -898,12 +893,8 @@ Remember to fix the errcode defintion in safecrt.h.
*/
#define _wcslwr_s _wcslwr_unsafe
-#define _snwprintf_s _snwprintf_unsafe
-#define _vsnwprintf_s _vsnwprintf_unsafe
#define _snprintf_s _snprintf_unsafe
-#define _vsnprintf_s _vsnprintf_unsafe
#define swscanf_s swscanf
-#define sscanf_s sscanf
#define _wfopen_s _wfopen_unsafe
#define fopen_s _fopen_unsafe
@@ -911,12 +902,8 @@ Remember to fix the errcode defintion in safecrt.h.
#define _strlwr_s _strlwr_unsafe
#define _vscprintf _vscprintf_unsafe
-#define _vscwprintf _vscwprintf_unsafe
-#define sprintf_s _snprintf
-#define swprintf_s _snwprintf
#define vsprintf_s _vsnprintf
-#define vswprintf_s _vsnwprintf
extern "C++" {
@@ -982,51 +969,6 @@ inline int __cdecl _vscprintf_unsafe(const char *_Format, va_list _ArgList)
}
}
-inline int __cdecl _vscwprintf_unsafe(const WCHAR *_Format, va_list _ArgList)
-{
- int guess = 256;
-
- for (;;)
- {
- WCHAR *buf = (WCHAR *)malloc(guess * sizeof(WCHAR));
- if (buf == nullptr)
- return 0;
-
- va_list apcopy;
- va_copy(apcopy, _ArgList);
- int ret = _vsnwprintf(buf, guess, _Format, apcopy);
- free(buf);
- va_end(apcopy);
-
- if ((ret != -1) && (ret < guess))
- return ret;
-
- guess *= 2;
- }
-}
-
-inline int __cdecl _vsnwprintf_unsafe(WCHAR *_Dst, size_t _SizeInWords, size_t _Count, const WCHAR *_Format, va_list _ArgList)
-{
- if (_Count == _TRUNCATE) _Count = _SizeInWords - 1;
- int ret = _vsnwprintf(_Dst, _Count, _Format, _ArgList);
- _Dst[_SizeInWords - 1] = L'\0';
- if (ret < 0 && errno == 0)
- {
- errno = ERANGE;
- }
- return ret;
-}
-
-inline int __cdecl _snwprintf_unsafe(WCHAR *_Dst, size_t _SizeInWords, size_t _Count, const WCHAR *_Format, ...)
-{
- int ret;
- va_list _ArgList;
- va_start(_ArgList, _Format);
- ret = _vsnwprintf_unsafe(_Dst, _SizeInWords, _Count, _Format, _ArgList);
- va_end(_ArgList);
- return ret;
-}
-
inline int __cdecl _vsnprintf_unsafe(char *_Dst, size_t _SizeInWords, size_t _Count, const char *_Format, va_list _ArgList)
{
if (_Count == _TRUNCATE) _Count = _SizeInWords - 1;
@@ -1071,100 +1013,6 @@ inline errno_t __cdecl _fopen_unsafe(PAL_FILE * *ff, const char *fileName, const
}
}
-/* _itow_s */
-_SAFECRT__EXTERN_C
-errno_t __cdecl _itow_s(int _Value, WCHAR *_Dst, size_t _SizeInWords, int _Radix);
-
-#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS
-template <size_t _SizeInWords>
-inline
-errno_t __cdecl _itow_s(int _Value, WCHAR (&_Dst)[_SizeInWords], int _Radix)
-{
- return _itow_s(_Value, _Dst, _SizeInWords, _Radix);
-}
-#endif
-
-#if _SAFECRT_USE_INLINES
-
-__inline
-errno_t __cdecl _itow_s(int _Value, WCHAR *_Dst, size_t _SizeInWords, int _Radix)
-{
- /* validation section */
- _SAFECRT__VALIDATE_STRING(_Dst, _SizeInWords);
-
- /* TODO: do not write past buffer size */
- _itow(_Value, _Dst, _Radix);
- return 0;
-}
-
-#endif
-
-/* _i64tow_s */
-_SAFECRT__EXTERN_C
-errno_t __cdecl _i64tow_s(__int64 _Value, WCHAR *_Dst, size_t _SizeInWords, int _Radix);
-
-#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS
-template <size_t _SizeInWords>
-inline
-errno_t __cdecl _i64tow_s(__int64 _Value, WCHAR (&_Dst)[_SizeInWords], int _Radix)
-{
- return _i64tow_s(_Value, _Dst, _SizeInWords, _Radix);
-}
-#endif
-
-#if _SAFECRT_USE_INLINES
-
-__inline
-errno_t __cdecl _i64tow_s(__int64 _Value, WCHAR *_Dst, size_t _SizeInWords, int _Radix)
-{
- /* validation section */
- _SAFECRT__VALIDATE_STRING(_Dst, _SizeInWords);
-
- /* TODO: do not write past buffer size */
- _i64tow(_Value, _Dst, _Radix);
- return 0;
-}
-
-#endif
-
-/* getenv_s */
-/*
- * _ReturnValue indicates if the variable has been found and size needed
- */
-_SAFECRT__EXTERN_C
-errno_t __cdecl getenv_s(size_t *_ReturnValue, char *_Dst, size_t _SizeInWords, const char *_Name);
-
-#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS
-template <size_t _SizeInWords>
-inline
-errno_t __cdecl getenv_s(size_t *_ReturnValue, char *_Dst, size_t _SizeInWords, const char *_Name)
-{
- return getenv_s(_ReturnValue, _Dst, _SizeInWords, _Name);
-}
-#endif
-
-#if _SAFECRT_USE_INLINES
-
-__inline
-errno_t __cdecl getenv_s(size_t *_ReturnValue, char *_Dst, size_t _SizeInWords, const char *_Name)
-{
- char *szFound;
-
- /* validation section */
- _SAFECRT__VALIDATE_STRING(_Dst, _SizeInWords);
-
- szFound = getenv(_Name);
- if (szFound == nullptr)
- {
- *_ReturnValue = 0;
- return 0;
- }
- *_ReturnValue = strlen(szFound) + 1;
- return strcpy_s(_Dst, _SizeInWords, szFound);
-}
-
-#endif
-
}
#endif /* __cplusplus */
@@ -1247,6 +1095,7 @@ namespace std
typedef decltype(nullptr) nullptr_t;
}
+extern "C++"
template< class T >
typename std::remove_reference<T>::type&& move( T&& t );
#endif // __cplusplus
@@ -1327,7 +1176,7 @@ typedef VOID (__stdcall *WAITORTIMERCALLBACK)(PVOID, BOOLEAN);
// The message in these two macros should not contain any keywords like TODO
// or NYI. It should be just the brief description of the problem.
-#if defined(_TARGET_X86_)
+#ifdef PORTABILITY_CHECK
// Finished ports - compile-time errors
#define PORTABILITY_WARNING(message) NEED_TO_PORT_THIS_ONE(NEED_TO_PORT_THIS_ONE)
#define PORTABILITY_ASSERT(message) NEED_TO_PORT_THIS_ONE(NEED_TO_PORT_THIS_ONE)
@@ -1666,7 +1515,7 @@ typedef struct _DISPATCHER_CONTEXT {
ULONG64 Reserved;
} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
-#else
+#elif defined(_AMD64_)
typedef struct _DISPATCHER_CONTEXT {
ULONG64 ControlPc;
@@ -1680,6 +1529,29 @@ typedef struct _DISPATCHER_CONTEXT {
PUNWIND_HISTORY_TABLE HistoryTable;
} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
+#elif defined(_X86_)
+
+typedef struct _EXCEPTION_REGISTRATION_RECORD {
+ struct _EXCEPTION_REGISTRATION_RECORD *Next;
+ PEXCEPTION_ROUTINE Handler;
+} EXCEPTION_REGISTRATION_RECORD;
+
+typedef struct _DISPATCHER_CONTEXT {
+ DWORD ControlPc;
+ DWORD ImageBase;
+ PRUNTIME_FUNCTION FunctionEntry;
+ DWORD EstablisherFrame;
+ DWORD TargetIp;
+ PCONTEXT ContextRecord;
+ PEXCEPTION_ROUTINE LanguageHandler;
+ PVOID HandlerData;
+ PUNWIND_HISTORY_TABLE HistoryTable;
+} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;
+
+#else
+
+#error Unknown architecture for defining DISPATCHER_CONTEXT.
+
#endif
// #endif // !defined(_TARGET_MAC64)
diff --git a/src/pal/inc/rt/safecrt.h b/src/pal/inc/rt/safecrt.h
index 6b95e28dfb..3cc10cef33 100644
--- a/src/pal/inc/rt/safecrt.h
+++ b/src/pal/inc/rt/safecrt.h
@@ -409,7 +409,6 @@ void __cdecl _invalid_parameter(const WCHAR *_Message, const WCHAR *_FunctionNam
#define _tmakepath_s _makepath_s
#define _tsplitpath_s _splitpath_s
#define _stprintf_s sprintf_s
-#define _vstprintf_s vsprintf_s
#define _sntprintf_s _snprintf_s
#define _vsntprintf_s _vsnprintf_s
#define _tscanf_s scanf_s
@@ -428,8 +427,6 @@ void __cdecl _invalid_parameter(const WCHAR *_Message, const WCHAR *_FunctionNam
#define _tmakepath_s _wmakepath_s
#define _tsplitpath_s _wsplitpath_s
#define _stprintf_s swprintf_s
-#define _vstprintf_s vswprintf_s
-#define _sntprintf_s _snwprintf_s
#define _vsntprintf_s _vsnwprintf_s
#define _tscanf_s wscanf_s
#define _tsscanf_s swscanf_s
@@ -447,9 +444,7 @@ void __cdecl _invalid_parameter(const WCHAR *_Message, const WCHAR *_FunctionNam
#define _tmakepath_s _makepath_s
#define _tsplitpath_s _splitpath_s
#define _stprintf_s sprintf_s
-#define _vstprintf_s vsprintf_s
#define _sntprintf_s _snprintf_s
-#define _vsntprintf_s _vsnprintf_s
#define _tscanf_s scanf_s
#define _tsscanf_s sscanf_s
#define _tsnscanf_s _snscanf_s
@@ -3222,7 +3217,7 @@ int __cdecl vswprintf_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Format,
#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS
template <size_t _SizeInWords>
inline
-int __cdecl swprintf_s(char (&_Dst)[_SizeInWords], const char *_Format, ...)
+int __cdecl swprintf_s(WCHAR (&_Dst)[_SizeInWords], const WCHAR *_Format, ...)
{
int ret;
va_list _ArgList;
@@ -3234,7 +3229,7 @@ int __cdecl swprintf_s(char (&_Dst)[_SizeInWords], const char *_Format, ...)
template <size_t _SizeInWords>
inline
-int __cdecl vswprintf_s(char (&_Dst)[_SizeInWords], const char *_Format, va_list _ArgList)
+int __cdecl vswprintf_s(WCHAR (&_Dst)[_SizeInWords], const WCHAR *_Format, va_list _ArgList)
{
return vswprintf_s(_Dst, _SizeInWords, _Format, _ArgList);
}
@@ -3288,14 +3283,12 @@ int __cdecl _vsnprintf_s(char (&_Dst)[_SizeInBytes], size_t _Count, const char *
/* _snwprintf_s, _vsnwprintf_s */
_SAFECRT__EXTERN_C
-int __cdecl _snwprintf_s(WCHAR *_Dst, size_t _SizeInWords, size_t _Count, const WCHAR *_Format, ...);
-_SAFECRT__EXTERN_C
int __cdecl _vsnwprintf_s(WCHAR *_Dst, size_t _SizeInWords, size_t _Count, const WCHAR *_Format, va_list _ArgList);
#if defined(__cplusplus) && _SAFECRT_USE_CPP_OVERLOADS
template <size_t _SizeInWords>
inline
-int __cdecl _snwprintf_s(char (&_Dst)[_SizeInWords], size_t _Count, const char *_Format, ...)
+int __cdecl _snwprintf_s(WCHAR (&_Dst)[_SizeInWords], size_t _Count, const WCHAR *_Format, ...)
{
int ret;
va_list _ArgList;
diff --git a/src/pal/inc/strsafe.h b/src/pal/inc/strsafe.h
index 5a9f0edd43..58749f27ee 100644
--- a/src/pal/inc/strsafe.h
+++ b/src/pal/inc/strsafe.h
@@ -32,7 +32,7 @@
#define _vsnprintf vsnprintf
#endif // defined(PLATFORM_UNIX) && !defined (FEATURE_PAL)
-#include <stdio.h> // for _vsnprintf, _vsnwprintf, getc, getwc
+#include <stdio.h> // for _vsnprintf, getc, getwc
#include <string.h> // for memset
#include <stdarg.h> // for va_start, etc.
@@ -146,10 +146,6 @@ STRSAFEAPI StringCatNWorkerA(char* pszDest, size_t cchDest, const char* pszSrc,
STRSAFEAPI StringCatNWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszSrc, size_t cchMaxAppend);
STRSAFEAPI StringCatNExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, const char* pszSrc, size_t cchMaxAppend, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags);
STRSAFEAPI StringCatNExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, const WCHAR* pszSrc, size_t cchMaxAppend, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags);
-STRSAFEAPI StringVPrintfWorkerA(char* pszDest, size_t cchDest, const char* pszFormat, va_list argList);
-STRSAFEAPI StringVPrintfWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszFormat, va_list argList);
-STRSAFEAPI StringVPrintfExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList);
-STRSAFEAPI StringVPrintfExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const WCHAR* pszFormat, va_list argList);
STRSAFEAPI StringLengthWorkerA(const char* psz, size_t cchMax, size_t* pcch);
STRSAFEAPI StringLengthWorkerW(const WCHAR* psz, size_t cchMax, size_t* pcch);
#endif // STRSAFE_INLINE
@@ -2356,1124 +2352,6 @@ STRSAFEAPI StringCbCatNExW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszSrc, s
#ifndef STRSAFE_NO_CCH_FUNCTIONS
/*++
-STDAPI StringCchVPrintf(LPTSTR pszDest,
- size_t cchDest,
- LPCTSTR pszFormat,
- va_list argList);
-
-Routine Description:
-
- This routine is a safer version of the C built-in function 'vsprintf'.
- The size of the destination buffer (in characters) is a parameter and
- this function will not write past the end of this buffer and it will
- ALWAYS null terminate the destination buffer (unless it is zero length).
-
- This function returns a hresult, and not a pointer. It returns a S_OK
- if the string was printed without truncation and null terminated, otherwise
- it will return a failure code. In failure cases it will return a truncated
- version of the ideal result.
-
-Arguments:
-
- pszDest - destination string
-
- cchDest - size of destination buffer in characters
- length must be sufficient to hold the resulting formatted
- string, including the null terminator.
-
- pszFormat - format string which must be null terminated
-
- argList - va_list from the variable arguments according to the
- stdarg.h convention
-
-Notes:
- Behavior is undefined if destination, format strings or any arguments
- strings overlap.
-
- pszDest and pszFormat should not be NULL. See StringCchVPrintfEx if you
- require the handling of NULL values.
-
-Return Value:
-
- S_OK - if there was sufficient space in the dest buffer for
- the resultant string and it was null terminated.
-
- failure - you can use the macro HRESULT_CODE() to get a win32 error
- code for all falure cases
-
- STRSAFE_E_INSUFFICIENT_BUFFER /
- HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER
- - this return value is an indication that the print operation
- failed due to insufficient space. When this error occurs,
- the destination buffer is modified to contain a truncated
- version of the ideal result and is null terminated. This
- is useful for situations where truncation is ok.
-
- It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the
- return value of this function
-
---*/
-
-STRSAFEAPI StringCchVPrintfA(char* pszDest, size_t cchDest, const char* pszFormat, va_list argList);
-STRSAFEAPI StringCchVPrintfW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszFormat, va_list argList);
-#ifdef UNICODE
-#define StringCchVPrintf StringCchVPrintfW
-#else
-#define StringCchVPrintf StringCchVPrintfA
-#endif // !UNICODE
-
-#ifdef STRSAFE_INLINE
-STRSAFEAPI StringCchVPrintfA(char* pszDest, size_t cchDest, const char* pszFormat, va_list argList)
-{
- HRESULT hr;
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- hr = StringVPrintfWorkerA(pszDest, cchDest, pszFormat, argList);
- }
-
- return hr;
-}
-
-#if defined(FEATURE_PAL) || !defined(PLATFORM_UNIX)
-STRSAFEAPI StringCchVPrintfW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszFormat, va_list argList)
-{
- HRESULT hr;
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- hr = StringVPrintfWorkerW(pszDest, cchDest, pszFormat, argList);
- }
-
- return hr;
-}
-#endif // FEATURE_PAL || !PLATFORM_UNIX
-#endif // STRSAFE_INLINE
-#endif // !STRSAFE_NO_CCH_FUNCTIONS
-
-
-#ifndef STRSAFE_NO_CB_FUNCTIONS
-/*++
-
-STDAPI StringCbVPrintf(LPTSTR pszDest,
- size_t cbDest,
- LPCTSTR pszFormat,
- va_list argList);
-
-Routine Description:
-
- This routine is a safer version of the C built-in function 'vsprintf'.
- The size of the destination buffer (in bytes) is a parameter and
- this function will not write past the end of this buffer and it will
- ALWAYS null terminate the destination buffer (unless it is zero length).
-
- This function returns a hresult, and not a pointer. It returns a S_OK
- if the string was printed without truncation and null terminated, otherwise
- it will return a failure code. In failure cases it will return a truncated
- version of the ideal result.
-
-Arguments:
-
- pszDest - destination string
-
- cbDest - size of destination buffer in bytes
- length must be sufficient to hold the resulting formatted
- string, including the null terminator.
-
- pszFormat - format string which must be null terminated
-
- argList - va_list from the variable arguments according to the
- stdarg.h convention
-
-Notes:
- Behavior is undefined if destination, format strings or any arguments
- strings overlap.
-
- pszDest and pszFormat should not be NULL. See StringCbVPrintfEx if you
- require the handling of NULL values.
-
-
-Return Value:
-
- S_OK - if there was sufficient space in the dest buffer for
- the resultant string and it was null terminated.
-
- failure - you can use the macro HRESULT_CODE() to get a win32 error
- code for all falure cases
-
- STRSAFE_E_INSUFFICIENT_BUFFER /
- HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER
- - this return value is an indication that the print operation
- failed due to insufficient space. When this error occurs,
- the destination buffer is modified to contain a truncated
- version of the ideal result and is null terminated. This
- is useful for situations where truncation is ok.
-
- It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the
- return value of this function
-
---*/
-
-STRSAFEAPI StringCbVPrintfA(char* pszDest, size_t cbDest, const char* pszFormat, va_list argList);
-STRSAFEAPI StringCbVPrintfW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszFormat, va_list argList);
-#ifdef UNICODE
-#define StringCbVPrintf StringCbVPrintfW
-#else
-#define StringCbVPrintf StringCbVPrintfA
-#endif // !UNICODE
-
-#ifdef STRSAFE_INLINE
-STRSAFEAPI StringCbVPrintfA(char* pszDest, size_t cbDest, const char* pszFormat, va_list argList)
-{
- HRESULT hr;
- size_t cchDest;
-
- cchDest = cbDest / sizeof(char);
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- hr = StringVPrintfWorkerA(pszDest, cchDest, pszFormat, argList);
- }
-
- return hr;
-}
-
-#if defined(FEATURE_PAL) || !defined(PLATFORM_UNIX)
-STRSAFEAPI StringCbVPrintfW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszFormat, va_list argList)
-{
- HRESULT hr;
- size_t cchDest;
-
- cchDest = cbDest / sizeof(WCHAR);
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- hr = StringVPrintfWorkerW(pszDest, cchDest, pszFormat, argList);
- }
-
- return hr;
-}
-#endif // FEATURE_PAL || !PLATFORM_UNIX
-#endif // STRSAFE_INLINE
-#endif // !STRSAFE_NO_CB_FUNCTIONS
-
-
-#ifndef STRSAFE_NO_CCH_FUNCTIONS
-/*++
-
-STDAPI StringCchPrintf(LPTSTR pszDest,
- size_t cchDest,
- LPCTSTR pszFormat,
- ...);
-
-Routine Description:
-
- This routine is a safer version of the C built-in function 'sprintf'.
- The size of the destination buffer (in characters) is a parameter and
- this function will not write past the end of this buffer and it will
- ALWAYS null terminate the destination buffer (unless it is zero length).
-
- This function returns a hresult, and not a pointer. It returns a S_OK
- if the string was printed without truncation and null terminated, otherwise
- it will return a failure code. In failure cases it will return a truncated
- version of the ideal result.
-
-Arguments:
-
- pszDest - destination string
-
- cchDest - size of destination buffer in characters
- length must be sufficient to hold the resulting formatted
- string, including the null terminator.
-
- pszFormat - format string which must be null terminated
-
- ... - additional parameters to be formatted according to
- the format string
-
-Notes:
- Behavior is undefined if destination, format strings or any arguments
- strings overlap.
-
- pszDest and pszFormat should not be NULL. See StringCchPrintfEx if you
- require the handling of NULL values.
-
-Return Value:
-
- S_OK - if there was sufficient space in the dest buffer for
- the resultant string and it was null terminated.
-
- failure - you can use the macro HRESULT_CODE() to get a win32 error
- code for all falure cases
-
- STRSAFE_E_INSUFFICIENT_BUFFER /
- HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER
- - this return value is an indication that the print operation
- failed due to insufficient space. When this error occurs,
- the destination buffer is modified to contain a truncated
- version of the ideal result and is null terminated. This
- is useful for situations where truncation is ok.
-
- It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the
- return value of this function
-
---*/
-
-STRSAFEAPI StringCchPrintfA(char* pszDest, size_t cchDest, const char* pszFormat, ...);
-STRSAFEAPI StringCchPrintfW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszFormat, ...);
-#ifdef UNICODE
-#define StringCchPrintf StringCchPrintfW
-#else
-#define StringCchPrintf StringCchPrintfA
-#endif // !UNICODE
-
-#ifdef STRSAFE_INLINE
-STRSAFEAPI StringCchPrintfA(char* pszDest, size_t cchDest, const char* pszFormat, ...)
-{
- HRESULT hr;
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- va_list argList;
-
- va_start(argList, pszFormat);
-
- hr = StringVPrintfWorkerA(pszDest, cchDest, pszFormat, argList);
-
- va_end(argList);
- }
-
- return hr;
-}
-
-#if defined(FEATURE_PAL) || !defined(PLATFORM_UNIX)
-STRSAFEAPI StringCchPrintfW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszFormat, ...)
-{
- HRESULT hr;
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- va_list argList;
-
- va_start(argList, pszFormat);
-
- hr = StringVPrintfWorkerW(pszDest, cchDest, pszFormat, argList);
-
- va_end(argList);
- }
-
- return hr;
-}
-#endif // FEATURE_PAL || !PLATFORM_UNIX
-#endif // STRSAFE_INLINE
-#endif // !STRSAFE_NO_CCH_FUNCTIONS
-
-
-#ifndef STRSAFE_NO_CB_FUNCTIONS
-/*++
-
-STDAPI StringCbPrintf(LPTSTR pszDest,
- size_t cbDest,
- LPCTSTR pszFormat,
- ...);
-
-Routine Description:
-
- This routine is a safer version of the C built-in function 'sprintf'.
- The size of the destination buffer (in bytes) is a parameter and
- this function will not write past the end of this buffer and it will
- ALWAYS null terminate the destination buffer (unless it is zero length).
-
- This function returns a hresult, and not a pointer. It returns a S_OK
- if the string was printed without truncation and null terminated, otherwise
- it will return a failure code. In failure cases it will return a truncated
- version of the ideal result.
-
-Arguments:
-
- pszDest - destination string
-
- cbDest - size of destination buffer in bytes
- length must be sufficient to hold the resulting formatted
- string, including the null terminator.
-
- pszFormat - format string which must be null terminated
-
- ... - additional parameters to be formatted according to
- the format string
-
-Notes:
- Behavior is undefined if destination, format strings or any arguments
- strings overlap.
-
- pszDest and pszFormat should not be NULL. See StringCbPrintfEx if you
- require the handling of NULL values.
-
-
-Return Value:
-
- S_OK - if there was sufficient space in the dest buffer for
- the resultant string and it was null terminated.
-
- failure - you can use the macro HRESULT_CODE() to get a win32 error
- code for all falure cases
-
- STRSAFE_E_INSUFFICIENT_BUFFER /
- HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER
- - this return value is an indication that the print operation
- failed due to insufficient space. When this error occurs,
- the destination buffer is modified to contain a truncated
- version of the ideal result and is null terminated. This
- is useful for situations where truncation is ok.
-
- It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the
- return value of this function
-
---*/
-
-STRSAFEAPI StringCbPrintfA(char* pszDest, size_t cbDest, const char* pszFormat, ...);
-STRSAFEAPI StringCbPrintfW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszFormat, ...);
-#ifdef UNICODE
-#define StringCbPrintf StringCbPrintfW
-#else
-#define StringCbPrintf StringCbPrintfA
-#endif // !UNICODE
-
-#ifdef STRSAFE_INLINE
-STRSAFEAPI StringCbPrintfA(char* pszDest, size_t cbDest, const char* pszFormat, ...)
-{
- HRESULT hr;
- size_t cchDest;
-
- cchDest = cbDest / sizeof(char);
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- va_list argList;
-
- va_start(argList, pszFormat);
-
- hr = StringVPrintfWorkerA(pszDest, cchDest, pszFormat, argList);
-
- va_end(argList);
- }
-
- return hr;
-}
-
-#if defined(FEATURE_PAL) || !defined(PLATFORM_UNIX)
-STRSAFEAPI StringCbPrintfW(WCHAR* pszDest, size_t cbDest, const WCHAR* pszFormat, ...)
-{
- HRESULT hr;
- size_t cchDest;
-
- cchDest = cbDest / sizeof(WCHAR);
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- va_list argList;
-
- va_start(argList, pszFormat);
-
- hr = StringVPrintfWorkerW(pszDest, cchDest, pszFormat, argList);
-
- va_end(argList);
- }
-
- return hr;
-}
-#endif // FEATURE_PAL || !PLATFORM_UNIX
-#endif // STRSAFE_INLINE
-#endif // !STRSAFE_NO_CB_FUNCTIONS
-
-
-#ifndef STRSAFE_NO_CCH_FUNCTIONS
-/*++
-
-STDAPI StringCchPrintfEx(LPTSTR pszDest,
- size_t cchDest,
- LPTSTR* ppszDestEnd,
- size_t* pcchRemaining,
- DWORD dwFlags,
- LPCTSTR pszFormat,
- ...);
-
-Routine Description:
-
- This routine is a safer version of the C built-in function 'sprintf' with
- some additional parameters. In addition to functionality provided by
- StringCchPrintf, this routine also returns a pointer to the end of the
- destination string and the number of characters left in the destination string
- including the null terminator. The flags parameter allows additional controls.
-
-Arguments:
-
- pszDest - destination string
-
- cchDest - size of destination buffer in characters.
- length must be sufficient to contain the resulting
- formatted string plus the null terminator.
-
- ppszDestEnd - if ppszDestEnd is non-null, the function will return a
- pointer to the end of the destination string. If the
- function printed any data, the result will point to the
- null termination character
-
- pcchRemaining - if pcchRemaining is non-null, the function will return
- the number of characters left in the destination string,
- including the null terminator
-
- dwFlags - controls some details of the string copy:
-
- STRSAFE_FILL_BEHIND_NULL
- if the function succeeds, the low byte of dwFlags will be
- used to fill the uninitialize part of destination buffer
- behind the null terminator
-
- STRSAFE_IGNORE_NULLS
- treat NULL string pointers like empty strings (TEXT(""))
-
- STRSAFE_FILL_ON_FAILURE
- if the function fails, the low byte of dwFlags will be
- used to fill all of the destination buffer, and it will
- be null terminated. This will overwrite any truncated
- string returned when the failure is
- STRSAFE_E_INSUFFICIENT_BUFFER
-
- STRSAFE_NO_TRUNCATION /
- STRSAFE_NULL_ON_FAILURE
- if the function fails, the destination buffer will be set
- to the empty string. This will overwrite any truncated string
- returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER.
-
- pszFormat - format string which must be null terminated
-
- ... - additional parameters to be formatted according to
- the format string
-
-Notes:
- Behavior is undefined if destination, format strings or any arguments
- strings overlap.
-
- pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS
- flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and
- pszFormat may be NULL. An error may still be returned even though NULLS
- are ignored due to insufficient space.
-
-Return Value:
-
- S_OK - if there was source data and it was all concatenated and the
- resultant dest string was null terminated
-
- failure - you can use the macro HRESULT_CODE() to get a win32 error
- code for all falure cases
-
- STRSAFE_E_INSUFFICIENT_BUFFER /
- HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER
- - this return value is an indication that the print operation
- failed due to insufficient space. When this error occurs,
- the destination buffer is modified to contain a truncated
- version of the ideal result and is null terminated. This
- is useful for situations where truncation is ok.
-
- It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the
- return value of this function
-
---*/
-
-STRSAFEAPI StringCchPrintfExA(char* pszDest, size_t cchDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, ...);
-STRSAFEAPI StringCchPrintfExW(WCHAR* pszDest, size_t cchDest, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const WCHAR* pszFormat, ...);
-#ifdef UNICODE
-#define StringCchPrintfEx StringCchPrintfExW
-#else
-#define StringCchPrintfEx StringCchPrintfExA
-#endif // !UNICODE
-
-#ifdef STRSAFE_INLINE
-STRSAFEAPI StringCchPrintfExA(char* pszDest, size_t cchDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, ...)
-{
- HRESULT hr;
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- size_t cbDest;
- va_list argList;
-
- // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1
- cbDest = cchDest * sizeof(char);
- va_start(argList, pszFormat);
-
- hr = StringVPrintfExWorkerA(pszDest, cchDest, cbDest, ppszDestEnd, pcchRemaining, dwFlags, pszFormat, argList);
-
- va_end(argList);
- }
-
- return hr;
-}
-
-#if defined(FEATURE_PAL) || !defined(PLATFORM_UNIX)
-STRSAFEAPI StringCchPrintfExW(WCHAR* pszDest, size_t cchDest, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const WCHAR* pszFormat, ...)
-{
- HRESULT hr;
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- size_t cbDest;
- va_list argList;
-
- // safe to multiply cchDest * sizeof(WCHAR) since cchDest < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2
- cbDest = cchDest * sizeof(WCHAR);
- va_start(argList, pszFormat);
-
- hr = StringVPrintfExWorkerW(pszDest, cchDest, cbDest, ppszDestEnd, pcchRemaining, dwFlags, pszFormat, argList);
-
- va_end(argList);
- }
-
- return hr;
-}
-#endif // FEATURE_PAL || !PLATFORM_UNIX
-#endif // STRSAFE_INLINE
-#endif // !STRSAFE_NO_CCH_FUNCTIONS
-
-
-#ifndef STRSAFE_NO_CB_FUNCTIONS
-/*++
-
-STDAPI StringCbPrintfEx(LPTSTR pszDest,
- size_t cbDest,
- LPTSTR* ppszDestEnd,
- size_t* pcbRemaining,
- DWORD dwFlags,
- LPCTSTR pszFormat,
- ...);
-
-Routine Description:
-
- This routine is a safer version of the C built-in function 'sprintf' with
- some additional parameters. In addition to functionality provided by
- StringCbPrintf, this routine also returns a pointer to the end of the
- destination string and the number of bytes left in the destination string
- including the null terminator. The flags parameter allows additional controls.
-
-Arguments:
-
- pszDest - destination string
-
- cbDest - size of destination buffer in bytes.
- length must be sufficient to contain the resulting
- formatted string plus the null terminator.
-
- ppszDestEnd - if ppszDestEnd is non-null, the function will return a
- pointer to the end of the destination string. If the
- function printed any data, the result will point to the
- null termination character
-
- pcbRemaining - if pcbRemaining is non-null, the function will return
- the number of bytes left in the destination string,
- including the null terminator
-
- dwFlags - controls some details of the string copy:
-
- STRSAFE_FILL_BEHIND_NULL
- if the function succeeds, the low byte of dwFlags will be
- used to fill the uninitialize part of destination buffer
- behind the null terminator
-
- STRSAFE_IGNORE_NULLS
- treat NULL string pointers like empty strings (TEXT(""))
-
- STRSAFE_FILL_ON_FAILURE
- if the function fails, the low byte of dwFlags will be
- used to fill all of the destination buffer, and it will
- be null terminated. This will overwrite any truncated
- string returned when the failure is
- STRSAFE_E_INSUFFICIENT_BUFFER
-
- STRSAFE_NO_TRUNCATION /
- STRSAFE_NULL_ON_FAILURE
- if the function fails, the destination buffer will be set
- to the empty string. This will overwrite any truncated string
- returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER.
-
- pszFormat - format string which must be null terminated
-
- ... - additional parameters to be formatted according to
- the format string
-
-Notes:
- Behavior is undefined if destination, format strings or any arguments
- strings overlap.
-
- pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS
- flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and
- pszFormat may be NULL. An error may still be returned even though NULLS
- are ignored due to insufficient space.
-
-Return Value:
-
- S_OK - if there was source data and it was all concatenated and the
- resultant dest string was null terminated
-
- failure - you can use the macro HRESULT_CODE() to get a win32 error
- code for all falure cases
-
- STRSAFE_E_INSUFFICIENT_BUFFER /
- HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER
- - this return value is an indication that the print operation
- failed due to insufficient space. When this error occurs,
- the destination buffer is modified to contain a truncated
- version of the ideal result and is null terminated. This
- is useful for situations where truncation is ok.
-
- It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the
- return value of this function
-
---*/
-
-STRSAFEAPI StringCbPrintfExA(char* pszDest, size_t cbDest, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const char* pszFormat, ...);
-STRSAFEAPI StringCbPrintfExW(WCHAR* pszDest, size_t cbDest, WCHAR** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const WCHAR* pszFormat, ...);
-#ifdef UNICODE
-#define StringCbPrintfEx StringCbPrintfExW
-#else
-#define StringCbPrintfEx StringCbPrintfExA
-#endif // !UNICODE
-
-#ifdef STRSAFE_INLINE
-STRSAFEAPI StringCbPrintfExA(char* pszDest, size_t cbDest, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const char* pszFormat, ...)
-{
- HRESULT hr;
- size_t cchDest;
- size_t cchRemaining = 0;
-
- cchDest = cbDest / sizeof(char);
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- va_list argList;
-
- va_start(argList, pszFormat);
-
- hr = StringVPrintfExWorkerA(pszDest, cchDest, cbDest, ppszDestEnd, &cchRemaining, dwFlags, pszFormat, argList);
-
- va_end(argList);
- }
-
- if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER))
- {
- if (pcbRemaining)
- {
- // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1
- *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char));
- }
- }
-
- return hr;
-}
-
-#if defined(FEATURE_PAL) || !defined(PLATFORM_UNIX)
-STRSAFEAPI StringCbPrintfExW(WCHAR* pszDest, size_t cbDest, WCHAR** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const WCHAR* pszFormat, ...)
-{
- HRESULT hr;
- size_t cchDest;
- size_t cchRemaining = 0;
-
- cchDest = cbDest / sizeof(WCHAR);
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- va_list argList;
-
- va_start(argList, pszFormat);
-
- hr = StringVPrintfExWorkerW(pszDest, cchDest, cbDest, ppszDestEnd, &cchRemaining, dwFlags, pszFormat, argList);
-
- va_end(argList);
- }
-
- if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER))
- {
- if (pcbRemaining)
- {
- // safe to multiply cchRemaining * sizeof(WCHAR) since cchRemaining < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2
- *pcbRemaining = (cchRemaining * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR));
- }
- }
-
- return hr;
-}
-#endif // FEATURE_PAL || !PLATFORM_UNIX
-#endif // STRSAFE_INLINE
-#endif // !STRSAFE_NO_CB_FUNCTIONS
-
-
-#ifndef STRSAFE_NO_CCH_FUNCTIONS
-/*++
-
-STDAPI StringCchVPrintfEx(LPTSTR pszDest,
- size_t cchDest,
- LPTSTR* ppszDestEnd,
- size_t* pcchRemaining,
- DWORD dwFlags,
- LPCTSTR pszFormat,
- va_list argList);
-
-Routine Description:
-
- This routine is a safer version of the C built-in function 'vsprintf' with
- some additional parameters. In addition to functionality provided by
- StringCchVPrintf, this routine also returns a pointer to the end of the
- destination string and the number of characters left in the destination string
- including the null terminator. The flags parameter allows additional controls.
-
-Arguments:
-
- pszDest - destination string
-
- cchDest - size of destination buffer in characters.
- length must be sufficient to contain the resulting
- formatted string plus the null terminator.
-
- ppszDestEnd - if ppszDestEnd is non-null, the function will return a
- pointer to the end of the destination string. If the
- function printed any data, the result will point to the
- null termination character
-
- pcchRemaining - if pcchRemaining is non-null, the function will return
- the number of characters left in the destination string,
- including the null terminator
-
- dwFlags - controls some details of the string copy:
-
- STRSAFE_FILL_BEHIND_NULL
- if the function succeeds, the low byte of dwFlags will be
- used to fill the uninitialize part of destination buffer
- behind the null terminator
-
- STRSAFE_IGNORE_NULLS
- treat NULL string pointers like empty strings (TEXT(""))
-
- STRSAFE_FILL_ON_FAILURE
- if the function fails, the low byte of dwFlags will be
- used to fill all of the destination buffer, and it will
- be null terminated. This will overwrite any truncated
- string returned when the failure is
- STRSAFE_E_INSUFFICIENT_BUFFER
-
- STRSAFE_NO_TRUNCATION /
- STRSAFE_NULL_ON_FAILURE
- if the function fails, the destination buffer will be set
- to the empty string. This will overwrite any truncated string
- returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER.
-
- pszFormat - format string which must be null terminated
-
- argList - va_list from the variable arguments according to the
- stdarg.h convention
-
-Notes:
- Behavior is undefined if destination, format strings or any arguments
- strings overlap.
-
- pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS
- flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and
- pszFormat may be NULL. An error may still be returned even though NULLS
- are ignored due to insufficient space.
-
-Return Value:
-
- S_OK - if there was source data and it was all concatenated and the
- resultant dest string was null terminated
-
- failure - you can use the macro HRESULT_CODE() to get a win32 error
- code for all falure cases
-
- STRSAFE_E_INSUFFICIENT_BUFFER /
- HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER
- - this return value is an indication that the print operation
- failed due to insufficient space. When this error occurs,
- the destination buffer is modified to contain a truncated
- version of the ideal result and is null terminated. This
- is useful for situations where truncation is ok.
-
- It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the
- return value of this function
-
---*/
-
-STRSAFEAPI StringCchVPrintfExA(char* pszDest, size_t cchDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList);
-STRSAFEAPI StringCchVPrintfExW(WCHAR* pszDest, size_t cchDest, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const WCHAR* pszFormat, va_list argList);
-#ifdef UNICODE
-#define StringCchVPrintfEx StringCchVPrintfExW
-#else
-#define StringCchVPrintfEx StringCchVPrintfExA
-#endif // !UNICODE
-
-#ifdef STRSAFE_INLINE
-STRSAFEAPI StringCchVPrintfExA(char* pszDest, size_t cchDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList)
-{
- HRESULT hr;
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- size_t cbDest;
-
- // safe to multiply cchDest * sizeof(char) since cchDest < STRSAFE_MAX_CCH and sizeof(char) is 1
- cbDest = cchDest * sizeof(char);
-
- hr = StringVPrintfExWorkerA(pszDest, cchDest, cbDest, ppszDestEnd, pcchRemaining, dwFlags, pszFormat, argList);
- }
-
- return hr;
-}
-
-#if defined(FEATURE_PAL) || !defined(PLATFORM_UNIX)
-STRSAFEAPI StringCchVPrintfExW(WCHAR* pszDest, size_t cchDest, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const WCHAR* pszFormat, va_list argList)
-{
- HRESULT hr;
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- size_t cbDest;
-
- // safe to multiply cchDest * sizeof(WCHAR) since cchDest < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2
- cbDest = cchDest * sizeof(WCHAR);
-
- hr = StringVPrintfExWorkerW(pszDest, cchDest, cbDest, ppszDestEnd, pcchRemaining, dwFlags, pszFormat, argList);
- }
-
- return hr;
-}
-#endif // FEATURE_PAL || !PLATFORM_UNIX
-#endif // STRSAFE_INLINE
-#endif // !STRSAFE_NO_CCH_FUNCTIONS
-
-
-#ifndef STRSAFE_NO_CB_FUNCTIONS
-/*++
-
-STDAPI StringCbVPrintfEx(LPTSTR pszDest,
- size_t cbDest,
- LPTSTR* ppszDestEnd,
- size_t* pcbRemaining,
- DWORD dwFlags,
- LPCTSTR pszFormat,
- va_list argList);
-
-Routine Description:
-
- This routine is a safer version of the C built-in function 'vsprintf' with
- some additional parameters. In addition to functionality provided by
- StringCbVPrintf, this routine also returns a pointer to the end of the
- destination string and the number of characters left in the destination string
- including the null terminator. The flags parameter allows additional controls.
-
-Arguments:
-
- pszDest - destination string
-
- cbDest - size of destination buffer in bytes.
- length must be sufficient to contain the resulting
- formatted string plus the null terminator.
-
- ppszDestEnd - if ppszDestEnd is non-null, the function will return
- a pointer to the end of the destination string. If the
- function printed any data, the result will point to the
- null termination character
-
- pcbRemaining - if pcbRemaining is non-null, the function will return
- the number of bytes left in the destination string,
- including the null terminator
-
- dwFlags - controls some details of the string copy:
-
- STRSAFE_FILL_BEHIND_NULL
- if the function succeeds, the low byte of dwFlags will be
- used to fill the uninitialize part of destination buffer
- behind the null terminator
-
- STRSAFE_IGNORE_NULLS
- treat NULL string pointers like empty strings (TEXT(""))
-
- STRSAFE_FILL_ON_FAILURE
- if the function fails, the low byte of dwFlags will be
- used to fill all of the destination buffer, and it will
- be null terminated. This will overwrite any truncated
- string returned when the failure is
- STRSAFE_E_INSUFFICIENT_BUFFER
-
- STRSAFE_NO_TRUNCATION /
- STRSAFE_NULL_ON_FAILURE
- if the function fails, the destination buffer will be set
- to the empty string. This will overwrite any truncated string
- returned when the failure is STRSAFE_E_INSUFFICIENT_BUFFER.
-
- pszFormat - format string which must be null terminated
-
- argList - va_list from the variable arguments according to the
- stdarg.h convention
-
-Notes:
- Behavior is undefined if destination, format strings or any arguments
- strings overlap.
-
- pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS
- flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and
- pszFormat may be NULL. An error may still be returned even though NULLS
- are ignored due to insufficient space.
-
-Return Value:
-
- S_OK - if there was source data and it was all concatenated and the
- resultant dest string was null terminated
-
- failure - you can use the macro HRESULT_CODE() to get a win32 error
- code for all falure cases
-
- STRSAFE_E_INSUFFICIENT_BUFFER /
- HRESULT_CODE(hr) == ERROR_INSUFFICIENT_BUFFER
- - this return value is an indication that the print operation
- failed due to insufficient space. When this error occurs,
- the destination buffer is modified to contain a truncated
- version of the ideal result and is null terminated. This
- is useful for situations where truncation is ok.
-
- It is strongly recommended to use the SUCCEEDED() / FAILED() macros to test the
- return value of this function
-
---*/
-
-STRSAFEAPI StringCbVPrintfExA(char* pszDest, size_t cbDest, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList);
-STRSAFEAPI StringCbVPrintfExW(WCHAR* pszDest, size_t cbDest, WCHAR** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const WCHAR* pszFormat, va_list argList);
-#ifdef UNICODE
-#define StringCbVPrintfEx StringCbVPrintfExW
-#else
-#define StringCbVPrintfEx StringCbVPrintfExA
-#endif // !UNICODE
-
-#ifdef STRSAFE_INLINE
-STRSAFEAPI StringCbVPrintfExA(char* pszDest, size_t cbDest, char** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList)
-{
- HRESULT hr;
- size_t cchDest;
- size_t cchRemaining = 0;
-
- cchDest = cbDest / sizeof(char);
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- hr = StringVPrintfExWorkerA(pszDest, cchDest, cbDest, ppszDestEnd, &cchRemaining, dwFlags, pszFormat, argList);
- }
-
- if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER))
- {
- if (pcbRemaining)
- {
- // safe to multiply cchRemaining * sizeof(char) since cchRemaining < STRSAFE_MAX_CCH and sizeof(char) is 1
- *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char));
- }
- }
-
- return hr;
-}
-
-#if defined(FEATURE_PAL) || !defined(PLATFORM_UNIX)
-STRSAFEAPI StringCbVPrintfExW(WCHAR* pszDest, size_t cbDest, WCHAR** ppszDestEnd, size_t* pcbRemaining, unsigned long dwFlags, const WCHAR* pszFormat, va_list argList)
-{
- HRESULT hr;
- size_t cchDest;
- size_t cchRemaining = 0;
-
- cchDest = cbDest / sizeof(WCHAR);
-
- if (cchDest > STRSAFE_MAX_CCH)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- hr = StringVPrintfExWorkerW(pszDest, cchDest, cbDest, ppszDestEnd, &cchRemaining, dwFlags, pszFormat, argList);
- }
-
- if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER))
- {
- if (pcbRemaining)
- {
- // safe to multiply cchRemaining * sizeof(WCHAR) since cchRemaining < STRSAFE_MAX_CCH and sizeof(WCHAR) is 2
- *pcbRemaining = (cchRemaining * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR));
- }
- }
-
- return hr;
-}
-#endif // FEATURE_PAL || !PLATFORM_UNIX
-#endif // STRSAFE_INLINE
-#endif // !STRSAFE_NO_CB_FUNCTIONS
-
-
-#ifndef STRSAFE_NO_CCH_FUNCTIONS
-/*++
-
STDAPI StringCchGets(LPTSTR pszDest,
size_t cchDest);
@@ -5543,394 +4421,6 @@ STRSAFEAPI StringCatNExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, co
}
#endif // FEATURE_PAL || !PLATFORM_UNIX
-STRSAFEAPI StringVPrintfWorkerA(char* pszDest, size_t cchDest, const char* pszFormat, va_list argList)
-{
- HRESULT hr = S_OK;
-
- if (cchDest == 0)
- {
- // can not null terminate a zero-byte dest buffer
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- int iRet;
- size_t cchMax;
-
- // leave the last space for the null terminator
- cchMax = cchDest - 1;
-
- iRet = _vsnprintf(pszDest, cchMax, pszFormat, argList);
- // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax));
-
- if ((iRet < 0) || (((size_t)iRet) > cchMax))
- {
- // need to null terminate the string
- pszDest += cchMax;
- *pszDest = '\0';
-
- // we have truncated pszDest
- hr = STRSAFE_E_INSUFFICIENT_BUFFER;
- }
- else if (((size_t)iRet) == cchMax)
- {
- // need to null terminate the string
- pszDest += cchMax;
- *pszDest = '\0';
- }
- }
-
- return hr;
-}
-
-#if defined(FEATURE_PAL) || !defined(PLATFORM_UNIX)
-STRSAFEAPI StringVPrintfWorkerW(WCHAR* pszDest, size_t cchDest, const WCHAR* pszFormat, va_list argList)
-{
- HRESULT hr = S_OK;
-
- if (cchDest == 0)
- {
- // can not null terminate a zero-byte dest buffer
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- int iRet;
- size_t cchMax;
-
- // leave the last space for the null terminator
- cchMax = cchDest - 1;
-
- iRet = _vsnwprintf(pszDest, cchMax, pszFormat, argList);
- // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax));
-
- if ((iRet < 0) || (((size_t)iRet) > cchMax))
- {
- // need to null terminate the string
- pszDest += cchMax;
- *pszDest = L'\0';
-
- // we have truncated pszDest
- hr = STRSAFE_E_INSUFFICIENT_BUFFER;
- }
- else if (((size_t)iRet) == cchMax)
- {
- // need to null terminate the string
- pszDest += cchMax;
- *pszDest = L'\0';
- }
- }
-
- return hr;
-}
-#endif // FEATURE_PAL || !PLATFORM_UNIX
-
-STRSAFEAPI StringVPrintfExWorkerA(char* pszDest, size_t cchDest, size_t cbDest, char** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const char* pszFormat, va_list argList)
-{
- HRESULT hr = S_OK;
- char* pszDestEnd = pszDest;
- size_t cchRemaining = 0;
-
- // ASSERT(cbDest == (cchDest * sizeof(char)) ||
- // cbDest == (cchDest * sizeof(char)) + (cbDest % sizeof(char)));
-
- // only accept valid flags
- if (dwFlags & (~STRSAFE_VALID_FLAGS))
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- if (dwFlags & STRSAFE_IGNORE_NULLS)
- {
- if (pszDest == NULL)
- {
- if ((cchDest != 0) || (cbDest != 0))
- {
- // NULL pszDest and non-zero cchDest/cbDest is invalid
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- }
-
- if (pszFormat == NULL)
- {
- pszFormat = "";
- }
- }
-
- if (SUCCEEDED(hr))
- {
- if (cchDest == 0)
- {
- pszDestEnd = pszDest;
- cchRemaining = 0;
-
- // only fail if there was actually a non-empty format string
- if (*pszFormat != '\0')
- {
- if (pszDest == NULL)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- hr = STRSAFE_E_INSUFFICIENT_BUFFER;
- }
- }
- }
- else
- {
- int iRet;
- size_t cchMax;
-
- // leave the last space for the null terminator
- cchMax = cchDest - 1;
-
- iRet = _vsnprintf(pszDest, cchMax, pszFormat, argList);
- // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax));
-
- if ((iRet < 0) || (((size_t)iRet) > cchMax))
- {
- // we have truncated pszDest
- pszDestEnd = pszDest + cchMax;
- cchRemaining = 1;
-
- // need to null terminate the string
- *pszDestEnd = '\0';
-
- hr = STRSAFE_E_INSUFFICIENT_BUFFER;
- }
- else if (((size_t)iRet) == cchMax)
- {
- // string fit perfectly
- pszDestEnd = pszDest + cchMax;
- cchRemaining = 1;
-
- // need to null terminate the string
- *pszDestEnd = '\0';
- }
- else if (((size_t)iRet) < cchMax)
- {
- // there is extra room
- pszDestEnd = pszDest + iRet;
- cchRemaining = cchDest - iRet;
-
- if (dwFlags & STRSAFE_FILL_BEHIND_NULL)
- {
- memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(char)) + (cbDest % sizeof(char)));
- }
- }
- }
- }
- }
-
- if (FAILED(hr))
- {
- if (pszDest)
- {
- if (dwFlags & STRSAFE_FILL_ON_FAILURE)
- {
- memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest);
-
- if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0)
- {
- pszDestEnd = pszDest;
- cchRemaining = cchDest;
- }
- else if (cchDest > 0)
- {
- pszDestEnd = pszDest + cchDest - 1;
- cchRemaining = 1;
-
- // null terminate the end of the string
- *pszDestEnd = '\0';
- }
- }
-
- if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION))
- {
- if (cchDest > 0)
- {
- pszDestEnd = pszDest;
- cchRemaining = cchDest;
-
- // null terminate the beginning of the string
- *pszDestEnd = '\0';
- }
- }
- }
- }
-
- if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER))
- {
- if (ppszDestEnd)
- {
- *ppszDestEnd = pszDestEnd;
- }
-
- if (pcchRemaining)
- {
- *pcchRemaining = cchRemaining;
- }
- }
-
- return hr;
-}
-
-#if defined(FEATURE_PAL) || !defined(PLATFORM_UNIX)
-STRSAFEAPI StringVPrintfExWorkerW(WCHAR* pszDest, size_t cchDest, size_t cbDest, WCHAR** ppszDestEnd, size_t* pcchRemaining, unsigned long dwFlags, const WCHAR* pszFormat, va_list argList)
-{
- HRESULT hr = S_OK;
- WCHAR* pszDestEnd = pszDest;
- size_t cchRemaining = 0;
-
- // ASSERT(cbDest == (cchDest * sizeof(WCHAR)) ||
- // cbDest == (cchDest * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR)));
-
- // only accept valid flags
- if (dwFlags & (~STRSAFE_VALID_FLAGS))
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- if (dwFlags & STRSAFE_IGNORE_NULLS)
- {
- if (pszDest == NULL)
- {
- if ((cchDest != 0) || (cbDest != 0))
- {
- // NULL pszDest and non-zero cchDest/cbDest is invalid
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- }
-
- if (pszFormat == NULL)
- {
- pszFormat = u"";
- }
- }
-
- if (SUCCEEDED(hr))
- {
- if (cchDest == 0)
- {
- pszDestEnd = pszDest;
- cchRemaining = 0;
-
- // only fail if there was actually a non-empty format string
- if (*pszFormat != L'\0')
- {
- if (pszDest == NULL)
- {
- hr = STRSAFE_E_INVALID_PARAMETER;
- }
- else
- {
- hr = STRSAFE_E_INSUFFICIENT_BUFFER;
- }
- }
- }
- else
- {
- int iRet;
- size_t cchMax;
-
- // leave the last space for the null terminator
- cchMax = cchDest - 1;
-
- iRet = _vsnwprintf(pszDest, cchMax, pszFormat, argList);
- // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax));
-
- if ((iRet < 0) || (((size_t)iRet) > cchMax))
- {
- // we have truncated pszDest
- pszDestEnd = pszDest + cchMax;
- cchRemaining = 1;
-
- // need to null terminate the string
- *pszDestEnd = L'\0';
-
- hr = STRSAFE_E_INSUFFICIENT_BUFFER;
- }
- else if (((size_t)iRet) == cchMax)
- {
- // string fit perfectly
- pszDestEnd = pszDest + cchMax;
- cchRemaining = 1;
-
- // need to null terminate the string
- *pszDestEnd = L'\0';
- }
- else if (((size_t)iRet) < cchMax)
- {
- // there is extra room
- pszDestEnd = pszDest + iRet;
- cchRemaining = cchDest - iRet;
-
- if (dwFlags & STRSAFE_FILL_BEHIND_NULL)
- {
- memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), ((cchRemaining - 1) * sizeof(WCHAR)) + (cbDest % sizeof(WCHAR)));
- }
- }
- }
- }
- }
-
- if (FAILED(hr))
- {
- if (pszDest)
- {
- if (dwFlags & STRSAFE_FILL_ON_FAILURE)
- {
- memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest);
-
- if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0)
- {
- pszDestEnd = pszDest;
- cchRemaining = cchDest;
- }
- else if (cchDest > 0)
- {
- pszDestEnd = pszDest + cchDest - 1;
- cchRemaining = 1;
-
- // null terminate the end of the string
- *pszDestEnd = L'\0';
- }
- }
-
- if (dwFlags & (STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION))
- {
- if (cchDest > 0)
- {
- pszDestEnd = pszDest;
- cchRemaining = cchDest;
-
- // null terminate the beginning of the string
- *pszDestEnd = L'\0';
- }
- }
- }
- }
-
- if (SUCCEEDED(hr) || (hr == STRSAFE_E_INSUFFICIENT_BUFFER))
- {
- if (ppszDestEnd)
- {
- *ppszDestEnd = pszDestEnd;
- }
-
- if (pcchRemaining)
- {
- *pcchRemaining = cchRemaining;
- }
- }
-
- return hr;
-}
-#endif // FEATURE_PAL || !PLATFORM_UNIX
-
STRSAFEAPI StringLengthWorkerA(const char* psz, size_t cchMax, size_t* pcch)
{
HRESULT hr = S_OK;
diff --git a/src/pal/inc/unixasmmacros.inc b/src/pal/inc/unixasmmacros.inc
index 7186645b34..e7a5eba898 100644
--- a/src/pal/inc/unixasmmacros.inc
+++ b/src/pal/inc/unixasmmacros.inc
@@ -28,7 +28,9 @@
.equiv \New, \Old
.endm
-#if defined(_AMD64_)
+#if defined(_X86_)
+#include "unixasmmacrosx86.inc"
+#elif defined(_AMD64_)
#include "unixasmmacrosamd64.inc"
#elif defined(_ARM_)
#include "unixasmmacrosarm.inc"
diff --git a/src/pal/inc/unixasmmacrosamd64.inc b/src/pal/inc/unixasmmacrosamd64.inc
index f221b4406b..c3321ce598 100644
--- a/src/pal/inc/unixasmmacrosamd64.inc
+++ b/src/pal/inc/unixasmmacrosamd64.inc
@@ -8,7 +8,7 @@
#if defined(__APPLE__)
.cfi_personality 0x9b, C_FUNC(\Handler) // 0x9b == DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4
#else
- .cfi_personality 0, C_FUNC(\Handler) // 0 == DW_EH_PE_absptr
+ .cfi_personality 0x1b, C_FUNC(\Handler) // 0x1b == DW_EH_PE_pcrel | DW_EH_PE_sdata4
#endif
.endif
.endm
diff --git a/src/pal/inc/unixasmmacrosarm.inc b/src/pal/inc/unixasmmacrosarm.inc
index 14b0b4160e..76ea5eb93c 100644
--- a/src/pal/inc/unixasmmacrosarm.inc
+++ b/src/pal/inc/unixasmmacrosarm.inc
@@ -229,7 +229,8 @@ C_FUNC(\Name\()_End):
.endm
.macro EPILOG_STACK_RESTORE_OFFSET Register, Offset
- sub sp, \Register, \Offset
+ sub \Register, \Offset
+ mov sp, \Register
.endm
.macro EPILOG_BRANCH Target
diff --git a/src/pal/inc/unixasmmacrosarm64.inc b/src/pal/inc/unixasmmacrosarm64.inc
index ae60db4d35..60142053b0 100644
--- a/src/pal/inc/unixasmmacrosarm64.inc
+++ b/src/pal/inc/unixasmmacrosarm64.inc
@@ -5,7 +5,7 @@
.macro NESTED_ENTRY Name, Section, Handler
LEAF_ENTRY \Name, \Section
.ifnc \Handler, NoHandler
- .cfi_personality 0, C_FUNC(\Handler) // 0 == DW_EH_PE_absptr
+ .cfi_personality 0x1b, C_FUNC(\Handler) // 0x1b == DW_EH_PE_pcrel | DW_EH_PE_sdata4
.endif
.endm
diff --git a/src/pal/inc/unixasmmacrosx86.inc b/src/pal/inc/unixasmmacrosx86.inc
new file mode 100644
index 0000000000..77b3a63484
--- /dev/null
+++ b/src/pal/inc/unixasmmacrosx86.inc
@@ -0,0 +1,87 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+.macro NESTED_ENTRY Name, Section, Handler
+ LEAF_ENTRY \Name, \Section
+ .ifnc \Handler, NoHandler
+ .cfi_personality 0x1b, C_FUNC(\Handler) // 0x1b == DW_EH_PE_pcrel | DW_EH_PE_sdata4
+ .endif
+.endm
+
+.macro NESTED_END Name, Section
+ LEAF_END \Name, \Section
+.endm
+
+.macro LEAF_ENTRY Name, Section
+ .global C_FUNC(\Name)
+ .type \Name, %function
+C_FUNC(\Name):
+ .cfi_startproc
+.endm
+
+.macro PATCH_LABEL Name
+ .global C_FUNC(\Name)
+C_FUNC(\Name):
+.endm
+
+.macro LEAF_END Name, Section
+ .size \Name, .-\Name
+ .cfi_endproc
+.endm
+
+.macro LEAF_END_MARKED Name, Section
+C_FUNC(\Name\()_End):
+ .global C_FUNC(\Name\()_End)
+ LEAF_END \Name, \Section
+.endm
+
+.macro PROLOG_BEG
+ push ebp
+ .cfi_def_cfa_offset 8
+ .cfi_offset ebp, -8
+ mov ebp, esp
+.endm
+
+.macro PROLOG_PUSH Reg
+ push \Reg
+ .cfi_adjust_cfa_offset 4
+ .cfi_rel_offset \Reg, 0
+.endm
+
+.macro PROLOG_END
+ .cfi_def_cfa_register ebp
+ .cfi_def_cfa_offset 8
+.endm
+
+.macro EPILOG_BEG
+.endm
+
+.macro EPILOG_POP Reg
+ pop \Reg
+ .cfi_restore \Reg
+.endm
+
+.macro EPILOG_END
+ pop ebp
+.endm
+
+.macro PREPARE_EXTERNAL_VAR Name, Reg
+.att_syntax
+ call 0f
+0:
+ popl %\Reg
+1:
+ addl $_GLOBAL_OFFSET_TABLE_ + (1b - 0b), %\Reg
+ movl C_FUNC(\Name)@GOT(%\Reg), %\Reg
+.intel_syntax noprefix
+.endm
+
+.macro CHECK_STACK_ALIGNMENT
+#ifdef _DEBUG
+ test esp, 0Fh
+ je 0f
+ int3
+0:
+#endif // _DEBUG
+.endm
diff --git a/src/pal/prebuilt/idl/clrdata_i.c b/src/pal/prebuilt/idl/clrdata_i.cpp
index bb9616a9f8..bb9616a9f8 100644
--- a/src/pal/prebuilt/idl/clrdata_i.c
+++ b/src/pal/prebuilt/idl/clrdata_i.cpp
diff --git a/src/pal/prebuilt/idl/clrinternal_i.c b/src/pal/prebuilt/idl/clrinternal_i.cpp
index 58a16672cf..58a16672cf 100644
--- a/src/pal/prebuilt/idl/clrinternal_i.c
+++ b/src/pal/prebuilt/idl/clrinternal_i.cpp
diff --git a/src/pal/prebuilt/idl/clrprivappxhosting_i.c b/src/pal/prebuilt/idl/clrprivappxhosting_i.cpp
index c46d033d1a..c46d033d1a 100644
--- a/src/pal/prebuilt/idl/clrprivappxhosting_i.c
+++ b/src/pal/prebuilt/idl/clrprivappxhosting_i.cpp
diff --git a/src/pal/prebuilt/idl/clrprivbinding_i.c b/src/pal/prebuilt/idl/clrprivbinding_i.cpp
index ee08cc3583..ee08cc3583 100644
--- a/src/pal/prebuilt/idl/clrprivbinding_i.c
+++ b/src/pal/prebuilt/idl/clrprivbinding_i.cpp
diff --git a/src/pal/prebuilt/idl/clrprivhosting_i.c b/src/pal/prebuilt/idl/clrprivhosting_i.cpp
index 07a40b290e..07a40b290e 100644
--- a/src/pal/prebuilt/idl/clrprivhosting_i.c
+++ b/src/pal/prebuilt/idl/clrprivhosting_i.cpp
diff --git a/src/pal/prebuilt/idl/clrprivruntimebinders_i.c b/src/pal/prebuilt/idl/clrprivruntimebinders_i.cpp
index 0fe4a180df..0fe4a180df 100644
--- a/src/pal/prebuilt/idl/clrprivruntimebinders_i.c
+++ b/src/pal/prebuilt/idl/clrprivruntimebinders_i.cpp
diff --git a/src/pal/prebuilt/idl/cordebug_i.c b/src/pal/prebuilt/idl/cordebug_i.c
deleted file mode 100644
index e3c8d2edcb..0000000000
--- a/src/pal/prebuilt/idl/cordebug_i.c
+++ /dev/null
@@ -1,451 +0,0 @@
-
-
-/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
-
-/* link this file in with the server and any clients */
-
-
- /* File created by MIDL compiler version 8.00.0613 */
-/* at Mon Jan 18 19:14:07 2038
- */
-/* Compiler settings for C:/ssd/coreclr/src/inc/cordebug.idl:
- Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0613
- protocol : dce , ms_ext, c_ext, robust
- error checks: allocation ref bounds_check enum stub_data
- VC __declspec() decoration level:
- __declspec(uuid()), __declspec(selectany), __declspec(novtable)
- DECLSPEC_UUID(), MIDL_INTERFACE()
-*/
-/* @@MIDL_FILE_HEADING( ) */
-
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-#include <rpc.h>
-#include <rpcndr.h>
-
-#ifdef _MIDL_USE_GUIDDEF_
-
-#ifndef INITGUID
-#define INITGUID
-#include <guiddef.h>
-#undef INITGUID
-#else
-#include <guiddef.h>
-#endif
-
-#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
-
-#else // !_MIDL_USE_GUIDDEF_
-
-#ifndef __IID_DEFINED__
-#define __IID_DEFINED__
-
-typedef struct _IID
-{
- unsigned long x;
- unsigned short s1;
- unsigned short s2;
- unsigned char c[8];
-} IID;
-
-#endif // __IID_DEFINED__
-
-#ifndef CLSID_DEFINED
-#define CLSID_DEFINED
-typedef IID CLSID;
-#endif // CLSID_DEFINED
-
-#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-
-#endif !_MIDL_USE_GUIDDEF_
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugDataTarget,0xFE06DC28,0x49FB,0x4636,0xA4,0xA3,0xE8,0x0D,0xB4,0xAE,0x11,0x6C);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugStaticFieldSymbol,0xCBF9DA63,0xF68D,0x4BBB,0xA2,0x1C,0x15,0xA4,0x5E,0xAA,0xDF,0x5B);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugInstanceFieldSymbol,0xA074096B,0x3ADC,0x4485,0x81,0xDA,0x68,0xC7,0xA4,0xEA,0x52,0xDB);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugVariableSymbol,0x707E8932,0x1163,0x48D9,0x8A,0x93,0xF5,0xB1,0xF4,0x80,0xFB,0xB7);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugMemoryBuffer,0x677888B3,0xD160,0x4B8C,0xA7,0x3B,0xD7,0x9E,0x6A,0xAA,0x1D,0x13);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugMergedAssemblyRecord,0xFAA8637B,0x3BBE,0x4671,0x8E,0x26,0x3B,0x59,0x87,0x5B,0x92,0x2A);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugSymbolProvider,0x3948A999,0xFD8A,0x4C38,0xA7,0x08,0x8A,0x71,0xE9,0xB0,0x4D,0xBB);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugSymbolProvider2,0xF9801807,0x4764,0x4330,0x9E,0x67,0x4F,0x68,0x50,0x94,0x16,0x5E);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugVirtualUnwinder,0xF69126B7,0xC787,0x4F6B,0xAE,0x96,0xA5,0x69,0x78,0x6F,0xC6,0x70);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugDataTarget2,0x2eb364da,0x605b,0x4e8d,0xb3,0x33,0x33,0x94,0xc4,0x82,0x8d,0x41);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugLoadedModule,0x817F343A,0x6630,0x4578,0x96,0xC5,0xD1,0x1B,0xC0,0xEC,0x5E,0xE2);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugDataTarget3,0xD05E60C3,0x848C,0x4E7D,0x89,0x4E,0x62,0x33,0x20,0xFF,0x6A,0xFA);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugDataTarget4,0xE799DC06,0xE099,0x4713,0xBD,0xD9,0x90,0x6D,0x3C,0xC0,0x2C,0xF2);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugMutableDataTarget,0xA1B8A756,0x3CB6,0x4CCB,0x97,0x9F,0x3D,0xF9,0x99,0x67,0x3A,0x59);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugMetaDataLocator,0x7cef8ba9,0x2ef7,0x42bf,0x97,0x3f,0x41,0x71,0x47,0x4f,0x87,0xd9);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugManagedCallback,0x3d6f5f60,0x7538,0x11d3,0x8d,0x5b,0x00,0x10,0x4b,0x35,0xe7,0xef);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugManagedCallback3,0x264EA0FC,0x2591,0x49AA,0x86,0x8E,0x83,0x5E,0x65,0x15,0x32,0x3F);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugManagedCallback2,0x250E5EEA,0xDB5C,0x4C76,0xB6,0xF3,0x8C,0x46,0xF1,0x2E,0x32,0x03);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugUnmanagedCallback,0x5263E909,0x8CB5,0x11d3,0xBD,0x2F,0x00,0x00,0xF8,0x08,0x49,0xBD);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebug,0x3d6f5f61,0x7538,0x11d3,0x8d,0x5b,0x00,0x10,0x4b,0x35,0xe7,0xef);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugRemoteTarget,0xC3ED8383,0x5A49,0x4cf5,0xB4,0xB7,0x01,0x86,0x4D,0x9E,0x58,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugRemote,0xD5EBB8E2,0x7BBE,0x4c1d,0x98,0xA6,0xA3,0xC0,0x4C,0xBD,0xEF,0x64);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebug2,0xECCCCF2E,0xB286,0x4b3e,0xA9,0x83,0x86,0x0A,0x87,0x93,0xD1,0x05);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugController,0x3d6f5f62,0x7538,0x11d3,0x8d,0x5b,0x00,0x10,0x4b,0x35,0xe7,0xef);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugAppDomain,0x3d6f5f63,0x7538,0x11d3,0x8d,0x5b,0x00,0x10,0x4b,0x35,0xe7,0xef);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugAppDomain2,0x096E81D5,0xECDA,0x4202,0x83,0xF5,0xC6,0x59,0x80,0xA9,0xEF,0x75);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugEnum,0xCC7BCB01,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugGuidToTypeEnum,0x6164D242,0x1015,0x4BD6,0x8C,0xBE,0xD0,0xDB,0xD4,0xB8,0x27,0x5A);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugAppDomain3,0x8CB96A16,0xB588,0x42E2,0xB7,0x1C,0xDD,0x84,0x9F,0xC2,0xEC,0xCC);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugAppDomain4,0xFB99CC40,0x83BE,0x4724,0xAB,0x3B,0x76,0x8E,0x79,0x6E,0xBA,0xC2);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugAssembly,0xdf59507c,0xd47a,0x459e,0xbc,0xe2,0x64,0x27,0xea,0xc8,0xfd,0x06);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugAssembly2,0x426d1f9e,0x6dd4,0x44c8,0xae,0xc7,0x26,0xcd,0xba,0xf4,0xe3,0x98);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugAssembly3,0x76361AB2,0x8C86,0x4FE9,0x96,0xF2,0xF7,0x3D,0x88,0x43,0x57,0x0A);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugHeapEnum,0x76D7DAB8,0xD044,0x11DF,0x9A,0x15,0x7E,0x29,0xDF,0xD7,0x20,0x85);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugHeapSegmentEnum,0xA2FA0F8E,0xD045,0x11DF,0xAC,0x8E,0xCE,0x2A,0xDF,0xD7,0x20,0x85);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugGCReferenceEnum,0x7F3C24D3,0x7E1D,0x4245,0xAC,0x3A,0xF7,0x2F,0x88,0x59,0xC8,0x0C);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess,0x3d6f5f64,0x7538,0x11d3,0x8d,0x5b,0x00,0x10,0x4b,0x35,0xe7,0xef);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess2,0xAD1B3588,0x0EF0,0x4744,0xA4,0x96,0xAA,0x09,0xA9,0xF8,0x03,0x71);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess3,0x2EE06488,0xC0D4,0x42B1,0xB2,0x6D,0xF3,0x79,0x5E,0xF6,0x06,0xFB);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess5,0x21e9d9c0,0xfcb8,0x11df,0x8c,0xff,0x08,0x00,0x20,0x0c,0x9a,0x66);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugDebugEvent,0x41BD395D,0xDE99,0x48F1,0xBF,0x7A,0xCC,0x0F,0x44,0xA6,0xD2,0x81);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess6,0x11588775,0x7205,0x4CEB,0xA4,0x1A,0x93,0x75,0x3C,0x31,0x53,0xE9);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess7,0x9B2C54E4,0x119F,0x4D6F,0xB4,0x02,0x52,0x76,0x03,0x26,0x6D,0x69);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess8,0x2E6F28C1,0x85EB,0x4141,0x80,0xAD,0x0A,0x90,0x94,0x4B,0x96,0x39);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugModuleDebugEvent,0x51A15E8D,0x9FFF,0x4864,0x9B,0x87,0xF4,0xFB,0xDE,0xA7,0x47,0xA2);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugExceptionDebugEvent,0xAF79EC94,0x4752,0x419C,0xA6,0x26,0x5F,0xB1,0xCC,0x1A,0x5A,0xB7);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugBreakpoint,0xCC7BCAE8,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugFunctionBreakpoint,0xCC7BCAE9,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugModuleBreakpoint,0xCC7BCAEA,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugValueBreakpoint,0xCC7BCAEB,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugStepper,0xCC7BCAEC,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugStepper2,0xC5B6E9C3,0xE7D1,0x4a8e,0x87,0x3B,0x7F,0x04,0x7F,0x07,0x06,0xF7);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugRegisterSet,0xCC7BCB0B,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugRegisterSet2,0x6DC7BA3F,0x89BA,0x4459,0x9E,0xC1,0x9D,0x60,0x93,0x7B,0x46,0x8D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugThread,0x938c6d66,0x7fb6,0x4f69,0xb3,0x89,0x42,0x5b,0x89,0x87,0x32,0x9b);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugThread2,0x2BD956D9,0x7B07,0x4bef,0x8A,0x98,0x12,0xAA,0x86,0x24,0x17,0xC5);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugThread3,0xF8544EC3,0x5E4E,0x46c7,0x8D,0x3E,0xA5,0x2B,0x84,0x05,0xB1,0xF5);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugThread4,0x1A1F204B,0x1C66,0x4637,0x82,0x3F,0x3E,0xE6,0xC7,0x44,0xA6,0x9C);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugStackWalk,0xA0647DE9,0x55DE,0x4816,0x92,0x9C,0x38,0x52,0x71,0xC6,0x4C,0xF7);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugChain,0xCC7BCAEE,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugFrame,0xCC7BCAEF,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugInternalFrame,0xB92CC7F7,0x9D2D,0x45c4,0xBC,0x2B,0x62,0x1F,0xCC,0x9D,0xFB,0xF4);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugInternalFrame2,0xC0815BDC,0xCFAB,0x447e,0xA7,0x79,0xC1,0x16,0xB4,0x54,0xEB,0x5B);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugILFrame,0x03E26311,0x4F76,0x11d3,0x88,0xC6,0x00,0x60,0x97,0x94,0x54,0x18);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugILFrame2,0x5D88A994,0x6C30,0x479b,0x89,0x0F,0xBC,0xEF,0x88,0xB1,0x29,0xA5);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugILFrame3,0x9A9E2ED6,0x04DF,0x4FE0,0xBB,0x50,0xCA,0xB6,0x41,0x26,0xAD,0x24);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugILFrame4,0xAD914A30,0xC6D1,0x4AC5,0x9C,0x5E,0x57,0x7F,0x3B,0xAA,0x8A,0x45);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugNativeFrame,0x03E26314,0x4F76,0x11d3,0x88,0xC6,0x00,0x60,0x97,0x94,0x54,0x18);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugNativeFrame2,0x35389FF1,0x3684,0x4c55,0xA2,0xEE,0x21,0x0F,0x26,0xC6,0x0E,0x5E);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugModule3,0x86F012BF,0xFF15,0x4372,0xBD,0x30,0xB6,0xF1,0x1C,0xAA,0xE1,0xDD);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugRuntimeUnwindableFrame,0x879CAC0A,0x4A53,0x4668,0xB8,0xE3,0xCB,0x84,0x73,0xCB,0x18,0x7F);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugModule,0xdba2d8c1,0xe5c5,0x4069,0x8c,0x13,0x10,0xa7,0xc6,0xab,0xf4,0x3d);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugModule2,0x7FCC5FB5,0x49C0,0x41de,0x99,0x38,0x3B,0x88,0xB5,0xB9,0xAD,0xD7);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugFunction,0xCC7BCAF3,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugFunction2,0xEF0C490B,0x94C3,0x4e4d,0xB6,0x29,0xDD,0xC1,0x34,0xC5,0x32,0xD8);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugFunction3,0x09B70F28,0xE465,0x482D,0x99,0xE0,0x81,0xA1,0x65,0xEB,0x05,0x32);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugCode,0xCC7BCAF4,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugCode2,0x5F696509,0x452F,0x4436,0xA3,0xFE,0x4D,0x11,0xFE,0x7E,0x23,0x47);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugCode3,0xD13D3E88,0xE1F2,0x4020,0xAA,0x1D,0x3D,0x16,0x2D,0xCB,0xE9,0x66);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugILCode,0x598D46C2,0xC877,0x42A7,0x89,0xD2,0x3D,0x0C,0x7F,0x1C,0x12,0x64);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugILCode2,0x46586093,0xD3F5,0x4DB6,0xAC,0xDB,0x95,0x5B,0xCE,0x22,0x8C,0x15);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugClass,0xCC7BCAF5,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugClass2,0xB008EA8D,0x7AB1,0x43f7,0xBB,0x20,0xFB,0xB5,0xA0,0x40,0x38,0xAE);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugEval,0xCC7BCAF6,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugEval2,0xFB0D9CE7,0xBE66,0x4683,0x9D,0x32,0xA4,0x2A,0x04,0xE2,0xFD,0x91);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugValue,0xCC7BCAF7,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugValue2,0x5E0B54E7,0xD88A,0x4626,0x94,0x20,0xA6,0x91,0xE0,0xA7,0x8B,0x49);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugValue3,0x565005FC,0x0F8A,0x4F3E,0x9E,0xDB,0x83,0x10,0x2B,0x15,0x65,0x95);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugGenericValue,0xCC7BCAF8,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugReferenceValue,0xCC7BCAF9,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugHeapValue,0xCC7BCAFA,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugHeapValue2,0xE3AC4D6C,0x9CB7,0x43e6,0x96,0xCC,0xB2,0x15,0x40,0xE5,0x08,0x3C);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugHeapValue3,0xA69ACAD8,0x2374,0x46e9,0x9F,0xF8,0xB1,0xF1,0x41,0x20,0xD2,0x96);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugObjectValue,0x18AD3D6E,0xB7D2,0x11d2,0xBD,0x04,0x00,0x00,0xF8,0x08,0x49,0xBD);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugObjectValue2,0x49E4A320,0x4A9B,0x4eca,0xB1,0x05,0x22,0x9F,0xB7,0xD5,0x00,0x9F);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugBoxValue,0xCC7BCAFC,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugStringValue,0xCC7BCAFD,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugArrayValue,0x0405B0DF,0xA660,0x11d2,0xBD,0x02,0x00,0x00,0xF8,0x08,0x49,0xBD);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugHandleValue,0x029596E8,0x276B,0x46a1,0x98,0x21,0x73,0x2E,0x96,0xBB,0xB0,0x0B);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugContext,0xCC7BCB00,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugComObjectValue,0x5F69C5E5,0x3E12,0x42DF,0xB3,0x71,0xF9,0xD7,0x61,0xD6,0xEE,0x24);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugObjectEnum,0xCC7BCB02,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugBreakpointEnum,0xCC7BCB03,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugStepperEnum,0xCC7BCB04,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugProcessEnum,0xCC7BCB05,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugThreadEnum,0xCC7BCB06,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugFrameEnum,0xCC7BCB07,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugChainEnum,0xCC7BCB08,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugModuleEnum,0xCC7BCB09,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugValueEnum,0xCC7BCB0A,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugCodeEnum,0x55E96461,0x9645,0x45e4,0xA2,0xFF,0x03,0x67,0x87,0x7A,0xBC,0xDE);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugTypeEnum,0x10F27499,0x9DF2,0x43ce,0x83,0x33,0xA3,0x21,0xD7,0xC9,0x9C,0xB4);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugType,0xD613F0BB,0xACE1,0x4c19,0xBD,0x72,0xE4,0xC0,0x8D,0x5D,0xA7,0xF5);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugErrorInfoEnum,0xF0E18809,0x72B5,0x11d2,0x97,0x6F,0x00,0xA0,0xC9,0xB4,0xD5,0x0C);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugAppDomainEnum,0x63ca1b24,0x4359,0x4883,0xbd,0x57,0x13,0xf8,0x15,0xf5,0x87,0x44);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugAssemblyEnum,0x4a2a1ec9,0x85ec,0x4bfb,0x9f,0x15,0xa8,0x9f,0xdf,0xe0,0xfe,0x83);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugBlockingObjectEnum,0x976A6278,0x134A,0x4a81,0x81,0xA3,0x8F,0x27,0x79,0x43,0xF4,0xC3);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugMDA,0xCC726F2F,0x1DB7,0x459b,0xB0,0xEC,0x05,0xF0,0x1D,0x84,0x1B,0x42);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugEditAndContinueErrorInfo,0x8D600D41,0xF4F6,0x4cb3,0xB7,0xEC,0x7B,0xD1,0x64,0x94,0x40,0x36);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugEditAndContinueSnapshot,0x6DC3FA01,0xD7CB,0x11d2,0x8A,0x95,0x00,0x80,0xC7,0x92,0xE5,0xD8);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugExceptionObjectCallStackEnum,0xED775530,0x4DC4,0x41F7,0x86,0xD0,0x9E,0x2D,0xEF,0x7D,0xFC,0x66);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorDebugExceptionObjectValue,0xAE4CA65D,0x59DD,0x42A2,0x83,0xA5,0x57,0xE8,0xA0,0x8D,0x87,0x19);
-
-
-MIDL_DEFINE_GUID(IID, LIBID_CORDBLib,0x53D13620,0xF417,0x11d1,0x97,0x62,0xA6,0x38,0x26,0xA4,0xF2,0x55);
-
-
-MIDL_DEFINE_GUID(CLSID, CLSID_CorDebug,0x6fef44d0,0x39e7,0x4c77,0xbe,0x8e,0xc9,0xf8,0xcf,0x98,0x86,0x30);
-
-
-MIDL_DEFINE_GUID(CLSID, CLSID_EmbeddedCLRCorDebug,0x211f1254,0xbc7e,0x4af5,0xb9,0xaa,0x06,0x73,0x08,0xd8,0x3d,0xd1);
-
-#undef MIDL_DEFINE_GUID
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
diff --git a/src/pal/prebuilt/idl/cordebug_i.cpp b/src/pal/prebuilt/idl/cordebug_i.cpp
new file mode 100644
index 0000000000..dd69e57086
--- /dev/null
+++ b/src/pal/prebuilt/idl/cordebug_i.cpp
@@ -0,0 +1,463 @@
+
+
+/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
+
+/* link this file in with the server and any clients */
+
+
+ /* File created by MIDL compiler version 8.00.0603 */
+/* at Fri Sep 23 15:43:16 2016
+ */
+/* Compiler settings for cordebug.idl:
+ Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0603
+ protocol : dce , ms_ext, c_ext, robust
+ error checks: allocation ref bounds_check enum stub_data
+ VC __declspec() decoration level:
+ __declspec(uuid()), __declspec(selectany), __declspec(novtable)
+ DECLSPEC_UUID(), MIDL_INTERFACE()
+*/
+/* @@MIDL_FILE_HEADING( ) */
+
+#pragma warning( disable: 4049 ) /* more than 64k source lines */
+
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifdef _MIDL_USE_GUIDDEF_
+
+#ifndef INITGUID
+#define INITGUID
+#include <guiddef.h>
+#undef INITGUID
+#else
+#include <guiddef.h>
+#endif
+
+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
+ DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
+
+#else // !_MIDL_USE_GUIDDEF_
+
+#ifndef __IID_DEFINED__
+#define __IID_DEFINED__
+
+typedef struct _IID
+{
+ unsigned long x;
+ unsigned short s1;
+ unsigned short s2;
+ unsigned char c[8];
+} IID;
+
+#endif // __IID_DEFINED__
+
+#ifndef CLSID_DEFINED
+#define CLSID_DEFINED
+typedef IID CLSID;
+#endif // CLSID_DEFINED
+
+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
+ const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
+
+#endif !_MIDL_USE_GUIDDEF_
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugDataTarget,0xFE06DC28,0x49FB,0x4636,0xA4,0xA3,0xE8,0x0D,0xB4,0xAE,0x11,0x6C);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugStaticFieldSymbol,0xCBF9DA63,0xF68D,0x4BBB,0xA2,0x1C,0x15,0xA4,0x5E,0xAA,0xDF,0x5B);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugInstanceFieldSymbol,0xA074096B,0x3ADC,0x4485,0x81,0xDA,0x68,0xC7,0xA4,0xEA,0x52,0xDB);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugVariableSymbol,0x707E8932,0x1163,0x48D9,0x8A,0x93,0xF5,0xB1,0xF4,0x80,0xFB,0xB7);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugMemoryBuffer,0x677888B3,0xD160,0x4B8C,0xA7,0x3B,0xD7,0x9E,0x6A,0xAA,0x1D,0x13);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugMergedAssemblyRecord,0xFAA8637B,0x3BBE,0x4671,0x8E,0x26,0x3B,0x59,0x87,0x5B,0x92,0x2A);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugSymbolProvider,0x3948A999,0xFD8A,0x4C38,0xA7,0x08,0x8A,0x71,0xE9,0xB0,0x4D,0xBB);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugSymbolProvider2,0xF9801807,0x4764,0x4330,0x9E,0x67,0x4F,0x68,0x50,0x94,0x16,0x5E);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugVirtualUnwinder,0xF69126B7,0xC787,0x4F6B,0xAE,0x96,0xA5,0x69,0x78,0x6F,0xC6,0x70);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugDataTarget2,0x2eb364da,0x605b,0x4e8d,0xb3,0x33,0x33,0x94,0xc4,0x82,0x8d,0x41);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugLoadedModule,0x817F343A,0x6630,0x4578,0x96,0xC5,0xD1,0x1B,0xC0,0xEC,0x5E,0xE2);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugDataTarget3,0xD05E60C3,0x848C,0x4E7D,0x89,0x4E,0x62,0x33,0x20,0xFF,0x6A,0xFA);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugDataTarget4,0xE799DC06,0xE099,0x4713,0xBD,0xD9,0x90,0x6D,0x3C,0xC0,0x2C,0xF2);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugMutableDataTarget,0xA1B8A756,0x3CB6,0x4CCB,0x97,0x9F,0x3D,0xF9,0x99,0x67,0x3A,0x59);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugMetaDataLocator,0x7cef8ba9,0x2ef7,0x42bf,0x97,0x3f,0x41,0x71,0x47,0x4f,0x87,0xd9);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugManagedCallback,0x3d6f5f60,0x7538,0x11d3,0x8d,0x5b,0x00,0x10,0x4b,0x35,0xe7,0xef);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugManagedCallback3,0x264EA0FC,0x2591,0x49AA,0x86,0x8E,0x83,0x5E,0x65,0x15,0x32,0x3F);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugManagedCallback2,0x250E5EEA,0xDB5C,0x4C76,0xB6,0xF3,0x8C,0x46,0xF1,0x2E,0x32,0x03);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugUnmanagedCallback,0x5263E909,0x8CB5,0x11d3,0xBD,0x2F,0x00,0x00,0xF8,0x08,0x49,0xBD);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebug,0x3d6f5f61,0x7538,0x11d3,0x8d,0x5b,0x00,0x10,0x4b,0x35,0xe7,0xef);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugRemoteTarget,0xC3ED8383,0x5A49,0x4cf5,0xB4,0xB7,0x01,0x86,0x4D,0x9E,0x58,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugRemote,0xD5EBB8E2,0x7BBE,0x4c1d,0x98,0xA6,0xA3,0xC0,0x4C,0xBD,0xEF,0x64);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebug2,0xECCCCF2E,0xB286,0x4b3e,0xA9,0x83,0x86,0x0A,0x87,0x93,0xD1,0x05);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugController,0x3d6f5f62,0x7538,0x11d3,0x8d,0x5b,0x00,0x10,0x4b,0x35,0xe7,0xef);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugAppDomain,0x3d6f5f63,0x7538,0x11d3,0x8d,0x5b,0x00,0x10,0x4b,0x35,0xe7,0xef);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugAppDomain2,0x096E81D5,0xECDA,0x4202,0x83,0xF5,0xC6,0x59,0x80,0xA9,0xEF,0x75);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugEnum,0xCC7BCB01,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugGuidToTypeEnum,0x6164D242,0x1015,0x4BD6,0x8C,0xBE,0xD0,0xDB,0xD4,0xB8,0x27,0x5A);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugAppDomain3,0x8CB96A16,0xB588,0x42E2,0xB7,0x1C,0xDD,0x84,0x9F,0xC2,0xEC,0xCC);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugAppDomain4,0xFB99CC40,0x83BE,0x4724,0xAB,0x3B,0x76,0x8E,0x79,0x6E,0xBA,0xC2);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugAssembly,0xdf59507c,0xd47a,0x459e,0xbc,0xe2,0x64,0x27,0xea,0xc8,0xfd,0x06);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugAssembly2,0x426d1f9e,0x6dd4,0x44c8,0xae,0xc7,0x26,0xcd,0xba,0xf4,0xe3,0x98);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugAssembly3,0x76361AB2,0x8C86,0x4FE9,0x96,0xF2,0xF7,0x3D,0x88,0x43,0x57,0x0A);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugHeapEnum,0x76D7DAB8,0xD044,0x11DF,0x9A,0x15,0x7E,0x29,0xDF,0xD7,0x20,0x85);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugHeapSegmentEnum,0xA2FA0F8E,0xD045,0x11DF,0xAC,0x8E,0xCE,0x2A,0xDF,0xD7,0x20,0x85);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugGCReferenceEnum,0x7F3C24D3,0x7E1D,0x4245,0xAC,0x3A,0xF7,0x2F,0x88,0x59,0xC8,0x0C);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess,0x3d6f5f64,0x7538,0x11d3,0x8d,0x5b,0x00,0x10,0x4b,0x35,0xe7,0xef);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess2,0xAD1B3588,0x0EF0,0x4744,0xA4,0x96,0xAA,0x09,0xA9,0xF8,0x03,0x71);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess3,0x2EE06488,0xC0D4,0x42B1,0xB2,0x6D,0xF3,0x79,0x5E,0xF6,0x06,0xFB);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess5,0x21e9d9c0,0xfcb8,0x11df,0x8c,0xff,0x08,0x00,0x20,0x0c,0x9a,0x66);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugDebugEvent,0x41BD395D,0xDE99,0x48F1,0xBF,0x7A,0xCC,0x0F,0x44,0xA6,0xD2,0x81);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess6,0x11588775,0x7205,0x4CEB,0xA4,0x1A,0x93,0x75,0x3C,0x31,0x53,0xE9);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess7,0x9B2C54E4,0x119F,0x4D6F,0xB4,0x02,0x52,0x76,0x03,0x26,0x6D,0x69);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess8,0x2E6F28C1,0x85EB,0x4141,0x80,0xAD,0x0A,0x90,0x94,0x4B,0x96,0x39);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugModuleDebugEvent,0x51A15E8D,0x9FFF,0x4864,0x9B,0x87,0xF4,0xFB,0xDE,0xA7,0x47,0xA2);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugExceptionDebugEvent,0xAF79EC94,0x4752,0x419C,0xA6,0x26,0x5F,0xB1,0xCC,0x1A,0x5A,0xB7);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugBreakpoint,0xCC7BCAE8,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugFunctionBreakpoint,0xCC7BCAE9,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugModuleBreakpoint,0xCC7BCAEA,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugValueBreakpoint,0xCC7BCAEB,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugStepper,0xCC7BCAEC,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugStepper2,0xC5B6E9C3,0xE7D1,0x4a8e,0x87,0x3B,0x7F,0x04,0x7F,0x07,0x06,0xF7);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugRegisterSet,0xCC7BCB0B,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugRegisterSet2,0x6DC7BA3F,0x89BA,0x4459,0x9E,0xC1,0x9D,0x60,0x93,0x7B,0x46,0x8D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugThread,0x938c6d66,0x7fb6,0x4f69,0xb3,0x89,0x42,0x5b,0x89,0x87,0x32,0x9b);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugThread2,0x2BD956D9,0x7B07,0x4bef,0x8A,0x98,0x12,0xAA,0x86,0x24,0x17,0xC5);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugThread3,0xF8544EC3,0x5E4E,0x46c7,0x8D,0x3E,0xA5,0x2B,0x84,0x05,0xB1,0xF5);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugThread4,0x1A1F204B,0x1C66,0x4637,0x82,0x3F,0x3E,0xE6,0xC7,0x44,0xA6,0x9C);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugStackWalk,0xA0647DE9,0x55DE,0x4816,0x92,0x9C,0x38,0x52,0x71,0xC6,0x4C,0xF7);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugChain,0xCC7BCAEE,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugFrame,0xCC7BCAEF,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugInternalFrame,0xB92CC7F7,0x9D2D,0x45c4,0xBC,0x2B,0x62,0x1F,0xCC,0x9D,0xFB,0xF4);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugInternalFrame2,0xC0815BDC,0xCFAB,0x447e,0xA7,0x79,0xC1,0x16,0xB4,0x54,0xEB,0x5B);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugILFrame,0x03E26311,0x4F76,0x11d3,0x88,0xC6,0x00,0x60,0x97,0x94,0x54,0x18);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugILFrame2,0x5D88A994,0x6C30,0x479b,0x89,0x0F,0xBC,0xEF,0x88,0xB1,0x29,0xA5);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugILFrame3,0x9A9E2ED6,0x04DF,0x4FE0,0xBB,0x50,0xCA,0xB6,0x41,0x26,0xAD,0x24);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugILFrame4,0xAD914A30,0xC6D1,0x4AC5,0x9C,0x5E,0x57,0x7F,0x3B,0xAA,0x8A,0x45);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugNativeFrame,0x03E26314,0x4F76,0x11d3,0x88,0xC6,0x00,0x60,0x97,0x94,0x54,0x18);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugNativeFrame2,0x35389FF1,0x3684,0x4c55,0xA2,0xEE,0x21,0x0F,0x26,0xC6,0x0E,0x5E);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugModule3,0x86F012BF,0xFF15,0x4372,0xBD,0x30,0xB6,0xF1,0x1C,0xAA,0xE1,0xDD);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugRuntimeUnwindableFrame,0x879CAC0A,0x4A53,0x4668,0xB8,0xE3,0xCB,0x84,0x73,0xCB,0x18,0x7F);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugModule,0xdba2d8c1,0xe5c5,0x4069,0x8c,0x13,0x10,0xa7,0xc6,0xab,0xf4,0x3d);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugModule2,0x7FCC5FB5,0x49C0,0x41de,0x99,0x38,0x3B,0x88,0xB5,0xB9,0xAD,0xD7);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugFunction,0xCC7BCAF3,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugFunction2,0xEF0C490B,0x94C3,0x4e4d,0xB6,0x29,0xDD,0xC1,0x34,0xC5,0x32,0xD8);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugFunction3,0x09B70F28,0xE465,0x482D,0x99,0xE0,0x81,0xA1,0x65,0xEB,0x05,0x32);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugCode,0xCC7BCAF4,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugCode2,0x5F696509,0x452F,0x4436,0xA3,0xFE,0x4D,0x11,0xFE,0x7E,0x23,0x47);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugCode3,0xD13D3E88,0xE1F2,0x4020,0xAA,0x1D,0x3D,0x16,0x2D,0xCB,0xE9,0x66);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugCode4,0x18221fa4,0x20cb,0x40fa,0xb1,0x9d,0x9f,0x91,0xc4,0xfa,0x8c,0x14);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugILCode,0x598D46C2,0xC877,0x42A7,0x89,0xD2,0x3D,0x0C,0x7F,0x1C,0x12,0x64);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugILCode2,0x46586093,0xD3F5,0x4DB6,0xAC,0xDB,0x95,0x5B,0xCE,0x22,0x8C,0x15);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugClass,0xCC7BCAF5,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugClass2,0xB008EA8D,0x7AB1,0x43f7,0xBB,0x20,0xFB,0xB5,0xA0,0x40,0x38,0xAE);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugEval,0xCC7BCAF6,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugEval2,0xFB0D9CE7,0xBE66,0x4683,0x9D,0x32,0xA4,0x2A,0x04,0xE2,0xFD,0x91);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugValue,0xCC7BCAF7,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugValue2,0x5E0B54E7,0xD88A,0x4626,0x94,0x20,0xA6,0x91,0xE0,0xA7,0x8B,0x49);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugValue3,0x565005FC,0x0F8A,0x4F3E,0x9E,0xDB,0x83,0x10,0x2B,0x15,0x65,0x95);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugGenericValue,0xCC7BCAF8,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugReferenceValue,0xCC7BCAF9,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugHeapValue,0xCC7BCAFA,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugHeapValue2,0xE3AC4D6C,0x9CB7,0x43e6,0x96,0xCC,0xB2,0x15,0x40,0xE5,0x08,0x3C);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugHeapValue3,0xA69ACAD8,0x2374,0x46e9,0x9F,0xF8,0xB1,0xF1,0x41,0x20,0xD2,0x96);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugObjectValue,0x18AD3D6E,0xB7D2,0x11d2,0xBD,0x04,0x00,0x00,0xF8,0x08,0x49,0xBD);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugObjectValue2,0x49E4A320,0x4A9B,0x4eca,0xB1,0x05,0x22,0x9F,0xB7,0xD5,0x00,0x9F);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugBoxValue,0xCC7BCAFC,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugStringValue,0xCC7BCAFD,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugArrayValue,0x0405B0DF,0xA660,0x11d2,0xBD,0x02,0x00,0x00,0xF8,0x08,0x49,0xBD);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugVariableHome,0x50847b8d,0xf43f,0x41b0,0x92,0x4c,0x63,0x83,0xa5,0xf2,0x27,0x8b);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugHandleValue,0x029596E8,0x276B,0x46a1,0x98,0x21,0x73,0x2E,0x96,0xBB,0xB0,0x0B);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugContext,0xCC7BCB00,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugComObjectValue,0x5F69C5E5,0x3E12,0x42DF,0xB3,0x71,0xF9,0xD7,0x61,0xD6,0xEE,0x24);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugObjectEnum,0xCC7BCB02,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugBreakpointEnum,0xCC7BCB03,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugStepperEnum,0xCC7BCB04,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugProcessEnum,0xCC7BCB05,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugThreadEnum,0xCC7BCB06,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugFrameEnum,0xCC7BCB07,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugChainEnum,0xCC7BCB08,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugModuleEnum,0xCC7BCB09,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugValueEnum,0xCC7BCB0A,0x8A68,0x11d2,0x98,0x3C,0x00,0x00,0xF8,0x08,0x34,0x2D);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugVariableHomeEnum,0xe76b7a57,0x4f7a,0x4309,0x85,0xa7,0x5d,0x91,0x8c,0x3d,0xea,0xf7);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugCodeEnum,0x55E96461,0x9645,0x45e4,0xA2,0xFF,0x03,0x67,0x87,0x7A,0xBC,0xDE);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugTypeEnum,0x10F27499,0x9DF2,0x43ce,0x83,0x33,0xA3,0x21,0xD7,0xC9,0x9C,0xB4);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugType,0xD613F0BB,0xACE1,0x4c19,0xBD,0x72,0xE4,0xC0,0x8D,0x5D,0xA7,0xF5);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugType2,0xe6e91d79,0x693d,0x48bc,0xb4,0x17,0x82,0x84,0xb4,0xf1,0x0f,0xb5);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugErrorInfoEnum,0xF0E18809,0x72B5,0x11d2,0x97,0x6F,0x00,0xA0,0xC9,0xB4,0xD5,0x0C);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugAppDomainEnum,0x63ca1b24,0x4359,0x4883,0xbd,0x57,0x13,0xf8,0x15,0xf5,0x87,0x44);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugAssemblyEnum,0x4a2a1ec9,0x85ec,0x4bfb,0x9f,0x15,0xa8,0x9f,0xdf,0xe0,0xfe,0x83);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugBlockingObjectEnum,0x976A6278,0x134A,0x4a81,0x81,0xA3,0x8F,0x27,0x79,0x43,0xF4,0xC3);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugMDA,0xCC726F2F,0x1DB7,0x459b,0xB0,0xEC,0x05,0xF0,0x1D,0x84,0x1B,0x42);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugEditAndContinueErrorInfo,0x8D600D41,0xF4F6,0x4cb3,0xB7,0xEC,0x7B,0xD1,0x64,0x94,0x40,0x36);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugEditAndContinueSnapshot,0x6DC3FA01,0xD7CB,0x11d2,0x8A,0x95,0x00,0x80,0xC7,0x92,0xE5,0xD8);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugExceptionObjectCallStackEnum,0xED775530,0x4DC4,0x41F7,0x86,0xD0,0x9E,0x2D,0xEF,0x7D,0xFC,0x66);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugExceptionObjectValue,0xAE4CA65D,0x59DD,0x42A2,0x83,0xA5,0x57,0xE8,0xA0,0x8D,0x87,0x19);
+
+
+MIDL_DEFINE_GUID(IID, LIBID_CORDBLib,0x53D13620,0xF417,0x11d1,0x97,0x62,0xA6,0x38,0x26,0xA4,0xF2,0x55);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_CorDebug,0x6fef44d0,0x39e7,0x4c77,0xbe,0x8e,0xc9,0xf8,0xcf,0x98,0x86,0x30);
+
+
+MIDL_DEFINE_GUID(CLSID, CLSID_EmbeddedCLRCorDebug,0x211f1254,0xbc7e,0x4af5,0xb9,0xaa,0x06,0x73,0x08,0xd8,0x3d,0xd1);
+
+#undef MIDL_DEFINE_GUID
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
diff --git a/src/pal/prebuilt/idl/corprof_i.c b/src/pal/prebuilt/idl/corprof_i.c
deleted file mode 100644
index 4686c76d54..0000000000
--- a/src/pal/prebuilt/idl/corprof_i.c
+++ /dev/null
@@ -1,134 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
-
-/* link this file in with the server and any clients */
-
-
- /* File created by MIDL compiler version 8.00.0603 */
-/* @@MIDL_FILE_HEADING( ) */
-
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-#include <rpc.h>
-#include <rpcndr.h>
-
-#ifdef _MIDL_USE_GUIDDEF_
-
-#ifndef INITGUID
-#define INITGUID
-#include <guiddef.h>
-#undef INITGUID
-#else
-#include <guiddef.h>
-#endif
-
-#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
-
-#else // !_MIDL_USE_GUIDDEF_
-
-#ifndef __IID_DEFINED__
-#define __IID_DEFINED__
-
-typedef struct _IID
-{
- unsigned long x;
- unsigned short s1;
- unsigned short s2;
- unsigned char c[8];
-} IID;
-
-#endif // __IID_DEFINED__
-
-#ifndef CLSID_DEFINED
-#define CLSID_DEFINED
-typedef IID CLSID;
-#endif // CLSID_DEFINED
-
-#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-
-#endif !_MIDL_USE_GUIDDEF_
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback,0x176FBED1,0xA55C,0x4796,0x98,0xCA,0xA9,0xDA,0x0E,0xF8,0x83,0xE7);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback2,0x8A8CC829,0xCCF2,0x49fe,0xBB,0xAE,0x0F,0x02,0x22,0x28,0x07,0x1A);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback3,0x4FD2ED52,0x7731,0x4b8d,0x94,0x69,0x03,0xD2,0xCC,0x30,0x86,0xC5);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback4,0x7B63B2E3,0x107D,0x4d48,0xB2,0xF6,0xF6,0x1E,0x22,0x94,0x70,0xD2);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback5,0x8DFBA405,0x8C9F,0x45F8,0xBF,0xFA,0x83,0xB1,0x4C,0xEF,0x78,0xB5);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback6,0xFC13DF4B,0x4448,0x4F4F,0x95,0x0C,0xBA,0x8D,0x19,0xD0,0x0C,0x36);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback7,0xF76A2DBA,0x1D52,0x4539,0x86,0x6C,0x2A,0xA5,0x18,0xF9,0xEF,0xC3);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo,0x28B5557D,0x3F3F,0x48b4,0x90,0xB2,0x5F,0x9E,0xEA,0x2F,0x6C,0x48);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo2,0xCC0935CD,0xA518,0x487d,0xB0,0xBB,0xA9,0x32,0x14,0xE6,0x54,0x78);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo3,0xB555ED4F,0x452A,0x4E54,0x8B,0x39,0xB5,0x36,0x0B,0xAD,0x32,0xA0);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerObjectEnum,0x2C6269BD,0x2D13,0x4321,0xAE,0x12,0x66,0x86,0x36,0x5F,0xD6,0xAF);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerFunctionEnum,0xFF71301A,0xB994,0x429D,0xA1,0x0B,0xB3,0x45,0xA6,0x52,0x80,0xEF);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerModuleEnum,0xb0266d75,0x2081,0x4493,0xaf,0x7f,0x02,0x8b,0xa3,0x4d,0xb8,0x91);
-
-
-MIDL_DEFINE_GUID(IID, IID_IMethodMalloc,0xA0EFB28B,0x6EE2,0x4d7b,0xB9,0x83,0xA7,0x5E,0xF7,0xBE,0xED,0xB8);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerFunctionControl,0xF0963021,0xE1EA,0x4732,0x85,0x81,0xE0,0x1B,0x0B,0xD3,0xC0,0xC6);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo4,0x0d8fdcaa,0x6257,0x47bf,0xb1,0xbf,0x94,0xda,0xc8,0x84,0x66,0xee);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo5,0x07602928,0xCE38,0x4B83,0x81,0xE7,0x74,0xAD,0xAF,0x78,0x12,0x14);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo6,0xF30A070D,0xBFFB,0x46A7,0xB1,0xD8,0x87,0x81,0xEF,0x7B,0x69,0x8A);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo7,0x9AEECC0D,0x63E0,0x4187,0x8C,0x00,0xE3,0x12,0xF5,0x03,0xF6,0x63);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerMethodEnum,0xFCCEE788,0x0088,0x454B,0xA8,0x11,0xC9,0x9F,0x29,0x8D,0x19,0x42);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerThreadEnum,0x571194f7,0x25ed,0x419f,0xaa,0x8b,0x70,0x16,0xb3,0x15,0x97,0x01);
-
-
-MIDL_DEFINE_GUID(IID, IID_ICorProfilerAssemblyReferenceProvider,0x66A78C24,0x2EEF,0x4F65,0xB4,0x5F,0xDD,0x1D,0x80,0x38,0xBF,0x3C);
-
-#undef MIDL_DEFINE_GUID
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
diff --git a/src/pal/prebuilt/idl/corprof_i.cpp b/src/pal/prebuilt/idl/corprof_i.cpp
new file mode 100644
index 0000000000..3758da041c
--- /dev/null
+++ b/src/pal/prebuilt/idl/corprof_i.cpp
@@ -0,0 +1,140 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
+
+/* link this file in with the server and any clients */
+
+
+ /* File created by MIDL compiler version 8.00.0603 */
+/* @@MIDL_FILE_HEADING( ) */
+
+#pragma warning( disable: 4049 ) /* more than 64k source lines */
+
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifdef _MIDL_USE_GUIDDEF_
+
+#ifndef INITGUID
+#define INITGUID
+#include <guiddef.h>
+#undef INITGUID
+#else
+#include <guiddef.h>
+#endif
+
+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
+ DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
+
+#else // !_MIDL_USE_GUIDDEF_
+
+#ifndef __IID_DEFINED__
+#define __IID_DEFINED__
+
+typedef struct _IID
+{
+ unsigned long x;
+ unsigned short s1;
+ unsigned short s2;
+ unsigned char c[8];
+} IID;
+
+#endif // __IID_DEFINED__
+
+#ifndef CLSID_DEFINED
+#define CLSID_DEFINED
+typedef IID CLSID;
+#endif // CLSID_DEFINED
+
+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
+ const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
+
+#endif !_MIDL_USE_GUIDDEF_
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback,0x176FBED1,0xA55C,0x4796,0x98,0xCA,0xA9,0xDA,0x0E,0xF8,0x83,0xE7);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback2,0x8A8CC829,0xCCF2,0x49fe,0xBB,0xAE,0x0F,0x02,0x22,0x28,0x07,0x1A);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback3,0x4FD2ED52,0x7731,0x4b8d,0x94,0x69,0x03,0xD2,0xCC,0x30,0x86,0xC5);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback4,0x7B63B2E3,0x107D,0x4d48,0xB2,0xF6,0xF6,0x1E,0x22,0x94,0x70,0xD2);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback5,0x8DFBA405,0x8C9F,0x45F8,0xBF,0xFA,0x83,0xB1,0x4C,0xEF,0x78,0xB5);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback6,0xFC13DF4B,0x4448,0x4F4F,0x95,0x0C,0xBA,0x8D,0x19,0xD0,0x0C,0x36);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback7,0xF76A2DBA,0x1D52,0x4539,0x86,0x6C,0x2A,0xA5,0x18,0xF9,0xEF,0xC3);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerCallback8,0x5BED9B15,0xC079,0x4D47,0xBF,0xE2,0x21,0x5A,0x14,0x0C,0x07,0xE0);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo,0x28B5557D,0x3F3F,0x48b4,0x90,0xB2,0x5F,0x9E,0xEA,0x2F,0x6C,0x48);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo2,0xCC0935CD,0xA518,0x487d,0xB0,0xBB,0xA9,0x32,0x14,0xE6,0x54,0x78);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo3,0xB555ED4F,0x452A,0x4E54,0x8B,0x39,0xB5,0x36,0x0B,0xAD,0x32,0xA0);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerObjectEnum,0x2C6269BD,0x2D13,0x4321,0xAE,0x12,0x66,0x86,0x36,0x5F,0xD6,0xAF);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerFunctionEnum,0xFF71301A,0xB994,0x429D,0xA1,0x0B,0xB3,0x45,0xA6,0x52,0x80,0xEF);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerModuleEnum,0xb0266d75,0x2081,0x4493,0xaf,0x7f,0x02,0x8b,0xa3,0x4d,0xb8,0x91);
+
+
+MIDL_DEFINE_GUID(IID, IID_IMethodMalloc,0xA0EFB28B,0x6EE2,0x4d7b,0xB9,0x83,0xA7,0x5E,0xF7,0xBE,0xED,0xB8);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerFunctionControl,0xF0963021,0xE1EA,0x4732,0x85,0x81,0xE0,0x1B,0x0B,0xD3,0xC0,0xC6);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo4,0x0d8fdcaa,0x6257,0x47bf,0xb1,0xbf,0x94,0xda,0xc8,0x84,0x66,0xee);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo5,0x07602928,0xCE38,0x4B83,0x81,0xE7,0x74,0xAD,0xAF,0x78,0x12,0x14);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo6,0xF30A070D,0xBFFB,0x46A7,0xB1,0xD8,0x87,0x81,0xEF,0x7B,0x69,0x8A);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo7,0x9AEECC0D,0x63E0,0x4187,0x8C,0x00,0xE3,0x12,0xF5,0x03,0xF6,0x63);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo8,0xC5AC80A6,0x782E,0x4716,0x80,0x44,0x39,0x59,0x8C,0x60,0xCF,0xBF);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerMethodEnum,0xFCCEE788,0x0088,0x454B,0xA8,0x11,0xC9,0x9F,0x29,0x8D,0x19,0x42);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerThreadEnum,0x571194f7,0x25ed,0x419f,0xaa,0x8b,0x70,0x16,0xb3,0x15,0x97,0x01);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorProfilerAssemblyReferenceProvider,0x66A78C24,0x2EEF,0x4F65,0xB4,0x5F,0xDD,0x1D,0x80,0x38,0xBF,0x3C);
+
+#undef MIDL_DEFINE_GUID
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
diff --git a/src/pal/prebuilt/idl/corpub_i.c b/src/pal/prebuilt/idl/corpub_i.cpp
index 982f89724e..982f89724e 100644
--- a/src/pal/prebuilt/idl/corpub_i.c
+++ b/src/pal/prebuilt/idl/corpub_i.cpp
diff --git a/src/pal/prebuilt/idl/corsym_i.c b/src/pal/prebuilt/idl/corsym_i.cpp
index 7ef9242315..7ef9242315 100644
--- a/src/pal/prebuilt/idl/corsym_i.c
+++ b/src/pal/prebuilt/idl/corsym_i.cpp
diff --git a/src/pal/prebuilt/idl/fusionpriv_i.c b/src/pal/prebuilt/idl/fusionpriv_i.cpp
index ece9622114..ece9622114 100644
--- a/src/pal/prebuilt/idl/fusionpriv_i.c
+++ b/src/pal/prebuilt/idl/fusionpriv_i.cpp
diff --git a/src/pal/prebuilt/idl/gchost_i.c b/src/pal/prebuilt/idl/gchost_i.cpp
index 32ecfbe9d5..32ecfbe9d5 100644
--- a/src/pal/prebuilt/idl/gchost_i.c
+++ b/src/pal/prebuilt/idl/gchost_i.cpp
diff --git a/src/pal/prebuilt/idl/ivalidator_i.c b/src/pal/prebuilt/idl/ivalidator_i.cpp
index 0edbec448a..0edbec448a 100644
--- a/src/pal/prebuilt/idl/ivalidator_i.c
+++ b/src/pal/prebuilt/idl/ivalidator_i.cpp
diff --git a/src/pal/prebuilt/idl/ivehandler_i.c b/src/pal/prebuilt/idl/ivehandler_i.cpp
index 44d0b961bb..44d0b961bb 100644
--- a/src/pal/prebuilt/idl/ivehandler_i.c
+++ b/src/pal/prebuilt/idl/ivehandler_i.cpp
diff --git a/src/pal/prebuilt/idl/mscorsvc_i.c b/src/pal/prebuilt/idl/mscorsvc_i.cpp
index 05d04e58a6..05d04e58a6 100644
--- a/src/pal/prebuilt/idl/mscorsvc_i.c
+++ b/src/pal/prebuilt/idl/mscorsvc_i.cpp
diff --git a/src/pal/prebuilt/idl/sospriv_i.c b/src/pal/prebuilt/idl/sospriv_i.c
deleted file mode 100644
index 7fee909ca3..0000000000
--- a/src/pal/prebuilt/idl/sospriv_i.c
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
-
-/* link this file in with the server and any clients */
-
-
- /* File created by MIDL compiler version 8.00.0613 */
-/* at Mon Jan 18 19:14:07 2038
- */
-/* Compiler settings for C:/ssd/coreclr/src/inc/sospriv.idl:
- Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0613
- protocol : dce , ms_ext, c_ext, robust
- error checks: allocation ref bounds_check enum stub_data
- VC __declspec() decoration level:
- __declspec(uuid()), __declspec(selectany), __declspec(novtable)
- DECLSPEC_UUID(), MIDL_INTERFACE()
-*/
-/* @@MIDL_FILE_HEADING( ) */
-
-#pragma warning( disable: 4049 ) /* more than 64k source lines */
-
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-#include <rpc.h>
-#include <rpcndr.h>
-
-#ifdef _MIDL_USE_GUIDDEF_
-
-#ifndef INITGUID
-#define INITGUID
-#include <guiddef.h>
-#undef INITGUID
-#else
-#include <guiddef.h>
-#endif
-
-#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
-
-#else // !_MIDL_USE_GUIDDEF_
-
-#ifndef __IID_DEFINED__
-#define __IID_DEFINED__
-
-typedef struct _IID
-{
- unsigned long x;
- unsigned short s1;
- unsigned short s2;
- unsigned char c[8];
-} IID;
-
-#endif // __IID_DEFINED__
-
-#ifndef CLSID_DEFINED
-#define CLSID_DEFINED
-typedef IID CLSID;
-#endif // CLSID_DEFINED
-
-#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
- const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
-
-#endif !_MIDL_USE_GUIDDEF_
-
-MIDL_DEFINE_GUID(IID, IID_ISOSEnum,0x286CA186,0xE763,0x4F61,0x97,0x60,0x48,0x7D,0x43,0xAE,0x43,0x41);
-
-
-MIDL_DEFINE_GUID(IID, IID_ISOSHandleEnum,0x3E269830,0x4A2B,0x4301,0x8E,0xE2,0xD6,0x80,0x5B,0x29,0xB2,0xFA);
-
-
-MIDL_DEFINE_GUID(IID, IID_ISOSStackRefErrorEnum,0x774F4E1B,0xFB7B,0x491B,0x97,0x6D,0xA8,0x13,0x0F,0xE3,0x55,0xE9);
-
-
-MIDL_DEFINE_GUID(IID, IID_ISOSStackRefEnum,0x8FA642BD,0x9F10,0x4799,0x9A,0xA3,0x51,0x2A,0xE7,0x8C,0x77,0xEE);
-
-
-MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface,0x436f00f2,0xb42a,0x4b9f,0x87,0x0c,0xe7,0x3d,0xb6,0x6a,0xe9,0x30);
-
-
-MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface2,0xA16026EC,0x96F4,0x40BA,0x87,0xFB,0x55,0x75,0x98,0x6F,0xB7,0xAF);
-
-
-MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface3,0xB08C5CDC,0xFD8A,0x49C5,0xAB,0x38,0x5F,0xEE,0xF3,0x52,0x35,0xB4);
-
-
-MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface4,0x74B9D34C,0xA612,0x4B07,0x93,0xDD,0x54,0x62,0x17,0x8F,0xCE,0x11);
-
-#undef MIDL_DEFINE_GUID
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
diff --git a/src/pal/prebuilt/idl/sospriv_i.cpp b/src/pal/prebuilt/idl/sospriv_i.cpp
new file mode 100644
index 0000000000..3584b761d2
--- /dev/null
+++ b/src/pal/prebuilt/idl/sospriv_i.cpp
@@ -0,0 +1,98 @@
+
+
+/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
+
+/* link this file in with the server and any clients */
+
+
+ /* File created by MIDL compiler version 8.00.0613 */
+/* at Mon Jan 18 19:14:07 2038
+ */
+/* Compiler settings for C:/ssd/coreclr/src/inc/sospriv.idl:
+ Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0613
+ protocol : dce , ms_ext, c_ext, robust
+ error checks: allocation ref bounds_check enum stub_data
+ VC __declspec() decoration level:
+ __declspec(uuid()), __declspec(selectany), __declspec(novtable)
+ DECLSPEC_UUID(), MIDL_INTERFACE()
+*/
+/* @@MIDL_FILE_HEADING( ) */
+
+#pragma warning( disable: 4049 ) /* more than 64k source lines */
+
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+#ifdef _MIDL_USE_GUIDDEF_
+
+#ifndef INITGUID
+#define INITGUID
+#include <guiddef.h>
+#undef INITGUID
+#else
+#include <guiddef.h>
+#endif
+
+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
+ DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
+
+#else // !_MIDL_USE_GUIDDEF_
+
+#ifndef __IID_DEFINED__
+#define __IID_DEFINED__
+
+typedef struct _IID
+{
+ unsigned long x;
+ unsigned short s1;
+ unsigned short s2;
+ unsigned char c[8];
+} IID;
+
+#endif // __IID_DEFINED__
+
+#ifndef CLSID_DEFINED
+#define CLSID_DEFINED
+typedef IID CLSID;
+#endif // CLSID_DEFINED
+
+#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
+ const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
+
+#endif !_MIDL_USE_GUIDDEF_
+
+MIDL_DEFINE_GUID(IID, IID_ISOSEnum,0x286CA186,0xE763,0x4F61,0x97,0x60,0x48,0x7D,0x43,0xAE,0x43,0x41);
+
+
+MIDL_DEFINE_GUID(IID, IID_ISOSHandleEnum,0x3E269830,0x4A2B,0x4301,0x8E,0xE2,0xD6,0x80,0x5B,0x29,0xB2,0xFA);
+
+
+MIDL_DEFINE_GUID(IID, IID_ISOSStackRefErrorEnum,0x774F4E1B,0xFB7B,0x491B,0x97,0x6D,0xA8,0x13,0x0F,0xE3,0x55,0xE9);
+
+
+MIDL_DEFINE_GUID(IID, IID_ISOSStackRefEnum,0x8FA642BD,0x9F10,0x4799,0x9A,0xA3,0x51,0x2A,0xE7,0x8C,0x77,0xEE);
+
+
+MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface,0x436f00f2,0xb42a,0x4b9f,0x87,0x0c,0xe7,0x3d,0xb6,0x6a,0xe9,0x30);
+
+
+MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface2,0xA16026EC,0x96F4,0x40BA,0x87,0xFB,0x55,0x75,0x98,0x6F,0xB7,0xAF);
+
+
+MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface3,0xB08C5CDC,0xFD8A,0x49C5,0xAB,0x38,0x5F,0xEE,0xF3,0x52,0x35,0xB4);
+
+
+MIDL_DEFINE_GUID(IID, IID_ISOSDacInterface4,0x74B9D34C,0xA612,0x4B07,0x93,0xDD,0x54,0x62,0x17,0x8F,0xCE,0x11);
+
+#undef MIDL_DEFINE_GUID
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
diff --git a/src/pal/prebuilt/idl/tlbimpexp_i.c b/src/pal/prebuilt/idl/tlbimpexp_i.cpp
index 0eb2791fa3..0eb2791fa3 100644
--- a/src/pal/prebuilt/idl/tlbimpexp_i.c
+++ b/src/pal/prebuilt/idl/tlbimpexp_i.cpp
diff --git a/src/pal/prebuilt/idl/xclrdata_i.c b/src/pal/prebuilt/idl/xclrdata_i.cpp
index 6dd642da4c..6dd642da4c 100644
--- a/src/pal/prebuilt/idl/xclrdata_i.c
+++ b/src/pal/prebuilt/idl/xclrdata_i.cpp
diff --git a/src/pal/prebuilt/idl/xcordebug_i.c b/src/pal/prebuilt/idl/xcordebug_i.cpp
index ffafd17c34..ffafd17c34 100644
--- a/src/pal/prebuilt/idl/xcordebug_i.c
+++ b/src/pal/prebuilt/idl/xcordebug_i.cpp
diff --git a/src/pal/prebuilt/inc/cordebug.h b/src/pal/prebuilt/inc/cordebug.h
index a5a5cf2e8a..39310403dc 100644
--- a/src/pal/prebuilt/inc/cordebug.h
+++ b/src/pal/prebuilt/inc/cordebug.h
@@ -4,9 +4,9 @@
/* File created by MIDL compiler version 8.00.0603 */
-/* at Fri Jul 15 18:01:08 2016
+/* at Fri Sep 23 15:43:16 2016
*/
-/* Compiler settings for E:/git/coreclr/src/inc/cordebug.idl:
+/* Compiler settings for cordebug.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.00.0603
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
@@ -598,6 +598,13 @@ typedef interface ICorDebugCode3 ICorDebugCode3;
#endif /* __ICorDebugCode3_FWD_DEFINED__ */
+#ifndef __ICorDebugCode4_FWD_DEFINED__
+#define __ICorDebugCode4_FWD_DEFINED__
+typedef interface ICorDebugCode4 ICorDebugCode4;
+
+#endif /* __ICorDebugCode4_FWD_DEFINED__ */
+
+
#ifndef __ICorDebugILCode_FWD_DEFINED__
#define __ICorDebugILCode_FWD_DEFINED__
typedef interface ICorDebugILCode ICorDebugILCode;
@@ -731,6 +738,13 @@ typedef interface ICorDebugArrayValue ICorDebugArrayValue;
#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */
+#ifndef __ICorDebugVariableHome_FWD_DEFINED__
+#define __ICorDebugVariableHome_FWD_DEFINED__
+typedef interface ICorDebugVariableHome ICorDebugVariableHome;
+
+#endif /* __ICorDebugVariableHome_FWD_DEFINED__ */
+
+
#ifndef __ICorDebugHandleValue_FWD_DEFINED__
#define __ICorDebugHandleValue_FWD_DEFINED__
typedef interface ICorDebugHandleValue ICorDebugHandleValue;
@@ -815,6 +829,13 @@ typedef interface ICorDebugValueEnum ICorDebugValueEnum;
#endif /* __ICorDebugValueEnum_FWD_DEFINED__ */
+#ifndef __ICorDebugVariableHomeEnum_FWD_DEFINED__
+#define __ICorDebugVariableHomeEnum_FWD_DEFINED__
+typedef interface ICorDebugVariableHomeEnum ICorDebugVariableHomeEnum;
+
+#endif /* __ICorDebugVariableHomeEnum_FWD_DEFINED__ */
+
+
#ifndef __ICorDebugCodeEnum_FWD_DEFINED__
#define __ICorDebugCodeEnum_FWD_DEFINED__
typedef interface ICorDebugCodeEnum ICorDebugCodeEnum;
@@ -836,6 +857,13 @@ typedef interface ICorDebugType ICorDebugType;
#endif /* __ICorDebugType_FWD_DEFINED__ */
+#ifndef __ICorDebugType2_FWD_DEFINED__
+#define __ICorDebugType2_FWD_DEFINED__
+typedef interface ICorDebugType2 ICorDebugType2;
+
+#endif /* __ICorDebugType2_FWD_DEFINED__ */
+
+
#ifndef __ICorDebugErrorInfoEnum_FWD_DEFINED__
#define __ICorDebugErrorInfoEnum_FWD_DEFINED__
typedef interface ICorDebugErrorInfoEnum ICorDebugErrorInfoEnum;
@@ -1321,6 +1349,7 @@ enum CorDebugNGENPolicy
+
#pragma warning(pop)
typedef ULONG64 CORDB_ADDRESS;
@@ -12423,6 +12452,86 @@ EXTERN_C const IID IID_ICorDebugCode3;
#endif /* __ICorDebugCode3_INTERFACE_DEFINED__ */
+#ifndef __ICorDebugCode4_INTERFACE_DEFINED__
+#define __ICorDebugCode4_INTERFACE_DEFINED__
+
+/* interface ICorDebugCode4 */
+/* [unique][uuid][local][object] */
+
+
+EXTERN_C const IID IID_ICorDebugCode4;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("18221fa4-20cb-40fa-b19d-9f91c4fa8c14")
+ ICorDebugCode4 : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE EnumerateVariableHomes(
+ /* [out] */ ICorDebugVariableHomeEnum **ppEnum) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ICorDebugCode4Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ICorDebugCode4 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ICorDebugCode4 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ICorDebugCode4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumerateVariableHomes )(
+ ICorDebugCode4 * This,
+ /* [out] */ ICorDebugVariableHomeEnum **ppEnum);
+
+ END_INTERFACE
+ } ICorDebugCode4Vtbl;
+
+ interface ICorDebugCode4
+ {
+ CONST_VTBL struct ICorDebugCode4Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ICorDebugCode4_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ICorDebugCode4_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ICorDebugCode4_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ICorDebugCode4_EnumerateVariableHomes(This,ppEnum) \
+ ( (This)->lpVtbl -> EnumerateVariableHomes(This,ppEnum) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ICorDebugCode4_INTERFACE_DEFINED__ */
+
+
#ifndef __ICorDebugILCode_INTERFACE_DEFINED__
#define __ICorDebugILCode_INTERFACE_DEFINED__
@@ -14382,15 +14491,15 @@ EXTERN_C const IID IID_ICorDebugBoxValue;
#endif /* __ICorDebugBoxValue_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0095 */
+/* interface __MIDL_itf_cordebug_0000_0096 */
/* [local] */
#pragma warning(push)
#pragma warning(disable:28718)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0095_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0095_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0096_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0096_v0_0_s_ifspec;
#ifndef __ICorDebugStringValue_INTERFACE_DEFINED__
#define __ICorDebugStringValue_INTERFACE_DEFINED__
@@ -14530,14 +14639,14 @@ EXTERN_C const IID IID_ICorDebugStringValue;
#endif /* __ICorDebugStringValue_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0096 */
+/* interface __MIDL_itf_cordebug_0000_0097 */
/* [local] */
#pragma warning(pop)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0096_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0096_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0097_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0097_v0_0_s_ifspec;
#ifndef __ICorDebugArrayValue_INTERFACE_DEFINED__
#define __ICorDebugArrayValue_INTERFACE_DEFINED__
@@ -14743,6 +14852,156 @@ EXTERN_C const IID IID_ICorDebugArrayValue;
#endif /* __ICorDebugArrayValue_INTERFACE_DEFINED__ */
+#ifndef __ICorDebugVariableHome_INTERFACE_DEFINED__
+#define __ICorDebugVariableHome_INTERFACE_DEFINED__
+
+/* interface ICorDebugVariableHome */
+/* [unique][uuid][local][object] */
+
+typedef
+enum VariableLocationType
+ {
+ VLT_REGISTER = 0,
+ VLT_REGISTER_RELATIVE = ( VLT_REGISTER + 1 ) ,
+ VLT_INVALID = ( VLT_REGISTER_RELATIVE + 1 )
+ } VariableLocationType;
+
+
+EXTERN_C const IID IID_ICorDebugVariableHome;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("50847b8d-f43f-41b0-924c-6383a5f2278b")
+ ICorDebugVariableHome : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetCode(
+ /* [out] */ ICorDebugCode **ppCode) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetSlotIndex(
+ /* [out] */ ULONG32 *pSlotIndex) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetArgumentIndex(
+ /* [out] */ ULONG32 *pArgumentIndex) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetLiveRange(
+ /* [out] */ ULONG32 *pStartOffset,
+ /* [out] */ ULONG32 *pEndOffset) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetLocationType(
+ /* [out] */ VariableLocationType *pLocationType) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetRegister(
+ /* [out] */ CorDebugRegister *pRegister) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetOffset(
+ /* [out] */ LONG *pOffset) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ICorDebugVariableHomeVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ICorDebugVariableHome * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ICorDebugVariableHome * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ICorDebugVariableHome * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCode )(
+ ICorDebugVariableHome * This,
+ /* [out] */ ICorDebugCode **ppCode);
+
+ HRESULT ( STDMETHODCALLTYPE *GetSlotIndex )(
+ ICorDebugVariableHome * This,
+ /* [out] */ ULONG32 *pSlotIndex);
+
+ HRESULT ( STDMETHODCALLTYPE *GetArgumentIndex )(
+ ICorDebugVariableHome * This,
+ /* [out] */ ULONG32 *pArgumentIndex);
+
+ HRESULT ( STDMETHODCALLTYPE *GetLiveRange )(
+ ICorDebugVariableHome * This,
+ /* [out] */ ULONG32 *pStartOffset,
+ /* [out] */ ULONG32 *pEndOffset);
+
+ HRESULT ( STDMETHODCALLTYPE *GetLocationType )(
+ ICorDebugVariableHome * This,
+ /* [out] */ VariableLocationType *pLocationType);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRegister )(
+ ICorDebugVariableHome * This,
+ /* [out] */ CorDebugRegister *pRegister);
+
+ HRESULT ( STDMETHODCALLTYPE *GetOffset )(
+ ICorDebugVariableHome * This,
+ /* [out] */ LONG *pOffset);
+
+ END_INTERFACE
+ } ICorDebugVariableHomeVtbl;
+
+ interface ICorDebugVariableHome
+ {
+ CONST_VTBL struct ICorDebugVariableHomeVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ICorDebugVariableHome_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ICorDebugVariableHome_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ICorDebugVariableHome_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ICorDebugVariableHome_GetCode(This,ppCode) \
+ ( (This)->lpVtbl -> GetCode(This,ppCode) )
+
+#define ICorDebugVariableHome_GetSlotIndex(This,pSlotIndex) \
+ ( (This)->lpVtbl -> GetSlotIndex(This,pSlotIndex) )
+
+#define ICorDebugVariableHome_GetArgumentIndex(This,pArgumentIndex) \
+ ( (This)->lpVtbl -> GetArgumentIndex(This,pArgumentIndex) )
+
+#define ICorDebugVariableHome_GetLiveRange(This,pStartOffset,pEndOffset) \
+ ( (This)->lpVtbl -> GetLiveRange(This,pStartOffset,pEndOffset) )
+
+#define ICorDebugVariableHome_GetLocationType(This,pLocationType) \
+ ( (This)->lpVtbl -> GetLocationType(This,pLocationType) )
+
+#define ICorDebugVariableHome_GetRegister(This,pRegister) \
+ ( (This)->lpVtbl -> GetRegister(This,pRegister) )
+
+#define ICorDebugVariableHome_GetOffset(This,pOffset) \
+ ( (This)->lpVtbl -> GetOffset(This,pOffset) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ICorDebugVariableHome_INTERFACE_DEFINED__ */
+
+
#ifndef __ICorDebugHandleValue_INTERFACE_DEFINED__
#define __ICorDebugHandleValue_INTERFACE_DEFINED__
@@ -16154,6 +16413,118 @@ EXTERN_C const IID IID_ICorDebugValueEnum;
#endif /* __ICorDebugValueEnum_INTERFACE_DEFINED__ */
+#ifndef __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__
+#define __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__
+
+/* interface ICorDebugVariableHomeEnum */
+/* [unique][uuid][local][object] */
+
+
+EXTERN_C const IID IID_ICorDebugVariableHomeEnum;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("e76b7a57-4f7a-4309-85a7-5d918c3deaf7")
+ ICorDebugVariableHomeEnum : public ICorDebugEnum
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE Next(
+ /* [in] */ ULONG celt,
+ /* [length_is][size_is][out] */ ICorDebugVariableHome *homes[ ],
+ /* [out] */ ULONG *pceltFetched) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ICorDebugVariableHomeEnumVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ICorDebugVariableHomeEnum * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ICorDebugVariableHomeEnum * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ICorDebugVariableHomeEnum * This);
+
+ HRESULT ( STDMETHODCALLTYPE *Skip )(
+ ICorDebugVariableHomeEnum * This,
+ /* [in] */ ULONG celt);
+
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ICorDebugVariableHomeEnum * This);
+
+ HRESULT ( STDMETHODCALLTYPE *Clone )(
+ ICorDebugVariableHomeEnum * This,
+ /* [out] */ ICorDebugEnum **ppEnum);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCount )(
+ ICorDebugVariableHomeEnum * This,
+ /* [out] */ ULONG *pcelt);
+
+ HRESULT ( STDMETHODCALLTYPE *Next )(
+ ICorDebugVariableHomeEnum * This,
+ /* [in] */ ULONG celt,
+ /* [length_is][size_is][out] */ ICorDebugVariableHome *homes[ ],
+ /* [out] */ ULONG *pceltFetched);
+
+ END_INTERFACE
+ } ICorDebugVariableHomeEnumVtbl;
+
+ interface ICorDebugVariableHomeEnum
+ {
+ CONST_VTBL struct ICorDebugVariableHomeEnumVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ICorDebugVariableHomeEnum_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ICorDebugVariableHomeEnum_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ICorDebugVariableHomeEnum_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ICorDebugVariableHomeEnum_Skip(This,celt) \
+ ( (This)->lpVtbl -> Skip(This,celt) )
+
+#define ICorDebugVariableHomeEnum_Reset(This) \
+ ( (This)->lpVtbl -> Reset(This) )
+
+#define ICorDebugVariableHomeEnum_Clone(This,ppEnum) \
+ ( (This)->lpVtbl -> Clone(This,ppEnum) )
+
+#define ICorDebugVariableHomeEnum_GetCount(This,pcelt) \
+ ( (This)->lpVtbl -> GetCount(This,pcelt) )
+
+
+#define ICorDebugVariableHomeEnum_Next(This,celt,homes,pceltFetched) \
+ ( (This)->lpVtbl -> Next(This,celt,homes,pceltFetched) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__ */
+
+
#ifndef __ICorDebugCodeEnum_INTERFACE_DEFINED__
#define __ICorDebugCodeEnum_INTERFACE_DEFINED__
@@ -16522,6 +16893,86 @@ EXTERN_C const IID IID_ICorDebugType;
#endif /* __ICorDebugType_INTERFACE_DEFINED__ */
+#ifndef __ICorDebugType2_INTERFACE_DEFINED__
+#define __ICorDebugType2_INTERFACE_DEFINED__
+
+/* interface ICorDebugType2 */
+/* [unique][uuid][local][object] */
+
+
+EXTERN_C const IID IID_ICorDebugType2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("e6e91d79-693d-48bc-b417-8284b4f10fb5")
+ ICorDebugType2 : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetTypeID(
+ /* [out] */ COR_TYPEID *id) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ICorDebugType2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ICorDebugType2 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ICorDebugType2 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ICorDebugType2 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeID )(
+ ICorDebugType2 * This,
+ /* [out] */ COR_TYPEID *id);
+
+ END_INTERFACE
+ } ICorDebugType2Vtbl;
+
+ interface ICorDebugType2
+ {
+ CONST_VTBL struct ICorDebugType2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ICorDebugType2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ICorDebugType2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ICorDebugType2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ICorDebugType2_GetTypeID(This,id) \
+ ( (This)->lpVtbl -> GetTypeID(This,id) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ICorDebugType2_INTERFACE_DEFINED__ */
+
+
#ifndef __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__
#define __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__
@@ -16970,15 +17421,15 @@ EXTERN_C const IID IID_ICorDebugBlockingObjectEnum;
#endif /* __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0117 */
+/* interface __MIDL_itf_cordebug_0000_0121 */
/* [local] */
#pragma warning(push)
#pragma warning(disable:28718)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0117_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0117_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0121_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0121_v0_0_s_ifspec;
#ifndef __ICorDebugMDA_INTERFACE_DEFINED__
#define __ICorDebugMDA_INTERFACE_DEFINED__
@@ -17118,7 +17569,7 @@ EXTERN_C const IID IID_ICorDebugMDA;
#endif /* __ICorDebugMDA_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0118 */
+/* interface __MIDL_itf_cordebug_0000_0122 */
/* [local] */
#pragma warning(pop)
@@ -17126,8 +17577,8 @@ EXTERN_C const IID IID_ICorDebugMDA;
#pragma warning(disable:28718)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0118_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0118_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0122_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0122_v0_0_s_ifspec;
#ifndef __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__
#define __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__
@@ -17243,14 +17694,14 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueErrorInfo;
#endif /* __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0119 */
+/* interface __MIDL_itf_cordebug_0000_0123 */
/* [local] */
#pragma warning(pop)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0119_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0119_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0123_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0123_v0_0_s_ifspec;
#ifndef __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__
#define __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__
diff --git a/src/pal/prebuilt/inc/corprof.h b/src/pal/prebuilt/inc/corprof.h
index 70b7e77df2..6778fb526f 100644
--- a/src/pal/prebuilt/inc/corprof.h
+++ b/src/pal/prebuilt/inc/corprof.h
@@ -5,7 +5,7 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
- /* File created by MIDL compiler version 8.00.0603 */
+ /* File created by MIDL compiler version 8.01.0620 */
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
@@ -21,7 +21,7 @@
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
-#endif // __RPCNDR_H_VERSION__
+#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
@@ -86,6 +86,13 @@ typedef interface ICorProfilerCallback7 ICorProfilerCallback7;
#endif /* __ICorProfilerCallback7_FWD_DEFINED__ */
+#ifndef __ICorProfilerCallback8_FWD_DEFINED__
+#define __ICorProfilerCallback8_FWD_DEFINED__
+typedef interface ICorProfilerCallback8 ICorProfilerCallback8;
+
+#endif /* __ICorProfilerCallback8_FWD_DEFINED__ */
+
+
#ifndef __ICorProfilerInfo_FWD_DEFINED__
#define __ICorProfilerInfo_FWD_DEFINED__
typedef interface ICorProfilerInfo ICorProfilerInfo;
@@ -170,6 +177,13 @@ typedef interface ICorProfilerInfo7 ICorProfilerInfo7;
#endif /* __ICorProfilerInfo7_FWD_DEFINED__ */
+#ifndef __ICorProfilerInfo8_FWD_DEFINED__
+#define __ICorProfilerInfo8_FWD_DEFINED__
+typedef interface ICorProfilerInfo8 ICorProfilerInfo8;
+
+#endif /* __ICorProfilerInfo8_FWD_DEFINED__ */
+
+
#ifndef __ICorProfilerMethodEnum_FWD_DEFINED__
#define __ICorProfilerMethodEnum_FWD_DEFINED__
typedef interface ICorProfilerMethodEnum ICorProfilerMethodEnum;
@@ -244,6 +258,12 @@ typedef const BYTE *LPCBYTE;
typedef BYTE *LPBYTE;
+typedef BYTE COR_SIGNATURE;
+
+typedef COR_SIGNATURE *PCOR_SIGNATURE;
+
+typedef const COR_SIGNATURE *PCCOR_SIGNATURE;
+
#ifndef _COR_IL_MAP
#define _COR_IL_MAP
typedef struct _COR_IL_MAP
@@ -5807,11 +5827,795 @@ EXTERN_C const IID IID_ICorProfilerCallback7;
#endif /* __ICorProfilerCallback7_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_corprof_0000_0007 */
+#ifndef __ICorProfilerCallback8_INTERFACE_DEFINED__
+#define __ICorProfilerCallback8_INTERFACE_DEFINED__
+
+/* interface ICorProfilerCallback8 */
+/* [local][unique][uuid][object] */
+
+
+EXTERN_C const IID IID_ICorProfilerCallback8;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("5BED9B15-C079-4D47-BFE2-215A140C07E0")
+ ICorProfilerCallback8 : public ICorProfilerCallback7
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE DynamicMethodJITCompilationStarted(
+ /* [in] */ FunctionID functionId,
+ /* [in] */ BOOL fIsSafeToBlock,
+ /* [in] */ LPCBYTE pILHeader,
+ /* [in] */ ULONG cbILHeader) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE DynamicMethodJITCompilationFinished(
+ /* [in] */ FunctionID functionId,
+ /* [in] */ HRESULT hrStatus,
+ /* [in] */ BOOL fIsSafeToBlock) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ICorProfilerCallback8Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ICorProfilerCallback8 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *Initialize )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ IUnknown *pICorProfilerInfoUnk);
+
+ HRESULT ( STDMETHODCALLTYPE *Shutdown )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ AppDomainID appDomainId);
+
+ HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ AppDomainID appDomainId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ AppDomainID appDomainId);
+
+ HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ AppDomainID appDomainId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ AssemblyID assemblyId);
+
+ HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ AssemblyID assemblyId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ AssemblyID assemblyId);
+
+ HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ AssemblyID assemblyId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ModuleID moduleId);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ModuleID moduleId);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ AssemblyID AssemblyId);
+
+ HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ClassID classId);
+
+ HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ClassID classId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ClassID classId);
+
+ HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ClassID classId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ BOOL fIsSafeToBlock);
+
+ HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ HRESULT hrStatus,
+ /* [in] */ BOOL fIsSafeToBlock);
+
+ HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [out] */ BOOL *pbUseCachedFunction);
+
+ HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ COR_PRF_JIT_CACHE result);
+
+ HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *JITInlining )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID callerId,
+ /* [in] */ FunctionID calleeId,
+ /* [out] */ BOOL *pfShouldInline);
+
+ HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ThreadID threadId);
+
+ HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ThreadID threadId);
+
+ HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ThreadID managedThreadId,
+ /* [in] */ DWORD osThreadId);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ GUID *pCookie,
+ /* [in] */ BOOL fIsAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ GUID *pCookie,
+ /* [in] */ BOOL fIsAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ GUID *pCookie,
+ /* [in] */ BOOL fIsAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ GUID *pCookie,
+ /* [in] */ BOOL fIsAsync);
+
+ HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ COR_PRF_TRANSITION_REASON reason);
+
+ HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ COR_PRF_TRANSITION_REASON reason);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ThreadID threadId);
+
+ HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ThreadID threadId);
+
+ HRESULT ( STDMETHODCALLTYPE *MovedReferences )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ULONG cMovedObjectIDRanges,
+ /* [size_is][in] */ ObjectID oldObjectIDRangeStart[ ],
+ /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ],
+ /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ObjectID objectId,
+ /* [in] */ ClassID classId);
+
+ HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ULONG cClassCount,
+ /* [size_is][in] */ ClassID classIds[ ],
+ /* [size_is][in] */ ULONG cObjects[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ObjectID objectId,
+ /* [in] */ ClassID classId,
+ /* [in] */ ULONG cObjectRefs,
+ /* [size_is][in] */ ObjectID objectRefIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *RootReferences )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ULONG cRootRefs,
+ /* [size_is][in] */ ObjectID rootRefIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ObjectID thrownObjectId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ UINT_PTR __unused);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ UINT_PTR __unused);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ ObjectID objectId);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ClassID wrappedClassId,
+ /* [in] */ REFGUID implementedIID,
+ /* [in] */ void *pVTable,
+ /* [in] */ ULONG cSlots);
+
+ HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ClassID wrappedClassId,
+ /* [in] */ REFGUID implementedIID,
+ /* [in] */ void *pVTable);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ThreadID threadId,
+ /* [in] */ ULONG cchName,
+ /* [annotation][in] */
+ _In_reads_opt_(cchName) WCHAR name[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ int cGenerations,
+ /* [size_is][in] */ BOOL generationCollected[ ],
+ /* [in] */ COR_PRF_GC_REASON reason);
+
+ HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ULONG cSurvivingObjectIDRanges,
+ /* [size_is][in] */ ObjectID objectIDRangeStart[ ],
+ /* [size_is][in] */ ULONG cObjectIDRangeLength[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ DWORD finalizerFlags,
+ /* [in] */ ObjectID objectID);
+
+ HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ULONG cRootRefs,
+ /* [size_is][in] */ ObjectID rootRefIds[ ],
+ /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[ ],
+ /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[ ],
+ /* [size_is][in] */ UINT_PTR rootIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *HandleCreated )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ GCHandleID handleId,
+ /* [in] */ ObjectID initialObjectId);
+
+ HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ GCHandleID handleId);
+
+ HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ IUnknown *pCorProfilerInfoUnk,
+ /* [in] */ void *pvClientData,
+ /* [in] */ UINT cbClientData);
+
+ HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(
+ ICorProfilerCallback8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ ReJITID rejitId,
+ /* [in] */ BOOL fIsSafeToBlock);
+
+ HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ mdMethodDef methodId,
+ /* [in] */ ICorProfilerFunctionControl *pFunctionControl);
+
+ HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ ReJITID rejitId,
+ /* [in] */ HRESULT hrStatus,
+ /* [in] */ BOOL fIsSafeToBlock);
+
+ HRESULT ( STDMETHODCALLTYPE *ReJITError )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ mdMethodDef methodId,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ HRESULT hrStatus);
+
+ HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ULONG cMovedObjectIDRanges,
+ /* [size_is][in] */ ObjectID oldObjectIDRangeStart[ ],
+ /* [size_is][in] */ ObjectID newObjectIDRangeStart[ ],
+ /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ULONG cSurvivingObjectIDRanges,
+ /* [size_is][in] */ ObjectID objectIDRangeStart[ ],
+ /* [size_is][in] */ SIZE_T cObjectIDRangeLength[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ ULONG cRootRefs,
+ /* [size_is][in] */ ObjectID keyRefIds[ ],
+ /* [size_is][in] */ ObjectID valueRefIds[ ],
+ /* [size_is][in] */ GCHandleID rootIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )(
+ ICorProfilerCallback8 * This,
+ /* [string][in] */ const WCHAR *wszAssemblyPath,
+ /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider);
+
+ HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )(
+ ICorProfilerCallback8 * This,
+ ModuleID moduleId);
+
+ HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationStarted )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ BOOL fIsSafeToBlock,
+ /* [in] */ LPCBYTE pILHeader,
+ /* [in] */ ULONG cbILHeader);
+
+ HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationFinished )(
+ ICorProfilerCallback8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ HRESULT hrStatus,
+ /* [in] */ BOOL fIsSafeToBlock);
+
+ END_INTERFACE
+ } ICorProfilerCallback8Vtbl;
+
+ interface ICorProfilerCallback8
+ {
+ CONST_VTBL struct ICorProfilerCallback8Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ICorProfilerCallback8_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ICorProfilerCallback8_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ICorProfilerCallback8_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ICorProfilerCallback8_Initialize(This,pICorProfilerInfoUnk) \
+ ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )
+
+#define ICorProfilerCallback8_Shutdown(This) \
+ ( (This)->lpVtbl -> Shutdown(This) )
+
+#define ICorProfilerCallback8_AppDomainCreationStarted(This,appDomainId) \
+ ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )
+
+#define ICorProfilerCallback8_AppDomainCreationFinished(This,appDomainId,hrStatus) \
+ ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )
+
+#define ICorProfilerCallback8_AppDomainShutdownStarted(This,appDomainId) \
+ ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )
+
+#define ICorProfilerCallback8_AppDomainShutdownFinished(This,appDomainId,hrStatus) \
+ ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )
+
+#define ICorProfilerCallback8_AssemblyLoadStarted(This,assemblyId) \
+ ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )
+
+#define ICorProfilerCallback8_AssemblyLoadFinished(This,assemblyId,hrStatus) \
+ ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )
+
+#define ICorProfilerCallback8_AssemblyUnloadStarted(This,assemblyId) \
+ ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )
+
+#define ICorProfilerCallback8_AssemblyUnloadFinished(This,assemblyId,hrStatus) \
+ ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )
+
+#define ICorProfilerCallback8_ModuleLoadStarted(This,moduleId) \
+ ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )
+
+#define ICorProfilerCallback8_ModuleLoadFinished(This,moduleId,hrStatus) \
+ ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )
+
+#define ICorProfilerCallback8_ModuleUnloadStarted(This,moduleId) \
+ ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )
+
+#define ICorProfilerCallback8_ModuleUnloadFinished(This,moduleId,hrStatus) \
+ ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )
+
+#define ICorProfilerCallback8_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \
+ ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )
+
+#define ICorProfilerCallback8_ClassLoadStarted(This,classId) \
+ ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )
+
+#define ICorProfilerCallback8_ClassLoadFinished(This,classId,hrStatus) \
+ ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )
+
+#define ICorProfilerCallback8_ClassUnloadStarted(This,classId) \
+ ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )
+
+#define ICorProfilerCallback8_ClassUnloadFinished(This,classId,hrStatus) \
+ ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )
+
+#define ICorProfilerCallback8_FunctionUnloadStarted(This,functionId) \
+ ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )
+
+#define ICorProfilerCallback8_JITCompilationStarted(This,functionId,fIsSafeToBlock) \
+ ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )
+
+#define ICorProfilerCallback8_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \
+ ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )
+
+#define ICorProfilerCallback8_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) \
+ ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )
+
+#define ICorProfilerCallback8_JITCachedFunctionSearchFinished(This,functionId,result) \
+ ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )
+
+#define ICorProfilerCallback8_JITFunctionPitched(This,functionId) \
+ ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )
+
+#define ICorProfilerCallback8_JITInlining(This,callerId,calleeId,pfShouldInline) \
+ ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )
+
+#define ICorProfilerCallback8_ThreadCreated(This,threadId) \
+ ( (This)->lpVtbl -> ThreadCreated(This,threadId) )
+
+#define ICorProfilerCallback8_ThreadDestroyed(This,threadId) \
+ ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )
+
+#define ICorProfilerCallback8_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \
+ ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )
+
+#define ICorProfilerCallback8_RemotingClientInvocationStarted(This) \
+ ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )
+
+#define ICorProfilerCallback8_RemotingClientSendingMessage(This,pCookie,fIsAsync) \
+ ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )
+
+#define ICorProfilerCallback8_RemotingClientReceivingReply(This,pCookie,fIsAsync) \
+ ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )
+
+#define ICorProfilerCallback8_RemotingClientInvocationFinished(This) \
+ ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )
+
+#define ICorProfilerCallback8_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \
+ ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )
+
+#define ICorProfilerCallback8_RemotingServerInvocationStarted(This) \
+ ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )
+
+#define ICorProfilerCallback8_RemotingServerInvocationReturned(This) \
+ ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )
+
+#define ICorProfilerCallback8_RemotingServerSendingReply(This,pCookie,fIsAsync) \
+ ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )
+
+#define ICorProfilerCallback8_UnmanagedToManagedTransition(This,functionId,reason) \
+ ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )
+
+#define ICorProfilerCallback8_ManagedToUnmanagedTransition(This,functionId,reason) \
+ ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )
+
+#define ICorProfilerCallback8_RuntimeSuspendStarted(This,suspendReason) \
+ ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )
+
+#define ICorProfilerCallback8_RuntimeSuspendFinished(This) \
+ ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )
+
+#define ICorProfilerCallback8_RuntimeSuspendAborted(This) \
+ ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )
+
+#define ICorProfilerCallback8_RuntimeResumeStarted(This) \
+ ( (This)->lpVtbl -> RuntimeResumeStarted(This) )
+
+#define ICorProfilerCallback8_RuntimeResumeFinished(This) \
+ ( (This)->lpVtbl -> RuntimeResumeFinished(This) )
+
+#define ICorProfilerCallback8_RuntimeThreadSuspended(This,threadId) \
+ ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )
+
+#define ICorProfilerCallback8_RuntimeThreadResumed(This,threadId) \
+ ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )
+
+#define ICorProfilerCallback8_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \
+ ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )
+
+#define ICorProfilerCallback8_ObjectAllocated(This,objectId,classId) \
+ ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )
+
+#define ICorProfilerCallback8_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) \
+ ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )
+
+#define ICorProfilerCallback8_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \
+ ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )
+
+#define ICorProfilerCallback8_RootReferences(This,cRootRefs,rootRefIds) \
+ ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )
+
+#define ICorProfilerCallback8_ExceptionThrown(This,thrownObjectId) \
+ ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )
+
+#define ICorProfilerCallback8_ExceptionSearchFunctionEnter(This,functionId) \
+ ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )
+
+#define ICorProfilerCallback8_ExceptionSearchFunctionLeave(This) \
+ ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )
+
+#define ICorProfilerCallback8_ExceptionSearchFilterEnter(This,functionId) \
+ ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )
+
+#define ICorProfilerCallback8_ExceptionSearchFilterLeave(This) \
+ ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )
+
+#define ICorProfilerCallback8_ExceptionSearchCatcherFound(This,functionId) \
+ ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )
+
+#define ICorProfilerCallback8_ExceptionOSHandlerEnter(This,__unused) \
+ ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )
+
+#define ICorProfilerCallback8_ExceptionOSHandlerLeave(This,__unused) \
+ ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )
+
+#define ICorProfilerCallback8_ExceptionUnwindFunctionEnter(This,functionId) \
+ ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )
+
+#define ICorProfilerCallback8_ExceptionUnwindFunctionLeave(This) \
+ ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )
+
+#define ICorProfilerCallback8_ExceptionUnwindFinallyEnter(This,functionId) \
+ ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )
+
+#define ICorProfilerCallback8_ExceptionUnwindFinallyLeave(This) \
+ ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )
+
+#define ICorProfilerCallback8_ExceptionCatcherEnter(This,functionId,objectId) \
+ ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )
+
+#define ICorProfilerCallback8_ExceptionCatcherLeave(This) \
+ ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )
+
+#define ICorProfilerCallback8_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \
+ ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )
+
+#define ICorProfilerCallback8_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \
+ ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )
+
+#define ICorProfilerCallback8_ExceptionCLRCatcherFound(This) \
+ ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )
+
+#define ICorProfilerCallback8_ExceptionCLRCatcherExecute(This) \
+ ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )
+
+
+#define ICorProfilerCallback8_ThreadNameChanged(This,threadId,cchName,name) \
+ ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )
+
+#define ICorProfilerCallback8_GarbageCollectionStarted(This,cGenerations,generationCollected,reason) \
+ ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )
+
+#define ICorProfilerCallback8_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \
+ ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )
+
+#define ICorProfilerCallback8_GarbageCollectionFinished(This) \
+ ( (This)->lpVtbl -> GarbageCollectionFinished(This) )
+
+#define ICorProfilerCallback8_FinalizeableObjectQueued(This,finalizerFlags,objectID) \
+ ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )
+
+#define ICorProfilerCallback8_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) \
+ ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )
+
+#define ICorProfilerCallback8_HandleCreated(This,handleId,initialObjectId) \
+ ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )
+
+#define ICorProfilerCallback8_HandleDestroyed(This,handleId) \
+ ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )
+
+
+#define ICorProfilerCallback8_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) \
+ ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )
+
+#define ICorProfilerCallback8_ProfilerAttachComplete(This) \
+ ( (This)->lpVtbl -> ProfilerAttachComplete(This) )
+
+#define ICorProfilerCallback8_ProfilerDetachSucceeded(This) \
+ ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )
+
+
+#define ICorProfilerCallback8_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) \
+ ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) )
+
+#define ICorProfilerCallback8_GetReJITParameters(This,moduleId,methodId,pFunctionControl) \
+ ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) )
+
+#define ICorProfilerCallback8_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \
+ ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) )
+
+#define ICorProfilerCallback8_ReJITError(This,moduleId,methodId,functionId,hrStatus) \
+ ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) )
+
+#define ICorProfilerCallback8_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \
+ ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )
+
+#define ICorProfilerCallback8_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) \
+ ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )
+
+
+#define ICorProfilerCallback8_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) \
+ ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) )
+
+
+#define ICorProfilerCallback8_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) \
+ ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) )
+
+
+#define ICorProfilerCallback8_ModuleInMemorySymbolsUpdated(This,moduleId) \
+ ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) )
+
+
+#define ICorProfilerCallback8_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) \
+ ( (This)->lpVtbl -> DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) )
+
+#define ICorProfilerCallback8_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \
+ ( (This)->lpVtbl -> DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ICorProfilerCallback8_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_corprof_0000_0008 */
/* [local] */
typedef /* [public] */
-enum __MIDL___MIDL_itf_corprof_0000_0007_0001
+enum __MIDL___MIDL_itf_corprof_0000_0008_0001
{
COR_PRF_CODEGEN_DISABLE_INLINING = 0x1,
COR_PRF_CODEGEN_DISABLE_ALL_OPTIMIZATIONS = 0x2
@@ -5819,8 +6623,8 @@ enum __MIDL___MIDL_itf_corprof_0000_0007_0001
-extern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0007_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0007_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0008_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0008_v0_0_s_ifspec;
#ifndef __ICorProfilerInfo_INTERFACE_DEFINED__
#define __ICorProfilerInfo_INTERFACE_DEFINED__
@@ -11712,6 +12516,904 @@ EXTERN_C const IID IID_ICorProfilerInfo7;
#endif /* __ICorProfilerInfo7_INTERFACE_DEFINED__ */
+#ifndef __ICorProfilerInfo8_INTERFACE_DEFINED__
+#define __ICorProfilerInfo8_INTERFACE_DEFINED__
+
+/* interface ICorProfilerInfo8 */
+/* [local][unique][uuid][object] */
+
+
+EXTERN_C const IID IID_ICorProfilerInfo8;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("C5AC80A6-782E-4716-8044-39598C60CFBF")
+ ICorProfilerInfo8 : public ICorProfilerInfo7
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE IsFunctionDynamic(
+ /* [in] */ FunctionID functionId,
+ /* [out] */ BOOL *isDynamic) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetFunctionFromIP3(
+ /* [in] */ LPCBYTE ip,
+ /* [out] */ FunctionID *functionId,
+ /* [out] */ ReJITID *pReJitId) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDynamicFunctionInfo(
+ /* [in] */ FunctionID functionId,
+ /* [out] */ ModuleID *moduleId,
+ /* [out] */ PCCOR_SIGNATURE *ppvSig,
+ /* [out] */ ULONG *pbSig,
+ /* [in] */ ULONG cchName,
+ /* [out] */ ULONG *pcchName,
+ /* [out] */ WCHAR wszName[ ]) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ICorProfilerInfo8Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ICorProfilerInfo8 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ICorProfilerInfo8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ObjectID objectId,
+ /* [out] */ ClassID *pClassId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ mdTypeDef typeDef,
+ /* [out] */ ClassID *pClassId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [out] */ LPCBYTE *pStart,
+ /* [out] */ ULONG *pcSize);
+
+ HRESULT ( STDMETHODCALLTYPE *GetEventMask )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ DWORD *pdwEvents);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ LPCBYTE ip,
+ /* [out] */ FunctionID *pFunctionId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ mdToken token,
+ /* [out] */ FunctionID *pFunctionId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ThreadID threadId,
+ /* [out] */ HANDLE *phThread);
+
+ HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ObjectID objectId,
+ /* [out] */ ULONG *pcSize);
+
+ HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classId,
+ /* [out] */ CorElementType *pBaseElemType,
+ /* [out] */ ClassID *pBaseClassId,
+ /* [out] */ ULONG *pcRank);
+
+ HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ThreadID threadId,
+ /* [out] */ DWORD *pdwWin32ThreadId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ ThreadID *pThreadId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classId,
+ /* [out] */ ModuleID *pModuleId,
+ /* [out] */ mdTypeDef *pTypeDefToken);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [out] */ ClassID *pClassId,
+ /* [out] */ ModuleID *pModuleId,
+ /* [out] */ mdToken *pToken);
+
+ HRESULT ( STDMETHODCALLTYPE *SetEventMask )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ DWORD dwEvents);
+
+ HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionEnter *pFuncEnter,
+ /* [in] */ FunctionLeave *pFuncLeave,
+ /* [in] */ FunctionTailcall *pFuncTailcall);
+
+ HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionIDMapper *pFunc);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ REFIID riid,
+ /* [out] */ IUnknown **ppImport,
+ /* [out] */ mdToken *pToken);
+
+ HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [out] */ LPCBYTE *ppBaseLoadAddress,
+ /* [in] */ ULONG cchName,
+ /* [out] */ ULONG *pcchName,
+ /* [annotation][out] */
+ _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ],
+ /* [out] */ AssemblyID *pAssemblyId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ DWORD dwOpenFlags,
+ /* [in] */ REFIID riid,
+ /* [out] */ IUnknown **ppOut);
+
+ HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ mdMethodDef methodId,
+ /* [out] */ LPCBYTE *ppMethodHeader,
+ /* [out] */ ULONG *pcbMethodSize);
+
+ HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [out] */ IMethodMalloc **ppMalloc);
+
+ HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ mdMethodDef methodid,
+ /* [in] */ LPCBYTE pbNewILMethodHeader);
+
+ HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ AppDomainID appDomainId,
+ /* [in] */ ULONG cchName,
+ /* [out] */ ULONG *pcchName,
+ /* [annotation][out] */
+ _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ],
+ /* [out] */ ProcessID *pProcessId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ AssemblyID assemblyId,
+ /* [in] */ ULONG cchName,
+ /* [out] */ ULONG *pcchName,
+ /* [annotation][out] */
+ _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ],
+ /* [out] */ AppDomainID *pAppDomainId,
+ /* [out] */ ModuleID *pModuleId);
+
+ HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId);
+
+ HRESULT ( STDMETHODCALLTYPE *ForceGC )(
+ ICorProfilerInfo8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ BOOL fStartJit,
+ /* [in] */ ULONG cILMapEntries,
+ /* [size_is][in] */ COR_IL_MAP rgILMapEntries[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ IUnknown **ppicd);
+
+ HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ IUnknown **ppicd);
+
+ HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ThreadID threadId,
+ /* [out] */ ContextID *pContextId);
+
+ HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ BOOL fThisThreadOnly,
+ /* [out] */ DWORD *pdwProfilerContext);
+
+ HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ DWORD dwProfilerContext);
+
+ HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ ULONG32 cMap,
+ /* [out] */ ULONG32 *pcMap,
+ /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ThreadID thread,
+ /* [in] */ StackSnapshotCallback *callback,
+ /* [in] */ ULONG32 infoFlags,
+ /* [in] */ void *clientData,
+ /* [size_is][in] */ BYTE context[ ],
+ /* [in] */ ULONG32 contextSize);
+
+ HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionEnter2 *pFuncEnter,
+ /* [in] */ FunctionLeave2 *pFuncLeave,
+ /* [in] */ FunctionTailcall2 *pFuncTailcall);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID funcId,
+ /* [in] */ COR_PRF_FRAME_INFO frameInfo,
+ /* [out] */ ClassID *pClassId,
+ /* [out] */ ModuleID *pModuleId,
+ /* [out] */ mdToken *pToken,
+ /* [in] */ ULONG32 cTypeArgs,
+ /* [out] */ ULONG32 *pcTypeArgs,
+ /* [out] */ ClassID typeArgs[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ ULONG *pBufferLengthOffset,
+ /* [out] */ ULONG *pStringLengthOffset,
+ /* [out] */ ULONG *pBufferOffset);
+
+ HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classID,
+ /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[ ],
+ /* [in] */ ULONG cFieldOffset,
+ /* [out] */ ULONG *pcFieldOffset,
+ /* [out] */ ULONG *pulClassSize);
+
+ HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classId,
+ /* [out] */ ModuleID *pModuleId,
+ /* [out] */ mdTypeDef *pTypeDefToken,
+ /* [out] */ ClassID *pParentClassId,
+ /* [in] */ ULONG32 cNumTypeArgs,
+ /* [out] */ ULONG32 *pcNumTypeArgs,
+ /* [out] */ ClassID typeArgs[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionID,
+ /* [in] */ ULONG32 cCodeInfos,
+ /* [out] */ ULONG32 *pcCodeInfos,
+ /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleID,
+ /* [in] */ mdTypeDef typeDef,
+ /* [in] */ ULONG32 cTypeArgs,
+ /* [size_is][in] */ ClassID typeArgs[ ],
+ /* [out] */ ClassID *pClassID);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleID,
+ /* [in] */ mdMethodDef funcDef,
+ /* [in] */ ClassID classId,
+ /* [in] */ ULONG32 cTypeArgs,
+ /* [size_is][in] */ ClassID typeArgs[ ],
+ /* [out] */ FunctionID *pFunctionID);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleID,
+ /* [out] */ ICorProfilerObjectEnum **ppEnum);
+
+ HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ObjectID objectId,
+ /* [in] */ ULONG32 cDimensions,
+ /* [size_is][out] */ ULONG32 pDimensionSizes[ ],
+ /* [size_is][out] */ int pDimensionLowerBounds[ ],
+ /* [out] */ BYTE **ppData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classId,
+ /* [out] */ ULONG32 *pBufferOffset);
+
+ HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ThreadID threadId,
+ /* [out] */ AppDomainID *pAppDomainId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classId,
+ /* [in] */ mdFieldDef fieldToken,
+ /* [out] */ void **ppAddress);
+
+ HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classId,
+ /* [in] */ mdFieldDef fieldToken,
+ /* [in] */ AppDomainID appDomainId,
+ /* [out] */ void **ppAddress);
+
+ HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classId,
+ /* [in] */ mdFieldDef fieldToken,
+ /* [in] */ ThreadID threadId,
+ /* [out] */ void **ppAddress);
+
+ HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classId,
+ /* [in] */ mdFieldDef fieldToken,
+ /* [in] */ ContextID contextId,
+ /* [out] */ void **ppAddress);
+
+ HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classId,
+ /* [in] */ mdFieldDef fieldToken,
+ /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ULONG cObjectRanges,
+ /* [out] */ ULONG *pcObjectRanges,
+ /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ObjectID objectId,
+ /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);
+
+ HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ ICorProfilerFunctionEnum **ppEnum);
+
+ HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ DWORD dwExpectedCompletionMilliseconds);
+
+ HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionIDMapper2 *pFunc,
+ /* [in] */ void *clientData);
+
+ HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ ULONG *pStringLengthOffset,
+ /* [out] */ ULONG *pBufferOffset);
+
+ HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionEnter3 *pFuncEnter3,
+ /* [in] */ FunctionLeave3 *pFuncLeave3,
+ /* [in] */ FunctionTailcall3 *pFuncTailcall3);
+
+ HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,
+ /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,
+ /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ COR_PRF_ELT_INFO eltInfo,
+ /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,
+ /* [out][in] */ ULONG *pcbArgumentInfo,
+ /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ COR_PRF_ELT_INFO eltInfo,
+ /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,
+ /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ COR_PRF_ELT_INFO eltInfo,
+ /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumModules )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ ICorProfilerModuleEnum **ppEnum);
+
+ HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ USHORT *pClrInstanceId,
+ /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,
+ /* [out] */ USHORT *pMajorVersion,
+ /* [out] */ USHORT *pMinorVersion,
+ /* [out] */ USHORT *pBuildNumber,
+ /* [out] */ USHORT *pQFEVersion,
+ /* [in] */ ULONG cchVersionString,
+ /* [out] */ ULONG *pcchVersionString,
+ /* [annotation][out] */
+ _Out_writes_to_(cchVersionString, *pcchVersionString) WCHAR szVersionString[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ClassID classId,
+ /* [in] */ mdFieldDef fieldToken,
+ /* [in] */ AppDomainID appDomainId,
+ /* [in] */ ThreadID threadId,
+ /* [out] */ void **ppAddress);
+
+ HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ ULONG32 cAppDomainIds,
+ /* [out] */ ULONG32 *pcAppDomainIds,
+ /* [length_is][size_is][out] */ AppDomainID appDomainIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [out] */ LPCBYTE *ppBaseLoadAddress,
+ /* [in] */ ULONG cchName,
+ /* [out] */ ULONG *pcchName,
+ /* [annotation][out] */
+ _Out_writes_to_(cchName, *pcchName) WCHAR szName[ ],
+ /* [out] */ AssemblyID *pAssemblyId,
+ /* [out] */ DWORD *pdwModuleFlags);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumThreads )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ ICorProfilerThreadEnum **ppEnum);
+
+ HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(
+ ICorProfilerInfo8 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ULONG cFunctions,
+ /* [size_is][in] */ ModuleID moduleIds[ ],
+ /* [size_is][in] */ mdMethodDef methodIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *RequestRevert )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ULONG cFunctions,
+ /* [size_is][in] */ ModuleID moduleIds[ ],
+ /* [size_is][in] */ mdMethodDef methodIds[ ],
+ /* [size_is][out] */ HRESULT status[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionID,
+ /* [in] */ ReJITID reJitId,
+ /* [in] */ ULONG32 cCodeInfos,
+ /* [out] */ ULONG32 *pcCodeInfos,
+ /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ LPCBYTE ip,
+ /* [out] */ FunctionID *pFunctionId,
+ /* [out] */ ReJITID *pReJitId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ ULONG cReJitIds,
+ /* [out] */ ULONG *pcReJitIds,
+ /* [length_is][size_is][out] */ ReJITID reJitIds[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [in] */ ReJITID reJitId,
+ /* [in] */ ULONG32 cMap,
+ /* [out] */ ULONG32 *pcMap,
+ /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[ ]);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ ICorProfilerFunctionEnum **ppEnum);
+
+ HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ObjectID objectId,
+ /* [out] */ SIZE_T *pcSize);
+
+ HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )(
+ ICorProfilerInfo8 * This,
+ /* [out] */ DWORD *pdwEventsLow,
+ /* [out] */ DWORD *pdwEventsHigh);
+
+ HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ DWORD dwEventsLow,
+ /* [in] */ DWORD dwEventsHigh);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID inlinersModuleId,
+ /* [in] */ ModuleID inlineeModuleId,
+ /* [in] */ mdMethodDef inlineeMethodId,
+ /* [out] */ BOOL *incompleteData,
+ /* [out] */ ICorProfilerMethodEnum **ppEnum);
+
+ HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [out] */ DWORD *pCountSymbolBytes);
+
+ HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ ModuleID moduleId,
+ /* [in] */ DWORD symbolsReadOffset,
+ /* [out] */ BYTE *pSymbolBytes,
+ /* [in] */ DWORD countSymbolBytes,
+ /* [out] */ DWORD *pCountSymbolBytesRead);
+
+ HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [out] */ BOOL *isDynamic);
+
+ HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ LPCBYTE ip,
+ /* [out] */ FunctionID *functionId,
+ /* [out] */ ReJITID *pReJitId);
+
+ HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )(
+ ICorProfilerInfo8 * This,
+ /* [in] */ FunctionID functionId,
+ /* [out] */ ModuleID *moduleId,
+ /* [out] */ PCCOR_SIGNATURE *ppvSig,
+ /* [out] */ ULONG *pbSig,
+ /* [in] */ ULONG cchName,
+ /* [out] */ ULONG *pcchName,
+ /* [out] */ WCHAR wszName[ ]);
+
+ END_INTERFACE
+ } ICorProfilerInfo8Vtbl;
+
+ interface ICorProfilerInfo8
+ {
+ CONST_VTBL struct ICorProfilerInfo8Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ICorProfilerInfo8_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ICorProfilerInfo8_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ICorProfilerInfo8_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ICorProfilerInfo8_GetClassFromObject(This,objectId,pClassId) \
+ ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )
+
+#define ICorProfilerInfo8_GetClassFromToken(This,moduleId,typeDef,pClassId) \
+ ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )
+
+#define ICorProfilerInfo8_GetCodeInfo(This,functionId,pStart,pcSize) \
+ ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )
+
+#define ICorProfilerInfo8_GetEventMask(This,pdwEvents) \
+ ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )
+
+#define ICorProfilerInfo8_GetFunctionFromIP(This,ip,pFunctionId) \
+ ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )
+
+#define ICorProfilerInfo8_GetFunctionFromToken(This,moduleId,token,pFunctionId) \
+ ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )
+
+#define ICorProfilerInfo8_GetHandleFromThread(This,threadId,phThread) \
+ ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )
+
+#define ICorProfilerInfo8_GetObjectSize(This,objectId,pcSize) \
+ ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )
+
+#define ICorProfilerInfo8_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \
+ ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )
+
+#define ICorProfilerInfo8_GetThreadInfo(This,threadId,pdwWin32ThreadId) \
+ ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )
+
+#define ICorProfilerInfo8_GetCurrentThreadID(This,pThreadId) \
+ ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )
+
+#define ICorProfilerInfo8_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \
+ ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )
+
+#define ICorProfilerInfo8_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \
+ ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )
+
+#define ICorProfilerInfo8_SetEventMask(This,dwEvents) \
+ ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )
+
+#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \
+ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )
+
+#define ICorProfilerInfo8_SetFunctionIDMapper(This,pFunc) \
+ ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )
+
+#define ICorProfilerInfo8_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \
+ ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )
+
+#define ICorProfilerInfo8_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \
+ ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )
+
+#define ICorProfilerInfo8_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) \
+ ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )
+
+#define ICorProfilerInfo8_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \
+ ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )
+
+#define ICorProfilerInfo8_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \
+ ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )
+
+#define ICorProfilerInfo8_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \
+ ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )
+
+#define ICorProfilerInfo8_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \
+ ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )
+
+#define ICorProfilerInfo8_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) \
+ ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )
+
+#define ICorProfilerInfo8_SetFunctionReJIT(This,functionId) \
+ ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )
+
+#define ICorProfilerInfo8_ForceGC(This) \
+ ( (This)->lpVtbl -> ForceGC(This) )
+
+#define ICorProfilerInfo8_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \
+ ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )
+
+#define ICorProfilerInfo8_GetInprocInspectionInterface(This,ppicd) \
+ ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )
+
+#define ICorProfilerInfo8_GetInprocInspectionIThisThread(This,ppicd) \
+ ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )
+
+#define ICorProfilerInfo8_GetThreadContext(This,threadId,pContextId) \
+ ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )
+
+#define ICorProfilerInfo8_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \
+ ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )
+
+#define ICorProfilerInfo8_EndInprocDebugging(This,dwProfilerContext) \
+ ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )
+
+#define ICorProfilerInfo8_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \
+ ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )
+
+
+#define ICorProfilerInfo8_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) \
+ ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )
+
+#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \
+ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )
+
+#define ICorProfilerInfo8_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) \
+ ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )
+
+#define ICorProfilerInfo8_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) \
+ ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )
+
+#define ICorProfilerInfo8_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \
+ ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )
+
+#define ICorProfilerInfo8_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \
+ ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )
+
+#define ICorProfilerInfo8_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) \
+ ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )
+
+#define ICorProfilerInfo8_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) \
+ ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )
+
+#define ICorProfilerInfo8_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \
+ ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )
+
+#define ICorProfilerInfo8_EnumModuleFrozenObjects(This,moduleID,ppEnum) \
+ ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )
+
+#define ICorProfilerInfo8_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) \
+ ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )
+
+#define ICorProfilerInfo8_GetBoxClassLayout(This,classId,pBufferOffset) \
+ ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )
+
+#define ICorProfilerInfo8_GetThreadAppDomain(This,threadId,pAppDomainId) \
+ ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )
+
+#define ICorProfilerInfo8_GetRVAStaticAddress(This,classId,fieldToken,ppAddress) \
+ ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )
+
+#define ICorProfilerInfo8_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \
+ ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )
+
+#define ICorProfilerInfo8_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) \
+ ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )
+
+#define ICorProfilerInfo8_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \
+ ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )
+
+#define ICorProfilerInfo8_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) \
+ ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )
+
+#define ICorProfilerInfo8_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \
+ ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )
+
+#define ICorProfilerInfo8_GetObjectGeneration(This,objectId,range) \
+ ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )
+
+#define ICorProfilerInfo8_GetNotifiedExceptionClauseInfo(This,pinfo) \
+ ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )
+
+
+#define ICorProfilerInfo8_EnumJITedFunctions(This,ppEnum) \
+ ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )
+
+#define ICorProfilerInfo8_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \
+ ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )
+
+#define ICorProfilerInfo8_SetFunctionIDMapper2(This,pFunc,clientData) \
+ ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )
+
+#define ICorProfilerInfo8_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \
+ ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )
+
+#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \
+ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )
+
+#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \
+ ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )
+
+#define ICorProfilerInfo8_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) \
+ ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )
+
+#define ICorProfilerInfo8_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) \
+ ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )
+
+#define ICorProfilerInfo8_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \
+ ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )
+
+#define ICorProfilerInfo8_EnumModules(This,ppEnum) \
+ ( (This)->lpVtbl -> EnumModules(This,ppEnum) )
+
+#define ICorProfilerInfo8_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) \
+ ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )
+
+#define ICorProfilerInfo8_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) \
+ ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )
+
+#define ICorProfilerInfo8_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) \
+ ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )
+
+#define ICorProfilerInfo8_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) \
+ ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )
+
+
+#define ICorProfilerInfo8_EnumThreads(This,ppEnum) \
+ ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )
+
+#define ICorProfilerInfo8_InitializeCurrentThread(This) \
+ ( (This)->lpVtbl -> InitializeCurrentThread(This) )
+
+#define ICorProfilerInfo8_RequestReJIT(This,cFunctions,moduleIds,methodIds) \
+ ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )
+
+#define ICorProfilerInfo8_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \
+ ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )
+
+#define ICorProfilerInfo8_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) \
+ ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )
+
+#define ICorProfilerInfo8_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \
+ ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )
+
+#define ICorProfilerInfo8_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) \
+ ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )
+
+#define ICorProfilerInfo8_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \
+ ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )
+
+#define ICorProfilerInfo8_EnumJITedFunctions2(This,ppEnum) \
+ ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )
+
+#define ICorProfilerInfo8_GetObjectSize2(This,objectId,pcSize) \
+ ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )
+
+
+#define ICorProfilerInfo8_GetEventMask2(This,pdwEventsLow,pdwEventsHigh) \
+ ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )
+
+#define ICorProfilerInfo8_SetEventMask2(This,dwEventsLow,dwEventsHigh) \
+ ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )
+
+
+#define ICorProfilerInfo8_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \
+ ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) )
+
+
+#define ICorProfilerInfo8_ApplyMetaData(This,moduleId) \
+ ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) )
+
+#define ICorProfilerInfo8_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \
+ ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) )
+
+#define ICorProfilerInfo8_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \
+ ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) )
+
+
+#define ICorProfilerInfo8_IsFunctionDynamic(This,functionId,isDynamic) \
+ ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) )
+
+#define ICorProfilerInfo8_GetFunctionFromIP3(This,ip,functionId,pReJitId) \
+ ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) )
+
+#define ICorProfilerInfo8_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) \
+ ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ICorProfilerInfo8_INTERFACE_DEFINED__ */
+
+
#ifndef __ICorProfilerMethodEnum_INTERFACE_DEFINED__
#define __ICorProfilerMethodEnum_INTERFACE_DEFINED__
diff --git a/src/pal/prebuilt/inc/xclrdata.h b/src/pal/prebuilt/inc/xclrdata.h
index 3f46c31319..da7acb34ab 100644
--- a/src/pal/prebuilt/inc/xclrdata.h
+++ b/src/pal/prebuilt/inc/xclrdata.h
@@ -1017,7 +1017,7 @@ EXTERN_C const IID IID_IXCLRDataDisplay;
IXCLRDataDisplay : public IUnknown
{
public:
- virtual HRESULT STDMETHODCALLTYPE ErrorPrintF(
+ virtual HRESULT STDMETHODVCALLTYPE ErrorPrintF(
const char *const fmt,
...) = 0;
@@ -1063,11 +1063,11 @@ EXTERN_C const IID IID_IXCLRDataDisplay;
virtual HRESULT STDMETHODCALLTYPE EndTextElement( void) = 0;
- virtual HRESULT STDMETHODCALLTYPE WriteXmlText(
+ virtual HRESULT STDMETHODVCALLTYPE WriteXmlText(
const char *const fmt,
...) = 0;
- virtual HRESULT STDMETHODCALLTYPE WriteXmlTextBlock(
+ virtual HRESULT STDMETHODVCALLTYPE WriteXmlTextBlock(
const char *const fmt,
...) = 0;
@@ -1258,7 +1258,7 @@ EXTERN_C const IID IID_IXCLRDataDisplay;
ULONG ( STDMETHODCALLTYPE *Release )(
IXCLRDataDisplay * This);
- HRESULT ( STDMETHODCALLTYPE *ErrorPrintF )(
+ HRESULT ( STDMETHODVCALLTYPE *ErrorPrintF )(
IXCLRDataDisplay * This,
const char *const fmt,
...);
@@ -1319,12 +1319,12 @@ EXTERN_C const IID IID_IXCLRDataDisplay;
HRESULT ( STDMETHODCALLTYPE *EndTextElement )(
IXCLRDataDisplay * This);
- HRESULT ( STDMETHODCALLTYPE *WriteXmlText )(
+ HRESULT ( STDMETHODVCALLTYPE *WriteXmlText )(
IXCLRDataDisplay * This,
const char *const fmt,
...);
- HRESULT ( STDMETHODCALLTYPE *WriteXmlTextBlock )(
+ HRESULT ( STDMETHODVCALLTYPE *WriteXmlTextBlock )(
IXCLRDataDisplay * This,
const char *const fmt,
...);
diff --git a/src/pal/src/CMakeLists.txt b/src/pal/src/CMakeLists.txt
index 7df0aaf360..28ee83a77c 100644
--- a/src/pal/src/CMakeLists.txt
+++ b/src/pal/src/CMakeLists.txt
@@ -2,13 +2,6 @@ cmake_minimum_required(VERSION 2.8.12.2)
include_directories(SYSTEM /usr/local/include)
-# set kernel version to detect Alpine
-EXEC_PROGRAM(uname ARGS -v OUTPUT_VARIABLE CMAKE_SYSTEM_KERNEL_VERSION)
-string(FIND "${CMAKE_SYSTEM_KERNEL_VERSION}" "Alpine" PAL_SYSTEM_ALPINE)
-if(PAL_SYSTEM_ALPINE EQUAL -1)
- unset(PAL_SYSTEM_ALPINE)
-endif()
-
include(configure.cmake)
project(coreclrpal)
@@ -39,16 +32,20 @@ elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL armv7l)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64)
set(PAL_CMAKE_PLATFORM_ARCH_ARM64 1)
add_definitions(-D_ARM64_)
+elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL i686)
+ set(CLR_CMAKE_PLATFORM_ARCH_I386 1)
+ add_definitions(-D_X86_)
else()
message(FATAL_ERROR "Only ARM and AMD64 is supported")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
add_definitions(-D_TARGET_MAC64)
+ add_definitions(-DXSTATE_SUPPORTED)
set(PLATFORM_SOURCES
- arch/i386/activationhandlerwrapper.S
- arch/i386/context.S
- arch/i386/dispatchexceptionwrapper.S
+ arch/amd64/activationhandlerwrapper.S
+ arch/amd64/context.S
+ arch/amd64/dispatchexceptionwrapper.S
exception/machexception.cpp
exception/machmessage.cpp
)
@@ -68,8 +65,20 @@ elseif(PAL_CMAKE_PLATFORM_ARCH_ARM)
elseif(PAL_CMAKE_PLATFORM_ARCH_ARM64)
add_definitions(-DBIT64=1)
add_definitions(-D_WIN64=1)
+elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
+ add_definitions(-DBIT32=1)
endif()
+if(CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT CLR_CMAKE_PLATFORM_ALPINE_LINUX)
+ # Currently the _xstate is not available on Alpine Linux
+ add_definitions(-DXSTATE_SUPPORTED)
+endif(CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT CLR_CMAKE_PLATFORM_ALPINE_LINUX)
+
+if(CLR_CMAKE_PLATFORM_ALPINE_LINUX)
+ # Setting RLIMIT_NOFILE breaks debugging of coreclr on Alpine Linux for some reason
+ add_definitions(-DDONT_SET_RLIMIT_NOFILE)
+endif(CLR_CMAKE_PLATFORM_ALPINE_LINUX)
+
# turn off capability to remove unused functions (which was enabled in debug build with sanitizers)
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--no-gc-sections")
@@ -77,10 +86,10 @@ add_compile_options(-fPIC)
if(PAL_CMAKE_PLATFORM_ARCH_AMD64)
set(ARCH_SOURCES
- arch/i386/context2.S
- arch/i386/debugbreak.S
- arch/i386/exceptionhelper.S
- arch/i386/processor.cpp
+ arch/amd64/context2.S
+ arch/amd64/debugbreak.S
+ arch/amd64/exceptionhelper.S
+ arch/amd64/processor.cpp
)
elseif(PAL_CMAKE_PLATFORM_ARCH_ARM)
set(ARCH_SOURCES
@@ -96,6 +105,13 @@ elseif(PAL_CMAKE_PLATFORM_ARCH_ARM64)
arch/arm64/exceptionhelper.S
arch/arm64/processor.cpp
)
+elseif(CLR_CMAKE_PLATFORM_ARCH_I386)
+ set(ARCH_SOURCES
+ arch/i386/context2.S
+ arch/i386/debugbreak.S
+ arch/i386/exceptionhelper.S
+ arch/i386/processor.cpp
+ )
endif()
if(PAL_CMAKE_PLATFORM_ARCH_ARM)
@@ -160,37 +176,37 @@ set(SOURCES
objmgr/palobjbase.cpp
objmgr/shmobject.cpp
objmgr/shmobjectmanager.cpp
- safecrt/makepath_s.c
- safecrt/memcpy_s.c
- safecrt/memmove_s.c
- safecrt/mbusafecrt.c
- safecrt/safecrt_input_s.c
- safecrt/safecrt_output_l.c
- safecrt/safecrt_output_s.c
- safecrt/safecrt_winput_s.c
- safecrt/safecrt_woutput_s.c
- safecrt/splitpath_s.c
- safecrt/sprintf.c
- safecrt/sscanf.c
- safecrt/strcat_s.c
- safecrt/strcpy_s.c
- safecrt/strlen_s.c
- safecrt/strncat_s.c
- safecrt/strncpy_s.c
- safecrt/strtok_s.c
- safecrt/swprintf.c
- safecrt/vsprintf.c
- safecrt/vswprint.c
- safecrt/wcscat_s.c
- safecrt/wcscpy_s.c
- safecrt/wcslen_s.c
- safecrt/wcsncat_s.c
- safecrt/wcsncpy_s.c
- safecrt/wcstok_s.c
- safecrt/wmakepath_s.c
- safecrt/wsplitpath_s.c
- safecrt/xtoa_s.c
- safecrt/xtow_s.c
+ safecrt/makepath_s.cpp
+ safecrt/memcpy_s.cpp
+ safecrt/memmove_s.cpp
+ safecrt/mbusafecrt.cpp
+ safecrt/safecrt_input_s.cpp
+ safecrt/safecrt_output_l.cpp
+ safecrt/safecrt_output_s.cpp
+ safecrt/safecrt_winput_s.cpp
+ safecrt/safecrt_woutput_s.cpp
+ safecrt/splitpath_s.cpp
+ safecrt/sprintf_s.cpp
+ safecrt/sscanf_s.cpp
+ safecrt/strcat_s.cpp
+ safecrt/strcpy_s.cpp
+ safecrt/strlen_s.cpp
+ safecrt/strncat_s.cpp
+ safecrt/strncpy_s.cpp
+ safecrt/strtok_s.cpp
+ safecrt/swprintf.cpp
+ safecrt/vsprintf.cpp
+ safecrt/vswprint.cpp
+ safecrt/wcscat_s.cpp
+ safecrt/wcscpy_s.cpp
+ safecrt/wcslen_s.cpp
+ safecrt/wcsncat_s.cpp
+ safecrt/wcsncpy_s.cpp
+ safecrt/wcstok_s.cpp
+ safecrt/wmakepath_s.cpp
+ safecrt/wsplitpath_s.cpp
+ safecrt/xtoa_s.cpp
+ safecrt/xtow_s.cpp
sharedmemory/sharedmemory.cpp
shmemory/shmemory.cpp
sync/cs.cpp
@@ -252,7 +268,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
find_library(UNWIND_ARCH NAMES unwind-x86_64)
endif()
- if(PAL_SYSTEM_ALPINE)
+ if(CLR_CMAKE_PLATFORM_ALPINE_LINUX)
find_library(INTL intl)
endif()
diff --git a/src/pal/src/arch/i386/activationhandlerwrapper.S b/src/pal/src/arch/amd64/activationhandlerwrapper.S
index 63f718e81f..63f718e81f 100644
--- a/src/pal/src/arch/i386/activationhandlerwrapper.S
+++ b/src/pal/src/arch/amd64/activationhandlerwrapper.S
diff --git a/src/pal/src/arch/amd64/asmconstants.h b/src/pal/src/arch/amd64/asmconstants.h
new file mode 100644
index 0000000000..182c1191e4
--- /dev/null
+++ b/src/pal/src/arch/amd64/asmconstants.h
@@ -0,0 +1,106 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifdef BIT64
+
+#define CONTEXT_AMD64 0x100000
+
+#define CONTEXT_CONTROL 1 // SegSs, Rsp, SegCs, Rip, and EFlags
+#define CONTEXT_INTEGER 2 // Rax, Rcx, Rdx, Rbx, Rbp, Rsi, Rdi, R8-R15
+#define CONTEXT_SEGMENTS 4 // SegDs, SegEs, SegFs, SegGs
+#define CONTEXT_FLOATING_POINT 8
+#define CONTEXT_DEBUG_REGISTERS 16 // Dr0-Dr3 and Dr6-Dr7
+
+#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
+
+#define CONTEXT_XSTATE 64
+
+#define CONTEXT_ContextFlags 6*8
+#define CONTEXT_SegCs CONTEXT_ContextFlags+8
+#define CONTEXT_SegDs CONTEXT_SegCs+2
+#define CONTEXT_SegEs CONTEXT_SegDs+2
+#define CONTEXT_SegFs CONTEXT_SegEs+2
+#define CONTEXT_SegGs CONTEXT_SegFs+2
+#define CONTEXT_SegSs CONTEXT_SegGs+2
+#define CONTEXT_EFlags CONTEXT_SegSs+2
+#define CONTEXT_Dr0 CONTEXT_EFlags+4
+#define CONTEXT_Dr1 CONTEXT_Dr0+8
+#define CONTEXT_Dr2 CONTEXT_Dr1+8
+#define CONTEXT_Dr3 CONTEXT_Dr2+8
+#define CONTEXT_Dr6 CONTEXT_Dr3+8
+#define CONTEXT_Dr7 CONTEXT_Dr6+8
+#define CONTEXT_Rax CONTEXT_Dr7+8
+#define CONTEXT_Rcx CONTEXT_Rax+8
+#define CONTEXT_Rdx CONTEXT_Rcx+8
+#define CONTEXT_Rbx CONTEXT_Rdx+8
+#define CONTEXT_Rsp CONTEXT_Rbx+8
+#define CONTEXT_Rbp CONTEXT_Rsp+8
+#define CONTEXT_Rsi CONTEXT_Rbp+8
+#define CONTEXT_Rdi CONTEXT_Rsi+8
+#define CONTEXT_R8 CONTEXT_Rdi+8
+#define CONTEXT_R9 CONTEXT_R8+8
+#define CONTEXT_R10 CONTEXT_R9+8
+#define CONTEXT_R11 CONTEXT_R10+8
+#define CONTEXT_R12 CONTEXT_R11+8
+#define CONTEXT_R13 CONTEXT_R12+8
+#define CONTEXT_R14 CONTEXT_R13+8
+#define CONTEXT_R15 CONTEXT_R14+8
+#define CONTEXT_Rip CONTEXT_R15+8
+#define CONTEXT_FltSave CONTEXT_Rip+8
+#define FLOATING_SAVE_AREA_SIZE 4*8+24*16+96
+#define CONTEXT_Xmm0 CONTEXT_FltSave+10*16
+#define CONTEXT_Xmm1 CONTEXT_Xmm0+16
+#define CONTEXT_Xmm2 CONTEXT_Xmm1+16
+#define CONTEXT_Xmm3 CONTEXT_Xmm2+16
+#define CONTEXT_Xmm4 CONTEXT_Xmm3+16
+#define CONTEXT_Xmm5 CONTEXT_Xmm4+16
+#define CONTEXT_Xmm6 CONTEXT_Xmm5+16
+#define CONTEXT_Xmm7 CONTEXT_Xmm6+16
+#define CONTEXT_Xmm8 CONTEXT_Xmm7+16
+#define CONTEXT_Xmm9 CONTEXT_Xmm8+16
+#define CONTEXT_Xmm10 CONTEXT_Xmm9+16
+#define CONTEXT_Xmm11 CONTEXT_Xmm10+16
+#define CONTEXT_Xmm12 CONTEXT_Xmm11+16
+#define CONTEXT_Xmm13 CONTEXT_Xmm12+16
+#define CONTEXT_Xmm14 CONTEXT_Xmm13+16
+#define CONTEXT_Xmm15 CONTEXT_Xmm14+16
+#define CONTEXT_VectorRegister CONTEXT_FltSave+FLOATING_SAVE_AREA_SIZE
+#define CONTEXT_VectorControl CONTEXT_VectorRegister+16*26
+#define CONTEXT_DebugControl CONTEXT_VectorControl+8
+#define CONTEXT_LastBranchToRip CONTEXT_DebugControl+8
+#define CONTEXT_LastBranchFromRip CONTEXT_LastBranchToRip+8
+#define CONTEXT_LastExceptionToRip CONTEXT_LastBranchFromRip+8
+#define CONTEXT_LastExceptionFromRip CONTEXT_LastExceptionToRip+8
+#define CONTEXT_Size CONTEXT_LastExceptionFromRip+8
+
+#else // BIT64
+
+#define CONTEXT_ContextFlags 0
+#define CONTEXT_FLOATING_POINT 8
+#define CONTEXT_FloatSave 7*4
+#define FLOATING_SAVE_AREA_SIZE 8*4+80
+#define CONTEXT_Edi CONTEXT_FloatSave + FLOATING_SAVE_AREA_SIZE + 4*4
+#define CONTEXT_Esi CONTEXT_Edi+4
+#define CONTEXT_Ebx CONTEXT_Esi+4
+#define CONTEXT_Edx CONTEXT_Ebx+4
+#define CONTEXT_Ecx CONTEXT_Edx+4
+#define CONTEXT_Eax CONTEXT_Ecx+4
+#define CONTEXT_Ebp CONTEXT_Eax+4
+#define CONTEXT_Eip CONTEXT_Ebp+4
+#define CONTEXT_SegCs CONTEXT_Eip+4
+#define CONTEXT_EFlags CONTEXT_SegCs+4
+#define CONTEXT_Esp CONTEXT_EFlags+4
+#define CONTEXT_SegSs CONTEXT_Esp+4
+#define CONTEXT_EXTENDED_REGISTERS 32
+#define CONTEXT_ExtendedRegisters CONTEXT_SegSs+4
+#define CONTEXT_Xmm0 CONTEXT_ExtendedRegisters+160
+#define CONTEXT_Xmm1 CONTEXT_Xmm0+16
+#define CONTEXT_Xmm2 CONTEXT_Xmm1+16
+#define CONTEXT_Xmm3 CONTEXT_Xmm2+16
+#define CONTEXT_Xmm4 CONTEXT_Xmm3+16
+#define CONTEXT_Xmm5 CONTEXT_Xmm4+16
+#define CONTEXT_Xmm6 CONTEXT_Xmm5+16
+#define CONTEXT_Xmm7 CONTEXT_Xmm6+16
+
+#endif // BIT64
diff --git a/src/pal/src/arch/i386/context.S b/src/pal/src/arch/amd64/context.S
index f8a2dca89c..f8a2dca89c 100644
--- a/src/pal/src/arch/i386/context.S
+++ b/src/pal/src/arch/amd64/context.S
diff --git a/src/pal/src/arch/amd64/context2.S b/src/pal/src/arch/amd64/context2.S
new file mode 100644
index 0000000000..0e93e81a55
--- /dev/null
+++ b/src/pal/src/arch/amd64/context2.S
@@ -0,0 +1,259 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+//
+// Implementation of _CONTEXT_CaptureContext for the Intel x86 platform.
+// This function is processor dependent. It is used by exception handling,
+// and is always apply to the current thread.
+//
+
+.intel_syntax noprefix
+#include "unixasmmacros.inc"
+#include "asmconstants.h"
+
+#ifdef BIT64
+
+#define IRETFRAME_Rip 0
+#define IRETFRAME_SegCs IRETFRAME_Rip+8
+#define IRETFRAME_EFlags IRETFRAME_SegCs+8
+#define IRETFRAME_Rsp IRETFRAME_EFlags+8
+#define IRETFRAME_SegSs IRETFRAME_Rsp+8
+#define IRetFrameLength IRETFRAME_SegSs+8
+#define IRetFrameLengthAligned 16*((IRetFrameLength+8)/16)
+
+// Incoming:
+// RDI: Context*
+//
+LEAF_ENTRY CONTEXT_CaptureContext, _TEXT
+ // Save processor flags before calling any of the following 'test' instructions
+ // because they will modify state of some flags
+ push_eflags
+ END_PROLOGUE
+
+ test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_INTEGER
+ je LOCAL_LABEL(Done_CONTEXT_INTEGER)
+ mov [rdi + CONTEXT_Rdi], rdi
+ mov [rdi + CONTEXT_Rsi], rsi
+ mov [rdi + CONTEXT_Rbx], rbx
+ mov [rdi + CONTEXT_Rdx], rdx
+ mov [rdi + CONTEXT_Rcx], rcx
+ mov [rdi + CONTEXT_Rax], rax
+ mov [rdi + CONTEXT_Rbp], rbp
+ mov [rdi + CONTEXT_R8], r8
+ mov [rdi + CONTEXT_R9], r9
+ mov [rdi + CONTEXT_R10], r10
+ mov [rdi + CONTEXT_R11], r11
+ mov [rdi + CONTEXT_R12], r12
+ mov [rdi + CONTEXT_R13], r13
+ mov [rdi + CONTEXT_R14], r14
+ mov [rdi + CONTEXT_R15], r15
+LOCAL_LABEL(Done_CONTEXT_INTEGER):
+
+ test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_CONTROL
+ je LOCAL_LABEL(Done_CONTEXT_CONTROL)
+
+ // Return address is @ (RSP + 8)
+ mov rdx, [rsp + 8]
+ mov [rdi + CONTEXT_Rip], rdx
+.att_syntax
+ mov %cs, CONTEXT_SegCs(%rdi)
+.intel_syntax noprefix
+ // Get the value of EFlags that was pushed on stack at the beginning of the function
+ mov rdx, [rsp]
+ mov [rdi + CONTEXT_EFlags], edx
+ lea rdx, [rsp + 16]
+ mov [rdi + CONTEXT_Rsp], rdx
+.att_syntax
+ mov %ss, CONTEXT_SegSs(%rdi)
+.intel_syntax noprefix
+LOCAL_LABEL(Done_CONTEXT_CONTROL):
+
+ // Need to double check this is producing the right result
+ // also that FFSXR (fast save/restore) is not turned on
+ // otherwise it omits the xmm registers.
+ test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_FLOATING_POINT
+ je LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT)
+ fxsave [rdi + CONTEXT_FltSave]
+LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT):
+
+ test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_DEBUG_REGISTERS
+ je LOCAL_LABEL(Done_CONTEXT_DEBUG_REGISTERS)
+ mov rdx, dr0
+ mov [rdi + CONTEXT_Dr0], rdx
+ mov rdx, dr1
+ mov [rdi + CONTEXT_Dr1], rdx
+ mov rdx, dr2
+ mov [rdi + CONTEXT_Dr2], rdx
+ mov rdx, dr3
+ mov [rdi + CONTEXT_Dr3], rdx
+ mov rdx, dr6
+ mov [rdi + CONTEXT_Dr6], rdx
+ mov rdx, dr7
+ mov [rdi + CONTEXT_Dr7], rdx
+LOCAL_LABEL(Done_CONTEXT_DEBUG_REGISTERS):
+
+ free_stack 8
+ ret
+LEAF_END CONTEXT_CaptureContext, _TEXT
+
+LEAF_ENTRY RtlCaptureContext, _TEXT
+ mov DWORD PTR [rdi + CONTEXT_ContextFlags], (CONTEXT_AMD64 | CONTEXT_FULL | CONTEXT_SEGMENTS)
+ jmp C_FUNC(CONTEXT_CaptureContext)
+LEAF_END RtlCaptureContext, _TEXT
+
+LEAF_ENTRY RtlRestoreContext, _TEXT
+ push_nonvol_reg rbp
+ alloc_stack (IRetFrameLengthAligned)
+
+ test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_DEBUG_REGISTERS
+ je LOCAL_LABEL(Done_Restore_CONTEXT_DEBUG_REGISTERS)
+ mov rdx, [rdi + CONTEXT_Dr0]
+ mov dr0, rdx
+ mov rdx, [rdi + CONTEXT_Dr1]
+ mov dr1, rdx
+ mov rdx, [rdi + CONTEXT_Dr2]
+ mov dr2, rdx
+ mov rdx, [rdi + CONTEXT_Dr3]
+ mov dr3, rdx
+ mov rdx, [rdi + CONTEXT_Dr6]
+ mov dr6, rdx
+ mov rdx, [rdi + CONTEXT_Dr7]
+ mov dr7, rdx
+LOCAL_LABEL(Done_Restore_CONTEXT_DEBUG_REGISTERS):
+
+ test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_FLOATING_POINT
+ je LOCAL_LABEL(Done_Restore_CONTEXT_FLOATING_POINT)
+ fxrstor [rdi + CONTEXT_FltSave]
+LOCAL_LABEL(Done_Restore_CONTEXT_FLOATING_POINT):
+
+ test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_XSTATE
+ je LOCAL_LABEL(Done_Restore_CONTEXT_XSTATE)
+
+ // Restore the extended state (for now, this is just the upper halves of YMM registers)
+ vinsertf128 ymm0, ymm0, xmmword ptr [rdi + (CONTEXT_VectorRegister + 0 * 16)], 1
+ vinsertf128 ymm1, ymm1, xmmword ptr [rdi + (CONTEXT_VectorRegister + 1 * 16)], 1
+ vinsertf128 ymm2, ymm2, xmmword ptr [rdi + (CONTEXT_VectorRegister + 2 * 16)], 1
+ vinsertf128 ymm3, ymm3, xmmword ptr [rdi + (CONTEXT_VectorRegister + 3 * 16)], 1
+ vinsertf128 ymm4, ymm4, xmmword ptr [rdi + (CONTEXT_VectorRegister + 4 * 16)], 1
+ vinsertf128 ymm5, ymm5, xmmword ptr [rdi + (CONTEXT_VectorRegister + 5 * 16)], 1
+ vinsertf128 ymm6, ymm6, xmmword ptr [rdi + (CONTEXT_VectorRegister + 6 * 16)], 1
+ vinsertf128 ymm7, ymm7, xmmword ptr [rdi + (CONTEXT_VectorRegister + 7 * 16)], 1
+ vinsertf128 ymm8, ymm8, xmmword ptr [rdi + (CONTEXT_VectorRegister + 8 * 16)], 1
+ vinsertf128 ymm9, ymm9, xmmword ptr [rdi + (CONTEXT_VectorRegister + 9 * 16)], 1
+ vinsertf128 ymm10, ymm10, xmmword ptr [rdi + (CONTEXT_VectorRegister + 10 * 16)], 1
+ vinsertf128 ymm11, ymm11, xmmword ptr [rdi + (CONTEXT_VectorRegister + 11 * 16)], 1
+ vinsertf128 ymm12, ymm12, xmmword ptr [rdi + (CONTEXT_VectorRegister + 12 * 16)], 1
+ vinsertf128 ymm13, ymm13, xmmword ptr [rdi + (CONTEXT_VectorRegister + 13 * 16)], 1
+ vinsertf128 ymm14, ymm14, xmmword ptr [rdi + (CONTEXT_VectorRegister + 14 * 16)], 1
+ vinsertf128 ymm15, ymm15, xmmword ptr [rdi + (CONTEXT_VectorRegister + 15 * 16)], 1
+LOCAL_LABEL(Done_Restore_CONTEXT_XSTATE):
+
+ test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_CONTROL
+ je LOCAL_LABEL(Done_Restore_CONTEXT_CONTROL)
+
+ // The control registers are restored via the iret instruction
+ // so we build the frame for the iret on the stack.
+#ifdef __APPLE__
+.att_syntax
+ // On OSX, we cannot read SS via the thread_get_context and RtlRestoreContext
+ // needs to be used on context extracted by thread_get_context. So we
+ // don't change the SS.
+ mov %ss, %ax
+.intel_syntax noprefix
+#else
+ mov ax, [rdi + CONTEXT_SegSs]
+#endif
+ mov [rsp + IRETFRAME_SegSs], ax
+ mov rax, [rdi + CONTEXT_Rsp]
+ mov [rsp + IRETFRAME_Rsp], rax
+ mov eax, [rdi + CONTEXT_EFlags]
+ mov [rsp + IRETFRAME_EFlags], eax
+ mov ax, [rdi + CONTEXT_SegCs]
+ mov [rsp + IRETFRAME_SegCs], ax
+ mov rax, [rdi + CONTEXT_Rip]
+ mov [rsp + IRETFRAME_Rip], rax
+
+LOCAL_LABEL(Done_Restore_CONTEXT_CONTROL):
+ // Remember the result of the test for the CONTEXT_CONTROL
+ push_eflags
+ test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_INTEGER
+ je LOCAL_LABEL(Done_Restore_CONTEXT_INTEGER)
+ mov rsi, [rdi + CONTEXT_Rsi]
+ mov rbx, [rdi + CONTEXT_Rbx]
+ mov rdx, [rdi + CONTEXT_Rdx]
+ mov rcx, [rdi + CONTEXT_Rcx]
+ mov rax, [rdi + CONTEXT_Rax]
+ mov rbp, [rdi + CONTEXT_Rbp]
+ mov r8, [rdi + CONTEXT_R8]
+ mov r9, [rdi + CONTEXT_R9]
+ mov r10, [rdi + CONTEXT_R10]
+ mov r11, [rdi + CONTEXT_R11]
+ mov r12, [rdi + CONTEXT_R12]
+ mov r13, [rdi + CONTEXT_R13]
+ mov r14, [rdi + CONTEXT_R14]
+ mov r15, [rdi + CONTEXT_R15]
+ mov rdi, [rdi + CONTEXT_Rdi]
+LOCAL_LABEL(Done_Restore_CONTEXT_INTEGER):
+
+ // Restore the result of the test for the CONTEXT_CONTROL
+ pop_eflags
+ je LOCAL_LABEL(No_Restore_CONTEXT_CONTROL)
+ // The function was asked to restore the control registers, so
+ // we perform iretq that restores them all.
+ // We don't return to the caller in this case.
+ iretq
+LOCAL_LABEL(No_Restore_CONTEXT_CONTROL):
+
+ // The function was not asked to restore the control registers
+ // so we return back to the caller.
+ free_stack (IRetFrameLengthAligned)
+ pop_nonvol_reg rbp
+ ret
+LEAF_END RtlRestoreContext, _TEXT
+
+#else
+
+ .globl C_FUNC(CONTEXT_CaptureContext)
+C_FUNC(CONTEXT_CaptureContext):
+ push %eax
+ mov 8(%esp), %eax
+ mov %edi, CONTEXT_Edi(%eax)
+ mov %esi, CONTEXT_Esi(%eax)
+ mov %ebx, CONTEXT_Ebx(%eax)
+ mov %edx, CONTEXT_Edx(%eax)
+ mov %ecx, CONTEXT_Ecx(%eax)
+ pop %ecx
+ mov %ecx, CONTEXT_Eax(%eax)
+ mov %ebp, CONTEXT_Ebp(%eax)
+ mov (%esp), %edx
+ mov %edx, CONTEXT_Eip(%eax)
+ push %cs
+ pop %edx
+ mov %edx, CONTEXT_SegCs(%eax)
+ pushf
+ pop %edx
+ mov %edx, CONTEXT_EFlags(%eax)
+ lea 4(%esp), %edx
+ mov %edx, CONTEXT_Esp(%eax)
+ push %ss
+ pop %edx
+ mov %edx, CONTEXT_SegSs(%eax)
+ testb $CONTEXT_FLOATING_POINT, CONTEXT_ContextFlags(%eax)
+ je 0f
+ fnsave CONTEXT_FloatSave(%eax)
+ frstor CONTEXT_FloatSave(%eax)
+0:
+ testb $CONTEXT_EXTENDED_REGISTERS, CONTEXT_ContextFlags(%eax)
+ je 2f
+ movdqu %xmm0, CONTEXT_Xmm0(%eax)
+ movdqu %xmm1, CONTEXT_Xmm1(%eax)
+ movdqu %xmm2, CONTEXT_Xmm2(%eax)
+ movdqu %xmm3, CONTEXT_Xmm3(%eax)
+ movdqu %xmm4, CONTEXT_Xmm4(%eax)
+ movdqu %xmm5, CONTEXT_Xmm5(%eax)
+ movdqu %xmm6, CONTEXT_Xmm6(%eax)
+ movdqu %xmm7, CONTEXT_Xmm7(%eax)
+2:
+ ret
+
+#endif
diff --git a/src/pal/src/arch/amd64/debugbreak.S b/src/pal/src/arch/amd64/debugbreak.S
new file mode 100644
index 0000000000..3065e4064c
--- /dev/null
+++ b/src/pal/src/arch/amd64/debugbreak.S
@@ -0,0 +1,12 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+.intel_syntax noprefix
+#include "unixasmmacros.inc"
+
+LEAF_ENTRY DBG_DebugBreak, _TEXT
+ int3
+ ret
+LEAF_END_MARKED DBG_DebugBreak, _TEXT
+
diff --git a/src/pal/src/arch/i386/dispatchexceptionwrapper.S b/src/pal/src/arch/amd64/dispatchexceptionwrapper.S
index ee5ff468d6..ee5ff468d6 100644
--- a/src/pal/src/arch/i386/dispatchexceptionwrapper.S
+++ b/src/pal/src/arch/amd64/dispatchexceptionwrapper.S
diff --git a/src/pal/src/arch/amd64/exceptionhelper.S b/src/pal/src/arch/amd64/exceptionhelper.S
new file mode 100644
index 0000000000..b7b34ace41
--- /dev/null
+++ b/src/pal/src/arch/amd64/exceptionhelper.S
@@ -0,0 +1,42 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+.intel_syntax noprefix
+#include "unixasmmacros.inc"
+#include "asmconstants.h"
+
+//////////////////////////////////////////////////////////////////////////
+//
+// This function creates a stack frame right below the target frame, restores all callee
+// saved registers from the passed in context, sets the RSP to that frame and sets the
+// return address to the target frame's RIP.
+// Then it uses the ThrowExceptionHelper to throw the passed in exception from that context.
+// EXTERN_C void ThrowExceptionFromContextInternal(CONTEXT* context, PAL_SEHException* ex);
+LEAF_ENTRY ThrowExceptionFromContextInternal, _TEXT
+ // Save the RBP to the stack so that the unwind can work at the instruction after
+ // loading the RBP from the context, but before loading the RSP from the context.
+ push_nonvol_reg rbp
+ mov r12, [rdi + CONTEXT_R12]
+ mov r13, [rdi + CONTEXT_R13]
+ mov r14, [rdi + CONTEXT_R14]
+ mov r15, [rdi + CONTEXT_R15]
+ mov rbx, [rdi + CONTEXT_Rbx]
+ mov rbp, [rdi + CONTEXT_Rbp]
+ mov rsp, [rdi + CONTEXT_Rsp]
+ // The RSP was set to the target frame's value, so the current function's
+ // CFA is now right at the RSP.
+ .cfi_def_cfa_offset 0
+
+ // Indicate that now that we have moved the RSP to the target address,
+ // the RBP is no longer saved in the current stack frame.
+ .cfi_restore rbp
+
+ mov rax, [rdi + CONTEXT_Rip]
+
+ // Store return address to the stack
+ push_register rax
+ // The PAL_SEHException pointer
+ mov rdi, rsi
+ jmp EXTERNAL_C_FUNC(ThrowExceptionHelper)
+LEAF_END ThrowExceptionFromContextInternal, _TEXT
diff --git a/src/pal/src/arch/amd64/optimizedtls.cpp b/src/pal/src/arch/amd64/optimizedtls.cpp
new file mode 100644
index 0000000000..cd89db6b0a
--- /dev/null
+++ b/src/pal/src/arch/amd64/optimizedtls.cpp
@@ -0,0 +1,237 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*++
+
+
+
+Module Name:
+
+ optimizedtls.cpp
+
+Abstract:
+
+ Implementation of platform-specific Thread local storage functions.
+
+
+
+--*/
+
+#include "pal/thread.hpp"
+#include "pal/malloc.hpp"
+
+#include <pthread.h>
+
+#include "pal/dbgmsg.h"
+#include "pal/misc.h"
+#include "pal/debug.h"
+
+#include <stddef.h>
+
+using namespace CorUnix;
+
+SET_DEFAULT_DEBUG_CHANNEL(THREAD);
+
+#if defined(USE_OPTIMIZEDTLSGETTER)
+
+#define PAL_safe_offsetof(s,m) ((size_t)((ptrdiff_t)&(char&)(((s *)64)->m))-64)
+
+/*++
+Function:
+ CorUnix::TLSMakeOptimizedGetter
+
+ Creates a platform-optimized version of TlsGetValue compiled
+ for a particular index.
+
+ Generates the hot part of CorUnix::InternalGetCurrentThread
+ as a chunk of highly optimized machine-specific code at runtime.
+
+ Check the difference between CorUnix::InternalGetCurrentThread and
+ CorUnix::InternalGetCurrentThreadSlow to see the C/C++ code that matches
+ the code generated by this function.
+--*/
+PAL_POPTIMIZEDTLSGETTER
+CorUnix::TLSMakeOptimizedGetter(
+ IN CPalThread* pThread,
+ IN DWORD dwTlsIndex)
+{
+#ifdef BIT64
+#pragma unused(pThread, dwTlsIndex)
+ ERROR("TLSMakeOptimizedGetter not rewritten for amd64 yet.");
+ return NULL;
+#else
+ PAL_POPTIMIZEDTLSGETTER Ret = NULL;
+ BYTE* p;
+ int i = 0;
+
+#ifdef __APPLE__
+#define TLS_OPTIMIZED_GETTER_SIZE 118
+#else
+#define TLS_OPTIMIZED_GETTER_SIZE 115
+#endif
+
+ p = (BYTE*)InternalMalloc(pThread, TLS_OPTIMIZED_GETTER_SIZE * sizeof(BYTE));
+
+ if (p == NULL)
+ {
+ return Ret;
+ }
+
+ // Need to preserve %ecx, %edx, and %esi registers as specified in
+ // GetThreadGeneric(void) in vm/amd64/asmhelpers.s
+ p[i++] = 0x51; // push %ecx
+ p[i++] = 0x52; // push %edx
+ p[i++] = 0x89; // mov %esp,%eax // %eax = sp;
+ p[i++] = 0xe0;
+ p[i++] = 0xc1; // shr $0x11,%eax // sp >> 17;
+ p[i++] = 0xe8;
+ p[i++] = 0x11;
+ p[i++] = 0x89; // mov %eax,%edx // key = sp >> 17;
+ p[i++] = 0xc2;
+ p[i++] = 0xc1; // sar $0x7,%edx // key >> 7;
+ p[i++] = 0xfa;
+ p[i++] = 0x07;
+ p[i++] = 0x29; // sub %edx,%eax // key -= key >> 7;
+ p[i++] = 0xd0;
+ p[i++] = 0x89; // mov %eax,%edx
+ p[i++] = 0xc2;
+ p[i++] = 0xc1; // sar $0x5,%edx // key >> 5;
+ p[i++] = 0xfa;
+ p[i++] = 0x05;
+ p[i++] = 0x29; // sub %edx,%eax // key -= key >> 5;
+ p[i++] = 0xd0;
+ p[i++] = 0x89; // mov %eax,%edx
+ p[i++] = 0xc2;
+ p[i++] = 0xc1; // sar $0x3,%edx // key >> 3;
+ p[i++] = 0xfa;
+ p[i++] = 0x03;
+ p[i++] = 0x29; // sub %edx,%eax // key -= key >> 3;
+ p[i++] = 0xd0;
+ p[i++] = 0x25; // and $0xff,%eax // key &= 0xFF;
+ p[i++] = 0xff;
+ p[i++] = 0x00;
+ p[i++] = 0x00;
+ p[i++] = 0x00;
+ p[i++] = 0x8b; // mov (flush_counter),%ecx // %ecx = counter = flush_counter;
+ p[i++] = 0x0d;
+ *((DWORD*) &p[i]) = (DWORD)&flush_counter;
+ i += sizeof(DWORD);
+ p[i++] = 0x8b; // mov (thread_hints,%eax,4),%eax // %edx = pThread = thread_hints[key];
+ p[i++] = 0x14;
+ p[i++] = 0x85;
+ *((DWORD*) &p[i]) = (DWORD)&thread_hints;
+ i += sizeof(DWORD);
+ p[i++] = 0x39; // cmp %esp,offsetof(CPalThread,tlsInfo)+offsetof(CThreadTLSInfo,minStack)(%edx)
+ // if ((size_t)pThread->tlsInfo.minStack <= sp)
+ p[i++] = 0xa2;
+ *((DWORD*) &p[i]) = (DWORD)(PAL_safe_offsetof(CPalThread,tlsInfo)+PAL_safe_offsetof(CThreadTLSInfo,minStack));
+ i += sizeof(DWORD);
+ p[i++] = 0x77; // ja CallInternalGetCurrentThreadSlow:
+ p[i++] = 0x19;
+ p[i++] = 0x3b; // cmp offsetof(CPalThread,tlsInfo)+offsetof(CThreadTLSInfo,maxStack)(%edx),%esp
+ // if (sp < (size_t)pThread->tlsInfo.maxStack)
+ p[i++] = 0xa2;
+ *((DWORD*) &p[i]) = (DWORD)(PAL_safe_offsetof(CPalThread,tlsInfo)+PAL_safe_offsetof(CThreadTLSInfo,maxStack));
+ i += sizeof(DWORD);
+ p[i++] = 0x73; // jae CallInternalGetCurrentThreadSlow:
+ p[i++] = 0x11;
+ p[i++] = 0x39; // cmp (flush_counter),%ecx // if (counter == flush_counter)
+ p[i++] = 0x0d;
+ *((DWORD*) &p[i]) = (DWORD)&flush_counter;
+ i += sizeof(DWORD);
+ p[i++] = 0x75; // jne CallInternalGetCurrentThreadSlow:
+ p[i++] = 0x09;
+ if (dwTlsIndex != THREAD_OBJECT_TLS_INDEX)
+ {
+ p[i++] = 0x8b; // mov offsetof(pThread->tlsSlots[dwTlsIndex])(%edx),%eax // %eax = pThread->tlsSlots[dwTlsIndex];
+ p[i++] = 0x82;
+ *((DWORD*) &p[i]) = (DWORD)(PAL_safe_offsetof(CPalThread,tlsInfo)+PAL_safe_offsetof(CThreadTLSInfo,tlsSlots[dwTlsIndex]));
+ i += sizeof(DWORD);
+ }
+ else
+ {
+ p[i++] = 0x89; // mov %edx,%eax // %eax = pThread;
+ p[i++] = 0xd0;
+ p[i++] = 0x90; // nop
+ p[i++] = 0x90; // nop
+ p[i++] = 0x90; // nop
+ p[i++] = 0x90; // nop
+ }
+ p[i++] = 0x5a; // pop %edx
+ p[i++] = 0x59; // pop %ecx
+ p[i++] = 0xc3; // ret
+ // CallInternalGetCurrentThreadSlow:
+ p[i++] = 0x5a; // pop %edx
+ p[i++] = 0x59; // pop %ecx
+ p[i++] = 0x8d; // lea (thread_hints,%eax,4),%eax // %eax = &thread_hints[key];
+ p[i++] = 0x04;
+ p[i++] = 0x85;
+ *((DWORD*) &p[i]) = (DWORD)&thread_hints;
+ i += sizeof(DWORD);
+ p[i++] = 0x55; // push %ebp
+ p[i++] = 0x89; // mov %esp,%ebp
+ p[i++] = 0xe5;
+ p[i++] = 0x51; // push %ecx
+ p[i++] = 0x89; // mov %esp,%ecx // this is the reference esp - need to match the reference esp used in the fast path.
+ p[i++] = 0xe1;
+ p[i++] = 0x52; // push %edx
+#ifdef __APPLE__
+ // establish 16-byte stack alignment
+ p[i++] = 0x83; // subl $8,%esp
+ p[i++] = 0xec;
+ p[i++] = 0x08;
+#endif
+ p[i++] = 0x50; // push %eax // store &thread_hints[key] on stack as 2nd argument;
+ p[i++] = 0x51; // push %ecx // reference esp - The 1st argument for call to InternalGetCurrentThreadSlow.
+ p[i++] = 0xe8; // call InternalGetCurrentThreadSlow
+ *((DWORD*) &p[i]) = (DWORD)&InternalGetCurrentThreadSlow - (DWORD)(&p[i+sizeof(DWORD)]);
+ i += sizeof(DWORD);
+#ifdef __APPLE__
+ p[i++] = 0x83; // addl $16,%esp
+ p[i++] = 0xc4;
+ p[i++] = 0x10;
+#else
+ p[i++] = 0x83; // addl $8,%esp
+ p[i++] = 0xc4;
+ p[i++] = 0x08;
+#endif
+ if (dwTlsIndex != THREAD_OBJECT_TLS_INDEX)
+ {
+ p[i++] = 0x8b; // mov offsetof(pThread->tlsSlots[dwTlsIndex])(%eax),%eax // %eax = pThread->tlsSlots[dwTlsIndex];
+ p[i++] = 0x80;
+ *((DWORD*) &p[i]) = (DWORD)(PAL_safe_offsetof(CPalThread,tlsInfo)+PAL_safe_offsetof(CThreadTLSInfo,tlsSlots[dwTlsIndex]));
+ i += sizeof(DWORD);
+ }
+ p[i++] = 0x5a; // pop %edx
+ p[i++] = 0x59; // pop %ecx
+ p[i++] = 0xc9; // leave
+ p[i++] = 0xc3; // ret
+
+ if (i > TLS_OPTIMIZED_GETTER_SIZE)
+ {
+ ASSERT("Invalid TLS_OPTIMIZED_GETTER_SIZE %d\n", i);
+ }
+
+ DBG_FlushInstructionCache(p, TLS_OPTIMIZED_GETTER_SIZE * sizeof(BYTE));
+
+ Ret = (PAL_POPTIMIZEDTLSGETTER)p;
+
+ return Ret;
+#endif // BIT64 else
+}
+
+/*++
+Function:
+ TLSFreeOptimizedGetter
+
+ Frees a function created by MakeOptimizedTlsGetter().
+--*/
+VOID
+CorUnix::TLSFreeOptimizedGetter(
+ IN PAL_POPTIMIZEDTLSGETTER pOptimizedTlsGetter)
+{
+ InternalFree(InternalGetCurrentThread(), (void *)pOptimizedTlsGetter);
+}
+
+#endif // USE_OPTIMIZEDTLSGETTER
diff --git a/src/pal/src/arch/amd64/processor.cpp b/src/pal/src/arch/amd64/processor.cpp
new file mode 100644
index 0000000000..ac3d448a81
--- /dev/null
+++ b/src/pal/src/arch/amd64/processor.cpp
@@ -0,0 +1,64 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*++
+
+
+
+Module Name:
+
+ processor.cpp
+
+Abstract:
+
+ Implementation of processor related functions for the Intel x86/x64
+ platforms. These functions are processor dependent.
+
+
+
+--*/
+
+#include "pal/palinternal.h"
+
+/*++
+Function:
+YieldProcessor
+
+The YieldProcessor function signals to the processor to give resources
+to threads that are waiting for them. This macro is only effective on
+processors that support technology allowing multiple threads running
+on a single processor, such as Intel's Hyper-Threading technology.
+
+--*/
+void
+PALAPI
+YieldProcessor(
+ VOID)
+{
+ __asm__ __volatile__ (
+ "rep\n"
+ "nop"
+ );
+}
+
+/*++
+Function:
+XmmYmmStateSupport
+
+Check if OS has enabled both XMM and YMM state support
+
+Return value:
+1 if XMM and YMM are enabled, 0 otherwise
+--*/
+extern "C" unsigned int XmmYmmStateSupport()
+{
+ unsigned int eax;
+ __asm(" xgetbv\n" \
+ : "=a"(eax) /*output in eax*/\
+ : "c"(0) /*inputs - 0 in ecx*/\
+ : "eax", "edx" /* registers that are clobbered*/
+ );
+ // Check OS has enabled both XMM and YMM state support
+ return ((eax & 0x06) == 0x06) ? 1 : 0;
+}
diff --git a/src/pal/src/arch/arm/exceptionhelper.S b/src/pal/src/arch/arm/exceptionhelper.S
index ed1c9c3dc2..76cdcba9b4 100644
--- a/src/pal/src/arch/arm/exceptionhelper.S
+++ b/src/pal/src/arch/arm/exceptionhelper.S
@@ -10,7 +10,7 @@
// EXTERN_C void ThrowExceptionFromContextInternal(CONTEXT* context, PAL_SEHException* ex);
LEAF_ENTRY ThrowExceptionFromContextInternal, _TEXT
- // Ported from src/pal/src/arch/i386/exceptionhelper.S
+ // Ported from src/pal/src/arch/amd64/exceptionhelper.S
push_nonvol_reg {r7} /* FP. x64-RBP */
ldr r4, [r0, #(CONTEXT_R4)]
diff --git a/src/pal/src/arch/i386/asmconstants.h b/src/pal/src/arch/i386/asmconstants.h
index 182c1191e4..ff763ef16b 100644
--- a/src/pal/src/arch/i386/asmconstants.h
+++ b/src/pal/src/arch/i386/asmconstants.h
@@ -2,80 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#ifdef BIT64
-
-#define CONTEXT_AMD64 0x100000
-
-#define CONTEXT_CONTROL 1 // SegSs, Rsp, SegCs, Rip, and EFlags
-#define CONTEXT_INTEGER 2 // Rax, Rcx, Rdx, Rbx, Rbp, Rsi, Rdi, R8-R15
-#define CONTEXT_SEGMENTS 4 // SegDs, SegEs, SegFs, SegGs
-#define CONTEXT_FLOATING_POINT 8
-#define CONTEXT_DEBUG_REGISTERS 16 // Dr0-Dr3 and Dr6-Dr7
-
-#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
-
-#define CONTEXT_XSTATE 64
-
-#define CONTEXT_ContextFlags 6*8
-#define CONTEXT_SegCs CONTEXT_ContextFlags+8
-#define CONTEXT_SegDs CONTEXT_SegCs+2
-#define CONTEXT_SegEs CONTEXT_SegDs+2
-#define CONTEXT_SegFs CONTEXT_SegEs+2
-#define CONTEXT_SegGs CONTEXT_SegFs+2
-#define CONTEXT_SegSs CONTEXT_SegGs+2
-#define CONTEXT_EFlags CONTEXT_SegSs+2
-#define CONTEXT_Dr0 CONTEXT_EFlags+4
-#define CONTEXT_Dr1 CONTEXT_Dr0+8
-#define CONTEXT_Dr2 CONTEXT_Dr1+8
-#define CONTEXT_Dr3 CONTEXT_Dr2+8
-#define CONTEXT_Dr6 CONTEXT_Dr3+8
-#define CONTEXT_Dr7 CONTEXT_Dr6+8
-#define CONTEXT_Rax CONTEXT_Dr7+8
-#define CONTEXT_Rcx CONTEXT_Rax+8
-#define CONTEXT_Rdx CONTEXT_Rcx+8
-#define CONTEXT_Rbx CONTEXT_Rdx+8
-#define CONTEXT_Rsp CONTEXT_Rbx+8
-#define CONTEXT_Rbp CONTEXT_Rsp+8
-#define CONTEXT_Rsi CONTEXT_Rbp+8
-#define CONTEXT_Rdi CONTEXT_Rsi+8
-#define CONTEXT_R8 CONTEXT_Rdi+8
-#define CONTEXT_R9 CONTEXT_R8+8
-#define CONTEXT_R10 CONTEXT_R9+8
-#define CONTEXT_R11 CONTEXT_R10+8
-#define CONTEXT_R12 CONTEXT_R11+8
-#define CONTEXT_R13 CONTEXT_R12+8
-#define CONTEXT_R14 CONTEXT_R13+8
-#define CONTEXT_R15 CONTEXT_R14+8
-#define CONTEXT_Rip CONTEXT_R15+8
-#define CONTEXT_FltSave CONTEXT_Rip+8
-#define FLOATING_SAVE_AREA_SIZE 4*8+24*16+96
-#define CONTEXT_Xmm0 CONTEXT_FltSave+10*16
-#define CONTEXT_Xmm1 CONTEXT_Xmm0+16
-#define CONTEXT_Xmm2 CONTEXT_Xmm1+16
-#define CONTEXT_Xmm3 CONTEXT_Xmm2+16
-#define CONTEXT_Xmm4 CONTEXT_Xmm3+16
-#define CONTEXT_Xmm5 CONTEXT_Xmm4+16
-#define CONTEXT_Xmm6 CONTEXT_Xmm5+16
-#define CONTEXT_Xmm7 CONTEXT_Xmm6+16
-#define CONTEXT_Xmm8 CONTEXT_Xmm7+16
-#define CONTEXT_Xmm9 CONTEXT_Xmm8+16
-#define CONTEXT_Xmm10 CONTEXT_Xmm9+16
-#define CONTEXT_Xmm11 CONTEXT_Xmm10+16
-#define CONTEXT_Xmm12 CONTEXT_Xmm11+16
-#define CONTEXT_Xmm13 CONTEXT_Xmm12+16
-#define CONTEXT_Xmm14 CONTEXT_Xmm13+16
-#define CONTEXT_Xmm15 CONTEXT_Xmm14+16
-#define CONTEXT_VectorRegister CONTEXT_FltSave+FLOATING_SAVE_AREA_SIZE
-#define CONTEXT_VectorControl CONTEXT_VectorRegister+16*26
-#define CONTEXT_DebugControl CONTEXT_VectorControl+8
-#define CONTEXT_LastBranchToRip CONTEXT_DebugControl+8
-#define CONTEXT_LastBranchFromRip CONTEXT_LastBranchToRip+8
-#define CONTEXT_LastExceptionToRip CONTEXT_LastBranchFromRip+8
-#define CONTEXT_LastExceptionFromRip CONTEXT_LastExceptionToRip+8
-#define CONTEXT_Size CONTEXT_LastExceptionFromRip+8
-
-#else // BIT64
-
#define CONTEXT_ContextFlags 0
#define CONTEXT_FLOATING_POINT 8
#define CONTEXT_FloatSave 7*4
@@ -102,5 +28,3 @@
#define CONTEXT_Xmm5 CONTEXT_Xmm4+16
#define CONTEXT_Xmm6 CONTEXT_Xmm5+16
#define CONTEXT_Xmm7 CONTEXT_Xmm6+16
-
-#endif // BIT64
diff --git a/src/pal/src/arch/i386/context2.S b/src/pal/src/arch/i386/context2.S
index 0e93e81a55..16cbcc855c 100644
--- a/src/pal/src/arch/i386/context2.S
+++ b/src/pal/src/arch/i386/context2.S
@@ -1,259 +1,151 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-//
-// Implementation of _CONTEXT_CaptureContext for the Intel x86 platform.
-// This function is processor dependent. It is used by exception handling,
-// and is always apply to the current thread.
-//
.intel_syntax noprefix
#include "unixasmmacros.inc"
#include "asmconstants.h"
-#ifdef BIT64
-
-#define IRETFRAME_Rip 0
-#define IRETFRAME_SegCs IRETFRAME_Rip+8
-#define IRETFRAME_EFlags IRETFRAME_SegCs+8
-#define IRETFRAME_Rsp IRETFRAME_EFlags+8
-#define IRETFRAME_SegSs IRETFRAME_Rsp+8
-#define IRetFrameLength IRETFRAME_SegSs+8
-#define IRetFrameLengthAligned 16*((IRetFrameLength+8)/16)
-
-// Incoming:
-// RDI: Context*
+//
+// Implementation of CONTEXT_CaptureContext for the Intel x86 platform.
+//
+// extern void CONTEXT_CaptureContext(LPCONTEXT lpContext);
+//
+// This function is processor-dependent. It is used by exception handling,
+// and is always apply to the current thread.
//
LEAF_ENTRY CONTEXT_CaptureContext, _TEXT
- // Save processor flags before calling any of the following 'test' instructions
- // because they will modify state of some flags
- push_eflags
- END_PROLOGUE
+ // Store
+ push eax
+ push ebx
+
+ // The stack will contain the following elements on the top of
+ // the caller's stack
+ // [ebx] / esp + 00
+ // [eax] / esp + 04
+ // [ret] / esp + 08
+ // [arg0: lpContext] / esp + 12
+
+ mov eax, [esp + 12] // eax will point to lpContext
+
+ // Capture INTEGER registers
+ mov ebx, [esp + 4]
+ mov [eax + CONTEXT_Eax], ebx
+ mov ebx, [esp]
+ mov [eax + CONTEXT_Ebx], ebx
+ mov [eax + CONTEXT_Ecx], ecx
+ mov [eax + CONTEXT_Edx], edx
+ mov [eax + CONTEXT_Esi], esi
+ mov [eax + CONTEXT_Edi], edi
+
+ // Capture CONTROL registers
+ mov [eax + CONTEXT_Ebp], ebp
+ lea ebx, [esp + 12]
+ mov [eax + CONTEXT_Esp], ebx
+ mov ebx, [esp + 8]
+ mov [eax + CONTEXT_Eip], ebx
+
+ push cs
+ xor ebx, ebx
+ pop bx
+ mov [eax + CONTEXT_SegCs], ebx
+
+ push ss
+ xor ebx, ebx
+ pop bx
+ mov [eax + CONTEXT_SegSs], ebx
- test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_INTEGER
- je LOCAL_LABEL(Done_CONTEXT_INTEGER)
- mov [rdi + CONTEXT_Rdi], rdi
- mov [rdi + CONTEXT_Rsi], rsi
- mov [rdi + CONTEXT_Rbx], rbx
- mov [rdi + CONTEXT_Rdx], rdx
- mov [rdi + CONTEXT_Rcx], rcx
- mov [rdi + CONTEXT_Rax], rax
- mov [rdi + CONTEXT_Rbp], rbp
- mov [rdi + CONTEXT_R8], r8
- mov [rdi + CONTEXT_R9], r9
- mov [rdi + CONTEXT_R10], r10
- mov [rdi + CONTEXT_R11], r11
- mov [rdi + CONTEXT_R12], r12
- mov [rdi + CONTEXT_R13], r13
- mov [rdi + CONTEXT_R14], r14
- mov [rdi + CONTEXT_R15], r15
-LOCAL_LABEL(Done_CONTEXT_INTEGER):
-
- test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_CONTROL
- je LOCAL_LABEL(Done_CONTEXT_CONTROL)
-
- // Return address is @ (RSP + 8)
- mov rdx, [rsp + 8]
- mov [rdi + CONTEXT_Rip], rdx
-.att_syntax
- mov %cs, CONTEXT_SegCs(%rdi)
-.intel_syntax noprefix
- // Get the value of EFlags that was pushed on stack at the beginning of the function
- mov rdx, [rsp]
- mov [rdi + CONTEXT_EFlags], edx
- lea rdx, [rsp + 16]
- mov [rdi + CONTEXT_Rsp], rdx
-.att_syntax
- mov %ss, CONTEXT_SegSs(%rdi)
-.intel_syntax noprefix
-LOCAL_LABEL(Done_CONTEXT_CONTROL):
+ pushf
+ xor ebx, ebx
+ pop bx
+ mov [eax + CONTEXT_EFlags], ebx
- // Need to double check this is producing the right result
- // also that FFSXR (fast save/restore) is not turned on
- // otherwise it omits the xmm registers.
- test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_FLOATING_POINT
+ test BYTE PTR [eax + CONTEXT_ContextFlags], CONTEXT_FLOATING_POINT
je LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT)
- fxsave [rdi + CONTEXT_FltSave]
+ // Capture FPU status
+ fnsave [eax + CONTEXT_FloatSave]
+ frstor [eax + CONTEXT_FloatSave]
LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT):
- test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_DEBUG_REGISTERS
- je LOCAL_LABEL(Done_CONTEXT_DEBUG_REGISTERS)
- mov rdx, dr0
- mov [rdi + CONTEXT_Dr0], rdx
- mov rdx, dr1
- mov [rdi + CONTEXT_Dr1], rdx
- mov rdx, dr2
- mov [rdi + CONTEXT_Dr2], rdx
- mov rdx, dr3
- mov [rdi + CONTEXT_Dr3], rdx
- mov rdx, dr6
- mov [rdi + CONTEXT_Dr6], rdx
- mov rdx, dr7
- mov [rdi + CONTEXT_Dr7], rdx
-LOCAL_LABEL(Done_CONTEXT_DEBUG_REGISTERS):
-
- free_stack 8
- ret
+ test BYTE PTR [eax + CONTEXT_ContextFlags], CONTEXT_EXTENDED_REGISTERS
+ je LOCAL_LABEL(Done_CONTEXT_EXTENDED_REGISTERS)
+ movdqu [eax + CONTEXT_Xmm0], xmm0
+ movdqu [eax + CONTEXT_Xmm1], xmm1
+ movdqu [eax + CONTEXT_Xmm2], xmm2
+ movdqu [eax + CONTEXT_Xmm3], xmm3
+ movdqu [eax + CONTEXT_Xmm4], xmm4
+ movdqu [eax + CONTEXT_Xmm5], xmm5
+ movdqu [eax + CONTEXT_Xmm6], xmm6
+ movdqu [eax + CONTEXT_Xmm7], xmm7
+LOCAL_LABEL(Done_CONTEXT_EXTENDED_REGISTERS):
+
+ // Restore
+ pop ebx
+ pop eax
+ ret 4
LEAF_END CONTEXT_CaptureContext, _TEXT
LEAF_ENTRY RtlCaptureContext, _TEXT
- mov DWORD PTR [rdi + CONTEXT_ContextFlags], (CONTEXT_AMD64 | CONTEXT_FULL | CONTEXT_SEGMENTS)
+ push eax
+ mov eax, [esp + 8]
+ mov DWORD PTR [eax + CONTEXT_ContextFlags], (CONTEXT_FLOATING_POINT)
+ pop eax
jmp C_FUNC(CONTEXT_CaptureContext)
LEAF_END RtlCaptureContext, _TEXT
LEAF_ENTRY RtlRestoreContext, _TEXT
- push_nonvol_reg rbp
- alloc_stack (IRetFrameLengthAligned)
-
- test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_DEBUG_REGISTERS
- je LOCAL_LABEL(Done_Restore_CONTEXT_DEBUG_REGISTERS)
- mov rdx, [rdi + CONTEXT_Dr0]
- mov dr0, rdx
- mov rdx, [rdi + CONTEXT_Dr1]
- mov dr1, rdx
- mov rdx, [rdi + CONTEXT_Dr2]
- mov dr2, rdx
- mov rdx, [rdi + CONTEXT_Dr3]
- mov dr3, rdx
- mov rdx, [rdi + CONTEXT_Dr6]
- mov dr6, rdx
- mov rdx, [rdi + CONTEXT_Dr7]
- mov dr7, rdx
-LOCAL_LABEL(Done_Restore_CONTEXT_DEBUG_REGISTERS):
+ mov eax, [esp + 4]
- test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_FLOATING_POINT
+ test BYTE PTR [eax + CONTEXT_ContextFlags], CONTEXT_FLOATING_POINT
je LOCAL_LABEL(Done_Restore_CONTEXT_FLOATING_POINT)
- fxrstor [rdi + CONTEXT_FltSave]
+ frstor [eax + CONTEXT_FloatSave]
LOCAL_LABEL(Done_Restore_CONTEXT_FLOATING_POINT):
- test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_XSTATE
- je LOCAL_LABEL(Done_Restore_CONTEXT_XSTATE)
-
- // Restore the extended state (for now, this is just the upper halves of YMM registers)
- vinsertf128 ymm0, ymm0, xmmword ptr [rdi + (CONTEXT_VectorRegister + 0 * 16)], 1
- vinsertf128 ymm1, ymm1, xmmword ptr [rdi + (CONTEXT_VectorRegister + 1 * 16)], 1
- vinsertf128 ymm2, ymm2, xmmword ptr [rdi + (CONTEXT_VectorRegister + 2 * 16)], 1
- vinsertf128 ymm3, ymm3, xmmword ptr [rdi + (CONTEXT_VectorRegister + 3 * 16)], 1
- vinsertf128 ymm4, ymm4, xmmword ptr [rdi + (CONTEXT_VectorRegister + 4 * 16)], 1
- vinsertf128 ymm5, ymm5, xmmword ptr [rdi + (CONTEXT_VectorRegister + 5 * 16)], 1
- vinsertf128 ymm6, ymm6, xmmword ptr [rdi + (CONTEXT_VectorRegister + 6 * 16)], 1
- vinsertf128 ymm7, ymm7, xmmword ptr [rdi + (CONTEXT_VectorRegister + 7 * 16)], 1
- vinsertf128 ymm8, ymm8, xmmword ptr [rdi + (CONTEXT_VectorRegister + 8 * 16)], 1
- vinsertf128 ymm9, ymm9, xmmword ptr [rdi + (CONTEXT_VectorRegister + 9 * 16)], 1
- vinsertf128 ymm10, ymm10, xmmword ptr [rdi + (CONTEXT_VectorRegister + 10 * 16)], 1
- vinsertf128 ymm11, ymm11, xmmword ptr [rdi + (CONTEXT_VectorRegister + 11 * 16)], 1
- vinsertf128 ymm12, ymm12, xmmword ptr [rdi + (CONTEXT_VectorRegister + 12 * 16)], 1
- vinsertf128 ymm13, ymm13, xmmword ptr [rdi + (CONTEXT_VectorRegister + 13 * 16)], 1
- vinsertf128 ymm14, ymm14, xmmword ptr [rdi + (CONTEXT_VectorRegister + 14 * 16)], 1
- vinsertf128 ymm15, ymm15, xmmword ptr [rdi + (CONTEXT_VectorRegister + 15 * 16)], 1
-LOCAL_LABEL(Done_Restore_CONTEXT_XSTATE):
-
- test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_CONTROL
- je LOCAL_LABEL(Done_Restore_CONTEXT_CONTROL)
-
- // The control registers are restored via the iret instruction
- // so we build the frame for the iret on the stack.
-#ifdef __APPLE__
-.att_syntax
- // On OSX, we cannot read SS via the thread_get_context and RtlRestoreContext
- // needs to be used on context extracted by thread_get_context. So we
- // don't change the SS.
- mov %ss, %ax
-.intel_syntax noprefix
-#else
- mov ax, [rdi + CONTEXT_SegSs]
-#endif
- mov [rsp + IRETFRAME_SegSs], ax
- mov rax, [rdi + CONTEXT_Rsp]
- mov [rsp + IRETFRAME_Rsp], rax
- mov eax, [rdi + CONTEXT_EFlags]
- mov [rsp + IRETFRAME_EFlags], eax
- mov ax, [rdi + CONTEXT_SegCs]
- mov [rsp + IRETFRAME_SegCs], ax
- mov rax, [rdi + CONTEXT_Rip]
- mov [rsp + IRETFRAME_Rip], rax
-
-LOCAL_LABEL(Done_Restore_CONTEXT_CONTROL):
- // Remember the result of the test for the CONTEXT_CONTROL
- push_eflags
- test BYTE PTR [rdi + CONTEXT_ContextFlags], CONTEXT_INTEGER
- je LOCAL_LABEL(Done_Restore_CONTEXT_INTEGER)
- mov rsi, [rdi + CONTEXT_Rsi]
- mov rbx, [rdi + CONTEXT_Rbx]
- mov rdx, [rdi + CONTEXT_Rdx]
- mov rcx, [rdi + CONTEXT_Rcx]
- mov rax, [rdi + CONTEXT_Rax]
- mov rbp, [rdi + CONTEXT_Rbp]
- mov r8, [rdi + CONTEXT_R8]
- mov r9, [rdi + CONTEXT_R9]
- mov r10, [rdi + CONTEXT_R10]
- mov r11, [rdi + CONTEXT_R11]
- mov r12, [rdi + CONTEXT_R12]
- mov r13, [rdi + CONTEXT_R13]
- mov r14, [rdi + CONTEXT_R14]
- mov r15, [rdi + CONTEXT_R15]
- mov rdi, [rdi + CONTEXT_Rdi]
-LOCAL_LABEL(Done_Restore_CONTEXT_INTEGER):
-
- // Restore the result of the test for the CONTEXT_CONTROL
- pop_eflags
- je LOCAL_LABEL(No_Restore_CONTEXT_CONTROL)
- // The function was asked to restore the control registers, so
- // we perform iretq that restores them all.
- // We don't return to the caller in this case.
- iretq
-LOCAL_LABEL(No_Restore_CONTEXT_CONTROL):
-
- // The function was not asked to restore the control registers
- // so we return back to the caller.
- free_stack (IRetFrameLengthAligned)
- pop_nonvol_reg rbp
- ret
+ test BYTE PTR [eax + CONTEXT_ContextFlags], CONTEXT_EXTENDED_REGISTERS
+ je LOCAL_LABEL(Done_Restore_CONTEXT_EXTENDED_REGISTERS)
+ movdqu xmm0, [eax + CONTEXT_Xmm0]
+ movdqu xmm1, [eax + CONTEXT_Xmm1]
+ movdqu xmm2, [eax + CONTEXT_Xmm2]
+ movdqu xmm3, [eax + CONTEXT_Xmm3]
+ movdqu xmm4, [eax + CONTEXT_Xmm4]
+ movdqu xmm5, [eax + CONTEXT_Xmm5]
+ movdqu xmm6, [eax + CONTEXT_Xmm6]
+ movdqu xmm7, [eax + CONTEXT_Xmm7]
+LOCAL_LABEL(Done_Restore_CONTEXT_EXTENDED_REGISTERS):
+
+ // Restore CONTROL register(s)
+ mov ecx, [eax + CONTEXT_Eip]
+ mov [esp], ecx
+
+ mov ecx, [eax + CONTEXT_Esp]
+ push ecx
+ mov ecx, [eax + CONTEXT_Ebp]
+ push ecx
+
+ pop ebp
+ pop esp
+
+ // Restore INTEGER register(s)
+ mov ecx, [eax + CONTEXT_Edi]
+ push ecx
+ mov ecx, [eax + CONTEXT_Esi]
+ push ecx
+ mov ecx, [eax + CONTEXT_Edx]
+ push ecx
+ mov ecx, [eax + CONTEXT_Ecx]
+ push ecx
+ mov ecx, [eax + CONTEXT_Ebx]
+ push ecx
+ mov ecx, [eax + CONTEXT_Eax]
+ push ecx
+
+ pop eax
+ pop ebx
+ pop ecx
+ pop edx
+ pop esi
+ pop edi
+
+ ret 8
LEAF_END RtlRestoreContext, _TEXT
-#else
-
- .globl C_FUNC(CONTEXT_CaptureContext)
-C_FUNC(CONTEXT_CaptureContext):
- push %eax
- mov 8(%esp), %eax
- mov %edi, CONTEXT_Edi(%eax)
- mov %esi, CONTEXT_Esi(%eax)
- mov %ebx, CONTEXT_Ebx(%eax)
- mov %edx, CONTEXT_Edx(%eax)
- mov %ecx, CONTEXT_Ecx(%eax)
- pop %ecx
- mov %ecx, CONTEXT_Eax(%eax)
- mov %ebp, CONTEXT_Ebp(%eax)
- mov (%esp), %edx
- mov %edx, CONTEXT_Eip(%eax)
- push %cs
- pop %edx
- mov %edx, CONTEXT_SegCs(%eax)
- pushf
- pop %edx
- mov %edx, CONTEXT_EFlags(%eax)
- lea 4(%esp), %edx
- mov %edx, CONTEXT_Esp(%eax)
- push %ss
- pop %edx
- mov %edx, CONTEXT_SegSs(%eax)
- testb $CONTEXT_FLOATING_POINT, CONTEXT_ContextFlags(%eax)
- je 0f
- fnsave CONTEXT_FloatSave(%eax)
- frstor CONTEXT_FloatSave(%eax)
-0:
- testb $CONTEXT_EXTENDED_REGISTERS, CONTEXT_ContextFlags(%eax)
- je 2f
- movdqu %xmm0, CONTEXT_Xmm0(%eax)
- movdqu %xmm1, CONTEXT_Xmm1(%eax)
- movdqu %xmm2, CONTEXT_Xmm2(%eax)
- movdqu %xmm3, CONTEXT_Xmm3(%eax)
- movdqu %xmm4, CONTEXT_Xmm4(%eax)
- movdqu %xmm5, CONTEXT_Xmm5(%eax)
- movdqu %xmm6, CONTEXT_Xmm6(%eax)
- movdqu %xmm7, CONTEXT_Xmm7(%eax)
-2:
- ret
-
-#endif
diff --git a/src/pal/src/arch/i386/exceptionhelper.S b/src/pal/src/arch/i386/exceptionhelper.S
index b7b34ace41..2061be26f8 100644
--- a/src/pal/src/arch/i386/exceptionhelper.S
+++ b/src/pal/src/arch/i386/exceptionhelper.S
@@ -8,35 +8,36 @@
//////////////////////////////////////////////////////////////////////////
//
-// This function creates a stack frame right below the target frame, restores all callee
-// saved registers from the passed in context, sets the RSP to that frame and sets the
-// return address to the target frame's RIP.
-// Then it uses the ThrowExceptionHelper to throw the passed in exception from that context.
// EXTERN_C void ThrowExceptionFromContextInternal(CONTEXT* context, PAL_SEHException* ex);
+//
+// This function creates a stack frame right below the target frame, restores all callee
+// saved registers from the passed in context, sets the SP to that frame and sets the
+// return address to the target frame's IP.
+// Then it uses the ThrowExceptionHelper to throw the passed in exception from that context.
+//
+//////////////////////////////////////////////////////////////////////////
+
LEAF_ENTRY ThrowExceptionFromContextInternal, _TEXT
- // Save the RBP to the stack so that the unwind can work at the instruction after
- // loading the RBP from the context, but before loading the RSP from the context.
- push_nonvol_reg rbp
- mov r12, [rdi + CONTEXT_R12]
- mov r13, [rdi + CONTEXT_R13]
- mov r14, [rdi + CONTEXT_R14]
- mov r15, [rdi + CONTEXT_R15]
- mov rbx, [rdi + CONTEXT_Rbx]
- mov rbp, [rdi + CONTEXT_Rbp]
- mov rsp, [rdi + CONTEXT_Rsp]
- // The RSP was set to the target frame's value, so the current function's
- // CFA is now right at the RSP.
+ push ebp
+ mov eax, [esp + 12] // ebx: PAL_SEHException *
+ mov ebx, [esp + 8] // eax: CONTEXT *
+
+ mov ebp, [ebx + CONTEXT_Ebp]
+ mov esp, [ebx + CONTEXT_Esp]
+
+ // The ESP is re-initialized as the target frame's value, so the current function's
+ // CFA is now right at the ESP.
.cfi_def_cfa_offset 0
- // Indicate that now that we have moved the RSP to the target address,
- // the RBP is no longer saved in the current stack frame.
- .cfi_restore rbp
+ // Indicate that now that we have moved the RSP to the target address,
+ // the EBP is no longer saved in the current stack frame.
+ .cfi_restore ebp
- mov rax, [rdi + CONTEXT_Rip]
+ // Store PAL_SEHException as the first argument
+ push eax
// Store return address to the stack
- push_register rax
- // The PAL_SEHException pointer
- mov rdi, rsi
+ mov ebx, [ebx + CONTEXT_Eip]
+ push ebx
jmp EXTERNAL_C_FUNC(ThrowExceptionHelper)
LEAF_END ThrowExceptionFromContextInternal, _TEXT
diff --git a/src/pal/src/arch/i386/optimizedtls.cpp b/src/pal/src/arch/i386/optimizedtls.cpp
deleted file mode 100644
index 910a6eb931..0000000000
--- a/src/pal/src/arch/i386/optimizedtls.cpp
+++ /dev/null
@@ -1,237 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*++
-
-
-
-Module Name:
-
- optimizedtls.cpp
-
-Abstract:
-
- Implementation of platform-specific Thread local storage functions.
-
-
-
---*/
-
-#include "pal/thread.hpp"
-#include "pal/malloc.hpp"
-
-#include <pthread.h>
-
-#include "pal/dbgmsg.h"
-#include "pal/misc.h"
-#include "pal/debug.h"
-
-#include <stddef.h>
-
-using namespace CorUnix;
-
-SET_DEFAULT_DEBUG_CHANNEL(THREAD);
-
-#if defined(USE_OPTIMIZEDTLSGETTER)
-
-#define PAL_safe_offsetof(s,m) ((size_t)((ptrdiff_t)&(char&)(((s *)64)->m))-64)
-
-/*++
-Function:
- CorUnix::TLSMakeOptimizedGetter
-
- Creates a platform-optimized version of TlsGetValue compiled
- for a particular index.
-
- Generates the hot part of CorUnix::InternalGetCurrentThread
- as a chunk of highly optimized machine-specific code at runtime.
-
- Check the difference between CorUnix::InternalGetCurrentThread and
- CorUnix::InternalGetCurrentThreadSlow to see the C/C++ code that matches
- the code generated by this function.
---*/
-PAL_POPTIMIZEDTLSGETTER
-CorUnix::TLSMakeOptimizedGetter(
- IN CPalThread* pThread,
- IN DWORD dwTlsIndex)
-{
-#ifdef BIT64
-#pragma unused(pThread, dwTlsIndex)
- ERROR("TLSMakeOptimizedGetter not rewritten for amd64 yet.");
- return NULL;
-#else
- PAL_POPTIMIZEDTLSGETTER Ret = NULL;
- BYTE* p;
- int i = 0;
-
-#ifdef __APPLE__
-#define TLS_OPTIMIZED_GETTER_SIZE 118
-#else
-#define TLS_OPTIMIZED_GETTER_SIZE 115
-#endif
-
- p = (BYTE*)InternalMalloc(pThread, TLS_OPTIMIZED_GETTER_SIZE * sizeof(BYTE));
-
- if (p == NULL)
- {
- return Ret;
- }
-
- // Need to preserve %ecx, %edx, and %esi registers as specified in
- // GetThreadGeneric(void) in vm/i386/asmhelpers.s
- p[i++] = 0x51; // push %ecx
- p[i++] = 0x52; // push %edx
- p[i++] = 0x89; // mov %esp,%eax // %eax = sp;
- p[i++] = 0xe0;
- p[i++] = 0xc1; // shr $0x11,%eax // sp >> 17;
- p[i++] = 0xe8;
- p[i++] = 0x11;
- p[i++] = 0x89; // mov %eax,%edx // key = sp >> 17;
- p[i++] = 0xc2;
- p[i++] = 0xc1; // sar $0x7,%edx // key >> 7;
- p[i++] = 0xfa;
- p[i++] = 0x07;
- p[i++] = 0x29; // sub %edx,%eax // key -= key >> 7;
- p[i++] = 0xd0;
- p[i++] = 0x89; // mov %eax,%edx
- p[i++] = 0xc2;
- p[i++] = 0xc1; // sar $0x5,%edx // key >> 5;
- p[i++] = 0xfa;
- p[i++] = 0x05;
- p[i++] = 0x29; // sub %edx,%eax // key -= key >> 5;
- p[i++] = 0xd0;
- p[i++] = 0x89; // mov %eax,%edx
- p[i++] = 0xc2;
- p[i++] = 0xc1; // sar $0x3,%edx // key >> 3;
- p[i++] = 0xfa;
- p[i++] = 0x03;
- p[i++] = 0x29; // sub %edx,%eax // key -= key >> 3;
- p[i++] = 0xd0;
- p[i++] = 0x25; // and $0xff,%eax // key &= 0xFF;
- p[i++] = 0xff;
- p[i++] = 0x00;
- p[i++] = 0x00;
- p[i++] = 0x00;
- p[i++] = 0x8b; // mov (flush_counter),%ecx // %ecx = counter = flush_counter;
- p[i++] = 0x0d;
- *((DWORD*) &p[i]) = (DWORD)&flush_counter;
- i += sizeof(DWORD);
- p[i++] = 0x8b; // mov (thread_hints,%eax,4),%eax // %edx = pThread = thread_hints[key];
- p[i++] = 0x14;
- p[i++] = 0x85;
- *((DWORD*) &p[i]) = (DWORD)&thread_hints;
- i += sizeof(DWORD);
- p[i++] = 0x39; // cmp %esp,offsetof(CPalThread,tlsInfo)+offsetof(CThreadTLSInfo,minStack)(%edx)
- // if ((size_t)pThread->tlsInfo.minStack <= sp)
- p[i++] = 0xa2;
- *((DWORD*) &p[i]) = (DWORD)(PAL_safe_offsetof(CPalThread,tlsInfo)+PAL_safe_offsetof(CThreadTLSInfo,minStack));
- i += sizeof(DWORD);
- p[i++] = 0x77; // ja CallInternalGetCurrentThreadSlow:
- p[i++] = 0x19;
- p[i++] = 0x3b; // cmp offsetof(CPalThread,tlsInfo)+offsetof(CThreadTLSInfo,maxStack)(%edx),%esp
- // if (sp < (size_t)pThread->tlsInfo.maxStack)
- p[i++] = 0xa2;
- *((DWORD*) &p[i]) = (DWORD)(PAL_safe_offsetof(CPalThread,tlsInfo)+PAL_safe_offsetof(CThreadTLSInfo,maxStack));
- i += sizeof(DWORD);
- p[i++] = 0x73; // jae CallInternalGetCurrentThreadSlow:
- p[i++] = 0x11;
- p[i++] = 0x39; // cmp (flush_counter),%ecx // if (counter == flush_counter)
- p[i++] = 0x0d;
- *((DWORD*) &p[i]) = (DWORD)&flush_counter;
- i += sizeof(DWORD);
- p[i++] = 0x75; // jne CallInternalGetCurrentThreadSlow:
- p[i++] = 0x09;
- if (dwTlsIndex != THREAD_OBJECT_TLS_INDEX)
- {
- p[i++] = 0x8b; // mov offsetof(pThread->tlsSlots[dwTlsIndex])(%edx),%eax // %eax = pThread->tlsSlots[dwTlsIndex];
- p[i++] = 0x82;
- *((DWORD*) &p[i]) = (DWORD)(PAL_safe_offsetof(CPalThread,tlsInfo)+PAL_safe_offsetof(CThreadTLSInfo,tlsSlots[dwTlsIndex]));
- i += sizeof(DWORD);
- }
- else
- {
- p[i++] = 0x89; // mov %edx,%eax // %eax = pThread;
- p[i++] = 0xd0;
- p[i++] = 0x90; // nop
- p[i++] = 0x90; // nop
- p[i++] = 0x90; // nop
- p[i++] = 0x90; // nop
- }
- p[i++] = 0x5a; // pop %edx
- p[i++] = 0x59; // pop %ecx
- p[i++] = 0xc3; // ret
- // CallInternalGetCurrentThreadSlow:
- p[i++] = 0x5a; // pop %edx
- p[i++] = 0x59; // pop %ecx
- p[i++] = 0x8d; // lea (thread_hints,%eax,4),%eax // %eax = &thread_hints[key];
- p[i++] = 0x04;
- p[i++] = 0x85;
- *((DWORD*) &p[i]) = (DWORD)&thread_hints;
- i += sizeof(DWORD);
- p[i++] = 0x55; // push %ebp
- p[i++] = 0x89; // mov %esp,%ebp
- p[i++] = 0xe5;
- p[i++] = 0x51; // push %ecx
- p[i++] = 0x89; // mov %esp,%ecx // this is the reference esp - need to match the reference esp used in the fast path.
- p[i++] = 0xe1;
- p[i++] = 0x52; // push %edx
-#ifdef __APPLE__
- // establish 16-byte stack alignment
- p[i++] = 0x83; // subl $8,%esp
- p[i++] = 0xec;
- p[i++] = 0x08;
-#endif
- p[i++] = 0x50; // push %eax // store &thread_hints[key] on stack as 2nd argument;
- p[i++] = 0x51; // push %ecx // reference esp - The 1st argument for call to InternalGetCurrentThreadSlow.
- p[i++] = 0xe8; // call InternalGetCurrentThreadSlow
- *((DWORD*) &p[i]) = (DWORD)&InternalGetCurrentThreadSlow - (DWORD)(&p[i+sizeof(DWORD)]);
- i += sizeof(DWORD);
-#ifdef __APPLE__
- p[i++] = 0x83; // addl $16,%esp
- p[i++] = 0xc4;
- p[i++] = 0x10;
-#else
- p[i++] = 0x83; // addl $8,%esp
- p[i++] = 0xc4;
- p[i++] = 0x08;
-#endif
- if (dwTlsIndex != THREAD_OBJECT_TLS_INDEX)
- {
- p[i++] = 0x8b; // mov offsetof(pThread->tlsSlots[dwTlsIndex])(%eax),%eax // %eax = pThread->tlsSlots[dwTlsIndex];
- p[i++] = 0x80;
- *((DWORD*) &p[i]) = (DWORD)(PAL_safe_offsetof(CPalThread,tlsInfo)+PAL_safe_offsetof(CThreadTLSInfo,tlsSlots[dwTlsIndex]));
- i += sizeof(DWORD);
- }
- p[i++] = 0x5a; // pop %edx
- p[i++] = 0x59; // pop %ecx
- p[i++] = 0xc9; // leave
- p[i++] = 0xc3; // ret
-
- if (i > TLS_OPTIMIZED_GETTER_SIZE)
- {
- ASSERT("Invalid TLS_OPTIMIZED_GETTER_SIZE %d\n", i);
- }
-
- DBG_FlushInstructionCache(p, TLS_OPTIMIZED_GETTER_SIZE * sizeof(BYTE));
-
- Ret = (PAL_POPTIMIZEDTLSGETTER)p;
-
- return Ret;
-#endif // BIT64 else
-}
-
-/*++
-Function:
- TLSFreeOptimizedGetter
-
- Frees a function created by MakeOptimizedTlsGetter().
---*/
-VOID
-CorUnix::TLSFreeOptimizedGetter(
- IN PAL_POPTIMIZEDTLSGETTER pOptimizedTlsGetter)
-{
- InternalFree(InternalGetCurrentThread(), (void *)pOptimizedTlsGetter);
-}
-
-#endif // USE_OPTIMIZEDTLSGETTER
diff --git a/src/pal/src/config.h.in b/src/pal/src/config.h.in
index 7a53c8cb5d..4d21fb70e4 100644
--- a/src/pal/src/config.h.in
+++ b/src/pal/src/config.h.in
@@ -43,7 +43,6 @@
#cmakedefine01 HAVE_LOCALTIME_R
#cmakedefine01 HAVE_GMTIME_R
#cmakedefine01 HAVE_TIMEGM
-#cmakedefine01 HAVE__SNWPRINTF
#cmakedefine01 HAVE_POLL
#cmakedefine01 HAVE_STATVFS
#cmakedefine01 HAVE_THREAD_SELF
diff --git a/src/pal/src/configure.cmake b/src/pal/src/configure.cmake
index cc38bc8541..a53e0db51e 100644
--- a/src/pal/src/configure.cmake
+++ b/src/pal/src/configure.cmake
@@ -13,7 +13,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL SunOS)
set(CMAKE_REQUIRED_INCLUDES /opt/local/include)
endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin AND NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
- set(CMAKE_REQUIRED_DEFINITIONS "-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L")
+ set(CMAKE_REQUIRED_DEFINITIONS "-D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L")
endif()
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_FILE_OFFSET_BITS=64)
@@ -33,7 +33,15 @@ check_include_files(sys/lwp.h HAVE_SYS_LWP_H)
check_include_files(lwp.h HAVE_LWP_H)
check_include_files(libunwind.h HAVE_LIBUNWIND_H)
check_include_files(runetype.h HAVE_RUNETYPE_H)
+
+if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
+ set(CMAKE_REQUIRED_FLAGS "-ldl")
+endif()
check_include_files(lttng/tracepoint.h HAVE_LTTNG_TRACEPOINT_H)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
+ unset(CMAKE_REQUIRED_FLAGS)
+endif()
+
check_include_files(uuid/uuid.h HAVE_LIBUUID_H)
check_include_files(sys/sysctl.h HAVE_SYS_SYSCTL_H)
check_include_files(gnu/lib-names.h HAVE_GNU_LIBNAMES_H)
@@ -62,7 +70,6 @@ check_function_exists(sysconf HAVE_SYSCONF)
check_function_exists(localtime_r HAVE_LOCALTIME_R)
check_function_exists(gmtime_r HAVE_GMTIME_R)
check_function_exists(timegm HAVE_TIMEGM)
-check_function_exists(_snwprintf HAVE__SNWPRINTF)
check_function_exists(poll HAVE_POLL)
check_function_exists(statvfs HAVE_STATVFS)
check_function_exists(thread_self HAVE_THREAD_SELF)
diff --git a/src/pal/src/cruntime/lstr.cpp b/src/pal/src/cruntime/lstr.cpp
index 2267d8491b..4502b025aa 100644
--- a/src/pal/src/cruntime/lstr.cpp
+++ b/src/pal/src/cruntime/lstr.cpp
@@ -24,141 +24,6 @@ Abstract:
SET_DEFAULT_DEBUG_CHANNEL(CRT);
-
-/*++
-Function:
- lstrcatW
-
-The lstrcat function appends one string to another.
-
-Parameters
-
-lpString1 [in/out] Pointer to a null-terminated string. The buffer must be large
- enough to contain both strings.
-lpString2 [in] Pointer to the null-terminated string to be appended to the
- string specified in the lpString1 parameter.
-
-Return Values
-
-If the function succeeds, the return value is a pointer to the buffer.
-If the function fails, the return value is NULL.
-
---*/
-LPWSTR
-PALAPI
-lstrcatW(
- IN OUT LPWSTR lpString1,
- IN LPCWSTR lpString2)
-{
- LPWSTR lpStart = lpString1;
-
- PERF_ENTRY(lstrcatW);
- ENTRY("lstrcatW (lpString1=%p (%S), lpString2=%p (%S))\n",
- lpString1?lpString1:W16_NULLSTRING,
- lpString1?lpString1:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING);
-
- if (lpString1 == NULL)
- {
- ERROR("invalid lpString1 argument\n");
- LOGEXIT("lstrcatW returning LPWSTR NULL\n");
- PERF_EXIT(lstrcatW);
- return NULL;
- }
-
- if (lpString2 == NULL)
- {
- ERROR("invalid lpString2 argument\n");
- LOGEXIT("lstrcatW returning LPWSTR NULL\n");
- PERF_EXIT(lstrcatW);
- return NULL;
- }
-
- /* find end of source string */
- while (*lpString1)
- {
- lpString1++;
- }
-
- /* concatenate new string */
- while(*lpString2)
- {
- *lpString1++ = *lpString2++;
- }
-
- /* add terminating null */
- *lpString1 = '\0';
-
- LOGEXIT("lstrcatW returning LPWSTR %p (%S)\n", lpStart, lpStart);
- PERF_EXIT(lstrcatW);
- return lpStart;
-}
-
-
-/*++
-Function:
- lstrcpyW
-
-The lstrcpy function copies a string to a buffer.
-
-To copy a specified number of characters, use the lstrcpyn function.
-
-Parameters
-
-lpString1 [out] Pointer to a buffer to receive the contents of the string pointed
- to by the lpString2 parameter. The buffer must be large enough to
- contain the string, including the terminating null character.
-
-lpString2 [in] Pointer to the null-terminated string to be copied.
-
-Return Values
-
-If the function succeeds, the return value is a pointer to the buffer.
-If the function fails, the return value is NULL.
-
---*/
-LPWSTR
-PALAPI
-lstrcpyW(
- OUT LPWSTR lpString1,
- IN LPCWSTR lpString2)
-{
- LPWSTR lpStart = lpString1;
-
- PERF_ENTRY(lstrcpyW);
- ENTRY("lstrcpyW (lpString1=%p, lpString2=%p (%S))\n",
- lpString1?lpString1:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING);
-
- if (lpString1 == NULL)
- {
- ERROR("invalid lpString1 argument\n");
- LOGEXIT("lstrcpyW returning LPWSTR NULL\n");
- PERF_EXIT(lstrcpyW);
- return NULL;
- }
-
- if (lpString2 == NULL)
- {
- ERROR("invalid lpString2 argument\n");
- LOGEXIT("lstrcpyW returning LPWSTR NULL\n");
- PERF_EXIT(lstrcpyW);
- return NULL;
- }
-
- /* copy source string to destination string */
- while(*lpString2)
- {
- *lpString1++ = *lpString2++;
- }
-
- /* add terminating null */
- *lpString1 = '\0';
-
- LOGEXIT("lstrcpyW returning LPWSTR %p (%S)\n", lpStart, lpStart);
- PERF_EXIT(lstrcpyW);
- return lpStart;
-}
-
-
/*++
Function:
lstrlenA
@@ -239,78 +104,3 @@ lstrlenW(
PERF_EXIT(lstrlenW);
return nChar;
}
-
-
-/*++
-Function:
- lstrcpynW
-
-The lstrcpyn function copies a specified number of characters from a
-source string into a buffer.
-
-Parameters
-
-lpString1 [out] Pointer to a buffer into which the function copies characters.
- The buffer must be large enough to contain the number of TCHARs
- specified by iMaxLength, including room for a terminating null character.
-lpString2 [in] Pointer to a null-terminated string from which the function copies
- characters.
-iMaxLength [in] Specifies the number of TCHARs to be copied from the string pointed
- to by lpString2 into the buffer pointed to by lpString1, including a
- terminating null character.
-
-Return Values
-
-If the function succeeds, the return value is a pointer to the buffer.
-If the function fails, the return value is NULL.
-
---*/
-LPWSTR
-PALAPI
-lstrcpynW(
- OUT LPWSTR lpString1,
- IN LPCWSTR lpString2,
- IN int iMaxLength)
-{
- LPWSTR lpStart = lpString1;
-
- PERF_ENTRY(lstrcpynW);
- ENTRY("lstrcpynW (lpString1=%p, lpString2=%p (%S), iMaxLength=%d)\n",
- lpString1?lpString1:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING, lpString2?lpString2:W16_NULLSTRING, iMaxLength);
-
- if (lpString1 == NULL)
- {
- ERROR("invalid lpString1 argument\n");
- LOGEXIT("lstrcpynW returning LPWSTR NULL\n");
- PERF_EXIT(lstrcpynW);
- return NULL;
- }
-
- if (lpString2 == NULL)
- {
- ERROR("invalid lpString2 argument\n");
- LOGEXIT("lstrcpynW returning LPWSTR NULL\n");
- PERF_EXIT(lstrcpynW);
- return NULL;
- }
-
- /* copy source string to destination string */
- while(iMaxLength > 1 && *lpString2)
- {
- *lpString1++ = *lpString2++;
- iMaxLength--;
- }
-
- /* add terminating null */
- if (iMaxLength > 0)
- {
- *lpString1 = '\0';
- }
-
- LOGEXIT("lstrcpynW returning LPWSTR %p (%S)\n", lpStart, lpStart);
- PERF_EXIT(lstrcpynW);
- return lpStart;
-
-}
-
-
diff --git a/src/pal/src/cruntime/math.cpp b/src/pal/src/cruntime/math.cpp
index 7075fd60f9..08f4192998 100644
--- a/src/pal/src/cruntime/math.cpp
+++ b/src/pal/src/cruntime/math.cpp
@@ -35,6 +35,12 @@ Abstract:
#define IS_DBL_NEGZERO(x) (((*((INT64*)((void*)&x))) & I64(0xFFFFFFFFFFFFFFFF)) == I64(0x8000000000000000))
+#define PAL_NAN_FLT sqrtf(-1.0f)
+#define PAL_POSINF_FLT -logf(0.0f)
+#define PAL_NEGINF_FLT logf(0.0f)
+
+#define IS_FLT_NEGZERO(x) (((*((INT32*)((void*)&x))) & 0xFFFFFFFF) == 0x80000000)
+
SET_DEFAULT_DEBUG_CHANNEL(CRT);
/*++
@@ -422,3 +428,364 @@ PALIMPORT double __cdecl PAL_pow(double x, double y)
PERF_EXIT(pow);
return ret;
}
+
+/*++
+Function:
+ _finitef
+
+Determines whether given single-precision floating point value is finite.
+
+Return Value
+
+_finitef returns a nonzero value (TRUE) if its argument x is not
+infinite, that is, if -INF < x < +INF. It returns 0 (FALSE) if the
+argument is infinite or a NaN.
+
+Parameter
+
+x Single-precision floating-point value
+
+--*/
+int __cdecl _finitef(float x)
+{
+ int ret;
+ PERF_ENTRY(_finitef);
+ ENTRY("_finitef (x=%f)\n", x);
+
+#if defined(_IA64_) && defined (_HPUX_)
+ ret = !isnan(x) && (x != PAL_POSINF_FLT) && (x != PAL_NEGINF_FLT);
+#else
+ ret = isfinite(x);
+#endif
+
+ LOGEXIT("_finitef returns int %d\n", ret);
+ PERF_EXIT(_finitef);
+ return ret;
+}
+
+/*++
+Function:
+ _isnanf
+
+See MSDN doc
+--*/
+int __cdecl _isnanf(float x)
+{
+ int ret;
+ PERF_ENTRY(_isnanf);
+ ENTRY("_isnanf (x=%f)\n", x);
+
+ ret = isnan(x);
+
+ LOGEXIT("_isnanf returns int %d\n", ret);
+ PERF_EXIT(_isnanf);
+ return ret;
+}
+
+/*++
+Function:
+ _copysignf
+
+See MSDN doc
+--*/
+float __cdecl _copysignf(float x, float y)
+{
+ float ret;
+ PERF_ENTRY(_copysignf);
+ ENTRY("_copysignf (x=%f, y=%f)\n", x, y);
+
+ ret = copysign(x, y);
+
+ LOGEXIT("_copysignf returns float %f\n", ret);
+ PERF_EXIT(_copysignf);
+ return ret;
+}
+
+/*++
+Function:
+ acosf
+
+See MSDN.
+--*/
+PALIMPORT float __cdecl PAL_acosf(float x)
+{
+ float ret;
+ PERF_ENTRY(acosf);
+ ENTRY("acosf (x=%f)\n", x);
+
+#if !HAVE_COMPATIBLE_ACOS
+ errno = 0;
+#endif // HAVE_COMPATIBLE_ACOS
+
+ ret = acosf(x);
+
+#if !HAVE_COMPATIBLE_ACOS
+ if (errno == EDOM)
+ {
+ ret = PAL_NAN_FLT; // NaN
+ }
+#endif // HAVE_COMPATIBLE_ACOS
+
+ LOGEXIT("acosf returns float %f\n", ret);
+ PERF_EXIT(acosf);
+ return ret;
+}
+
+/*++
+Function:
+ asinf
+
+See MSDN.
+--*/
+PALIMPORT float __cdecl PAL_asinf(float x)
+{
+ float ret;
+ PERF_ENTRY(asinf);
+ ENTRY("asinf (x=%f)\n", x);
+
+#if !HAVE_COMPATIBLE_ASIN
+ errno = 0;
+#endif // HAVE_COMPATIBLE_ASIN
+
+ ret = asinf(x);
+
+#if !HAVE_COMPATIBLE_ASIN
+ if (errno == EDOM)
+ {
+ ret = PAL_NAN_FLT; // NaN
+ }
+#endif // HAVE_COMPATIBLE_ASIN
+
+ LOGEXIT("asinf returns float %f\n", ret);
+ PERF_EXIT(asinf);
+ return ret;
+}
+
+/*++
+Function:
+ atan2f
+
+See MSDN.
+--*/
+PALIMPORT float __cdecl PAL_atan2f(float y, float x)
+{
+ float ret;
+ PERF_ENTRY(atan2f);
+ ENTRY("atan2f (y=%f, x=%f)\n", y, x);
+
+#if !HAVE_COMPATIBLE_ATAN2
+ errno = 0;
+#endif // !HAVE_COMPATIBLE_ATAN2
+
+ ret = atan2f(y, x);
+
+#if !HAVE_COMPATIBLE_ATAN2
+ if ((errno == EDOM) && (x == 0.0f) && (y == 0.0f))
+ {
+ const float sign_x = copysign(1.0f, x);
+ const float sign_y = copysign(1.0f, y);
+
+ if (sign_x > 0)
+ {
+ ret = copysign(0.0f, sign_y);
+ }
+ else
+ {
+ ret = copysign(atan2f(0.0f, -1.0f), sign_y);
+ }
+ }
+#endif // !HAVE_COMPATIBLE_ATAN2
+
+ LOGEXIT("atan2f returns float %f\n", ret);
+ PERF_EXIT(atan2f);
+ return ret;
+}
+
+/*++
+Function:
+ expf
+
+See MSDN.
+--*/
+PALIMPORT float __cdecl PAL_expf(float x)
+{
+ float ret;
+ PERF_ENTRY(expf);
+ ENTRY("expf (x=%f)\n", x);
+
+#if !HAVE_COMPATIBLE_EXP
+ if (x == 1.0f)
+ {
+ ret = M_E;
+ }
+ else
+ {
+#endif // HAVE_COMPATIBLE_EXP
+
+ ret = expf(x);
+
+#if !HAVE_COMPATIBLE_EXP
+ }
+#endif // HAVE_COMPATIBLE_EXP
+
+ LOGEXIT("expf returns float %f\n", ret);
+ PERF_EXIT(expf);
+ return ret;
+}
+
+/*++
+Function:
+ logf
+
+See MSDN.
+--*/
+PALIMPORT float __cdecl PAL_logf(float x)
+{
+ float ret;
+ PERF_ENTRY(logf);
+ ENTRY("logf (x=%f)\n", x);
+
+#if !HAVE_COMPATIBLE_LOG
+ errno = 0;
+#endif // !HAVE_COMPATIBLE_LOG
+
+ ret = logf(x);
+
+#if !HAVE_COMPATIBLE_LOG
+ if ((errno == EDOM) && (x < 0))
+ {
+ ret = PAL_NAN_FLT; // NaN
+ }
+#endif // !HAVE_COMPATIBLE_LOG
+
+ LOGEXIT("logf returns float %f\n", ret);
+ PERF_EXIT(logf);
+ return ret;
+}
+
+/*++
+Function:
+ log10f
+
+See MSDN.
+--*/
+PALIMPORT float __cdecl PAL_log10f(float x)
+{
+ float ret;
+ PERF_ENTRY(log10f);
+ ENTRY("log10f (x=%f)\n", x);
+
+#if !HAVE_COMPATIBLE_LOG10
+ errno = 0;
+#endif // !HAVE_COMPATIBLE_LOG10
+
+ ret = log10f(x);
+
+#if !HAVE_COMPATIBLE_LOG10
+ if ((errno == EDOM) && (x < 0))
+ {
+ ret = PAL_NAN_FLT; // NaN
+ }
+#endif // !HAVE_COMPATIBLE_LOG10
+
+ LOGEXIT("log10f returns float %f\n", ret);
+ PERF_EXIT(log10f);
+ return ret;
+}
+
+/*++
+Function:
+ powf
+
+See MSDN.
+--*/
+PALIMPORT float __cdecl PAL_powf(float x, float y)
+{
+ float ret;
+ PERF_ENTRY(powf);
+ ENTRY("powf (x=%f, y=%f)\n", x, y);
+
+#if !HAVE_COMPATIBLE_POW
+ if ((y == PAL_POSINF_FLT) && !isnan(x)) // +Inf
+ {
+ if (x == 1.0f)
+ {
+ ret = x;
+ }
+ else if (x == -1.0f)
+ {
+ ret = PAL_NAN_FLT; // NaN
+ }
+ else if ((x > -1.0f) && (x < 1.0f))
+ {
+ ret = 0.0f;
+ }
+ else
+ {
+ ret = PAL_POSINF_FLT; // +Inf
+ }
+ }
+ else if ((y == PAL_NEGINF_FLT) && !isnan(x)) // -Inf
+ {
+ if (x == 1.0f)
+ {
+ ret = x;
+ }
+ else if (x == -1.0f)
+ {
+ ret = PAL_NAN_FLT; // NaN
+ }
+ else if ((x > -1.0f) && (x < 1.0f))
+ {
+ ret = PAL_POSINF_FLT; // +Inf
+ }
+ else
+ {
+ ret = 0.0f;
+ }
+ }
+ else if (IS_FLT_NEGZERO(x) && (y == -1.0f))
+ {
+ ret = PAL_NEGINF_FLT; // -Inf
+ }
+ else if ((x == 0.0f) && (y < 0.0f))
+ {
+ ret = PAL_POSINF_FLT; // +Inf
+ }
+ else
+#endif // !HAVE_COMPATIBLE_POW
+
+ if ((y == 0.0f) && isnan(x))
+ {
+ // Windows returns NaN for powf(NaN, 0), but POSIX specifies
+ // a return value of 1 for that case. We need to return
+ // the same result as Windows.
+ ret = PAL_NAN_FLT;
+ }
+ else
+ {
+ ret = powf(x, y);
+ }
+
+#if !HAVE_VALID_NEGATIVE_INF_POW
+ if ((ret == PAL_POSINF_FLT) && (x < 0) && isfinite(x) && (ceilf(y / 2) != floorf(y / 2)))
+ {
+ ret = PAL_NEGINF_FLT; // -Inf
+ }
+#endif // !HAVE_VALID_NEGATIVE_INF_POW
+
+#if !HAVE_VALID_POSITIVE_INF_POW
+ /*
+ * The (ceil(y/2) == floor(y/2)) test is slower, but more robust for platforms where large y
+ * will return the wrong result for ((long) y % 2 == 0). See PAL_pow(double) above for more details.
+ */
+ if ((ret == PAL_NEGINF_FLT) && (x < 0) && isfinite(x) && (ceilf(y / 2) == floorf(y / 2)))
+ {
+ ret = PAL_POSINF_FLT; // +Inf
+ }
+#endif // !HAVE_VALID_POSITIVE_INF_POW
+
+ LOGEXIT("powf returns float %f\n", ret);
+ PERF_EXIT(powf);
+ return ret;
+}
diff --git a/src/pal/src/cruntime/mbstring.cpp b/src/pal/src/cruntime/mbstring.cpp
index dd4bcbbdce..ace2aa56c6 100644
--- a/src/pal/src/cruntime/mbstring.cpp
+++ b/src/pal/src/cruntime/mbstring.cpp
@@ -37,60 +37,6 @@ SET_DEFAULT_DEBUG_CHANNEL(CRT);
/*++
Function:
- _mbslen
-
-Determines the number of characters (code points) in a multibyte
-character string.
-
-Parameters
-
-string Points to a multibyte character string.
-
-Return Values
-
-The mbslen subroutine returns the number of multibyte characters in a
-multibyte character string. It returns 0 if the string parameter
-points to a null character or if a character cannot be formed from the
-string pointed to by this parameter.
-
---*/
-size_t
-__cdecl
-_mbslen(
- const unsigned char *string)
-{
- size_t ret = 0;
- CPINFO cpinfo;
- PERF_ENTRY(_mbslen);
- ENTRY("_mbslen (string=%p (%s))\n", string, string);
-
- if (string)
- {
- if (GetCPInfo(CP_ACP, &cpinfo) && cpinfo.MaxCharSize == 1)
- {
- ret = strlen((const char*)string);
- }
- else
- {
- while (*string)
- {
- if (IsDBCSLeadByteEx(CP_ACP, *string))
- {
- ++string;
- }
- ++string;
- ++ret;
- }
- }
- }
-
- LOGEXIT("_mbslen returning size_t %u\n", ret);
- PERF_EXIT(_mbslen);
- return ret;
-}
-
-/*++
-Function:
_mbsinc
Return Value
diff --git a/src/pal/src/cruntime/path.cpp b/src/pal/src/cruntime/path.cpp
index e5b955ebd9..4925af5b89 100644
--- a/src/pal/src/cruntime/path.cpp
+++ b/src/pal/src/cruntime/path.cpp
@@ -33,488 +33,6 @@ Revision History:
SET_DEFAULT_DEBUG_CHANNEL(CRT);
-
-/* ON_ERROR. A Helper macro for _?splitpath functions. */
-#define ON_ERROR if ( drive ) \
- {\
- drive[0] = 0;\
- }\
- if(dir)\
- {\
- dir[0] = 0;\
- }\
- if(fname)\
- {\
- fname[0] = 0;\
- }\
- if(ext)\
- {\
- ext[0] = 0;\
- }\
- goto done;\
-
-/*++
-Function:
- _wsplitpath
-
-See MSDN doc.
-
-Notes :
- This implementation ignores drive letters as they should not be
- present. If the drive argument is non-NULL, it always returns an empty
- string.
- File names in which the only period is at the beginning (like .bashrc, but
- not .bashrc.bak), the file is treated as having no extension
- (fname is ".bashrc", ext is "")
-
---*/
-void
-__cdecl
-_wsplitpath(
- const wchar_16 *dospath,
- wchar_16 *drive,
- wchar_16 *dir,
- wchar_16 *fname,
- wchar_16 *ext)
-{
- WCHAR path[_MAX_PATH+1];
- LPCWSTR slash_ptr = NULL;
- LPCWSTR period_ptr = NULL;
- INT size = 0;
-
- PERF_ENTRY(_wsplitpath);
- ENTRY("_wsplitpath (path=%p (%S), drive=%p, dir=%p, fname=%p, ext=%p)\n",
- dospath?dospath:W16_NULLSTRING,
- dospath?dospath:W16_NULLSTRING, drive, dir, fname, ext);
-
- /* Do performance intensive error checking only in debug builds.
-
- NOTE: This function must fail predictably across all platforms.
- Under Windows this function throw an access violation if NULL
- was passed in as the value for path.
-
- */
-#if _DEBUG
- if ( !dospath )
- {
- ERROR( "path cannot be NULL!\n" );
- }
-#endif
-
- if( lstrlenW( dospath ) >= _MAX_PATH )
- {
- ERROR("Path length is > _MAX_PATH (%d)!\n", _MAX_PATH);
- ON_ERROR;
- }
-
-
- PAL_wcscpy(path, dospath);
- FILEDosToUnixPathW(path);
-
- /* no drive letters in the PAL */
- if( drive != NULL )
- {
- drive[0] = 0;
- }
-
- /* find last path separator char */
- slash_ptr = PAL_wcsrchr(path, '/');
-
- if( slash_ptr == NULL )
- {
- TRACE("No path separator in path\n");
- slash_ptr = path - 1;
- }
- /* find extension separator, if any */
- period_ptr = PAL_wcsrchr(path, '.');
-
- /* make sure we only consider periods after the last path separator */
- if( period_ptr < slash_ptr )
- {
- period_ptr = NULL;
- }
-
- /* if the only period in the file is a leading period (denoting a hidden
- file), don't treat what follows as an extension */
- if( period_ptr == slash_ptr+1 )
- {
- period_ptr = NULL;
- }
-
- if( period_ptr == NULL )
- {
- TRACE("No extension in path\n");
- period_ptr = path + lstrlenW(path);
- }
-
- size = slash_ptr - path + 1;
- if( dir != NULL )
- {
- INT i;
-
- if( (size + 1 ) > _MAX_DIR )
- {
- ERROR("Directory component needs %d characters, _MAX_DIR is %d\n",
- size+1, _MAX_DIR);
- ON_ERROR;
- }
-
- memcpy(dir, path, size*sizeof(WCHAR));
- dir[size] = 0;
-
- /* only allow / separators in returned path */
- i = 0;
- while( dir[ i ] )
- {
- if( dir[ i ] == '\\' )
- {
- dir[i]='/';
- }
- i++;
- }
- }
-
- size = period_ptr-slash_ptr-1;
- if( fname != NULL )
- {
- if( (size+1) > _MAX_FNAME )
- {
- ERROR("Filename component needs %d characters, _MAX_FNAME is %d\n",
- size+1, _MAX_FNAME);
- ON_ERROR;
- }
- memcpy(fname, slash_ptr+1, size*sizeof(WCHAR));
- fname[size] = 0;
- }
-
- size = 1 + lstrlenW( period_ptr );
- if( ext != NULL )
- {
- if( size > _MAX_EXT )
- {
- ERROR("Extension component needs %d characters, _MAX_EXT is %d\n",
- size, _MAX_EXT);
- ON_ERROR;
- }
- memcpy(ext, period_ptr, size*sizeof(WCHAR));
- ext[size-1] = 0;
- }
-
- TRACE("Path components are '%S' '%S' '%S'\n", dir, fname, ext);
-
-done:
-
- LOGEXIT("_wsplitpath returns.\n");
- PERF_EXIT(_wsplitpath);
-}
-
-
-/*++
-Function:
- _splitpath
-
-See description above for _wsplitpath.
-
---*/
-void
-__cdecl
-_splitpath(
- const char *path,
- char *drive,
- char *dir,
- char *fname,
- char *ext)
-{
- WCHAR w_path[_MAX_PATH];
- WCHAR w_dir[_MAX_DIR];
- WCHAR w_fname[_MAX_FNAME];
- WCHAR w_ext[_MAX_EXT];
-
- PERF_ENTRY(_splitpath);
- ENTRY("_splitpath (path=%p (%s), drive=%p, dir=%p, fname=%p, ext=%p)\n",
- path?path:"NULL",
- path?path:"NULL", drive, dir, fname, ext);
-
- /* Do performance intensive error checking only in debug builds.
-
- NOTE: This function must fail predictably across all platforms.
- Under Windows this function throw an access violation if NULL
- was passed in as the value for path.
-
- */
-#if _DEBUG
- if ( !path )
- {
- ERROR( "path cannot be NULL!\n" );
- }
-
- if( strlen( path ) >= _MAX_PATH )
- {
- ERROR( "Path length is > _MAX_PATH (%d)!\n", _MAX_PATH);
- }
-#endif
-
- /* no drive letters in the PAL */
- if(drive)
- {
- drive[0] = '\0';
- }
-
- if(0 == MultiByteToWideChar(CP_ACP, 0, path, -1, w_path, _MAX_PATH))
- {
- ASSERT("MultiByteToWideChar failed!\n");
- ON_ERROR;
- }
-
- /* Call up to Unicode version; pass NULL for parameters the caller doesn't
- care about */
- _wsplitpath(w_path, NULL, dir?w_dir:NULL,
- fname?w_fname:NULL, ext?w_ext:NULL);
-
- /* Convert result back to MultiByte; report conversion errors but don't
- stop because of them */
-
- if(dir)
- {
- if(0 == WideCharToMultiByte(CP_ACP, 0, w_dir, -1, dir, _MAX_DIR,
- NULL, NULL))
- {
- ASSERT("WideCharToMultiByte failed!\n");
- ON_ERROR;
- }
- }
- if(fname)
- {
- if(0 == WideCharToMultiByte(CP_ACP, 0, w_fname, -1, fname, _MAX_FNAME,
- NULL, NULL))
- {
- ASSERT("WideCharToMultiByte failed!\n");
- ON_ERROR;
- }
- }
- if(ext)
- {
- if(0 == WideCharToMultiByte(CP_ACP, 0, w_ext, -1, ext, _MAX_EXT,
- NULL, NULL))
- {
- ASSERT("WideCharToMultiByte failed!\n");
- ON_ERROR;
- }
- }
-
-done:
- LOGEXIT("_splitpath returns.\n");
- PERF_EXIT(_splitpath);
-}
-
-
-
-/*++
-Function:
- _makepath
-
-See MSDN doc.
-
---*/
-void
-__cdecl
-_makepath(
- char *path,
- const char *drive,
- const char *dir,
- const char *fname,
- const char *ext)
-{
- UINT Length = 0;
-
- PERF_ENTRY(_makepath);
- ENTRY( "_makepath (path=%p, drive=%p (%s), dir=%p (%s), fname=%p (%s), ext=%p (%s))\n",
- path, drive ? drive:"NULL", drive ? drive:"NULL", dir ? dir:"NULL", dir ? dir:"NULL", fname ? fname:"NULL", fname ? fname:"NULL",
- ext ? ext:"NULL",
- ext ? ext:"NULL");
-
- path[ 0 ] = '\0';
-
- /* According to the pal documentation, host operating systems that
- don't support drive letters, the "drive" parameter must always be null. */
- if ( drive != NULL && drive[0] != '\0' )
- {
- ASSERT( "The drive parameter must always be NULL on systems that don't"
- "support drive letters. drive is being ignored!.\n" );
- }
-
- if ( dir != NULL && dir[ 0 ] != '\0' )
- {
- UINT DirLength = strlen( dir );
- Length += DirLength ;
-
- if ( Length < _MAX_PATH )
- {
- strncat( path, dir, DirLength );
- if ( dir[ DirLength - 1 ] != '/' && dir[ DirLength - 1 ] != '\\' )
- {
- if ( Length + 1 < _MAX_PATH )
- {
- path[ Length ] = '/';
- Length++;
- path[ Length ] = '\0';
- }
- else
- {
- goto Max_Path_Error;
- }
- }
- }
- else
- {
- goto Max_Path_Error;
- }
- }
-
- if ( fname != NULL && fname[ 0 ] != '\0' )
- {
- UINT fNameLength = strlen( fname );
- Length += fNameLength;
-
- if ( Length < _MAX_PATH )
- {
- strncat( path, fname, fNameLength );
- }
- else
- {
- goto Max_Path_Error;
- }
- }
-
- if ( ext != NULL && ext[ 0 ] != '\0' )
- {
- UINT ExtLength = strlen( ext );
- Length += ExtLength;
-
- if ( ext[ 0 ] != '.' )
- {
- /* Add a '.' */
- if ( Length + 1 < _MAX_PATH )
- {
- path[ Length - ExtLength ] = '.';
- Length++;
- path[ Length - ExtLength ] = '\0';
- strncat( path, ext, ExtLength );
- }
- else
- {
- goto Max_Path_Error;
- }
- }
- else
- {
- /* Already has a '.' */
- if ( Length < _MAX_PATH )
- {
- strncat( path, ext, ExtLength );
- }
- else
- {
- goto Max_Path_Error;
- }
- }
- }
-
- FILEDosToUnixPathA( path );
- LOGEXIT( "_makepath returning void.\n" );
- PERF_EXIT(_makepath);
- return;
-
-Max_Path_Error:
-
- ERROR( "path cannot be greater then _MAX_PATH\n" );
- path[ 0 ] = '\0';
- LOGEXIT( "_makepath returning void \n" );
- PERF_EXIT(_makepath);
- return;
-}
-
-/*++
-Function:
- _wmakepath
-
-See MSDN doc.
-
---*/
-void
-__cdecl
-_wmakepath(
- wchar_16 *path,
- const wchar_16 *drive,
- const wchar_16 *dir,
- const wchar_16 *fname,
- const wchar_16 *ext)
-{
- CHAR Dir[ _MAX_DIR ]={0};
- CHAR FileName[ _MAX_FNAME ]={0};
- CHAR Ext[ _MAX_EXT ]={0};
- CHAR Path[ _MAX_PATH ]={0};
-
- PERF_ENTRY(_wmakepath);
- ENTRY("_wmakepath (path=%p, drive=%p (%S), dir=%p (%S), fname=%p (%S), ext=%p (%S))\n",
- path, drive ? drive:W16_NULLSTRING, drive ? drive:W16_NULLSTRING, dir ? dir:W16_NULLSTRING, dir ? dir:W16_NULLSTRING,
- fname ? fname:W16_NULLSTRING,
- fname ? fname:W16_NULLSTRING, ext ? ext:W16_NULLSTRING, ext ? ext:W16_NULLSTRING);
-
- /* According to the pal documentation, host operating systems that
- don't support drive letters, the "drive" parameter must always be null. */
- if ( drive != NULL && drive[0] != '\0' )
- {
- ASSERT( "The drive parameter must always be NULL on systems that don't"
- "support drive letters. drive is being ignored!.\n" );
- }
-
- if ((dir != NULL) && WideCharToMultiByte( CP_ACP, 0, dir, -1, Dir,
- _MAX_DIR, NULL, NULL ) == 0 )
- {
- ASSERT( "An error occurred while converting dir to multibyte."
- "Possible error: Length of dir is greater than _MAX_DIR.\n" );
- goto error;
- }
-
- if ((fname != NULL) && WideCharToMultiByte( CP_ACP, 0, fname, -1, FileName,
- _MAX_FNAME, NULL, NULL ) == 0 )
- {
- ASSERT( "An error occurred while converting fname to multibyte."
- "Possible error: Length of fname is greater than _MAX_FNAME.\n" );
- goto error;
- }
-
- if ((ext != NULL) && WideCharToMultiByte( CP_ACP, 0, ext, -1, Ext,
- _MAX_EXT, NULL, NULL ) == 0 )
- {
- ASSERT( "An error occurred while converting ext to multibyte."
- "Possible error: Length of ext is greater than _MAX_EXT.\n" );
- goto error;
- }
-
- /* Call up to the ANSI _makepath. */
- _makepath_s( Path, sizeof(Path), NULL, Dir, FileName, Ext );
-
- if ( MultiByteToWideChar( CP_ACP, 0, Path, -1, path, _MAX_PATH ) == 0 )
- {
- ASSERT( "An error occurred while converting the back wide char."
- "Possible error: The length of combined path is greater "
- "than _MAX_PATH.\n" );
- goto error;
- }
-
- LOGEXIT("_wmakepath returns void\n");
- PERF_EXIT(_wmakepath);
- return;
-
-error:
- *path = '\0';
- LOGEXIT("_wmakepath returns void\n");
- PERF_EXIT(_wmakepath);
-}
-
-
/*++
Function:
_fullpath
diff --git a/src/pal/src/cruntime/printf.cpp b/src/pal/src/cruntime/printf.cpp
index 2d9d6e4b94..c437b8e39f 100644
--- a/src/pal/src/cruntime/printf.cpp
+++ b/src/pal/src/cruntime/printf.cpp
@@ -277,124 +277,6 @@ PAL_vprintf(
/*++
Function:
- wsprintfA
-
-See MSDN doc.
---*/
-int
-PALAPIV
-wsprintfA(
- OUT LPSTR buffer,
- IN LPCSTR format,
- ...)
-{
- LONG Length;
- va_list ap;
-
- PERF_ENTRY(wsprintfA);
- ENTRY("wsprintfA (buffer=%p, format=%p (%s))\n", buffer, format, format);
-
- va_start(ap, format);
- Length = InternalVsnprintf(CorUnix::InternalGetCurrentThread(), buffer, 1024, format, ap);
- va_end(ap);
-
- LOGEXIT("wsprintfA returns int %d\n", Length);
- PERF_EXIT(wsprintfA);
- return Length;
-}
-
-/*++
-Function:
- wsprintfW
-
-See MSDN doc.
---*/
-int
-PALAPIV
-wsprintfW(
- OUT LPWSTR buffer,
- IN LPCWSTR format,
- ...)
-{
- LONG Length;
- va_list ap;
-
- PERF_ENTRY(wsprintfW);
- ENTRY("wsprintfW (buffer=%p, format=%p (%S))\n", buffer, format, format);
-
- va_start(ap, format);
- Length = PAL__wvsnprintf(buffer, 1024, format, ap);
- va_end(ap);
-
- LOGEXIT("wsprintfW returns int %d\n", Length);
- PERF_EXIT(wsprintfW);
- return Length;
-}
-
-
-/*++
-Function:
- _snprintf
-
-See MSDN doc.
---*/
-int
-__cdecl
-_snprintf(
- char *buffer,
- size_t count,
- const char *format,
- ...)
-{
- LONG Length;
- va_list ap;
-
- PERF_ENTRY(_snprintf);
- ENTRY("_snprintf (buffer=%p, count=%lu, format=%p (%s))\n",
- buffer, (unsigned long) count, format, format);
-
- va_start(ap, format);
- Length = InternalVsnprintf(CorUnix::InternalGetCurrentThread(), buffer, count, format, ap);
- va_end(ap);
-
- LOGEXIT("_snprintf returns int %d\n", Length);
- PERF_EXIT(_snprintf);
- return Length;
-}
-
-
-/*++
-Function:
- _snwprintf
-
-See MSDN doc.
---*/
-int
-__cdecl
-_snwprintf(
- wchar_16 *buffer,
- size_t count,
- const wchar_16 *format,
- ...)
-{
- LONG Length;
- va_list ap;
-
- PERF_ENTRY(_snwprintf);
- ENTRY("_snwprintf (buffer=%p, count=%lu, format=%p (%S))\n",
- buffer, (unsigned long) count, format, format);
-
- va_start(ap, format);
- Length = PAL__wvsnprintf(buffer, count, format, ap);
- va_end(ap);
-
- LOGEXIT("_snwprintf returns int %d\n", Length);
- PERF_EXIT(_snwprintf);
- return Length;
-}
-
-/*++
-Function:
fwprintf
See MSDN doc.
@@ -1483,63 +1365,6 @@ int PAL_wvsscanf(LPCWSTR Buffer, LPCWSTR Format, va_list ap)
/*++
Function:
- PAL_sscanf
-
-See MSDN doc.
---*/
-int
-__cdecl
-PAL_sscanf(
- const char *buffer,
- const char *format,
- ...)
-{
- int Length;
- va_list ap;
-
- PERF_ENTRY(sscanf);
- ENTRY("PAL_sscanf (buffer=%p (%s), format=%p (%s))\n", buffer, buffer, format, format);
-
- va_start(ap, format);
- Length = PAL_vsscanf(buffer, format, ap);
- va_end(ap);
-
- LOGEXIT("PAL_sscanf returns int %d\n", Length);
- PERF_EXIT(sscanf);
- return Length;
-}
-
-/*++
-Function:
- PAL_sprintf
-
-See MSDN doc.
---*/
-int
-__cdecl
-PAL_sprintf(
- char *buffer,
- const char *format,
- ...)
-{
- LONG Length;
- va_list ap;
-
- PERF_ENTRY(sprintf);
- ENTRY("PAL_sprintf (buffer=%p, format=%p (%s))\n", buffer, format, format);
-
- va_start(ap, format);
- Length = InternalVsnprintf(CorUnix::InternalGetCurrentThread(), buffer, 0x7fffffff, format, ap);
- va_end(ap);
-
- LOGEXIT("PAL_sprintf returns int %d\n", Length);
- PERF_EXIT(sprintf);
- return Length;
-}
-
-
-/*++
-Function:
PAL_swprintf
See MSDN doc.
@@ -1649,33 +1474,6 @@ PAL_vswprintf(wchar_16 *buffer,
}
-/*++
-Function:
- _vsnwprintf
-
-See MSDN doc.
---*/
-int
-__cdecl
-_vsnwprintf(wchar_16 *buffer,
- size_t count,
- const wchar_16 *format,
- va_list argptr)
-{
- LONG Length;
-
- PERF_ENTRY(_vsnwprintf);
- ENTRY("_vsnwprintf (buffer=%p, count=%lu, format=%p (%S), argptr=%p)\n",
- buffer, (unsigned long) count, format, format, argptr);
-
- Length = PAL__wvsnprintf(buffer, count, format, argptr);
-
- LOGEXIT("_vsnwprintf returns int %d\n", Length);
- PERF_EXIT(_vsnwprintf);
-
- return Length;
-}
-
#if SSCANF_CANNOT_HANDLE_MISSING_EXPONENT
/*++
Function:
diff --git a/src/pal/src/cruntime/string.cpp b/src/pal/src/cruntime/string.cpp
index 23781d8b39..abe6d136f0 100644
--- a/src/pal/src/cruntime/string.cpp
+++ b/src/pal/src/cruntime/string.cpp
@@ -151,61 +151,6 @@ _strlwr(
return orig;
}
-
-/*++
-Function:
- _swab
-
-Swaps bytes.
-
-Return Value
-
-None
-
-Parameters
-
-src Data to be copied and swapped
-dest Storage location for swapped data
-n Number of bytes to be copied and swapped
-
-Remarks
-
-The _swab function copies n bytes from src, swaps each pair of
-adjacent bytes, and stores the result at dest. The integer n should be
-an even number to allow for swapping. _swab is typically used to
-prepare binary data for transfer to a machine that uses a different
-byte order.
-
-Example
-
-char from[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-char to[] = "..........................";
-
-printf("Before:\n%s\n%s\n\n", from, to);
-_swab(from, to, strlen(from));
-printf("After:\n%s\n%s\n\n", from, to);
-
-Before:
-ABCDEFGHIJKLMNOPQRSTUVWXYZ
-..........................
-
-After:
-ABCDEFGHIJKLMNOPQRSTUVWXYZ
-BADCFEHGJILKNMPORQTSVUXWZY
-
---*/
-void
-__cdecl
-_swab(char *src, char *dest, int n)
-{
- PERF_ENTRY(_swab);
- ENTRY("_swab (src=%p (%s), dest=%p (%s), n=%d)\n", src?src:"NULL", src?src:"NULL", dest?dest:"NULL", dest?dest:"NULL", n);
- swab(src, dest, n);
- LOGEXIT("_swab returning\n");
- PERF_EXIT(_swab);
-}
-
-
/*++
Function:
PAL_strtoul
diff --git a/src/pal/src/cruntime/wchar.cpp b/src/pal/src/cruntime/wchar.cpp
index 2d244a639f..3de065e361 100644
--- a/src/pal/src/cruntime/wchar.cpp
+++ b/src/pal/src/cruntime/wchar.cpp
@@ -73,146 +73,6 @@ wtolower(wchar_16 c)
}
-/*******************************************************************************
-Function:
- Internal_i64tow
-
-Parameters:
- value
- - INT64 value to be converted to a string
- string
- - out buffer to place interger string
- radix
- - numeric base to convert to
- isI64
- - TRUE if value is INT64, FALSE if value is a long
-
-Note:
- - only a radix of ten (and value < 0) will result in a negative
- sign in the output buffer
-*******************************************************************************/
-LPWSTR Internal_i64tow(INT64 value, LPWSTR string, int radix, BOOL isI64)
-{
- int length = 0;
- int n;
- int r;
- UINT64 uval = value;
- LPWSTR stringPtr = string;
- int start = 0;
- int end;
- WCHAR tempCh;
-
- if (radix < 2 || radix > 36)
- {
- ASSERT( "Invalid radix, radix must be between 2 and 36\n" );
- SetLastError(ERROR_INVALID_PARAMETER);
- return string;
- }
- if (FALSE == isI64)
- {
- uval = (ULONG) uval;
- }
- if (10 == radix && value < 0)
- {
- uval = value * -1;
- }
- if(0 == uval)
- {
- ++length;
- *stringPtr++ = '0';
- }
- else while (uval > 0)
- {
- ++length;
- n = uval / radix;
- r = uval - (n * radix);
- uval /= radix;
- if (r > 9)
- {
- *stringPtr++ = r + 87;
- }
- else
- {
- *stringPtr++ = r + 48;
- }
- }
- if (10 == radix && value < 0)
- {
- *stringPtr++ = '-';
- ++length;
- }
- *stringPtr = 0; /* end the string */
-
- /* reverse the string */
- end = length - 1;
- while (start < end)
- {
- tempCh = string[start];
- string[start] = string[end];
- string[end] = tempCh;
- ++start;
- --end;
- }
-
- return string;
-}
-
-/*--
-Function:
- _itow
-
-16-bit wide character version of the ANSI tolower() function.
-
- --*/
-wchar_16 *
-__cdecl
-_itow(
- int value,
- wchar_16 *string,
- int radix)
-{
- wchar_16 *ret;
-
- PERF_ENTRY(_itow);
- ENTRY("_itow (value=%d, string=%p, radix=%d)\n",
- value, string, radix);
-
- ret = Internal_i64tow(value, string, radix, FALSE);
-
- LOGEXIT("_itow returns wchar_t* %p\n", ret);
- PERF_EXIT(_itow);
-
- return ret;
-}
-
-/*--
-Function:
- _i64tow
-
-See MSDN doc
---*/
-wchar_16 *
- __cdecl
-_i64tow(
- __int64 value,
- wchar_16 *string,
- int radix)
-{
- wchar_16 *ret;
-
- PERF_ENTRY(_i64tow);
- ENTRY("_i64tow (value=%ld, string=%p, radix=%d)\n",
- value, string, radix);
-
- ret = Internal_i64tow(value, string, radix, TRUE);
-
- LOGEXIT("_i64tow returns wchar_t* %p\n", ret);
- PERF_EXIT(_i64tow);
-
- return ret;
-}
-
-
/*--
Function:
_wtoi
@@ -1558,77 +1418,6 @@ PAL_wcstod( const wchar_16 * nptr, wchar_16 **endptr )
}
/*++
-Function :
-
- _ui64tow
-
-See MSDN for more details.
---*/
-wchar_16 *
-__cdecl
-_ui64tow( unsigned __int64 value , wchar_16 * string , int radix )
-{
- UINT ReversedIndex = 0;
- WCHAR ReversedString[ 65 ];
- LPWSTR lpString = string;
- UINT Index = 0;
-
- PERF_ENTRY(_ui64tow);
- ENTRY( "_ui64tow( value=%I64d, string=%p (%S), radix=%d )\n",
- value, string, string, radix );
-
- if ( !string )
- {
- ERROR( "string has to be a valid pointer.\n" );
- LOGEXIT( "_ui64tow returning NULL.\n" );
- PERF_EXIT(_ui64tow);
- return NULL;
- }
- if ( radix < 2 || radix > 36 )
- {
- ERROR( "radix has to be between 2 and 36.\n" );
- LOGEXIT( "_ui64tow returning NULL.\n" );
- PERF_EXIT(_ui64tow);
- return NULL;
- }
-
- if(0 == value)
- {
- ReversedString[0] = '0';
- Index++;
- }
- else while ( value )
- {
- int temp = value % radix;
- value /= radix;
-
- if ( temp < 10 )
- {
- ReversedString[ Index ] = temp + '0';
- Index++;
- }
- else
- {
- ReversedString[ Index ] = temp - 10 + 'a';
- Index++;
- }
- }
-
- /* Reverse the string. */
- ReversedIndex = Index;
- for ( Index = 0; ReversedIndex > 0; ReversedIndex--, Index++ )
- {
- string[ Index ] = ReversedString[ ReversedIndex - 1 ];
- }
-
- string[ Index ] = '\0';
- LOGEXIT( "_ui64tow returning %p (%S).\n", lpString , lpString );
- PERF_EXIT(_ui64tow);
- return lpString;
-}
-
-
-/*++
Function:
iswdigit
diff --git a/src/pal/src/debug/debug.cpp b/src/pal/src/debug/debug.cpp
index 5461ac6265..2f7d17cabe 100644
--- a/src/pal/src/debug/debug.cpp
+++ b/src/pal/src/debug/debug.cpp
@@ -92,29 +92,6 @@ static const char PAL_OUTPUTDEBUGSTRING[] = "PAL_OUTPUTDEBUGSTRING";
static const char PAL_RUN_ON_DEBUG_BREAK[] = "PAL_RUN_ON_DEBUG_BREAK";
#endif // ENABLE_RUN_ON_DEBUG_BREAK
-/* ------------------- Static function prototypes ----------------------------*/
-
-#if !HAVE_VM_READ && !HAVE_PROCFS_CTL && !HAVE_TTRACE
-static int
-DBGWriteProcMem_Int(DWORD processId, int *addr, int data);
-static int
-DBGWriteProcMem_IntWithMask(DWORD processId, int *addr, int data,
- unsigned int mask);
-#endif // !HAVE_VM_READ && !HAVE_PROCFS_CTL && !HAVE_TTRACE
-
-#if !HAVE_VM_READ && !HAVE_PROCFS_CTL
-
-static BOOL
-DBGAttachProcess(CPalThread *pThread, HANDLE hProcess, DWORD dwProcessId);
-
-static BOOL
-DBGDetachProcess(CPalThread *pThread, HANDLE hProcess, DWORD dwProcessId);
-
-static int
-DBGSetProcessAttached(CPalThread *pThread, HANDLE hProcess, BOOL bAttach);
-
-#endif // !HAVE_VM_READ && !HAVE_PROCFS_CTL
-
extern "C" {
/*++
@@ -566,457 +543,6 @@ SetThreadContext(
return ret;
}
-#if !HAVE_VM_READ && !HAVE_PROCFS_CTL && !HAVE_TTRACE
-/*++
-Function:
- DBGWriteProcMem_Int
-
-Abstract
- write one int to a process memory address
-
-Parameter
- processId : process handle
- addr : memory address where the int should be written
- data : int to be written in addr
-
-Return
- Return 1 if it succeeds, or 0 if it's fails
---*/
-static
-int
-DBGWriteProcMem_Int(IN DWORD processId,
- IN int *addr,
- IN int data)
-{
- if (PAL_PTRACE( PAL_PT_WRITE_D, processId, addr, data ) == -1)
- {
- if (errno == EFAULT)
- {
- ERROR("ptrace(PT_WRITE_D, pid:%d caddr_t:%p data:%x) failed "
- "errno:%d (%s)\n", processId, addr, data, errno, strerror(errno));
- SetLastError(ERROR_INVALID_ADDRESS);
- }
- else
- {
- ASSERT("ptrace(PT_WRITE_D, pid:%d caddr_t:%p data:%x) failed "
- "errno:%d (%s)\n", processId, addr, data, errno, strerror(errno));
- SetLastError(ERROR_INTERNAL_ERROR);
- }
- return 0;
- }
-
- return 1;
-}
-
-/*++
-Function:
- DBGWriteProcMem_IntWithMask
-
-Abstract
- write one int to a process memory address space using mask
-
-Parameter
- processId : process ID
- addr : memory address where the int should be written
- data : int to be written in addr
- mask : the mask used to write only a parts of data
-
-Return
- Return 1 if it succeeds, or 0 if it's fails
---*/
-static
-int
-DBGWriteProcMem_IntWithMask(IN DWORD processId,
- IN int *addr,
- IN int data,
- IN unsigned int mask )
-{
- int readInt;
-
- if (mask != ~0)
- {
- errno = 0;
- if (((readInt = PAL_PTRACE( PAL_PT_READ_D, processId, addr, 0 )) == -1)
- && errno)
- {
- if (errno == EFAULT)
- {
- ERROR("ptrace(PT_READ_D, pid:%d, caddr_t:%p, 0) failed "
- "errno:%d (%s)\n", processId, addr, errno, strerror(errno));
- SetLastError(ERROR_INVALID_ADDRESS);
- }
- else
- {
- ASSERT("ptrace(PT_READ_D, pid:%d, caddr_t:%p, 0) failed "
- "errno:%d (%s)\n", processId, addr, errno, strerror(errno));
- SetLastError(ERROR_INTERNAL_ERROR);
- }
-
- return 0;
- }
- data = (data & mask) | (readInt & ~mask);
- }
- return DBGWriteProcMem_Int(processId, addr, data);
-}
-#endif // !HAVE_VM_READ && !HAVE_PROCFS_CTL && !HAVE_TTRACE
-
-#if !HAVE_VM_READ && !HAVE_PROCFS_CTL
-
-/*++
-Function:
- DBGAttachProcess
-
-Abstract
-
- Attach the indicated process to the current process.
-
- if the indicated process is already attached by the current process, then
- increment the number of attachment pending. if ot, attach it to the current
- process (with PT_ATTACH).
-
-Parameter
- hProcess : handle to process to attach to
- processId : process ID to attach
-Return
- Return true if it succeeds, or false if it's fails
---*/
-static
-BOOL
-DBGAttachProcess(
- CPalThread *pThread,
- HANDLE hProcess,
- DWORD processId
- )
-{
- int attchmentCount;
- int savedErrno;
-#if HAVE_PROCFS_CTL
- int fd = -1;
- char ctlPath[1024];
-#endif // HAVE_PROCFS_CTL
-
- attchmentCount =
- DBGSetProcessAttached(pThread, hProcess, DBG_ATTACH);
-
- if (attchmentCount == -1)
- {
- /* Failed to set the process as attached */
- goto EXIT;
- }
-
- if (attchmentCount == 1)
- {
-#if HAVE_PROCFS_CTL
- struct timespec waitTime;
-
- // FreeBSD has some trouble when a series of attach/detach sequences
- // occurs too close together. When this happens, we'll be able to
- // attach to the process, but waiting for the process to stop
- // (either via writing "wait" to /proc/<pid>/ctl or via waitpid)
- // will hang. If we pause for a very short amount of time before
- // trying to attach, we don't run into this situation.
- waitTime.tv_sec = 0;
- waitTime.tv_nsec = 50000000;
- nanosleep(&waitTime, NULL);
-
- sprintf_s(ctlPath, sizeof(ctlPath), "/proc/%d/ctl", processId);
- fd = InternalOpen(ctlPath, O_WRONLY);
- if (fd == -1)
- {
- ERROR("Failed to open %s: errno is %d (%s)\n", ctlPath,
- errno, strerror(errno));
- goto DETACH1;
- }
-
- if (write(fd, CTL_ATTACH, sizeof(CTL_ATTACH)) < (int)sizeof(CTL_ATTACH))
- {
- ERROR("Failed to attach to %s: errno is %d (%s)\n", ctlPath,
- errno, strerror(errno));
- close(fd);
- goto DETACH1;
- }
-
- if (write(fd, CTL_WAIT, sizeof(CTL_WAIT)) < (int)sizeof(CTL_WAIT))
- {
- ERROR("Failed to wait for %s: errno is %d (%s)\n", ctlPath,
- errno, strerror(errno));
- goto DETACH2;
- }
-
- close(fd);
-#elif HAVE_TTRACE
- if (ttrace(TT_PROC_ATTACH, processId, 0, TT_DETACH_ON_EXIT, TT_VERSION, 0) == -1)
- {
- if (errno != ESRCH)
- {
- ASSERT("ttrace(TT_PROC_ATTACH, pid:%d) failed errno:%d (%s)\n",
- processId, errno, strerror(errno));
- }
- goto DETACH1;
- }
-#else // HAVE_TTRACE
- if (PAL_PTRACE( PAL_PT_ATTACH, processId, 0, 0 ) == -1)
- {
- if (errno != ESRCH)
- {
- ASSERT("ptrace(PT_ATTACH, pid:%d) failed errno:%d (%s)\n",
- processId, errno, strerror(errno));
- }
- goto DETACH1;
- }
-
- if (waitpid(processId, NULL, WUNTRACED) == -1)
- {
- if (errno != ESRCH)
- {
- ASSERT("waitpid(pid:%d, NULL, WUNTRACED) failed.errno:%d"
- " (%s)\n", processId, errno, strerror(errno));
- }
- goto DETACH2;
- }
-#endif // HAVE_PROCFS_CTL
- }
-
- return TRUE;
-
-#if HAVE_PROCFS_CTL
-DETACH2:
- if (write(fd, CTL_DETACH, sizeof(CTL_DETACH)) < (int)sizeof(CTL_DETACH))
- {
- ASSERT("Failed to detach from %s: errno is %d (%s)\n", ctlPath,
- errno, strerror(errno));
- }
- close(fd);
-#elif !HAVE_TTRACE
-DETACH2:
- if (PAL_PTRACE(PAL_PT_DETACH, processId, 0, 0) == -1)
- {
- ASSERT("ptrace(PT_DETACH, pid:%d) failed. errno:%d (%s)\n", processId,
- errno, strerror(errno));
- }
-#endif // HAVE_PROCFS_CTL
-
-DETACH1:
- savedErrno = errno;
- DBGSetProcessAttached(pThread, hProcess, DBG_DETACH);
- errno = savedErrno;
-EXIT:
- if (errno == ESRCH || errno == ENOENT || errno == EBADF)
- {
- ERROR("Invalid process ID:%d\n", processId);
- SetLastError(ERROR_INVALID_PARAMETER);
- }
- else
- {
- SetLastError(ERROR_INTERNAL_ERROR);
- }
- return FALSE;
-}
-
-/*++
-Function:
- DBGDetachProcess
-
-Abstract
- Detach the indicated process from the current process.
-
- if the indicated process is already attached by the current process, then
- decrement the number of attachment pending and detach it from the current
- process (with PT_DETACH) if there's no more attachment left.
-
-Parameter
- hProcess : process handle
- processId : process ID
-
-Return
- Return true if it succeeds, or true if it's fails
---*/
-static
-BOOL
-DBGDetachProcess(
- CPalThread *pThread,
- HANDLE hProcess,
- DWORD processId
- )
-{
- int nbAttachLeft;
-#if HAVE_PROCFS_CTL
- int fd = -1;
- char ctlPath[1024];
-#endif // HAVE_PROCFS_CTL
-
- nbAttachLeft = DBGSetProcessAttached(pThread, hProcess, DBG_DETACH);
-
- if (nbAttachLeft == -1)
- {
- /* Failed to set the process as detached */
- return FALSE;
- }
-
- /* check if there's no more attachment left on processId */
- if (nbAttachLeft == 0)
- {
-#if HAVE_PROCFS_CTL
- sprintf(ctlPath, sizeof(ctlPath), "/proc/%d/ctl", processId);
- fd = InternalOpen(pThread, ctlPath, O_WRONLY);
- if (fd == -1)
- {
- if (errno == ENOENT)
- {
- ERROR("Invalid process ID: %d\n", processId);
- SetLastError(ERROR_INVALID_PARAMETER);
- }
- else
- {
- ERROR("Failed to open %s: errno is %d (%s)\n", ctlPath,
- errno, strerror(errno));
- SetLastError(ERROR_INTERNAL_ERROR);
- }
- return FALSE;
- }
-
- if (write(fd, CTL_DETACH, sizeof(CTL_DETACH)) < (int)sizeof(CTL_DETACH))
- {
- ERROR("Failed to detach from %s: errno is %d (%s)\n", ctlPath,
- errno, strerror(errno));
- close(fd);
- return FALSE;
- }
- close(fd);
-
-#elif HAVE_TTRACE
- if (ttrace(TT_PROC_DETACH, processId, 0, 0, 0, 0) == -1)
- {
- if (errno == ESRCH)
- {
- ERROR("Invalid process ID: %d\n", processId);
- SetLastError(ERROR_INVALID_PARAMETER);
- }
- else
- {
- ASSERT("ttrace(TT_PROC_DETACH, pid:%d) failed. errno:%d (%s)\n",
- processId, errno, strerror(errno));
- SetLastError(ERROR_INTERNAL_ERROR);
- }
- return FALSE;
- }
-#else // HAVE_TTRACE
- if (PAL_PTRACE(PAL_PT_DETACH, processId, 1, 0) == -1)
- {
- if (errno == ESRCH)
- {
- ERROR("Invalid process ID: %d\n", processId);
- SetLastError(ERROR_INVALID_PARAMETER);
- }
- else
- {
- ASSERT("ptrace(PT_DETACH, pid:%d) failed. errno:%d (%s)\n",
- processId, errno, strerror(errno));
- SetLastError(ERROR_INTERNAL_ERROR);
- }
- return FALSE;
- }
-#endif // HAVE_PROCFS_CTL
-
-#if !HAVE_TTRACE
- if (kill(processId, SIGCONT) == -1)
- {
- ERROR("Failed to continue the detached process:%d errno:%d (%s)\n",
- processId, errno, strerror(errno));
- return FALSE;
- }
-#endif // !HAVE_TTRACE
- }
- return TRUE;
-}
-
-/*++
-Function:
- DBGSetProcessAttached
-
-Abstract
- saves the current process Id in the attached process structure
-
-Parameter
- hProcess : process handle
- bAttach : true (false) to set the process as attached (as detached)
-Return
- returns the number of attachment left on attachedProcId, or -1 if it fails
---*/
-static int
-DBGSetProcessAttached(
- CPalThread *pThread,
- HANDLE hProcess,
- BOOL bAttach
- )
-{
- PAL_ERROR palError = NO_ERROR;
- IPalObject *pobjProcess = NULL;
- IDataLock *pDataLock = NULL;
- CProcProcessLocalData *pLocalData = NULL;
- int ret = -1;
- CAllowedObjectTypes aotProcess(otiProcess);
-
- palError = g_pObjectManager->ReferenceObjectByHandle(
- pThread,
- hProcess,
- &aotProcess,
- 0,
- &pobjProcess
- );
-
- if (NO_ERROR != palError)
- {
- goto DBGSetProcessAttachedExit;
- }
-
- palError = pobjProcess->GetProcessLocalData(
- pThread,
- WriteLock,
- &pDataLock,
- reinterpret_cast<void **>(&pLocalData)
- );
-
- if (NO_ERROR != palError)
- {
- goto DBGSetProcessAttachedExit;
- }
-
- if (bAttach)
- {
- pLocalData->lAttachCount += 1;
- }
- else
- {
- pLocalData->lAttachCount -= 1;
-
- if (pLocalData->lAttachCount < 0)
- {
- ASSERT("pLocalData->lAttachCount < 0 check for extra DBGDetachProcess calls\n");
- palError = ERROR_INTERNAL_ERROR;
- goto DBGSetProcessAttachedExit;
- }
- }
-
- ret = pLocalData->lAttachCount;
-
-DBGSetProcessAttachedExit:
-
- if (NULL != pDataLock)
- {
- pDataLock->ReleaseLock(pThread, TRUE);
- }
-
- if (NULL != pobjProcess)
- {
- pobjProcess->ReleaseReference(pThread);
- }
-
- return ret;
-}
-
-#endif // !HAVE_VM_READ && !HAVE_PROCFS_CTL
-
/*++
Function:
PAL_CreateExecWatchpoint
@@ -1240,605 +766,64 @@ PAL_DeleteExecWatchpointExit:
return dwError;
}
-// We want to enable hardware exception handling for ReadProcessMemory
-// and WriteProcessMemory in all cases since it is acceptable if they
-// hit AVs, so redefine HardwareExceptionHolder for these two functions
-// (here to the end of the file).
-#undef HardwareExceptionHolder
-#define HardwareExceptionHolder CatchHardwareExceptionHolder __catchHardwareException;
-
-/*++
-Function:
- ReadProcessMemory
-
-See MSDN doc.
---*/
-BOOL
-PALAPI
-ReadProcessMemory(
- IN HANDLE hProcess,
- IN LPCVOID lpBaseAddress,
- IN LPVOID lpBuffer,
- IN SIZE_T nSize,
- OUT SIZE_T * lpNumberOfBytesRead
- )
+__attribute__((noinline))
+__attribute__((optnone))
+void
+ProbeMemory(volatile PBYTE pbBuffer, DWORD cbBuffer, bool fWriteAccess)
{
- CPalThread *pThread;
- DWORD processId;
- Volatile<BOOL> ret = FALSE;
- Volatile<SIZE_T> numberOfBytesRead = 0;
-#if HAVE_VM_READ
- kern_return_t result;
- vm_map_t task;
- LONG_PTR bytesToRead;
-#elif HAVE_PROCFS_CTL
- int fd = -1;
- char memPath[64];
- off_t offset;
-#elif !HAVE_TTRACE
- SIZE_T nbInts;
- int* ptrInt;
- int* lpTmpBuffer;
-#endif
-#if !HAVE_PROCFS_CTL && !HAVE_TTRACE
- int* lpBaseAddressAligned;
- SIZE_T offset;
-#endif // !HAVE_PROCFS_CTL && !HAVE_TTRACE
-
- PERF_ENTRY(ReadProcessMemory);
- ENTRY("ReadProcessMemory (hProcess=%p,lpBaseAddress=%p, lpBuffer=%p, "
- "nSize=%u, lpNumberOfBytesRead=%p)\n",hProcess,lpBaseAddress,
- lpBuffer, (unsigned int)nSize, lpNumberOfBytesRead);
-
- pThread = InternalGetCurrentThread();
-
- if (!(processId = PROCGetProcessIDFromHandle(hProcess)))
- {
- ERROR("Invalid process handler hProcess:%p.",hProcess);
- SetLastError(ERROR_INVALID_HANDLE);
- goto EXIT;
- }
-
- // Check if the read request is for the current process.
- // We don't need ptrace in that case.
- if (GetCurrentProcessId() == processId)
+ // Need an throw in this function to fool the C++ runtime into handling the
+ // possible h/w exception below.
+ if (pbBuffer == NULL)
{
- TRACE("We are in the same process, so ptrace is not needed\n");
-
- struct Param
- {
- LPCVOID lpBaseAddress;
- LPVOID lpBuffer;
- SIZE_T nSize;
- SIZE_T numberOfBytesRead;
- BOOL ret;
- } param;
- param.lpBaseAddress = lpBaseAddress;
- param.lpBuffer = lpBuffer;
- param.nSize = nSize;
- param.numberOfBytesRead = numberOfBytesRead;
- param.ret = ret;
-
- PAL_TRY(Param *, pParam, &param)
- {
- SIZE_T i;
-
- // Seg fault in memcpy can't be caught
- // so we simulate the memcpy here
-
- for (i = 0; i<pParam->nSize; i++)
- {
- *((char*)(pParam->lpBuffer)+i) = *((char*)(pParam->lpBaseAddress)+i);
- }
-
- pParam->numberOfBytesRead = pParam->nSize;
- pParam->ret = TRUE;
- }
- PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- SetLastError(ERROR_ACCESS_DENIED);
- }
- PAL_ENDTRY
-
- numberOfBytesRead = param.numberOfBytesRead;
- ret = param.ret;
- goto EXIT;
+ throw PAL_SEHException();
}
-#if HAVE_VM_READ
- result = task_for_pid(mach_task_self(), processId, &task);
- if (result != KERN_SUCCESS)
+ // Simple one byte at a time probing
+ while (cbBuffer > 0)
{
- ERROR("No Mach task for pid %d: %d\n", processId, ret.Load());
- SetLastError(ERROR_INVALID_HANDLE);
- goto EXIT;
- }
- // vm_read_overwrite usually requires that the address be page-aligned
- // and the size be a multiple of the page size. We can't differentiate
- // between the cases in which that's required and those in which it
- // isn't, so we do it all the time.
- lpBaseAddressAligned = (int*)((SIZE_T) lpBaseAddress & ~VIRTUAL_PAGE_MASK);
- offset = ((SIZE_T) lpBaseAddress & VIRTUAL_PAGE_MASK);
- char *data;
- data = (char*)alloca(VIRTUAL_PAGE_SIZE);
- while (nSize > 0)
- {
- vm_size_t bytesRead;
-
- bytesToRead = VIRTUAL_PAGE_SIZE - offset;
- if (bytesToRead > (LONG_PTR)nSize)
- {
- bytesToRead = nSize;
- }
- bytesRead = VIRTUAL_PAGE_SIZE;
- result = vm_read_overwrite(task, (vm_address_t) lpBaseAddressAligned,
- VIRTUAL_PAGE_SIZE, (vm_address_t) data, &bytesRead);
- if (result != KERN_SUCCESS || bytesRead != VIRTUAL_PAGE_SIZE)
+ volatile BYTE read = *pbBuffer;
+ if (fWriteAccess)
{
- ERROR("vm_read_overwrite failed for %d bytes from %p in %d: %d\n",
- VIRTUAL_PAGE_SIZE, (char *) lpBaseAddressAligned, task, result);
- if (result <= KERN_RETURN_MAX)
- {
- SetLastError(ERROR_INVALID_ACCESS);
- }
- else
- {
- SetLastError(ERROR_INTERNAL_ERROR);
- }
- goto EXIT;
+ *pbBuffer = read;
}
- memcpy((LPSTR)lpBuffer + numberOfBytesRead, data + offset, bytesToRead);
- numberOfBytesRead.Store(numberOfBytesRead.Load() + bytesToRead);
- lpBaseAddressAligned = (int*)((char*)lpBaseAddressAligned + VIRTUAL_PAGE_SIZE);
- nSize -= bytesToRead;
- offset = 0;
+ ++pbBuffer;
+ --cbBuffer;
}
- ret = TRUE;
-#else // HAVE_VM_READ
-#if HAVE_PROCFS_CTL
- snprintf(memPath, sizeof(memPath), "/proc/%u/%s", processId, PROCFS_MEM_NAME);
- fd = InternalOpen(memPath, O_RDONLY);
- if (fd == -1)
- {
- ERROR("Failed to open %s\n", memPath);
- SetLastError(ERROR_INVALID_ACCESS);
- goto PROCFSCLEANUP;
- }
-
- //
- // off_t may be greater in size than void*, so first cast to
- // an unsigned type to ensure that no sign extension takes place
- //
-
- offset = (off_t) (UINT_PTR) lpBaseAddress;
-
- if (lseek(fd, offset, SEEK_SET) == -1)
- {
- ERROR("Failed to seek to base address\n");
- SetLastError(ERROR_INVALID_ACCESS);
- goto PROCFSCLEANUP;
- }
-
- numberOfBytesRead = read(fd, lpBuffer, nSize);
- ret = TRUE;
-
-#else // HAVE_PROCFS_CTL
- // Attach the process before calling ttrace/ptrace otherwise it fails.
- if (DBGAttachProcess(pThread, hProcess, processId))
- {
-#if HAVE_TTRACE
- if (ttrace(TT_PROC_RDDATA, processId, 0, (__uint64_t)lpBaseAddress, (__uint64_t)nSize, (__uint64_t)lpBuffer) == -1)
- {
- if (errno == EFAULT)
- {
- ERROR("ttrace(TT_PROC_RDDATA, pid:%d, 0, addr:%p, data:%d, addr2:%d) failed"
- " errno=%d (%s)\n", processId, lpBaseAddress, (int)nSize, lpBuffer,
- errno, strerror(errno));
-
- SetLastError(ERROR_ACCESS_DENIED);
- }
- else
- {
- ASSERT("ttrace(TT_PROC_RDDATA, pid:%d, 0, addr:%p, data:%d, addr2:%d) failed"
- " errno=%d (%s)\n", processId, lpBaseAddress, (int)nSize, lpBuffer,
- errno, strerror(errno));
- SetLastError(ERROR_INTERNAL_ERROR);
- }
-
- goto CLEANUP1;
- }
-
- numberOfBytesRead = nSize;
- ret = TRUE;
-
-#else // HAVE_TTRACE
-
- offset = (SIZE_T)lpBaseAddress % sizeof(int);
- lpBaseAddressAligned = (int*)((char*)lpBaseAddress - offset);
- nbInts = (nSize + offset)/sizeof(int) +
- ((nSize + offset)%sizeof(int) ? 1:0);
-
- /* before transferring any data to lpBuffer we should make sure that all
- data is accessible for read. so we need to use a temp buffer for that.*/
- if (!(lpTmpBuffer = (int*)InternalMalloc((nbInts * sizeof(int)))))
- {
- ERROR("Insufficient memory available !\n");
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- goto CLEANUP1;
- }
-
- for (ptrInt = lpTmpBuffer; nbInts; ptrInt++,
- lpBaseAddressAligned++, nbInts--)
- {
- errno = 0;
- *ptrInt =
- PAL_PTRACE(PAL_PT_READ_D, processId, lpBaseAddressAligned, 0);
- if (*ptrInt == -1 && errno)
- {
- if (errno == EFAULT)
- {
- ERROR("ptrace(PT_READ_D, pid:%d, addr:%p, data:0) failed"
- " errno=%d (%s)\n", processId, lpBaseAddressAligned,
- errno, strerror(errno));
-
- SetLastError(ptrInt == lpTmpBuffer ? ERROR_ACCESS_DENIED :
- ERROR_PARTIAL_COPY);
- }
- else
- {
- ASSERT("ptrace(PT_READ_D, pid:%d, addr:%p, data:0) failed"
- " errno=%d (%s)\n", processId, lpBaseAddressAligned,
- errno, strerror(errno));
- SetLastError(ERROR_INTERNAL_ERROR);
- }
-
- goto CLEANUP2;
- }
- }
-
- /* transfer data from temp buffer to lpBuffer */
- memcpy( (char *)lpBuffer, ((char*)lpTmpBuffer) + offset, nSize);
- numberOfBytesRead = nSize;
- ret = TRUE;
-#endif // HAVE_TTRACE
- }
- else
- {
- /* Failed to attach processId */
- goto EXIT;
- }
-#endif // HAVE_PROCFS_CTL
-
-#if HAVE_PROCFS_CTL
-PROCFSCLEANUP:
- if (fd != -1)
- {
- close(fd);
- }
-#elif !HAVE_TTRACE
-CLEANUP2:
- if (lpTmpBuffer)
- {
- free(lpTmpBuffer);
- }
-#endif // !HAVE_TTRACE
-
-#if !HAVE_PROCFS_CTL
-CLEANUP1:
- if (!DBGDetachProcess(pThread, hProcess, processId))
- {
- /* Failed to detach processId */
- ret = FALSE;
- }
-#endif // HAVE_PROCFS_CTL
-#endif // HAVE_VM_READ
-
-EXIT:
- if (lpNumberOfBytesRead)
- {
- *lpNumberOfBytesRead = numberOfBytesRead;
- }
- LOGEXIT("ReadProcessMemory returns BOOL %d\n", ret.Load());
- PERF_EXIT(ReadProcessMemory);
- return ret;
}
/*++
Function:
- WriteProcessMemory
+ PAL_ProbeMemory
-See MSDN doc.
+Abstract
+
+Parameter
+ pBuffer : address of memory to validate
+ cbBuffer : size of memory region to validate
+ fWriteAccess : if true, validate writable access, else just readable.
+
+Return
+ true if memory is valid, false if not.
--*/
BOOL
PALAPI
-WriteProcessMemory(
- IN HANDLE hProcess,
- IN LPVOID lpBaseAddress,
- IN LPCVOID lpBuffer,
- IN SIZE_T nSize,
- OUT SIZE_T * lpNumberOfBytesWritten
- )
-
+PAL_ProbeMemory(
+ PVOID pBuffer,
+ DWORD cbBuffer,
+ BOOL fWriteAccess)
{
- CPalThread *pThread;
- DWORD processId;
- Volatile<BOOL> ret = FALSE;
- Volatile<SIZE_T> numberOfBytesWritten = 0;
-#if HAVE_VM_READ
- kern_return_t result;
- vm_map_t task;
-#elif HAVE_PROCFS_CTL
- int fd = -1;
- char memPath[64];
- LONG_PTR bytesWritten;
- off_t offset;
-#elif !HAVE_TTRACE
- SIZE_T FirstIntOffset;
- SIZE_T LastIntOffset;
- unsigned int FirstIntMask;
- unsigned int LastIntMask;
- SIZE_T nbInts;
- int *lpTmpBuffer = 0, *lpInt;
- int* lpBaseAddressAligned;
-#endif
-
- PERF_ENTRY(WriteProcessMemory);
- ENTRY("WriteProcessMemory (hProcess=%p,lpBaseAddress=%p, lpBuffer=%p, "
- "nSize=%u, lpNumberOfBytesWritten=%p)\n",
- hProcess,lpBaseAddress, lpBuffer, (unsigned int)nSize, lpNumberOfBytesWritten);
-
- pThread = InternalGetCurrentThread();
-
- if (!(nSize && (processId = PROCGetProcessIDFromHandle(hProcess))))
- {
- ERROR("Invalid nSize:%u number or invalid process handler "
- "hProcess:%p\n", (unsigned int)nSize, hProcess);
- SetLastError(ERROR_INVALID_PARAMETER);
- goto EXIT;
- }
-
- // Check if the write request is for the current process.
- // In that case we don't need ptrace.
- if (GetCurrentProcessId() == processId)
- {
- TRACE("We are in the same process so we don't need ptrace\n");
-
- struct Param
- {
- LPVOID lpBaseAddress;
- LPCVOID lpBuffer;
- SIZE_T nSize;
- SIZE_T numberOfBytesWritten;
- BOOL ret;
- } param;
- param.lpBaseAddress = lpBaseAddress;
- param.lpBuffer = lpBuffer;
- param.nSize = nSize;
- param.numberOfBytesWritten = numberOfBytesWritten;
- param.ret = ret;
-
- PAL_TRY(Param *, pParam, &param)
- {
- SIZE_T i;
-
- // Seg fault in memcpy can't be caught
- // so we simulate the memcpy here
-
- for (i = 0; i<pParam->nSize; i++)
- {
- *((char*)(pParam->lpBaseAddress)+i) = *((char*)(pParam->lpBuffer)+i);
- }
-
- pParam->numberOfBytesWritten = pParam->nSize;
- pParam->ret = TRUE;
- }
- PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- SetLastError(ERROR_ACCESS_DENIED);
- }
- PAL_ENDTRY
-
- numberOfBytesWritten = param.numberOfBytesWritten;
- ret = param.ret;
- goto EXIT;
- }
-
-#if HAVE_VM_READ
- result = task_for_pid(mach_task_self(), processId, &task);
- if (result != KERN_SUCCESS)
- {
- ERROR("No Mach task for pid %d: %d\n", processId, ret.Load());
- SetLastError(ERROR_INVALID_HANDLE);
- goto EXIT;
- }
- result = vm_write(task, (vm_address_t) lpBaseAddress,
- (vm_address_t) lpBuffer, nSize);
- if (result != KERN_SUCCESS)
- {
- ERROR("vm_write failed for %d bytes from %p in %d: %d\n",
- (int)nSize, lpBaseAddress, task, result);
- if (result <= KERN_RETURN_MAX)
- {
- SetLastError(ERROR_ACCESS_DENIED);
- }
- else
- {
- SetLastError(ERROR_INTERNAL_ERROR);
- }
- goto EXIT;
- }
- numberOfBytesWritten = nSize;
- ret = TRUE;
-#else // HAVE_VM_READ
-#if HAVE_PROCFS_CTL
- snprintf(memPath, sizeof(memPath), "/proc/%u/%s", processId, PROCFS_MEM_NAME);
- fd = InternalOpen(memPath, O_WRONLY);
- if (fd == -1)
+ try
{
- ERROR("Failed to open %s\n", memPath);
- SetLastError(ERROR_INVALID_ACCESS);
- goto PROCFSCLEANUP;
- }
-
- //
- // off_t may be greater in size than void*, so first cast to
- // an unsigned type to ensure that no sign extension takes place
- //
-
- offset = (off_t) (UINT_PTR) lpBaseAddress;
+ // Need to explicit h/w exception holder so to catch them in ProbeMemory
+ CatchHardwareExceptionHolder __catchHardwareException;
- if (lseek(fd, offset, SEEK_SET) == -1)
- {
- ERROR("Failed to seek to base address\n");
- SetLastError(ERROR_INVALID_ACCESS);
- goto PROCFSCLEANUP;
+ ProbeMemory((PBYTE)pBuffer, cbBuffer, fWriteAccess);
}
-
- bytesWritten = write(fd, lpBuffer, nSize);
- if (bytesWritten < 0)
- {
- ERROR("Failed to write to %s\n", memPath);
- SetLastError(ERROR_INVALID_ACCESS);
- goto PROCFSCLEANUP;
- }
-
- numberOfBytesWritten = bytesWritten;
- ret = TRUE;
-
-#else // HAVE_PROCFS_CTL
- /* Attach the process before calling ptrace otherwise it fails */
- if (DBGAttachProcess(pThread, hProcess, processId))
+ catch(...)
{
-#if HAVE_TTRACE
- if (ttrace(TT_PROC_WRDATA, processId, 0, (__uint64_t)lpBaseAddress, (__uint64_t)nSize, (__uint64_t)lpBuffer) == -1)
- {
- if (errno == EFAULT)
- {
- ERROR("ttrace(TT_PROC_WRDATA, pid:%d, addr:%p, data:%d, addr2:%d) failed"
- " errno=%d (%s)\n", processId, lpBaseAddress, nSize, lpBuffer,
- errno, strerror(errno));
-
- SetLastError(ERROR_ACCESS_DENIED);
- }
- else
- {
- ASSERT("ttrace(TT_PROC_WRDATA, pid:%d, addr:%p, data:%d, addr2:%d) failed"
- " errno=%d (%s)\n", processId, lpBaseAddress, nSize, lpBuffer,
- errno, strerror(errno));
- SetLastError(ERROR_INTERNAL_ERROR);
- }
-
- goto CLEANUP1;
- }
-
- numberOfBytesWritten = nSize;
- ret = TRUE;
-
-#else // HAVE_TTRACE
-
- FirstIntOffset = (SIZE_T)lpBaseAddress % sizeof(int);
- FirstIntMask = -1;
- FirstIntMask <<= (FirstIntOffset * 8);
-
- nbInts = (nSize + FirstIntOffset) / sizeof(int) +
- (((nSize + FirstIntOffset)%sizeof(int)) ? 1:0);
- lpBaseAddressAligned = (int*)((char*)lpBaseAddress - FirstIntOffset);
-
- if ((lpTmpBuffer = (int*)InternalMalloc((nbInts * sizeof(int)))) == NULL)
- {
- ERROR("Insufficient memory available !\n");
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- goto CLEANUP1;
- }
-
- memcpy((char *)lpTmpBuffer + FirstIntOffset, (char *)lpBuffer, nSize);
- lpInt = lpTmpBuffer;
-
- LastIntOffset = (nSize + FirstIntOffset) % sizeof(int);
- LastIntMask = -1;
- LastIntMask >>= ((sizeof(int) - LastIntOffset) * 8);
-
- if (nbInts == 1)
- {
- if (DBGWriteProcMem_IntWithMask(processId, lpBaseAddressAligned,
- *lpInt,
- LastIntMask & FirstIntMask)
- == 0)
- {
- goto CLEANUP2;
- }
- numberOfBytesWritten = nSize;
- ret = TRUE;
- goto CLEANUP2;
- }
-
- if (DBGWriteProcMem_IntWithMask(processId,
- lpBaseAddressAligned++,
- *lpInt++, FirstIntMask)
- == 0)
- {
- goto CLEANUP2;
- }
-
- while (--nbInts > 1)
- {
- if (DBGWriteProcMem_Int(processId, lpBaseAddressAligned++,
- *lpInt++) == 0)
- {
- goto CLEANUP2;
- }
- }
-
- if (DBGWriteProcMem_IntWithMask(processId, lpBaseAddressAligned,
- *lpInt, LastIntMask ) == 0)
- {
- goto CLEANUP2;
- }
-
- numberOfBytesWritten = nSize;
- ret = TRUE;
-#endif // HAVE_TTRACE
- }
- else
- {
- /* Failed to attach processId */
- goto EXIT;
- }
-#endif // HAVE_PROCFS_CTL
-
-#if HAVE_PROCFS_CTL
-PROCFSCLEANUP:
- if (fd != -1)
- {
- close(fd);
- }
-#elif !HAVE_TTRACE
-CLEANUP2:
- if (lpTmpBuffer)
- {
- free(lpTmpBuffer);
- }
-#endif // !HAVE_TTRACE
-
-#if !HAVE_PROCFS_CTL
-CLEANUP1:
- if (!DBGDetachProcess(pThread, hProcess, processId))
- {
- /* Failed to detach processId */
- ret = FALSE;
- }
-#endif // !HAVE_PROCFS_CTL
-#endif // HAVE_VM_READ
-
-EXIT:
- if (lpNumberOfBytesWritten)
- {
- *lpNumberOfBytesWritten = numberOfBytesWritten;
+ return FALSE;
}
-
- LOGEXIT("WriteProcessMemory returns BOOL %d\n", ret.Load());
- PERF_EXIT(WriteProcessMemory);
- return ret;
+ return TRUE;
}
} // extern "C"
diff --git a/src/pal/src/examples/CMakeLists.txt b/src/pal/src/examples/CMakeLists.txt
index 2cef914892..3797d89b68 100644
--- a/src/pal/src/examples/CMakeLists.txt
+++ b/src/pal/src/examples/CMakeLists.txt
@@ -4,7 +4,7 @@ project(palexmpl)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- example1.c
+ example1.cpp
)
add_executable(palexmpl
diff --git a/src/pal/src/examples/example1.c b/src/pal/src/examples/example1.cpp
index 071f42e4f9..071f42e4f9 100644
--- a/src/pal/src/examples/example1.c
+++ b/src/pal/src/examples/example1.cpp
diff --git a/src/pal/src/exception/machexception.cpp b/src/pal/src/exception/machexception.cpp
index 8b0d7f22a8..5328e1f329 100644
--- a/src/pal/src/exception/machexception.cpp
+++ b/src/pal/src/exception/machexception.cpp
@@ -1518,6 +1518,7 @@ ActivationHandler(CONTEXT* context)
extern "C" void ActivationHandlerWrapper();
extern "C" int ActivationHandlerReturnOffset;
+extern "C" unsigned int XmmYmmStateSupport();
/*++
Function :
@@ -1581,6 +1582,12 @@ InjectActivationInternal(CPalThread* pThread)
// after the activation function returns.
CONTEXT *pContext = (CONTEXT *)contextAddress;
pContext->ContextFlags = CONTEXT_FULL | CONTEXT_SEGMENTS;
+#ifdef XSTATE_SUPPORTED
+ if (XmmYmmStateSupport() == 1)
+ {
+ pContext->ContextFlags |= CONTEXT_XSTATE;
+ }
+#endif
MachRet = CONTEXT_GetThreadContextFromPort(threadPort, pContext);
_ASSERT_MSG(MachRet == KERN_SUCCESS, "CONTEXT_GetThreadContextFromPort\n");
diff --git a/src/pal/src/exception/machmessage.cpp b/src/pal/src/exception/machmessage.cpp
index a6f7e57484..b786960782 100644
--- a/src/pal/src/exception/machmessage.cpp
+++ b/src/pal/src/exception/machmessage.cpp
@@ -1069,7 +1069,7 @@ thread_act_t MachMessage::GetThreadFromState(thread_state_flavor_t eFlavor, thre
NONPAL_RETAIL_ASSERT("Failed to locate thread from state.");
}
-// Transform a exception handler behavior type into the corresponding Mach message ID for the notification.
+// Transform an exception handler behavior type into the corresponding Mach message ID for the notification.
mach_msg_id_t MachMessage::MapBehaviorToNotificationType(exception_behavior_t eBehavior)
{
switch ((uint)eBehavior)
diff --git a/src/pal/src/exception/machmessage.h b/src/pal/src/exception/machmessage.h
index 244396cd35..abc583f6c4 100644
--- a/src/pal/src/exception/machmessage.h
+++ b/src/pal/src/exception/machmessage.h
@@ -36,7 +36,7 @@ using namespace CorUnix;
if (machret != KERN_SUCCESS) \
{ \
char _szError[1024]; \
- sprintf(_szError, "%s: %u: %s", __FUNCTION__, __LINE__, _msg); \
+ snprintf(_szError, _countof(_szError), "%s: %u: %s", __FUNCTION__, __LINE__, _msg); \
mach_error(_szError, machret); \
abort(); \
} \
@@ -395,7 +395,7 @@ private:
// x86_THREAD_STATE and x86_THREAD_STATE32 state flavors are supported.
thread_act_t GetThreadFromState(thread_state_flavor_t eFlavor, thread_state_t pState);
- // Transform a exception handler behavior type into the corresponding Mach message ID for the
+ // Transform an exception handler behavior type into the corresponding Mach message ID for the
// notification.
mach_msg_id_t MapBehaviorToNotificationType(exception_behavior_t eBehavior);
diff --git a/src/pal/src/exception/seh-unwind.cpp b/src/pal/src/exception/seh-unwind.cpp
index 24eebbbf94..fa2f109875 100644
--- a/src/pal/src/exception/seh-unwind.cpp
+++ b/src/pal/src/exception/seh-unwind.cpp
@@ -73,6 +73,14 @@ Abstract:
ASSIGN_REG(X26) \
ASSIGN_REG(X27) \
ASSIGN_REG(X28)
+#elif defined(_X86_)
+#define ASSIGN_UNWIND_REGS \
+ ASSIGN_REG(Eip) \
+ ASSIGN_REG(Esp) \
+ ASSIGN_REG(Ebp) \
+ ASSIGN_REG(Ebx) \
+ ASSIGN_REG(Esi) \
+ ASSIGN_REG(Edi)
#else
#error unsupported architecture
#endif
@@ -122,6 +130,13 @@ static void WinContextToUnwindCursor(CONTEXT *winContext, unw_cursor_t *cursor)
unw_set_reg(cursor, UNW_X86_64_R13, winContext->R13);
unw_set_reg(cursor, UNW_X86_64_R14, winContext->R14);
unw_set_reg(cursor, UNW_X86_64_R15, winContext->R15);
+#elif defined(_X86_)
+ unw_set_reg(cursor, UNW_REG_IP, winContext->Eip);
+ unw_set_reg(cursor, UNW_REG_SP, winContext->Esp);
+ unw_set_reg(cursor, UNW_X86_EBP, winContext->Ebp);
+ unw_set_reg(cursor, UNW_X86_EBX, winContext->Ebx);
+ unw_set_reg(cursor, UNW_X86_ESI, winContext->Esi);
+ unw_set_reg(cursor, UNW_X86_EDI, winContext->Edi);
#endif
}
#endif
@@ -137,6 +152,13 @@ static void UnwindContextToWinContext(unw_cursor_t *cursor, CONTEXT *winContext)
unw_get_reg(cursor, UNW_X86_64_R13, (unw_word_t *) &winContext->R13);
unw_get_reg(cursor, UNW_X86_64_R14, (unw_word_t *) &winContext->R14);
unw_get_reg(cursor, UNW_X86_64_R15, (unw_word_t *) &winContext->R15);
+#elif defined(_X86_)
+ unw_get_reg(cursor, UNW_REG_IP, (unw_word_t *) &winContext->Eip);
+ unw_get_reg(cursor, UNW_REG_SP, (unw_word_t *) &winContext->Esp);
+ unw_get_reg(cursor, UNW_X86_EBP, (unw_word_t *) &winContext->Ebp);
+ unw_get_reg(cursor, UNW_X86_EBX, (unw_word_t *) &winContext->Ebx);
+ unw_get_reg(cursor, UNW_X86_ESI, (unw_word_t *) &winContext->Esi);
+ unw_get_reg(cursor, UNW_X86_EDI, (unw_word_t *) &winContext->Edi);
#elif defined(_ARM_)
unw_get_reg(cursor, UNW_REG_SP, (unw_word_t *) &winContext->Sp);
unw_get_reg(cursor, UNW_REG_IP, (unw_word_t *) &winContext->Pc);
@@ -196,6 +218,11 @@ static void GetContextPointers(unw_cursor_t *cursor, unw_context_t *unwContext,
GetContextPointer(cursor, unwContext, UNW_X86_64_R13, &contextPointers->R13);
GetContextPointer(cursor, unwContext, UNW_X86_64_R14, &contextPointers->R14);
GetContextPointer(cursor, unwContext, UNW_X86_64_R15, &contextPointers->R15);
+#elif defined(_X86_)
+ GetContextPointer(cursor, unwContext, UNW_X86_EBX, &contextPointers->Ebx);
+ GetContextPointer(cursor, unwContext, UNW_X86_EBP, &contextPointers->Ebp);
+ GetContextPointer(cursor, unwContext, UNW_X86_ESI, &contextPointers->Esi);
+ GetContextPointer(cursor, unwContext, UNW_X86_EDI, &contextPointers->Edi);
#elif defined(_ARM_)
GetContextPointer(cursor, unwContext, UNW_ARM_R4, &contextPointers->R4);
GetContextPointer(cursor, unwContext, UNW_ARM_R5, &contextPointers->R5);
@@ -221,15 +248,34 @@ static void GetContextPointers(unw_cursor_t *cursor, unw_context_t *unwContext,
#endif
}
+extern int g_common_signal_handler_context_locvar_offset;
+
BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextPointers)
{
int st;
unw_context_t unwContext;
unw_cursor_t cursor;
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(_ARM64_) || defined(_ARM_)
- DWORD64 curPc;
-#endif
+ DWORD64 curPc = CONTEXTGetPC(context);
+
+#ifndef __APPLE__
+ // Check if the PC is the return address from the SEHProcessException in the common_signal_handler.
+ // If that's the case, extract its local variable containing the native_context_t of the hardware
+ // exception and return that. This skips the hardware signal handler trampoline that the libunwind
+ // cannot cross on some systems.
+ if ((void*)curPc == g_SEHProcessExceptionReturnAddress)
+ {
+ ULONG contextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT | CONTEXT_EXCEPTION_ACTIVE;
+
+ #if defined(_AMD64_)
+ contextFlags |= CONTEXT_XSTATE;
+ #endif
+ size_t nativeContext = *(size_t*)(CONTEXTGetFP(context) + g_common_signal_handler_context_locvar_offset);
+ CONTEXTFromNativeContext((const native_context_t *)nativeContext, context, contextFlags);
+
+ return TRUE;
+ }
+#endif
if ((context->ContextFlags & CONTEXT_EXCEPTION_ACTIVE) != 0)
{
@@ -240,7 +286,7 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP
// So we compensate it by incrementing the PC before passing it to the unwinder.
// Without it, the unwinder would not find unwind info if the hardware exception
// happened in the first instruction of a function.
- CONTEXTSetPC(context, CONTEXTGetPC(context) + 1);
+ CONTEXTSetPC(context, curPc + 1);
}
#if !UNWIND_CONTEXT_IS_UCONTEXT_T
@@ -264,18 +310,6 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP
WinContextToUnwindCursor(context, &cursor);
#endif
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(_ARM64_) || defined(_ARM_)
- // FreeBSD, NetBSD and OSX appear to do two different things when unwinding
- // 1: If it reaches where it cannot unwind anymore, say a
- // managed frame. It wil return 0, but also update the $pc
- // 2: If it unwinds all the way to _start it will return
- // 0 from the step, but $pc will stay the same.
- // The behaviour of libunwind from nongnu.org is to null the PC
- // So we bank the original PC here, so we can compare it after
- // the step
- curPc = CONTEXTGetPC(context);
-#endif
-
st = unw_step(&cursor);
if (st < 0)
{
@@ -303,12 +337,18 @@ BOOL PAL_VirtualUnwind(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *contextP
// Update the passed in windows context to reflect the unwind
//
UnwindContextToWinContext(&cursor, context);
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(_ARM64_) || defined(_ARM_)
+
+ // FreeBSD, NetBSD, OSX and Alpine appear to do two different things when unwinding
+ // 1: If it reaches where it cannot unwind anymore, say a
+ // managed frame. It will return 0, but also update the $pc
+ // 2: If it unwinds all the way to _start it will return
+ // 0 from the step, but $pc will stay the same.
+ // So we detect that here and set the $pc to NULL in that case.
+ // This is the default behavior of the libunwind on Linux.
if (st == 0 && CONTEXTGetPC(context) == curPc)
{
CONTEXTSetPC(context, 0);
}
-#endif
if (contextPointers != NULL)
{
diff --git a/src/pal/src/exception/seh.cpp b/src/pal/src/exception/seh.cpp
index 38779bf59b..ad09e02884 100644
--- a/src/pal/src/exception/seh.cpp
+++ b/src/pal/src/exception/seh.cpp
@@ -88,6 +88,10 @@ PHARDWARE_EXCEPTION_SAFETY_CHECK_FUNCTION g_safeExceptionCheckFunction = NULL;
PGET_GCMARKER_EXCEPTION_CODE g_getGcMarkerExceptionCode = NULL;
+// Return address of the SEHProcessException, which is used to enable walking over
+// the signal handler trampoline on some Unixes where the libunwind cannot do that.
+void* g_SEHProcessExceptionReturnAddress = NULL;
+
/* Internal function definitions **********************************************/
/*++
@@ -245,6 +249,8 @@ Return value:
BOOL
SEHProcessException(PAL_SEHException* exception)
{
+ g_SEHProcessExceptionReturnAddress = __builtin_return_address(0);
+
CONTEXT* contextRecord = exception->GetContextRecord();
EXCEPTION_RECORD* exceptionRecord = exception->GetExceptionRecord();
@@ -268,7 +274,7 @@ SEHProcessException(PAL_SEHException* exception)
{
// The exception happened in the page right below the stack limit,
// so it is a stack overflow
- write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1);
+ (void)write(STDERR_FILENO, StackOverflowMessage, sizeof(StackOverflowMessage) - 1);
PROCAbort();
}
}
diff --git a/src/pal/src/exception/signal.cpp b/src/pal/src/exception/signal.cpp
index c2c217993a..26e2a012c5 100644
--- a/src/pal/src/exception/signal.cpp
+++ b/src/pal/src/exception/signal.cpp
@@ -100,6 +100,10 @@ static bool registered_sigterm_handler = false;
struct sigaction g_previous_activation;
#endif
+// Offset of the local variable containing native context in the common_signal_handler function.
+// This offset is relative to the frame pointer.
+int g_common_signal_handler_context_locvar_offset = 0;
+
/* public function definitions ************************************************/
/*++
@@ -582,6 +586,7 @@ Note:
the "pointers" parameter should contain a valid exception record pointer,
but the ContextRecord pointer will be overwritten.
--*/
+__attribute__((noinline))
static bool common_signal_handler(int code, siginfo_t *siginfo, void *sigcontext, int numParams, ...)
{
sigset_t signal_set;
@@ -590,6 +595,7 @@ static bool common_signal_handler(int code, siginfo_t *siginfo, void *sigcontext
native_context_t *ucontext;
ucontext = (native_context_t *)sigcontext;
+ g_common_signal_handler_context_locvar_offset = (int)((char*)&ucontext - (char*)__builtin_frame_address(0));
AllocateExceptionRecords(&exceptionRecord, &contextRecord);
diff --git a/src/pal/src/file/find.cpp b/src/pal/src/file/find.cpp
index 18639d3d14..18bf8c4cf1 100644
--- a/src/pal/src/file/find.cpp
+++ b/src/pal/src/file/find.cpp
@@ -383,7 +383,7 @@ FindNextFileA(
// Split the path into a dir and filename.
if (_splitpath_s(path, NULL, 0, find_data->dir, _MAX_DIR, find_data->fname, _MAX_PATH, ext, _MAX_EXT) != 0)
{
- ASSERT("_splitpath failed on %s\n", path);
+ ASSERT("_splitpath_s failed on %s\n", path);
dwLastError = ERROR_INTERNAL_ERROR;
goto done;
}
@@ -716,7 +716,7 @@ Simple helper function to insert backslashes before square brackets
to prevent glob from using them as wildcards.
note: this functions assumes all backslashes have previously been
- converted into forwardslashes by _splitpath.
+ converted into forwardslashes by _splitpath_s.
--*/
static void FILEEscapeSquareBrackets(char *pattern, char *escaped_pattern)
{
@@ -750,7 +750,7 @@ Function:
FILEGlobFromSplitPath
Simple wrapper function around glob(3), except that the pattern is accepted
-in broken-down form like _splitpath produces.
+in broken-down form like _splitpath_s produces.
ie. calling splitpath on a pattern then calling this function should
produce the same result as just calling glob() on the pattern.
@@ -874,12 +874,12 @@ static BOOL FILEDosGlobA( CPalThread *pthrCurrent,
_splitpath_s( pattern, NULL, 0, Dir, _MAX_DIR, Filename, _MAX_FNAME+1, Ext, _MAX_EXT);
- /* check to see if _splitpath failed */
+ /* check to see if _splitpath_s failed */
if ( Filename[0] == 0 )
{
if ( Dir[0] == 0 )
{
- ERROR("_splitpath failed on path [%s]\n", pattern);
+ ERROR("_splitpath_s failed on path [%s]\n", pattern);
}
else
{
diff --git a/src/pal/src/include/pal/context.h b/src/pal/src/include/pal/context.h
index 5e378942fb..6857c130ee 100644
--- a/src/pal/src/include/pal/context.h
+++ b/src/pal/src/include/pal/context.h
@@ -139,6 +139,8 @@ typedef ucontext_t native_context_t;
/////////////////////
// Extended state
+#ifdef XSTATE_SUPPORTED
+
inline _fpx_sw_bytes *FPREG_FpxSwBytes(const ucontext_t *uc)
{
// Bytes 464..511 in the FXSAVE format are available for software to use for any purpose. In this case, they are used to
@@ -185,6 +187,8 @@ inline void *FPREG_Xstate_Ymmh(const ucontext_t *uc)
return reinterpret_cast<_xstate *>(FPREG_Fpstate(uc))->ymmh.ymmh_space;
}
+#endif // XSTATE_SUPPORTED
+
/////////////////////
#else // BIT64
@@ -450,6 +454,8 @@ inline static DWORD64 CONTEXTGetPC(LPCONTEXT pContext)
{
#if defined(_AMD64_)
return pContext->Rip;
+#elif defined(_X86_)
+ return pContext->Eip;
#elif defined(_ARM64_) || defined(_ARM_)
return pContext->Pc;
#else
@@ -461,6 +467,8 @@ inline static void CONTEXTSetPC(LPCONTEXT pContext, DWORD64 pc)
{
#if defined(_AMD64_)
pContext->Rip = pc;
+#elif defined(_X86_)
+ pContext->Eip = pc;
#elif defined(_ARM64_) || defined(_ARM_)
pContext->Pc = pc;
#else
@@ -468,6 +476,21 @@ inline static void CONTEXTSetPC(LPCONTEXT pContext, DWORD64 pc)
#endif
}
+inline static DWORD64 CONTEXTGetFP(LPCONTEXT pContext)
+{
+#if defined(_AMD64_)
+ return pContext->Rbp;
+#elif defined(_X86_)
+ return pContext->Ebp;
+#elif defined(_ARM_)
+ return pContext->R7;
+#elif defined(_ARM64_)
+ return pContext->Fp;
+#else
+#error don't know how to get the frame pointer for this architecture
+#endif
+}
+
/*++
Function :
CONTEXT_CaptureContext
@@ -481,6 +504,7 @@ Parameters :
--*/
void
+PALAPI
CONTEXT_CaptureContext(
LPCONTEXT lpContext
);
diff --git a/src/pal/src/include/pal/palinternal.h b/src/pal/src/include/pal/palinternal.h
index 7348192e6d..f7856be902 100644
--- a/src/pal/src/include/pal/palinternal.h
+++ b/src/pal/src/include/pal/palinternal.h
@@ -169,7 +169,6 @@ function_name() to call the system's implementation
#define memmove DUMMY_memmove
#define memchr DUMMY_memchr
#define strlen DUMMY_strlen
-#define strnlen DUMMY_strnlen
#define stricmp DUMMY_stricmp
#define strstr DUMMY_strstr
#define strcmp DUMMY_strcmp
@@ -184,12 +183,6 @@ function_name() to call the system's implementation
#define strpbrk DUMMY_strpbrk
#define strtod DUMMY_strtod
#define strspn DUMMY_strspn
-#if HAVE__SNPRINTF
-#define _snprintf DUMMY__snprintf
-#endif /* HAVE__SNPRINTF */
-#if HAVE__SNWPRINTF
-#define _snwprintf DUMMY__snwprintf
-#endif /* HAVE__SNWPRINTF */
#define tolower DUMMY_tolower
#define toupper DUMMY_toupper
#define islower DUMMY_islower
@@ -217,9 +210,18 @@ function_name() to call the system's implementation
#define sqrt DUMMY_sqrt
#define tan DUMMY_tan
#define tanh DUMMY_tanh
+#define ceilf DUMMY_ceilf
+#define cosf DUMMY_cosf
+#define coshf DUMMY_coshf
#define fabsf DUMMY_fabsf
+#define floorf DUMMY_floorf
#define fmodf DUMMY_fmodf
#define modff DUMMY_modff
+#define sinf DUMMY_sinf
+#define sinhf DUMMY_sinhf
+#define sqrtf DUMMY_sqrtf
+#define tanf DUMMY_tanf
+#define tanhf DUMMY_tanhf
/* RAND_MAX needed to be renamed to avoid duplicate definition when including
stdlib.h header files. PAL_RAND_MAX should have the same value as RAND_MAX
@@ -349,9 +351,7 @@ function_name() to call the system's implementation
#undef atexit
#undef div
#undef div_t
-#if !defined(_DEBUG)
#undef memcpy
-#endif //!defined(_DEBUG)
#undef memcmp
#undef memset
#undef memmove
@@ -460,9 +460,26 @@ function_name() to call the system's implementation
#undef sqrt
#undef tan
#undef tanh
+#undef acosf
+#undef asinf
+#undef atanf
+#undef atan2f
+#undef ceilf
+#undef cosf
+#undef coshf
+#undef expf
#undef fabsf
+#undef floorf
#undef fmodf
+#undef logf
+#undef log10f
#undef modff
+#undef powf
+#undef sinf
+#undef sinhf
+#undef sqrtf
+#undef tanf
+#undef tanhf
#undef rand
#undef srand
#undef errno
@@ -485,13 +502,7 @@ function_name() to call the system's implementation
#undef vfwprintf
#undef vprintf
#undef wprintf
-#undef sprintf
#undef swprintf
-#undef _snprintf
-#if HAVE__SNWPRINTF
-#undef _snwprintf
-#endif /* HAVE__SNWPRINTF */
-#undef sscanf
#undef wcstod
#undef wcstol
#undef wcstoul
@@ -502,7 +513,6 @@ function_name() to call the system's implementation
#undef wcsncmp
#undef wcschr
#undef wcsrchr
-#undef wsprintf
#undef swscanf
#undef wcspbrk
#undef wcsstr
@@ -518,7 +528,6 @@ function_name() to call the system's implementation
#undef vsprintf
#undef vswprintf
#undef _vsnprintf
-#undef _vsnwprintf
#undef vsnprintf
#undef wvsnprintf
@@ -689,7 +698,7 @@ inline T* InterlockedCompareExchangePointerT(
#include "volatile.h"
-const char StackOverflowMessage[] = "Process is terminated due to StackOverflowException.\n";
+const char StackOverflowMessage[] = "Process is terminating due to StackOverflowException.\n";
#endif // __cplusplus
diff --git a/src/pal/src/init/pal.cpp b/src/pal/src/init/pal.cpp
index a5edb36428..0bda27644e 100644
--- a/src/pal/src/init/pal.cpp
+++ b/src/pal/src/init/pal.cpp
@@ -992,6 +992,7 @@ Return value:
--*/
static BOOL INIT_IncreaseDescriptorLimit(void)
{
+#ifndef DONT_SET_RLIMIT_NOFILE
struct rlimit rlp;
int result;
@@ -1008,7 +1009,7 @@ static BOOL INIT_IncreaseDescriptorLimit(void)
{
return FALSE;
}
-
+#endif // !DONT_SET_RLIMIT_NOFILE
return TRUE;
}
diff --git a/src/pal/src/map/virtual.cpp b/src/pal/src/map/virtual.cpp
index 4b5209642c..4a55de9891 100644
--- a/src/pal/src/map/virtual.cpp
+++ b/src/pal/src/map/virtual.cpp
@@ -1096,6 +1096,7 @@ VIRTUALCommitMemory(
}
StartBoundary = pInformation->startBoundary + runStart * VIRTUAL_PAGE_SIZE;
+ pRetVal = (void *)StartBoundary;
MemSize = runLength * VIRTUAL_PAGE_SIZE;
if (allocationType != MEM_COMMIT)
@@ -1156,10 +1157,10 @@ error:
pRetVal = NULL;
goto done;
}
- pInformation = NULL;
- pRetVal = NULL;
}
+ pInformation = NULL;
+ pRetVal = NULL;
done:
LogVaOperation(
diff --git a/src/pal/src/misc/sysinfo.cpp b/src/pal/src/misc/sysinfo.cpp
index 515ccf1cdb..e7589e8583 100644
--- a/src/pal/src/misc/sysinfo.cpp
+++ b/src/pal/src/misc/sysinfo.cpp
@@ -172,7 +172,7 @@ GetSystemInfo(
#ifdef VM_MAXUSER_ADDRESS
lpSystemInfo->lpMaximumApplicationAddress = (PVOID) VM_MAXUSER_ADDRESS;
#elif defined(__sun__) || defined(_AIX) || defined(__hppa__) || ( defined (_IA64_) && defined (_HPUX_) ) || defined(__linux__)
- lpSystemInfo->lpMaximumApplicationAddress = (PVOID) -1;
+ lpSystemInfo->lpMaximumApplicationAddress = (PVOID) (1ull << 47);
#elif defined(USERLIMIT)
lpSystemInfo->lpMaximumApplicationAddress = (PVOID) USERLIMIT;
#elif defined(_WIN64)
diff --git a/src/pal/src/safecrt/input.inl b/src/pal/src/safecrt/input.inl
index eaad174ff5..25c4541029 100644
--- a/src/pal/src/safecrt/input.inl
+++ b/src/pal/src/safecrt/input.inl
@@ -671,7 +671,7 @@ scanit:
#endif /* _SECURE_SCANF */
#ifndef _UNICODE
if (fl_wchar_arg) {
- wctemp = L'?';
+ wctemp = W('?');
char temp[2];
temp[0] = (char) ch;
#if 0 // we are not supporting multibyte input strings
@@ -682,7 +682,7 @@ scanit:
#endif /* 0 */
_MBTOWC(&wctemp, temp, MB_CUR_MAX);
*(wchar_t UNALIGNED *)pointer = wctemp;
- /* just copy L'?' if mbtowc fails, errno is set by mbtowc */
+ /* just copy W('?') if mbtowc fails, errno is set by mbtowc */
pointer = (wchar_t *)pointer + 1;
#ifdef _SECURE_SCANF
--array_width;
diff --git a/src/pal/src/safecrt/makepath_s.c b/src/pal/src/safecrt/makepath_s.cpp
index 4342685b9c..4342685b9c 100644
--- a/src/pal/src/safecrt/makepath_s.c
+++ b/src/pal/src/safecrt/makepath_s.cpp
diff --git a/src/pal/src/safecrt/mbusafecrt.c b/src/pal/src/safecrt/mbusafecrt.c
deleted file mode 100644
index ca853d9269..0000000000
--- a/src/pal/src/safecrt/mbusafecrt.c
+++ /dev/null
@@ -1,254 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/***
-* mbusafecrt.c - implementaion of support functions and data for MBUSafeCRT
-*
-
-*
-* Purpose:
-* This file contains the implementation of support functions and
-* data for MBUSafeCRT declared in mbusafecrt.h and mbusafecrt_internal.h.
-****/
-
-#include "pal/palinternal.h"
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-
-#include "mbusafecrt_internal.h"
-
-/* global data */
-tSafeCRT_AssertFuncPtr sMBUSafeCRTAssertFunc = NULL;
-
-/***
-* MBUSafeCRTSetAssertFunc - Set the function called when an assert fails.
-****/
-
-void MBUSafeCRTSetAssertFunc( tSafeCRT_AssertFuncPtr inAssertFuncPtr )
-{
- /* set it */
- sMBUSafeCRTAssertFunc = inAssertFuncPtr;
-}
-
-/***
-* _putc_nolock - putc for the miniFILE stream.
-****/
-
-int _putc_nolock( char inChar, miniFILE* inStream )
-{
- int returnValue = EOF;
-
- inStream->_cnt -= sizeof( char );
-
- if ( ( inStream->_cnt ) >= 0 )
- {
- *( inStream->_ptr ) = inChar;
- inStream->_ptr += sizeof( char );
- returnValue = ( int )inChar;
- }
-
- return returnValue;
-}
-
-/***
-* _putwc_nolock - putwc for the miniFILE stream.
-****/
-
-int _putwc_nolock( wchar_t inChar, miniFILE* inStream )
-{
- int returnValue = WEOF;
-
- inStream->_cnt -= sizeof( wchar_t );
-
- if ( ( inStream->_cnt ) >= 0 )
- {
- *( ( wchar_t* )( inStream->_ptr ) ) = inChar;
- inStream->_ptr += sizeof( wchar_t );
- returnValue = ( int )inChar;
- }
-
- return returnValue;
-}
-
-/***
-* _getc_nolock - getc for the miniFILE stream.
-****/
-
-int _getc_nolock( miniFILE* inStream )
-{
- int returnValue = EOF;
-
- if ( ( inStream->_cnt ) >= ( int )( sizeof( char ) ) )
- {
- inStream->_cnt -= sizeof( char );
- returnValue = ( int )( *( inStream->_ptr ) );
- inStream->_ptr += sizeof( char );
- }
-
- return returnValue;
-}
-
-/***
-* _getwc_nolock - getc for the miniFILE stream.
-****/
-
-int _getwc_nolock( miniFILE* inStream )
-{
- int returnValue = EOF;
-
- if ( ( inStream->_cnt ) >= ( int )( sizeof( wchar_t ) ) )
- {
- inStream->_cnt -= sizeof( wchar_t );
- returnValue = ( int )( *( ( wchar_t* )( inStream->_ptr ) ) );
- inStream->_ptr += sizeof( wchar_t );
- }
-
- return returnValue;
-}
-
-/***
-* _ungetc_nolock - ungetc for the miniFILE stream.
-****/
-
-int _ungetc_nolock( char inChar, miniFILE* inStream )
-{
- int returnValue = EOF;
-
- if ( ( size_t )( ( inStream->_ptr ) - ( inStream->_base ) ) >= ( sizeof( char ) ) )
- {
- inStream->_cnt += sizeof( char );
- inStream->_ptr -= sizeof( char );
- return ( int )inChar;
- }
-
- return returnValue;
-}
-
-/***
-* _ungetwc_nolock - ungetwc for the miniFILE stream.
-****/
-
-int _ungetwc_nolock( wchar_t inChar, miniFILE* inStream )
-{
- int returnValue = WEOF;
-
- if ( ( size_t )( ( inStream->_ptr ) - ( inStream->_base ) ) >= ( sizeof( wchar_t ) ) )
- {
- inStream->_cnt += sizeof( wchar_t );
- inStream->_ptr -= sizeof( wchar_t );
- returnValue = ( unsigned short )inChar;
- }
-
- return returnValue;
-}
-
-
-/***
-* _safecrt_cfltcvt - convert a float to an ascii string.
-* Uses sprintf - this usage is OK.
-****/
-
-/* routine used for floating-point output */
-#define FORMATSIZE 30
-
-#define _snprintf snprintf
-
-// taken from output.inl
-#define FL_ALTERNATE 0x00080 /* alternate form requested */
-
-errno_t _safecrt_cfltcvt(double *arg, char *buffer, size_t sizeInBytes, int type, int precision, int flags)
-{
- char format[FORMATSIZE];
- size_t formatlen = 0;
- int retvalue;
-
- if (flags & 1)
- {
- type -= 'a' - 'A';
- }
- formatlen = 0;
- format[formatlen++] = '%';
- if (flags & FL_ALTERNATE)
- {
- format[formatlen++] = '#';
- }
- format[formatlen++] = '.';
- _itoa_s(precision, format + formatlen, FORMATSIZE - formatlen, 10);
- formatlen = strlen(format);
- format[formatlen++] = (char)type;
- format[formatlen] = 0;
-
- buffer[sizeInBytes - 1] = 0;
- retvalue = _snprintf(buffer, sizeInBytes, format, *arg);
- if (buffer[sizeInBytes - 1] != 0 || retvalue <= 0)
- {
- buffer[0] = 0;
- return EINVAL;
- }
- return 0;
-}
-
-
-/***
-* _safecrt_fassign - convert a string into a float or double.
-****/
-
-void _safecrt_fassign(int flag, void* argument, char* number )
-{
- if ( flag != 0 ) // double
- {
- double dblValue = 0.0;
- (void)sscanf( number, "%lf", &dblValue );
- *( ( double* )argument ) = dblValue;
- }
- else // float
- {
- float fltValue = 0.0;
- (void)sscanf( number, "%f", &fltValue );
- *( ( float* )argument ) = fltValue;
- }
-}
-
-
-/***
-* _safecrt_wfassign - convert a wchar_t string into a float or double.
-****/
-
-void _safecrt_wfassign(int flag, void* argument, wchar_t* number )
-{
- // We cannot use system functions for this - they
- // assume that wchar_t is four bytes, while we assume
- // two. So, we need to convert to a regular char string
- // without using any system functions. To do this,
- // we'll assume that the numbers are in the 0-9 range and
- // do a simple conversion.
-
- char* numberAsChars = ( char* )number;
- int position = 0;
-
- // do the convert
- while ( number[ position ] != 0 )
- {
- numberAsChars[ position ] = ( char )( number[ position ] & 0x00FF );
- position++;
- }
- numberAsChars[ position ] = ( char )( number[ position ] & 0x00FF );
-
- // call the normal char version
- _safecrt_fassign( flag, argument, numberAsChars );
-}
-
-
-/***
-* _minimal_chartowchar - do a simple char to wchar conversion.
-****/
-
-int _minimal_chartowchar( wchar_t* outWChar, const char* inChar )
-{
- *outWChar = ( wchar_t )( ( unsigned short )( ( unsigned char )( *inChar ) ) );
- return 1;
-}
-
-
diff --git a/src/pal/src/safecrt/mbusafecrt.cpp b/src/pal/src/safecrt/mbusafecrt.cpp
new file mode 100644
index 0000000000..4446f77fd1
--- /dev/null
+++ b/src/pal/src/safecrt/mbusafecrt.cpp
@@ -0,0 +1,249 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***
+* mbusafecrt.c - implementaion of support functions and data for MBUSafeCRT
+*
+
+*
+* Purpose:
+* This file contains the implementation of support functions and
+* data for MBUSafeCRT declared in mbusafecrt.h and mbusafecrt_internal.h.
+****/
+
+#include "pal/palinternal.h"
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+
+#include "mbusafecrt_internal.h"
+
+/* global data */
+tSafeCRT_AssertFuncPtr sMBUSafeCRTAssertFunc = NULL;
+
+/***
+* MBUSafeCRTSetAssertFunc - Set the function called when an assert fails.
+****/
+
+void MBUSafeCRTSetAssertFunc( tSafeCRT_AssertFuncPtr inAssertFuncPtr )
+{
+ /* set it */
+ sMBUSafeCRTAssertFunc = inAssertFuncPtr;
+}
+
+/***
+* _putc_nolock - putc for the miniFILE stream.
+****/
+
+int _putc_nolock( char inChar, miniFILE* inStream )
+{
+ int returnValue = EOF;
+
+ inStream->_cnt -= sizeof( char );
+
+ if ( ( inStream->_cnt ) >= 0 )
+ {
+ *( inStream->_ptr ) = inChar;
+ inStream->_ptr += sizeof( char );
+ returnValue = ( int )inChar;
+ }
+
+ return returnValue;
+}
+
+/***
+* _putwc_nolock - putwc for the miniFILE stream.
+****/
+
+int _putwc_nolock( wchar_t inChar, miniFILE* inStream )
+{
+ int returnValue = WEOF;
+
+ inStream->_cnt -= sizeof( wchar_t );
+
+ if ( ( inStream->_cnt ) >= 0 )
+ {
+ *( ( wchar_t* )( inStream->_ptr ) ) = inChar;
+ inStream->_ptr += sizeof( wchar_t );
+ returnValue = ( int )inChar;
+ }
+
+ return returnValue;
+}
+
+/***
+* _getc_nolock - getc for the miniFILE stream.
+****/
+
+int _getc_nolock( miniFILE* inStream )
+{
+ int returnValue = EOF;
+
+ if ( ( inStream->_cnt ) >= ( int )( sizeof( char ) ) )
+ {
+ inStream->_cnt -= sizeof( char );
+ returnValue = ( int )( *( inStream->_ptr ) );
+ inStream->_ptr += sizeof( char );
+ }
+
+ return returnValue;
+}
+
+/***
+* _getwc_nolock - getc for the miniFILE stream.
+****/
+
+int _getwc_nolock( miniFILE* inStream )
+{
+ int returnValue = EOF;
+
+ if ( ( inStream->_cnt ) >= ( int )( sizeof( wchar_t ) ) )
+ {
+ inStream->_cnt -= sizeof( wchar_t );
+ returnValue = ( int )( *( ( wchar_t* )( inStream->_ptr ) ) );
+ inStream->_ptr += sizeof( wchar_t );
+ }
+
+ return returnValue;
+}
+
+/***
+* _ungetc_nolock - ungetc for the miniFILE stream.
+****/
+
+int _ungetc_nolock( char inChar, miniFILE* inStream )
+{
+ int returnValue = EOF;
+
+ if ( ( size_t )( ( inStream->_ptr ) - ( inStream->_base ) ) >= ( sizeof( char ) ) )
+ {
+ inStream->_cnt += sizeof( char );
+ inStream->_ptr -= sizeof( char );
+ return ( int )inChar;
+ }
+
+ return returnValue;
+}
+
+/***
+* _ungetwc_nolock - ungetwc for the miniFILE stream.
+****/
+
+int _ungetwc_nolock( wchar_t inChar, miniFILE* inStream )
+{
+ int returnValue = WEOF;
+
+ if ( ( size_t )( ( inStream->_ptr ) - ( inStream->_base ) ) >= ( sizeof( wchar_t ) ) )
+ {
+ inStream->_cnt += sizeof( wchar_t );
+ inStream->_ptr -= sizeof( wchar_t );
+ returnValue = ( unsigned short )inChar;
+ }
+
+ return returnValue;
+}
+
+
+/***
+* _safecrt_cfltcvt - convert a float to an ascii string.
+****/
+
+/* routine used for floating-point output */
+#define FORMATSIZE 30
+
+// taken from output.inl
+#define FL_ALTERNATE 0x00080 /* alternate form requested */
+
+errno_t _safecrt_cfltcvt(double *arg, char *buffer, size_t sizeInBytes, int type, int precision, int flags)
+{
+ char format[FORMATSIZE];
+ size_t formatlen = 0;
+ int retvalue;
+
+ if (flags & 1)
+ {
+ type -= 'a' - 'A';
+ }
+ formatlen = 0;
+ format[formatlen++] = '%';
+ if (flags & FL_ALTERNATE)
+ {
+ format[formatlen++] = '#';
+ }
+ format[formatlen++] = '.';
+ _itoa_s(precision, format + formatlen, FORMATSIZE - formatlen, 10);
+ formatlen = strlen(format);
+ format[formatlen++] = (char)type;
+ format[formatlen] = 0;
+
+ buffer[sizeInBytes - 1] = 0;
+ retvalue = snprintf(buffer, sizeInBytes, format, *arg);
+ if (buffer[sizeInBytes - 1] != 0 || retvalue <= 0)
+ {
+ buffer[0] = 0;
+ return EINVAL;
+ }
+ return 0;
+}
+
+
+/***
+* _safecrt_fassign - convert a string into a float or double.
+****/
+
+void _safecrt_fassign(int flag, void* argument, char* number )
+{
+ if ( flag != 0 ) // double
+ {
+ double dblValue = strtod(number, NULL);
+ *( ( double* )argument ) = dblValue;
+ }
+ else // float
+ {
+ float fltValue = strtof(number, NULL);
+ *( ( float* )argument ) = fltValue;
+ }
+}
+
+
+/***
+* _safecrt_wfassign - convert a wchar_t string into a float or double.
+****/
+
+void _safecrt_wfassign(int flag, void* argument, wchar_t* number )
+{
+ // We cannot use system functions for this - they
+ // assume that wchar_t is four bytes, while we assume
+ // two. So, we need to convert to a regular char string
+ // without using any system functions. To do this,
+ // we'll assume that the numbers are in the 0-9 range and
+ // do a simple conversion.
+
+ char* numberAsChars = ( char* )number;
+ int position = 0;
+
+ // do the convert
+ while ( number[ position ] != 0 )
+ {
+ numberAsChars[ position ] = ( char )( number[ position ] & 0x00FF );
+ position++;
+ }
+ numberAsChars[ position ] = ( char )( number[ position ] & 0x00FF );
+
+ // call the normal char version
+ _safecrt_fassign( flag, argument, numberAsChars );
+}
+
+
+/***
+* _minimal_chartowchar - do a simple char to wchar conversion.
+****/
+
+int _minimal_chartowchar( wchar_t* outWChar, const char* inChar )
+{
+ *outWChar = ( wchar_t )( ( unsigned short )( ( unsigned char )( *inChar ) ) );
+ return 1;
+}
+
+
diff --git a/src/pal/src/safecrt/memcpy_s.c b/src/pal/src/safecrt/memcpy_s.cpp
index 27aeb79665..27aeb79665 100644
--- a/src/pal/src/safecrt/memcpy_s.c
+++ b/src/pal/src/safecrt/memcpy_s.cpp
diff --git a/src/pal/src/safecrt/memmove_s.c b/src/pal/src/safecrt/memmove_s.cpp
index a0ae5f7ea6..a0ae5f7ea6 100644
--- a/src/pal/src/safecrt/memmove_s.c
+++ b/src/pal/src/safecrt/memmove_s.cpp
diff --git a/src/pal/src/safecrt/output.inl b/src/pal/src/safecrt/output.inl
index ae0692efc5..5b86cf2c96 100644
--- a/src/pal/src/safecrt/output.inl
+++ b/src/pal/src/safecrt/output.inl
@@ -857,6 +857,12 @@ int __cdecl _output (
flags |= FL_LONG; /* 'l' => long int or wchar_t */
}
break;
+ case _T('L'):
+ if (*format == _T('p'))
+ {
+ flags |= FL_LONG;
+ }
+ break;
case _T('I'):
/*
@@ -956,7 +962,11 @@ int __cdecl _output (
#else /* _UNICODE */
if (flags & (FL_LONG|FL_WIDECHAR)) {
wchar = (wchar_t) get_int_arg(&argptr);
- no_output = 1;
+ textlen = snprintf(buffer.sz, BUFFERSIZE, "%lc", wchar);
+ if (textlen == 0)
+ {
+ no_output = 1;
+ }
} else {
/* format multibyte character */
/* this is an extension of ANSI */
@@ -1172,7 +1182,15 @@ int __cdecl _output (
precision = 2 * sizeof(void *); /* number of hex digits needed */
#if PTR_IS_INT64
- flags |= FL_I64; /* assume we're converting an int64 */
+ if (flags & (FL_LONG | FL_SHORT))
+ {
+ /* %lp, %Lp or %hp - these print 8 hex digits*/
+ precision = 2 * sizeof(int32_t);
+ }
+ else
+ {
+ flags |= FL_I64; /* assume we're converting an int64 */
+ }
#elif !PTR_IS_INT
flags |= FL_LONG; /* assume we're converting a long */
#endif /* !PTR_IS_INT */
@@ -1371,7 +1389,22 @@ int __cdecl _output (
/* write text */
#ifndef _UNICODE
if (bufferiswide && (textlen > 0)) {
- charsout = -1;
+ const WCHAR *p;
+ int mbCharCount;
+ int count;
+ char mbStr[5];
+
+ p = text.wz;
+ count = textlen;
+ while (count-- > 0) {
+ mbCharCount = snprintf(mbStr, sizeof(mbStr), "%lc", *p);
+ if (mbCharCount == 0) {
+ charsout = -1;
+ break;
+ }
+ WRITE_STRING(mbStr, mbCharCount, &charsout);
+ p++;
+ }
} else {
WRITE_STRING(text.sz, textlen, &charsout);
}
diff --git a/src/pal/src/safecrt/safecrt_input_s.c b/src/pal/src/safecrt/safecrt_input_s.cpp
index 6ba607c669..6ba607c669 100644
--- a/src/pal/src/safecrt/safecrt_input_s.c
+++ b/src/pal/src/safecrt/safecrt_input_s.cpp
diff --git a/src/pal/src/safecrt/safecrt_output_l.c b/src/pal/src/safecrt/safecrt_output_l.cpp
index d6844f4f8b..d6844f4f8b 100644
--- a/src/pal/src/safecrt/safecrt_output_l.c
+++ b/src/pal/src/safecrt/safecrt_output_l.cpp
diff --git a/src/pal/src/safecrt/safecrt_output_s.c b/src/pal/src/safecrt/safecrt_output_s.cpp
index c3e7f91404..c3e7f91404 100644
--- a/src/pal/src/safecrt/safecrt_output_s.c
+++ b/src/pal/src/safecrt/safecrt_output_s.cpp
diff --git a/src/pal/src/safecrt/safecrt_winput_s.c b/src/pal/src/safecrt/safecrt_winput_s.cpp
index 17a621781b..17a621781b 100644
--- a/src/pal/src/safecrt/safecrt_winput_s.c
+++ b/src/pal/src/safecrt/safecrt_winput_s.cpp
diff --git a/src/pal/src/safecrt/safecrt_woutput_s.c b/src/pal/src/safecrt/safecrt_woutput_s.cpp
index 52fe9400d5..52fe9400d5 100644
--- a/src/pal/src/safecrt/safecrt_woutput_s.c
+++ b/src/pal/src/safecrt/safecrt_woutput_s.cpp
diff --git a/src/pal/src/safecrt/snprintf.c b/src/pal/src/safecrt/snprintf.c
deleted file mode 100644
index c892d1a9b6..0000000000
--- a/src/pal/src/safecrt/snprintf.c
+++ /dev/null
@@ -1,18 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/***
-*snprintf.c - "Count" version of sprintf
-*
-
-*
-*Purpose:
-* The _snprintf() flavor takes a count argument that is
-* the max number of bytes that should be written to the
-* user's buffer.
-*
-*******************************************************************************/
-
-#define _COUNT_ 1
-#include "sprintf.c"
diff --git a/src/pal/src/safecrt/snprintf.cpp b/src/pal/src/safecrt/snprintf.cpp
new file mode 100644
index 0000000000..dea87167b9
--- /dev/null
+++ b/src/pal/src/safecrt/snprintf.cpp
@@ -0,0 +1,18 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***
+*snprintf.c - "Count" version of sprintf
+*
+
+*
+*Purpose:
+* The sprintf_s() flavor takes a count argument that is
+* the max number of bytes that should be written to the
+* user's buffer.
+*
+*******************************************************************************/
+
+#define _COUNT_ 1
+#include "sprintf.c"
diff --git a/src/pal/src/safecrt/splitpath_s.c b/src/pal/src/safecrt/splitpath_s.cpp
index cb8a364550..cb8a364550 100644
--- a/src/pal/src/safecrt/splitpath_s.c
+++ b/src/pal/src/safecrt/splitpath_s.cpp
diff --git a/src/pal/src/safecrt/sprintf.c b/src/pal/src/safecrt/sprintf.c
deleted file mode 100644
index 5454179f8d..0000000000
--- a/src/pal/src/safecrt/sprintf.c
+++ /dev/null
@@ -1,98 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/***
-*sprintf.c - print formatted to string
-*
-
-*
-*Purpose:
-* defines sprintf() and _snprintf() - print formatted data to string
-*
-*******************************************************************************/
-
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include "internal_securecrt.h"
-
-#include "mbusafecrt_internal.h"
-
-
-/***
-*ifndef _COUNT_
-*int sprintf(string, format, ...) - print formatted data to string
-*else
-*int _snprintf(string, cnt, format, ...) - print formatted data to string
-*endif
-*
-*Purpose:
-* Prints formatted data to the using the format string to
-* format data and getting as many arguments as called for
-* Sets up a FILE so file i/o operations can be used, make
-* string look like a huge buffer to it, but _flsbuf will
-* refuse to flush it if it fills up. Appends '\0' to make
-* it a true string. _output does the real work here
-*
-* Allocate the 'fake' _iob[] entry statically instead of on
-* the stack so that other routines can assume that _iob[]
-* entries are in are in DGROUP and, thus, are near.
-*
-*ifdef _COUNT_
-* The _snprintf() flavor takes a count argument that is
-* the max number of bytes that should be written to the
-* user's buffer.
-*endif
-*
-* Multi-thread: (1) Since there is no stream, this routine must
-* never try to get the stream lock (i.e., there is no stream
-* lock either). (2) Also, since there is only one statically
-* allocated 'fake' iob, we must lock/unlock to prevent collisions.
-*
-*Entry:
-* char *string - pointer to place to put output
-*ifdef _COUNT_
-* size_t count - max number of bytes to put in buffer
-*endif
-* char *format - format string to control data format/number
-* of arguments followed by list of arguments, number and type
-* controlled by format string
-*
-*Exit:
-* returns number of characters printed
-*
-*Exceptions:
-*
-*******************************************************************************/
-
-int sprintf_s (
- char *string,
- size_t sizeInBytes,
- const char *format,
- ...
- )
-{
- int ret;
- va_list arglist;
- va_start(arglist, format);
- ret = _vsprintf_s(string, sizeInBytes, format, arglist);
- va_end(arglist);
- return ret;
-}
-
-int _snprintf_s (
- char *string,
- size_t sizeInBytes,
- size_t count,
- const char *format,
- ...
- )
-{
- int ret;
- va_list arglist;
- va_start(arglist, format);
- ret = _vsnprintf_s(string, sizeInBytes, count, format, arglist);
- va_end(arglist);
- return ret;
-}
diff --git a/src/pal/src/safecrt/sprintf_s.cpp b/src/pal/src/safecrt/sprintf_s.cpp
new file mode 100644
index 0000000000..edfb768670
--- /dev/null
+++ b/src/pal/src/safecrt/sprintf_s.cpp
@@ -0,0 +1,98 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***
+*sprintf_s.c - print formatted to string
+*
+
+*
+*Purpose:
+* defines sprintf_s() and _snprintf_s() - print formatted data to string
+*
+*******************************************************************************/
+
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+#include "internal_securecrt.h"
+
+#include "mbusafecrt_internal.h"
+
+
+/***
+*ifndef _COUNT_
+*int sprintf_s(string, format, ...) - print formatted data to string
+*else
+*int _snprintf_s(string, cnt, format, ...) - print formatted data to string
+*endif
+*
+*Purpose:
+* Prints formatted data to the using the format string to
+* format data and getting as many arguments as called for
+* Sets up a FILE so file i/o operations can be used, make
+* string look like a huge buffer to it, but _flsbuf will
+* refuse to flush it if it fills up. Appends '\0' to make
+* it a true string. _output does the real work here
+*
+* Allocate the 'fake' _iob[] entry statically instead of on
+* the stack so that other routines can assume that _iob[]
+* entries are in are in DGROUP and, thus, are near.
+*
+*ifdef _COUNT_
+* The _snprintf_s() flavor takes a count argument that is
+* the max number of bytes that should be written to the
+* user's buffer.
+*endif
+*
+* Multi-thread: (1) Since there is no stream, this routine must
+* never try to get the stream lock (i.e., there is no stream
+* lock either). (2) Also, since there is only one statically
+* allocated 'fake' iob, we must lock/unlock to prevent collisions.
+*
+*Entry:
+* char *string - pointer to place to put output
+*ifdef _COUNT_
+* size_t count - max number of bytes to put in buffer
+*endif
+* char *format - format string to control data format/number
+* of arguments followed by list of arguments, number and type
+* controlled by format string
+*
+*Exit:
+* returns number of characters printed
+*
+*Exceptions:
+*
+*******************************************************************************/
+
+int sprintf_s (
+ char *string,
+ size_t sizeInBytes,
+ const char *format,
+ ...
+ )
+{
+ int ret;
+ va_list arglist;
+ va_start(arglist, format);
+ ret = vsprintf_s(string, sizeInBytes, format, arglist);
+ va_end(arglist);
+ return ret;
+}
+
+int _snprintf_s (
+ char *string,
+ size_t sizeInBytes,
+ size_t count,
+ const char *format,
+ ...
+ )
+{
+ int ret;
+ va_list arglist;
+ va_start(arglist, format);
+ ret = _vsnprintf_s(string, sizeInBytes, count, format, arglist);
+ va_end(arglist);
+ return ret;
+}
diff --git a/src/pal/src/safecrt/sscanf.c b/src/pal/src/safecrt/sscanf.c
deleted file mode 100644
index 94b5148875..0000000000
--- a/src/pal/src/safecrt/sscanf.c
+++ /dev/null
@@ -1,249 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/***
-*sscanf.c - read formatted data from string
-*
-
-*
-*Purpose:
-* defines scanf() - reads formatted data from string
-*
-*******************************************************************************/
-
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include "internal_securecrt.h"
-
-#include "mbusafecrt_internal.h"
-
-typedef int (*INPUTFN)(miniFILE *, const unsigned char*, va_list);
-typedef int (*WINPUTFN)(miniFILE *, const unsigned short*, va_list);
-
-
-/***
-*static int v[nw]scan_fn([w]inputfn, string, [count], format, ...)
-*
-*Purpose:
-* this is a helper function which is called by the other functions
-* in this file - sscanf/swscanf/snscanf etc. It calls either _(w)input or
-* _(w)input_s depending on the first parameter.
-*
-*******************************************************************************/
-
-static int __cdecl vscan_fn (
- INPUTFN inputfn,
- const char *string,
- const char *format,
- va_list arglist
- )
-{
- miniFILE str;
- miniFILE *infile = &str;
- int retval;
- size_t count = strlen(string);
-
- _VALIDATE_RETURN( (string != NULL), EINVAL, EOF);
- _VALIDATE_RETURN( (format != NULL), EINVAL, EOF);
-
- infile->_flag = _IOREAD|_IOSTRG|_IOMYBUF;
- infile->_ptr = infile->_base = (char *) string;
-
- if(count>(INT_MAX/sizeof(char)))
- {
- /* old-style functions allow any large value to mean unbounded */
- infile->_cnt = INT_MAX;
- }
- else
- {
- infile->_cnt = (int)count*sizeof(char);
- }
-
- retval = (inputfn(infile, ( const unsigned char* )format, arglist));
-
- return(retval);
-}
-
-static int __cdecl vnscan_fn (
- INPUTFN inputfn,
- const char *string,
- size_t count,
- const char *format,
- va_list arglist
- )
-{
- miniFILE str;
- miniFILE *infile = &str;
- int retval;
- size_t length = strlen(string);
-
- _VALIDATE_RETURN( (string != NULL), EINVAL, EOF);
- _VALIDATE_RETURN( (format != NULL), EINVAL, EOF);
-
- infile->_flag = _IOREAD|_IOSTRG|_IOMYBUF;
- infile->_ptr = infile->_base = (char *) string;
-
- if ( count > length )
- {
- count = length;
- }
-
- if(count>(INT_MAX/sizeof(char)))
- {
- /* old-style functions allow any large value to mean unbounded */
- infile->_cnt = INT_MAX;
- }
- else
- {
- infile->_cnt = (int)count*sizeof(char);
- }
-
- retval = (inputfn(infile, ( const unsigned char* )format, arglist));
-
- return(retval);
-}
-
-static int __cdecl vwscan_fn (
- WINPUTFN inputfn,
- const wchar_t *string,
- const wchar_t *format,
- va_list arglist
- )
-{
- miniFILE str;
- miniFILE *infile = &str;
- int retval;
- size_t count = wcsnlen(string, INT_MAX);
-
- _VALIDATE_RETURN( (string != NULL), EINVAL, EOF);
- _VALIDATE_RETURN( (format != NULL), EINVAL, EOF);
-
- infile->_flag = _IOREAD|_IOSTRG|_IOMYBUF;
- infile->_ptr = infile->_base = (char *) string;
-
- if(count>(INT_MAX/sizeof(wchar_t)))
- {
- /* old-style functions allow any large value to mean unbounded */
- infile->_cnt = INT_MAX;
- }
- else
- {
- infile->_cnt = (int)count*sizeof(wchar_t);
- }
-
- retval = (inputfn(infile, format, arglist));
-
- return(retval);
-}
-
-static int __cdecl vnwscan_fn (
- WINPUTFN inputfn,
- const wchar_t *string,
- size_t count,
- const wchar_t *format,
- va_list arglist
- )
-{
- miniFILE str;
- miniFILE *infile = &str;
- int retval;
- size_t length = wcsnlen(string, INT_MAX);
-
- _VALIDATE_RETURN( (string != NULL), EINVAL, EOF);
- _VALIDATE_RETURN( (format != NULL), EINVAL, EOF);
-
- infile->_flag = _IOREAD|_IOSTRG|_IOMYBUF;
- infile->_ptr = infile->_base = (char *) string;
-
- if ( count > length )
- {
- count = length;
- }
-
- if(count>(INT_MAX/sizeof(wchar_t)))
- {
- /* old-style functions allow any large value to mean unbounded */
- infile->_cnt = INT_MAX;
- }
- else
- {
- infile->_cnt = (int)count*sizeof(wchar_t);
- }
-
- retval = (inputfn(infile, format, arglist));
-
- return(retval);
-}
-
-
-/***
-*int sscanf_s(string, format, ...)
-* Same as sscanf above except that it calls _input_s to do the real work.
-*
-*int snscanf_s(string, size, format, ...)
-* Same as snscanf above except that it calls _input_s to do the real work.
-*
-* _input_s has a size check for array parameters.
-*
-*******************************************************************************/
-
-int __cdecl sscanf_s (
- const char *string,
- const char *format,
- ...
- )
-{
- int ret;
- va_list arglist;
- va_start(arglist, format);
- ret = vscan_fn(__tinput_s, string, format, arglist);
- va_end(arglist);
- return ret;
-}
-
-int __cdecl _snscanf_s (
- const char *string,
- size_t count,
- const char *format,
- ...
- )
-{
- int ret;
- va_list arglist;
- va_start(arglist, format);
- ret = vnscan_fn(__tinput_s, string, count, format, arglist);
- va_end(arglist);
- return ret;
-}
-
-int __cdecl swscanf_s (
- const wchar_t *string,
- const wchar_t *format,
- ...
- )
-{
- int ret;
- va_list arglist;
- va_start(arglist, format);
- ret = vwscan_fn(__twinput_s, string, format, arglist);
- va_end(arglist);
- return ret;
-}
-
-int __cdecl _snwscanf_s (
- const wchar_t *string,
- size_t count,
- const wchar_t *format,
- ...
- )
-{
- int ret;
- va_list arglist;
- va_start(arglist, format);
- ret = vnwscan_fn(__twinput_s, string, count, format, arglist);
- va_end(arglist);
- return ret;
-}
-
diff --git a/src/pal/src/safecrt/sscanf_s.cpp b/src/pal/src/safecrt/sscanf_s.cpp
new file mode 100644
index 0000000000..4f548bccc6
--- /dev/null
+++ b/src/pal/src/safecrt/sscanf_s.cpp
@@ -0,0 +1,249 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***
+*sscanf_s.c - read formatted data from string
+*
+
+*
+*Purpose:
+* defines scanf() - reads formatted data from string
+*
+*******************************************************************************/
+
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+#include "internal_securecrt.h"
+
+#include "mbusafecrt_internal.h"
+
+typedef int (*INPUTFN)(miniFILE *, const unsigned char*, va_list);
+typedef int (*WINPUTFN)(miniFILE *, const wchar_t*, va_list);
+
+
+/***
+*static int v[nw]scan_fn([w]inputfn, string, [count], format, ...)
+*
+*Purpose:
+* this is a helper function which is called by the other functions
+* in this file - sscanf/swscanf/snscanf etc. It calls either _(w)input or
+* _(w)input_s depending on the first parameter.
+*
+*******************************************************************************/
+
+static int __cdecl vscan_fn (
+ INPUTFN inputfn,
+ const char *string,
+ const char *format,
+ va_list arglist
+ )
+{
+ miniFILE str;
+ miniFILE *infile = &str;
+ int retval;
+ size_t count = strlen(string);
+
+ _VALIDATE_RETURN( (string != NULL), EINVAL, EOF);
+ _VALIDATE_RETURN( (format != NULL), EINVAL, EOF);
+
+ infile->_flag = _IOREAD|_IOSTRG|_IOMYBUF;
+ infile->_ptr = infile->_base = (char *) string;
+
+ if(count>(INT_MAX/sizeof(char)))
+ {
+ /* old-style functions allow any large value to mean unbounded */
+ infile->_cnt = INT_MAX;
+ }
+ else
+ {
+ infile->_cnt = (int)count*sizeof(char);
+ }
+
+ retval = (inputfn(infile, ( const unsigned char* )format, arglist));
+
+ return(retval);
+}
+
+static int __cdecl vnscan_fn (
+ INPUTFN inputfn,
+ const char *string,
+ size_t count,
+ const char *format,
+ va_list arglist
+ )
+{
+ miniFILE str;
+ miniFILE *infile = &str;
+ int retval;
+ size_t length = strlen(string);
+
+ _VALIDATE_RETURN( (string != NULL), EINVAL, EOF);
+ _VALIDATE_RETURN( (format != NULL), EINVAL, EOF);
+
+ infile->_flag = _IOREAD|_IOSTRG|_IOMYBUF;
+ infile->_ptr = infile->_base = (char *) string;
+
+ if ( count > length )
+ {
+ count = length;
+ }
+
+ if(count>(INT_MAX/sizeof(char)))
+ {
+ /* old-style functions allow any large value to mean unbounded */
+ infile->_cnt = INT_MAX;
+ }
+ else
+ {
+ infile->_cnt = (int)count*sizeof(char);
+ }
+
+ retval = (inputfn(infile, ( const unsigned char* )format, arglist));
+
+ return(retval);
+}
+
+static int __cdecl vwscan_fn (
+ WINPUTFN inputfn,
+ const wchar_t *string,
+ const wchar_t *format,
+ va_list arglist
+ )
+{
+ miniFILE str;
+ miniFILE *infile = &str;
+ int retval;
+ size_t count = wcsnlen(string, INT_MAX);
+
+ _VALIDATE_RETURN( (string != NULL), EINVAL, EOF);
+ _VALIDATE_RETURN( (format != NULL), EINVAL, EOF);
+
+ infile->_flag = _IOREAD|_IOSTRG|_IOMYBUF;
+ infile->_ptr = infile->_base = (char *) string;
+
+ if(count>(INT_MAX/sizeof(wchar_t)))
+ {
+ /* old-style functions allow any large value to mean unbounded */
+ infile->_cnt = INT_MAX;
+ }
+ else
+ {
+ infile->_cnt = (int)count*sizeof(wchar_t);
+ }
+
+ retval = (inputfn(infile, format, arglist));
+
+ return(retval);
+}
+
+static int __cdecl vnwscan_fn (
+ WINPUTFN inputfn,
+ const wchar_t *string,
+ size_t count,
+ const wchar_t *format,
+ va_list arglist
+ )
+{
+ miniFILE str;
+ miniFILE *infile = &str;
+ int retval;
+ size_t length = wcsnlen(string, INT_MAX);
+
+ _VALIDATE_RETURN( (string != NULL), EINVAL, EOF);
+ _VALIDATE_RETURN( (format != NULL), EINVAL, EOF);
+
+ infile->_flag = _IOREAD|_IOSTRG|_IOMYBUF;
+ infile->_ptr = infile->_base = (char *) string;
+
+ if ( count > length )
+ {
+ count = length;
+ }
+
+ if(count>(INT_MAX/sizeof(wchar_t)))
+ {
+ /* old-style functions allow any large value to mean unbounded */
+ infile->_cnt = INT_MAX;
+ }
+ else
+ {
+ infile->_cnt = (int)count*sizeof(wchar_t);
+ }
+
+ retval = (inputfn(infile, format, arglist));
+
+ return(retval);
+}
+
+
+/***
+*int sscanf_s(string, format, ...)
+* Same as sscanf above except that it calls _input_s to do the real work.
+*
+*int snscanf_s(string, size, format, ...)
+* Same as snscanf above except that it calls _input_s to do the real work.
+*
+* _input_s has a size check for array parameters.
+*
+*******************************************************************************/
+
+int __cdecl sscanf_s (
+ const char *string,
+ const char *format,
+ ...
+ )
+{
+ int ret;
+ va_list arglist;
+ va_start(arglist, format);
+ ret = vscan_fn(__tinput_s, string, format, arglist);
+ va_end(arglist);
+ return ret;
+}
+
+int __cdecl _snscanf_s (
+ const char *string,
+ size_t count,
+ const char *format,
+ ...
+ )
+{
+ int ret;
+ va_list arglist;
+ va_start(arglist, format);
+ ret = vnscan_fn(__tinput_s, string, count, format, arglist);
+ va_end(arglist);
+ return ret;
+}
+
+int __cdecl swscanf_s (
+ const wchar_t *string,
+ const wchar_t *format,
+ ...
+ )
+{
+ int ret;
+ va_list arglist;
+ va_start(arglist, format);
+ ret = vwscan_fn(__twinput_s, string, format, arglist);
+ va_end(arglist);
+ return ret;
+}
+
+int __cdecl _snwscanf_s (
+ const wchar_t *string,
+ size_t count,
+ const wchar_t *format,
+ ...
+ )
+{
+ int ret;
+ va_list arglist;
+ va_start(arglist, format);
+ ret = vnwscan_fn(__twinput_s, string, count, format, arglist);
+ va_end(arglist);
+ return ret;
+}
+
diff --git a/src/pal/src/safecrt/strcat_s.c b/src/pal/src/safecrt/strcat_s.cpp
index 4dc2332006..4dc2332006 100644
--- a/src/pal/src/safecrt/strcat_s.c
+++ b/src/pal/src/safecrt/strcat_s.cpp
diff --git a/src/pal/src/safecrt/strcpy_s.c b/src/pal/src/safecrt/strcpy_s.cpp
index 821dbe85f6..821dbe85f6 100644
--- a/src/pal/src/safecrt/strcpy_s.c
+++ b/src/pal/src/safecrt/strcpy_s.cpp
diff --git a/src/pal/src/safecrt/strlen_s.c b/src/pal/src/safecrt/strlen_s.c
deleted file mode 100644
index 34c1308d5c..0000000000
--- a/src/pal/src/safecrt/strlen_s.c
+++ /dev/null
@@ -1,58 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/***
-*strlen_s.c - contains strnlen() routine
-*
-
-*
-*Purpose:
-* strnlen returns the length of a null-terminated string,
-* not including the null byte itself, up to the specified max size
-*
-*******************************************************************************/
-
-
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include "internal_securecrt.h"
-
-#include "mbusafecrt_internal.h"
-
-/***
-*strnlen - return the length of a null-terminated string
-*
-*Purpose:
-* Finds the length in bytes of the given string, not including
-* the final null character. Only the first maxsize characters
-* are inspected: if the null character is not found, maxsize is
-* returned.
-*
-*Entry:
-* const char * str - string whose length is to be computed
-* size_t maxsize
-*
-*Exit:
-* Length of the string "str", exclusive of the final null byte, or
-* maxsize if the null character is not found.
-*
-*Exceptions:
-*
-*******************************************************************************/
-
-size_t __cdecl strnlen(const char *str, size_t maxsize)
-{
- size_t n;
-
- /* Note that we do not check if str == NULL, because we do not
- * return errno_t...
- */
-
- for (n = 0; n < maxsize && *str; n++, str++)
- ;
-
- return n;
-}
-
diff --git a/src/pal/src/safecrt/strlen_s.cpp b/src/pal/src/safecrt/strlen_s.cpp
new file mode 100644
index 0000000000..3f1e1cf1ae
--- /dev/null
+++ b/src/pal/src/safecrt/strlen_s.cpp
@@ -0,0 +1,58 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***
+*strlen_s.c - contains strnlen() routine
+*
+
+*
+*Purpose:
+* strnlen returns the length of a null-terminated string,
+* not including the null byte itself, up to the specified max size
+*
+*******************************************************************************/
+
+
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+#include "internal_securecrt.h"
+
+#include "mbusafecrt_internal.h"
+
+/***
+*strnlen - return the length of a null-terminated string
+*
+*Purpose:
+* Finds the length in bytes of the given string, not including
+* the final null character. Only the first maxsize characters
+* are inspected: if the null character is not found, maxsize is
+* returned.
+*
+*Entry:
+* const char * str - string whose length is to be computed
+* size_t maxsize
+*
+*Exit:
+* Length of the string "str", exclusive of the final null byte, or
+* maxsize if the null character is not found.
+*
+*Exceptions:
+*
+*******************************************************************************/
+
+size_t __cdecl PAL_strnlen(const char *str, size_t maxsize)
+{
+ size_t n;
+
+ /* Note that we do not check if str == NULL, because we do not
+ * return errno_t...
+ */
+
+ for (n = 0; n < maxsize && *str; n++, str++)
+ ;
+
+ return n;
+}
+
diff --git a/src/pal/src/safecrt/strncat_s.c b/src/pal/src/safecrt/strncat_s.cpp
index ef8c6cfc7f..ef8c6cfc7f 100644
--- a/src/pal/src/safecrt/strncat_s.c
+++ b/src/pal/src/safecrt/strncat_s.cpp
diff --git a/src/pal/src/safecrt/strncpy_s.c b/src/pal/src/safecrt/strncpy_s.cpp
index f819ebb6bb..f819ebb6bb 100644
--- a/src/pal/src/safecrt/strncpy_s.c
+++ b/src/pal/src/safecrt/strncpy_s.cpp
diff --git a/src/pal/src/safecrt/strtok_s.c b/src/pal/src/safecrt/strtok_s.cpp
index 6f1c80633f..6f1c80633f 100644
--- a/src/pal/src/safecrt/strtok_s.c
+++ b/src/pal/src/safecrt/strtok_s.cpp
diff --git a/src/pal/src/safecrt/swprintf.c b/src/pal/src/safecrt/swprintf.c
deleted file mode 100644
index 75004eafe2..0000000000
--- a/src/pal/src/safecrt/swprintf.c
+++ /dev/null
@@ -1,120 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/***
-*swprintf.c - print formatted to string
-*
-*Purpose:
-* defines _swprintf(), _swprintf_c and _snwprintf() - print formatted data
-* to string
-*
-*******************************************************************************/
-
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include "internal_securecrt.h"
-
-#include "mbusafecrt_internal.h"
-
-/***
-*ifndef _COUNT_
-*int _swprintf(string, format, ...) - print formatted data to string
-*else
-*ifndef _SWPRINTFS_ERROR_RETURN_FIX
-*int _snwprintf(string, cnt, format, ...) - print formatted data to string
-*else
-*int _swprintf_c(string, cnt, format, ...) - print formatted data to string
-*endif
-*endif
-*
-*Purpose:
-* Prints formatted data to the using the format string to
-* format data and getting as many arguments as called for
-* Sets up a FILE so file i/o operations can be used, make
-* string look like a huge buffer to it, but _flsbuf will
-* refuse to flush it if it fills up. Appends '\0' to make
-* it a true string. _output does the real work here
-*
-* Allocate the 'fake' _iob[] entry statically instead of on
-* the stack so that other routines can assume that _iob[]
-* entries are in are in DGROUP and, thus, are near.
-*
-* We alias swprintf to _swprintf
-*
-*ifdef _COUNT_
-*ifndef _SWPRINTFS_ERROR_RETURN_FIX
-* The _snwprintf() flavor takes a count argument that is
-* the max number of wide characters that should be written to the
-* user's buffer.
-* We don't expose this function directly in the headers.
-*else
-* The _swprintf_c() flavor does the same thing as the _snwprintf
-* above, but, it also fixes a issue in the return value in the case
-* when there isn't enough space to write the null terminator
-* We don't fix this issue in _snwprintf because of backward
-* compatibility. In new code, however, _snwprintf is #defined to
-* _swprintf_c so users get the fix.
-*
-*endif
-*
-* Multi-thread: (1) Since there is no stream, this routine must
-* never try to get the stream lock (i.e., there is no stream
-* lock either). (2) Also, since there is only one statically
-* allocated 'fake' iob, we must lock/unlock to prevent collisions.
-*
-*Entry:
-* wchar_t *string - pointer to place to put output
-*ifdef _COUNT_
-* size_t count - max number of wide characters to put in buffer
-*endif
-* wchar_t *format - format string to control data format/number
-* of arguments followed by list of arguments, number and type
-* controlled by format string
-*
-*Exit:
-* returns number of wide characters printed
-*
-*Exceptions:
-*
-*******************************************************************************/
-
-int __cdecl swprintf_s (
- wchar_t *string,
- size_t sizeInWords,
- const wchar_t *format,
- ...
- )
-{
- int ret;
- va_list arglist;
-
- va_start(arglist, format);
-
- ret = _vswprintf_s(string, sizeInWords, format, arglist);
-
- va_end(arglist);
-
- return ret;
-}
-
-int __cdecl _snwprintf_s (
- wchar_t *string,
- size_t sizeInWords,
- size_t count,
- const wchar_t *format,
- ...
- )
-{
- int ret;
- va_list arglist;
-
- va_start(arglist, format);
-
- ret = _vsnwprintf_s(string, sizeInWords, count, format, arglist);
-
- va_end(arglist);
-
- return ret;
-}
diff --git a/src/pal/src/safecrt/swprintf.cpp b/src/pal/src/safecrt/swprintf.cpp
new file mode 100644
index 0000000000..2fbfcfaf58
--- /dev/null
+++ b/src/pal/src/safecrt/swprintf.cpp
@@ -0,0 +1,120 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***
+*swprintf.c - print formatted to string
+*
+*Purpose:
+* defines _swprintf(), _swprintf_c and _snwprintf() - print formatted data
+* to string
+*
+*******************************************************************************/
+
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+#include "internal_securecrt.h"
+
+#include "mbusafecrt_internal.h"
+
+/***
+*ifndef _COUNT_
+*int _swprintf(string, format, ...) - print formatted data to string
+*else
+*ifndef _SWPRINTFS_ERROR_RETURN_FIX
+*int _snwprintf(string, cnt, format, ...) - print formatted data to string
+*else
+*int _swprintf_c(string, cnt, format, ...) - print formatted data to string
+*endif
+*endif
+*
+*Purpose:
+* Prints formatted data to the using the format string to
+* format data and getting as many arguments as called for
+* Sets up a FILE so file i/o operations can be used, make
+* string look like a huge buffer to it, but _flsbuf will
+* refuse to flush it if it fills up. Appends '\0' to make
+* it a true string. _output does the real work here
+*
+* Allocate the 'fake' _iob[] entry statically instead of on
+* the stack so that other routines can assume that _iob[]
+* entries are in are in DGROUP and, thus, are near.
+*
+* We alias swprintf to _swprintf
+*
+*ifdef _COUNT_
+*ifndef _SWPRINTFS_ERROR_RETURN_FIX
+* The _snwprintf() flavor takes a count argument that is
+* the max number of wide characters that should be written to the
+* user's buffer.
+* We don't expose this function directly in the headers.
+*else
+* The _swprintf_c() flavor does the same thing as the _snwprintf
+* above, but, it also fixes a issue in the return value in the case
+* when there isn't enough space to write the null terminator
+* We don't fix this issue in _snwprintf because of backward
+* compatibility. In new code, however, _snwprintf is #defined to
+* _swprintf_c so users get the fix.
+*
+*endif
+*
+* Multi-thread: (1) Since there is no stream, this routine must
+* never try to get the stream lock (i.e., there is no stream
+* lock either). (2) Also, since there is only one statically
+* allocated 'fake' iob, we must lock/unlock to prevent collisions.
+*
+*Entry:
+* wchar_t *string - pointer to place to put output
+*ifdef _COUNT_
+* size_t count - max number of wide characters to put in buffer
+*endif
+* wchar_t *format - format string to control data format/number
+* of arguments followed by list of arguments, number and type
+* controlled by format string
+*
+*Exit:
+* returns number of wide characters printed
+*
+*Exceptions:
+*
+*******************************************************************************/
+
+int __cdecl swprintf_s (
+ wchar_t *string,
+ size_t sizeInWords,
+ const wchar_t *format,
+ ...
+ )
+{
+ int ret;
+ va_list arglist;
+
+ va_start(arglist, format);
+
+ ret = vswprintf_s(string, sizeInWords, format, arglist);
+
+ va_end(arglist);
+
+ return ret;
+}
+
+int __cdecl _snwprintf_s (
+ wchar_t *string,
+ size_t sizeInWords,
+ size_t count,
+ const wchar_t *format,
+ ...
+ )
+{
+ int ret;
+ va_list arglist;
+
+ va_start(arglist, format);
+
+ ret = _vsnwprintf_s(string, sizeInWords, count, format, arglist);
+
+ va_end(arglist);
+
+ return ret;
+}
diff --git a/src/pal/src/safecrt/vsprintf.c b/src/pal/src/safecrt/vsprintf.c
deleted file mode 100644
index 4f2bd9fdeb..0000000000
--- a/src/pal/src/safecrt/vsprintf.c
+++ /dev/null
@@ -1,268 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/***
-*vsprintf.c - print formatted data into a string from var arg list
-*
-
-*
-*Purpose:
-* defines vsprintf(), _vsnprintf() and _vsnprintf_s() - print formatted output to
-* a string, get the data from an argument ptr instead of explicit
-* arguments.
-*
-*******************************************************************************/
-
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include "internal_securecrt.h"
-
-#include "mbusafecrt_internal.h"
-
-typedef int (*OUTPUTFN)(miniFILE *, const char *, va_list);
-
-static int _vsnprintf_helper( OUTPUTFN outfn, char *string, size_t count, const char *format, va_list ap );
-static int _vscprintf_helper ( OUTPUTFN outfn, const char *format, va_list ap);
-
-/***
-*ifndef _COUNT_
-*int vsprintf(string, format, ap) - print formatted data to string from arg ptr
-*else
-*int _vsnprintf(string, cnt, format, ap) - print formatted data to string from arg ptr
-*endif
-*
-*Purpose:
-* Prints formatted data, but to a string and gets data from an argument
-* pointer.
-* Sets up a FILE so file i/o operations can be used, make string look
-* like a huge buffer to it, but _flsbuf will refuse to flush it if it
-* fills up. Appends '\0' to make it a true string.
-*
-* Allocate the 'fake' _iob[] entryit statically instead of on
-* the stack so that other routines can assume that _iob[] entries are in
-* are in DGROUP and, thus, are near.
-*
-*ifdef _COUNT_
-* The _vsnprintf() flavor takes a count argument that is
-* the max number of bytes that should be written to the
-* user's buffer.
-*endif
-*
-* Multi-thread: (1) Since there is no stream, this routine must never try
-* to get the stream lock (i.e., there is no stream lock either). (2)
-* Also, since there is only one staticly allocated 'fake' iob, we must
-* lock/unlock to prevent collisions.
-*
-*Entry:
-* char *string - place to put destination string
-*ifdef _COUNT_
-* size_t count - max number of bytes to put in buffer
-*endif
-* char *format - format string, describes format of data
-* va_list ap - varargs argument pointer
-*
-*Exit:
-* returns number of characters in string
-* returns -2 if the string has been truncated (only in _vsnprintf_helper)
-* returns -1 in other error cases
-*
-*Exceptions:
-*
-*******************************************************************************/
-
-int __cdecl _vsnprintf_helper (
- OUTPUTFN outfn,
- char *string,
- size_t count,
- const char *format,
- va_list ap
- )
-{
- miniFILE str;
- miniFILE *outfile = &str;
- int retval;
-
- _VALIDATE_RETURN( (format != NULL), EINVAL, -1);
-
- _VALIDATE_RETURN( (count == 0) || (string != NULL), EINVAL, -1 );
-
- if(count>INT_MAX)
- {
- /* old-style functions allow any large value to mean unbounded */
- outfile->_cnt = INT_MAX;
- }
- else
- {
- outfile->_cnt = (int)count;
- }
-
- outfile->_flag = _IOWRT|_IOSTRG;
- outfile->_ptr = outfile->_base = string;
-
- retval = outfn(outfile, format, ap );
-
- if ( string==NULL)
- return(retval);
-
- if((retval >= 0) && (_putc_nolock('\0',outfile) != EOF))
- return(retval);
-
- string[count - 1] = 0;
-
- if (outfile->_cnt < 0)
- {
- /* the buffer was too small; we return -2 to indicate truncation */
- return -2;
- }
- return -1;
-}
-
-int __cdecl _vsprintf_s (
- char *string,
- size_t sizeInBytes,
- const char *format,
- va_list ap
- )
-{
- int retvalue = -1;
-
- /* validation section */
- _VALIDATE_RETURN(format != NULL, EINVAL, -1);
- _VALIDATE_RETURN(string != NULL && sizeInBytes > 0, EINVAL, -1);
-
- retvalue = _vsnprintf_helper(_output_s, string, sizeInBytes, format, ap);
- if (retvalue < 0)
- {
- string[0] = 0;
- _SECURECRT__FILL_STRING(string, sizeInBytes, 1);
- }
- if (retvalue == -2)
- {
- _VALIDATE_RETURN(("Buffer too small" && 0), ERANGE, -1);
- }
- if (retvalue >= 0)
- {
- _SECURECRT__FILL_STRING(string, sizeInBytes, retvalue + 1);
- }
-
- return retvalue;
-}
-
-int __cdecl _vsnprintf_s (
- char *string,
- size_t sizeInBytes,
- size_t count,
- const char *format,
- va_list ap
- )
-{
- int retvalue = -1;
- errno_t save_errno = 0;
-
- /* validation section */
- _VALIDATE_RETURN(format != NULL, EINVAL, -1);
- if (count == 0 && string == NULL && sizeInBytes == 0)
- {
- /* this case is allowed; nothing to do */
- return 0;
- }
- _VALIDATE_RETURN(string != NULL && sizeInBytes > 0, EINVAL, -1);
-
- if (sizeInBytes > count)
- {
- save_errno = errno;
- retvalue = _vsnprintf_helper(_output_s, string, count + 1, format, ap);
- if (retvalue == -2)
- {
- /* the string has been truncated, return -1 */
- _SECURECRT__FILL_STRING(string, sizeInBytes, count + 1);
- if (errno == ERANGE)
- {
- errno = save_errno;
- }
- return -1;
- }
- }
- else /* sizeInBytes <= count */
- {
- save_errno = errno;
- retvalue = _vsnprintf_helper(_output_s, string, sizeInBytes, format, ap);
- string[sizeInBytes - 1] = 0;
- /* we allow truncation if count == _TRUNCATE */
- if (retvalue == -2 && count == _TRUNCATE)
- {
- if (errno == ERANGE)
- {
- errno = save_errno;
- }
- return -1;
- }
- }
-
- if (retvalue < 0)
- {
- string[0] = 0;
- _SECURECRT__FILL_STRING(string, sizeInBytes, 1);
- if (retvalue == -2)
- {
- _VALIDATE_RETURN(("Buffer too small" && 0), ERANGE, -1);
- }
- return -1;
- }
-
- _SECURECRT__FILL_STRING(string, sizeInBytes, retvalue + 1);
-
- return (retvalue < 0 ? -1 : retvalue);
-}
-
-/***
-* _vscprintf() - counts the number of character needed to print the formatted
-* data
-*
-*Purpose:
-* Counts the number of characters in the fotmatted data.
-*
-*Entry:
-* char *format - format string, describes format of data
-* va_list ap - varargs argument pointer
-*
-*Exit:
-* returns number of characters needed to print formatted data.
-*
-*Exceptions:
-*
-*******************************************************************************/
-
-#ifndef _COUNT_
-
-int __cdecl _vscprintf_helper (
- OUTPUTFN outfn,
- const char *format,
- va_list ap
- )
-{
- miniFILE str;
- miniFILE *outfile = &str;
- int retval;
-
- _VALIDATE_RETURN( (format != NULL), EINVAL, -1);
-
- outfile->_cnt = INT_MAX; //MAXSTR;
- outfile->_flag = _IOWRT|_IOSTRG;
- outfile->_ptr = outfile->_base = NULL;
-
- retval = outfn(outfile, format, ap);
- return(retval);
-}
-
-int __cdecl _vscprintf (
- const char *format,
- va_list ap
- )
-{
- return _vscprintf_helper(_output, format, ap);
-}
-
-#endif /* _COUNT_ */
diff --git a/src/pal/src/safecrt/vsprintf.cpp b/src/pal/src/safecrt/vsprintf.cpp
new file mode 100644
index 0000000000..e1a94d086d
--- /dev/null
+++ b/src/pal/src/safecrt/vsprintf.cpp
@@ -0,0 +1,268 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***
+*vsprintf.c - print formatted data into a string from var arg list
+*
+
+*
+*Purpose:
+* defines vsprintf(), _vsnprintf() and _vsnprintf_s() - print formatted output to
+* a string, get the data from an argument ptr instead of explicit
+* arguments.
+*
+*******************************************************************************/
+
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+#include "internal_securecrt.h"
+
+#include "mbusafecrt_internal.h"
+
+typedef int (*OUTPUTFN)(miniFILE *, const char *, va_list);
+
+static int _vsnprintf_helper( OUTPUTFN outfn, char *string, size_t count, const char *format, va_list ap );
+static int _vscprintf_helper ( OUTPUTFN outfn, const char *format, va_list ap);
+
+/***
+*ifndef _COUNT_
+*int vsprintf(string, format, ap) - print formatted data to string from arg ptr
+*else
+*int _vsnprintf(string, cnt, format, ap) - print formatted data to string from arg ptr
+*endif
+*
+*Purpose:
+* Prints formatted data, but to a string and gets data from an argument
+* pointer.
+* Sets up a FILE so file i/o operations can be used, make string look
+* like a huge buffer to it, but _flsbuf will refuse to flush it if it
+* fills up. Appends '\0' to make it a true string.
+*
+* Allocate the 'fake' _iob[] entryit statically instead of on
+* the stack so that other routines can assume that _iob[] entries are in
+* are in DGROUP and, thus, are near.
+*
+*ifdef _COUNT_
+* The _vsnprintf() flavor takes a count argument that is
+* the max number of bytes that should be written to the
+* user's buffer.
+*endif
+*
+* Multi-thread: (1) Since there is no stream, this routine must never try
+* to get the stream lock (i.e., there is no stream lock either). (2)
+* Also, since there is only one staticly allocated 'fake' iob, we must
+* lock/unlock to prevent collisions.
+*
+*Entry:
+* char *string - place to put destination string
+*ifdef _COUNT_
+* size_t count - max number of bytes to put in buffer
+*endif
+* char *format - format string, describes format of data
+* va_list ap - varargs argument pointer
+*
+*Exit:
+* returns number of characters in string
+* returns -2 if the string has been truncated (only in _vsnprintf_helper)
+* returns -1 in other error cases
+*
+*Exceptions:
+*
+*******************************************************************************/
+
+int __cdecl _vsnprintf_helper (
+ OUTPUTFN outfn,
+ char *string,
+ size_t count,
+ const char *format,
+ va_list ap
+ )
+{
+ miniFILE str;
+ miniFILE *outfile = &str;
+ int retval;
+
+ _VALIDATE_RETURN( (format != NULL), EINVAL, -1);
+
+ _VALIDATE_RETURN( (count == 0) || (string != NULL), EINVAL, -1 );
+
+ if(count>INT_MAX)
+ {
+ /* old-style functions allow any large value to mean unbounded */
+ outfile->_cnt = INT_MAX;
+ }
+ else
+ {
+ outfile->_cnt = (int)count;
+ }
+
+ outfile->_flag = _IOWRT|_IOSTRG;
+ outfile->_ptr = outfile->_base = string;
+
+ retval = outfn(outfile, format, ap );
+
+ if ( string==NULL)
+ return(retval);
+
+ if((retval >= 0) && (_putc_nolock('\0',outfile) != EOF))
+ return(retval);
+
+ string[count - 1] = 0;
+
+ if (outfile->_cnt < 0)
+ {
+ /* the buffer was too small; we return -2 to indicate truncation */
+ return -2;
+ }
+ return -1;
+}
+
+int __cdecl vsprintf_s (
+ char *string,
+ size_t sizeInBytes,
+ const char *format,
+ va_list ap
+ )
+{
+ int retvalue = -1;
+
+ /* validation section */
+ _VALIDATE_RETURN(format != NULL, EINVAL, -1);
+ _VALIDATE_RETURN(string != NULL && sizeInBytes > 0, EINVAL, -1);
+
+ retvalue = _vsnprintf_helper(_output_s, string, sizeInBytes, format, ap);
+ if (retvalue < 0)
+ {
+ string[0] = 0;
+ _SECURECRT__FILL_STRING(string, sizeInBytes, 1);
+ }
+ if (retvalue == -2)
+ {
+ _VALIDATE_RETURN(("Buffer too small" && 0), ERANGE, -1);
+ }
+ if (retvalue >= 0)
+ {
+ _SECURECRT__FILL_STRING(string, sizeInBytes, retvalue + 1);
+ }
+
+ return retvalue;
+}
+
+int __cdecl _vsnprintf_s (
+ char *string,
+ size_t sizeInBytes,
+ size_t count,
+ const char *format,
+ va_list ap
+ )
+{
+ int retvalue = -1;
+ errno_t save_errno = 0;
+
+ /* validation section */
+ _VALIDATE_RETURN(format != NULL, EINVAL, -1);
+ if (count == 0 && string == NULL && sizeInBytes == 0)
+ {
+ /* this case is allowed; nothing to do */
+ return 0;
+ }
+ _VALIDATE_RETURN(string != NULL && sizeInBytes > 0, EINVAL, -1);
+
+ if (sizeInBytes > count)
+ {
+ save_errno = errno;
+ retvalue = _vsnprintf_helper(_output_s, string, count + 1, format, ap);
+ if (retvalue == -2)
+ {
+ /* the string has been truncated, return -1 */
+ _SECURECRT__FILL_STRING(string, sizeInBytes, count + 1);
+ if (errno == ERANGE)
+ {
+ errno = save_errno;
+ }
+ return -1;
+ }
+ }
+ else /* sizeInBytes <= count */
+ {
+ save_errno = errno;
+ retvalue = _vsnprintf_helper(_output_s, string, sizeInBytes, format, ap);
+ string[sizeInBytes - 1] = 0;
+ /* we allow truncation if count == _TRUNCATE */
+ if (retvalue == -2 && count == _TRUNCATE)
+ {
+ if (errno == ERANGE)
+ {
+ errno = save_errno;
+ }
+ return -1;
+ }
+ }
+
+ if (retvalue < 0)
+ {
+ string[0] = 0;
+ _SECURECRT__FILL_STRING(string, sizeInBytes, 1);
+ if (retvalue == -2)
+ {
+ _VALIDATE_RETURN(("Buffer too small" && 0), ERANGE, -1);
+ }
+ return -1;
+ }
+
+ _SECURECRT__FILL_STRING(string, sizeInBytes, retvalue + 1);
+
+ return (retvalue < 0 ? -1 : retvalue);
+}
+
+/***
+* _vscprintf() - counts the number of character needed to print the formatted
+* data
+*
+*Purpose:
+* Counts the number of characters in the fotmatted data.
+*
+*Entry:
+* char *format - format string, describes format of data
+* va_list ap - varargs argument pointer
+*
+*Exit:
+* returns number of characters needed to print formatted data.
+*
+*Exceptions:
+*
+*******************************************************************************/
+
+#ifndef _COUNT_
+
+int __cdecl _vscprintf_helper (
+ OUTPUTFN outfn,
+ const char *format,
+ va_list ap
+ )
+{
+ miniFILE str;
+ miniFILE *outfile = &str;
+ int retval;
+
+ _VALIDATE_RETURN( (format != NULL), EINVAL, -1);
+
+ outfile->_cnt = INT_MAX; //MAXSTR;
+ outfile->_flag = _IOWRT|_IOSTRG;
+ outfile->_ptr = outfile->_base = NULL;
+
+ retval = outfn(outfile, format, ap);
+ return(retval);
+}
+
+int __cdecl _vscprintf (
+ const char *format,
+ va_list ap
+ )
+{
+ return _vscprintf_helper(_output, format, ap);
+}
+
+#endif /* _COUNT_ */
diff --git a/src/pal/src/safecrt/vswprint.c b/src/pal/src/safecrt/vswprint.c
deleted file mode 100644
index 77c79b8752..0000000000
--- a/src/pal/src/safecrt/vswprint.c
+++ /dev/null
@@ -1,282 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/***
-*vswprint.c - print formatted data into a string from var arg list
-*
-*Purpose:
-* defines vswprintf(), _vswprintf_c and _vsnwprintf() - print formatted output to
-* a string, get the data from an argument ptr instead of explicit
-* arguments.
-*
-*******************************************************************************/
-
-
-#include <string.h>
-#include <errno.h>
-#include <limits.h>
-#include "internal_securecrt.h"
-
-#include "mbusafecrt_internal.h"
-
-typedef int (*WOUTPUTFN)(miniFILE *, const wchar_t *, va_list);
-
-static int _vswprintf_helper( WOUTPUTFN outfn, wchar_t *string, size_t count, const wchar_t *format, va_list ap );
-static int _vscwprintf_helper (WOUTPUTFN outfn, const wchar_t *format, va_list ap );
-
-/***
-*ifndef _COUNT_
-*int _vswprintf(string, format, ap) - print formatted data to string from arg ptr
-*else
-*ifndef _SWPRINTFS_ERROR_RETURN_FIX
-*int _vsnwprintf(string, cnt, format, ap) - print formatted data to string from arg ptr
-*else
-*int _vswprintf_c(string, cnt, format, ...) - print formatted data to string
-*endif
-*endif
-*
-*Purpose:
-* Prints formatted data, but to a string and gets data from an argument
-* pointer.
-* Sets up a FILE so file i/o operations can be used, make string look
-* like a huge buffer to it, but _flsbuf will refuse to flush it if it
-* fills up. Appends '\0' to make it a true string.
-*
-* Allocate the 'fake' _iob[] entryit statically instead of on
-* the stack so that other routines can assume that _iob[] entries are in
-* are in DGROUP and, thus, are near.
-*
-*ifdef _COUNT_
-*ifndef _SWPRINTFS_ERROR_RETURN_FIX
-* The _vsnwprintf() flavor takes a count argument that is
-* the max number of bytes that should be written to the
-* user's buffer.
-* We don't expose this function directly in the headers.
-*else
-* The _vswprintf_c() flavor does the same thing as the _snwprintf
-* above, but, it also fixes an issue in the return value in the case
-* when there isn't enough space to write the null terminator
-* We don't fix this issue in _vsnwprintf because of backward
-* compatibility. In new code, however, _vsnwprintf is #defined to
-* _vswprintf_c so users get the fix.
-*
-*endif
-*
-* Multi-thread: (1) Since there is no stream, this routine must never try
-* to get the stream lock (i.e., there is no stream lock either). (2)
-* Also, since there is only one statically allocated 'fake' iob, we must
-* lock/unlock to prevent collisions.
-*
-*Entry:
-* wchar_t *string - place to put destination string
-*ifdef _COUNT_
-* size_t count - max number of bytes to put in buffer
-*endif
-* wchar_t *format - format string, describes format of data
-* va_list ap - varargs argument pointer
-*
-*Exit:
-* returns number of wide characters in string
-* returns -2 if the string has been truncated (only in _vsnprintf_helper)
-* returns -1 in other error cases
-*
-*Exceptions:
-*
-*******************************************************************************/
-
-int __cdecl _vswprintf_helper (
- WOUTPUTFN woutfn,
- wchar_t *string,
- size_t count,
- const wchar_t *format,
- va_list ap
- )
-{
- miniFILE str;
- miniFILE *outfile = &str;
- int retval;
-
- _VALIDATE_RETURN( (format != NULL), EINVAL, -1);
-
- _VALIDATE_RETURN( (count == 0) || (string != NULL), EINVAL, -1 );
-
- outfile->_flag = _IOWRT|_IOSTRG;
- outfile->_ptr = outfile->_base = (char *) string;
-
- if(count>(INT_MAX/sizeof(wchar_t)))
- {
- /* old-style functions allow any large value to mean unbounded */
- outfile->_cnt = INT_MAX;
- }
- else
- {
- outfile->_cnt = (int)(count*sizeof(wchar_t));
- }
-
- retval = woutfn(outfile, format, ap );
-
- if(string==NULL)
- {
- return retval;
- }
-
- if((retval >= 0) && (_putc_nolock('\0',outfile) != EOF) && (_putc_nolock('\0',outfile) != EOF))
- return(retval);
-
- string[count - 1] = 0;
- if (outfile->_cnt < 0)
- {
- /* the buffer was too small; we return -2 to indicate truncation */
- return -2;
- }
- return -1;
-}
-
-int __cdecl _vswprintf_s (
- wchar_t *string,
- size_t sizeInWords,
- const wchar_t *format,
- va_list ap
- )
-{
- int retvalue = -1;
-
- /* validation section */
- _VALIDATE_RETURN(format != NULL, EINVAL, -1);
- _VALIDATE_RETURN(string != NULL && sizeInWords > 0, EINVAL, -1);
-
- retvalue = _vswprintf_helper(_woutput_s, string, sizeInWords, format, ap);
- if (retvalue < 0)
- {
- string[0] = 0;
- _SECURECRT__FILL_STRING(string, sizeInWords, 1);
- }
- if (retvalue == -2)
- {
- _VALIDATE_RETURN(("Buffer too small" && 0), ERANGE, -1);
- }
- if (retvalue >= 0)
- {
- _SECURECRT__FILL_STRING(string, sizeInWords, retvalue + 1);
- }
-
- return retvalue;
-}
-
-int __cdecl _vsnwprintf_s (
- wchar_t *string,
- size_t sizeInWords,
- size_t count,
- const wchar_t *format,
- va_list ap
- )
-{
- int retvalue = -1;
- errno_t save_errno = 0;
-
- /* validation section */
- _VALIDATE_RETURN(format != NULL, EINVAL, -1);
- if (count == 0 && string == NULL && sizeInWords == 0)
- {
- /* this case is allowed; nothing to do */
- return 0;
- }
- _VALIDATE_RETURN(string != NULL && sizeInWords > 0, EINVAL, -1);
-
- if (sizeInWords > count)
- {
- save_errno = errno;
- retvalue = _vswprintf_helper(_woutput_s, string, count + 1, format, ap);
- if (retvalue == -2)
- {
- /* the string has been truncated, return -1 */
- _SECURECRT__FILL_STRING(string, sizeInWords, count + 1);
- if (errno == ERANGE)
- {
- errno = save_errno;
- }
- return -1;
- }
- }
- else /* sizeInWords <= count */
- {
- save_errno = errno;
- retvalue = _vswprintf_helper(_woutput_s, string, sizeInWords, format, ap);
- string[sizeInWords - 1] = 0;
- /* we allow truncation if count == _TRUNCATE */
- if (retvalue == -2 && count == _TRUNCATE)
- {
- if (errno == ERANGE)
- {
- errno = save_errno;
- }
- return -1;
- }
- }
-
- if (retvalue < 0)
- {
- string[0] = 0;
- _SECURECRT__FILL_STRING(string, sizeInWords, 1);
- if (retvalue == -2)
- {
- _VALIDATE_RETURN(("Buffer too small" && 0), ERANGE, -1);
- }
- return -1;
- }
-
- _SECURECRT__FILL_STRING(string, sizeInWords, retvalue + 1);
-
- return (retvalue < 0 ? -1 : retvalue);
-}
-
-/***
-* _vscwprintf() - counts the number of character needed to print the formatted
-* data
-*
-*Purpose:
-* Counts the number of characters in the fotmatted data.
-*
-*Entry:
-* wchar_t *format - format string, describes format of data
-* va_list ap - varargs argument pointer
-*
-*Exit:
-* returns number of characters needed to print formatted data.
-*
-*Exceptions:
-*
-*******************************************************************************/
-
-#ifndef _COUNT_
-
-int __cdecl _vscwprintf_helper (
- WOUTPUTFN woutfn,
- const wchar_t *format,
- va_list ap
- )
-{
- miniFILE str;
- miniFILE *outfile = &str;
- int retval;
-
- _VALIDATE_RETURN( (format != NULL), EINVAL, -1);
-
- outfile->_cnt = INT_MAX; //MAXSTR;
- outfile->_flag = _IOWRT|_IOSTRG;
- outfile->_ptr = outfile->_base = NULL;
-
- retval = woutfn(outfile, format, ap);
- return(retval);
-}
-
-int __cdecl _vscwprintf (
- const wchar_t *format,
- va_list ap
- )
-{
- return _vscwprintf_helper(_woutput_s, format, ap);
-}
-
-#endif /* _COUNT_ */
diff --git a/src/pal/src/safecrt/vswprint.cpp b/src/pal/src/safecrt/vswprint.cpp
new file mode 100644
index 0000000000..b9940a693a
--- /dev/null
+++ b/src/pal/src/safecrt/vswprint.cpp
@@ -0,0 +1,211 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***
+*vswprint.c - print formatted data into a string from var arg list
+*
+*Purpose:
+* defines vswprintf_s() and _vsnwprintf_s() - print formatted output to
+* a string, get the data from an argument ptr instead of explicit
+* arguments.
+*
+*******************************************************************************/
+
+
+#include <string.h>
+#include <errno.h>
+#include <limits.h>
+#include "internal_securecrt.h"
+
+#include "mbusafecrt_internal.h"
+
+typedef int (*WOUTPUTFN)(miniFILE *, const wchar_t *, va_list);
+
+static int _vswprintf_helper( WOUTPUTFN outfn, wchar_t *string, size_t count, const wchar_t *format, va_list ap );
+
+/***
+*int vswprintf_s(string, sizeInWords, format, ap) - print formatted data to string from arg ptr
+*int _vsnwprintf_s(string, sizeInWords, cnt, format, ap) - print formatted data to string from arg ptr
+*Purpose:
+* Prints formatted data, but to a string and gets data from an argument
+* pointer.
+* Sets up a FILE so file i/o operations can be used, make string look
+* like a huge buffer to it, but _flsbuf will refuse to flush it if it
+* fills up. Appends '\0' to make it a true string.
+*
+* Allocate the 'fake' _iob[] entryit statically instead of on
+* the stack so that other routines can assume that _iob[] entries are in
+* are in DGROUP and, thus, are near.
+*
+* The _vsnwprintf_s() flavor takes a count argument that is
+* the max number of bytes that should be written to the
+* user's buffer.
+* We don't expose this function directly in the headers.
+*
+* Multi-thread: (1) Since there is no stream, this routine must never try
+* to get the stream lock (i.e., there is no stream lock either). (2)
+* Also, since there is only one statically allocated 'fake' iob, we must
+* lock/unlock to prevent collisions.
+*
+*Entry:
+* wchar_t *string - place to put destination string
+* size_t sizeInWords - size of the string buffer in wchar_t units
+* size_t count - max number of bytes to put in buffer
+* wchar_t *format - format string, describes format of data
+* va_list ap - varargs argument pointer
+*
+*Exit:
+* returns number of wide characters in string
+* returns -2 if the string has been truncated (only in _vsnprintf_helper)
+* returns -1 in other error cases
+*
+*Exceptions:
+*
+*******************************************************************************/
+
+int __cdecl _vswprintf_helper (
+ WOUTPUTFN woutfn,
+ wchar_t *string,
+ size_t count,
+ const wchar_t *format,
+ va_list ap
+ )
+{
+ miniFILE str;
+ miniFILE *outfile = &str;
+ int retval;
+
+ _VALIDATE_RETURN( (format != NULL), EINVAL, -1);
+
+ _VALIDATE_RETURN( (count == 0) || (string != NULL), EINVAL, -1 );
+
+ outfile->_flag = _IOWRT|_IOSTRG;
+ outfile->_ptr = outfile->_base = (char *) string;
+
+ if(count>(INT_MAX/sizeof(wchar_t)))
+ {
+ /* old-style functions allow any large value to mean unbounded */
+ outfile->_cnt = INT_MAX;
+ }
+ else
+ {
+ outfile->_cnt = (int)(count*sizeof(wchar_t));
+ }
+
+ retval = woutfn(outfile, format, ap );
+
+ if(string==NULL)
+ {
+ return retval;
+ }
+
+ if((retval >= 0) && (_putc_nolock('\0',outfile) != EOF) && (_putc_nolock('\0',outfile) != EOF))
+ return(retval);
+
+ string[count - 1] = 0;
+ if (outfile->_cnt < 0)
+ {
+ /* the buffer was too small; we return -2 to indicate truncation */
+ return -2;
+ }
+ return -1;
+}
+
+int __cdecl vswprintf_s (
+ wchar_t *string,
+ size_t sizeInWords,
+ const wchar_t *format,
+ va_list ap
+ )
+{
+ int retvalue = -1;
+
+ /* validation section */
+ _VALIDATE_RETURN(format != NULL, EINVAL, -1);
+ _VALIDATE_RETURN(string != NULL && sizeInWords > 0, EINVAL, -1);
+
+ retvalue = _vswprintf_helper(_woutput_s, string, sizeInWords, format, ap);
+ if (retvalue < 0)
+ {
+ string[0] = 0;
+ _SECURECRT__FILL_STRING(string, sizeInWords, 1);
+ }
+ if (retvalue == -2)
+ {
+ _VALIDATE_RETURN(("Buffer too small" && 0), ERANGE, -1);
+ }
+ if (retvalue >= 0)
+ {
+ _SECURECRT__FILL_STRING(string, sizeInWords, retvalue + 1);
+ }
+
+ return retvalue;
+}
+
+int __cdecl _vsnwprintf_s (
+ wchar_t *string,
+ size_t sizeInWords,
+ size_t count,
+ const wchar_t *format,
+ va_list ap
+ )
+{
+ int retvalue = -1;
+ errno_t save_errno = 0;
+
+ /* validation section */
+ _VALIDATE_RETURN(format != NULL, EINVAL, -1);
+ if (count == 0 && string == NULL && sizeInWords == 0)
+ {
+ /* this case is allowed; nothing to do */
+ return 0;
+ }
+ _VALIDATE_RETURN(string != NULL && sizeInWords > 0, EINVAL, -1);
+
+ if (sizeInWords > count)
+ {
+ save_errno = errno;
+ retvalue = _vswprintf_helper(_woutput_s, string, count + 1, format, ap);
+ if (retvalue == -2)
+ {
+ /* the string has been truncated, return -1 */
+ _SECURECRT__FILL_STRING(string, sizeInWords, count + 1);
+ if (errno == ERANGE)
+ {
+ errno = save_errno;
+ }
+ return -1;
+ }
+ }
+ else /* sizeInWords <= count */
+ {
+ save_errno = errno;
+ retvalue = _vswprintf_helper(_woutput_s, string, sizeInWords, format, ap);
+ string[sizeInWords - 1] = 0;
+ /* we allow truncation if count == _TRUNCATE */
+ if (retvalue == -2 && count == _TRUNCATE)
+ {
+ if (errno == ERANGE)
+ {
+ errno = save_errno;
+ }
+ return -1;
+ }
+ }
+
+ if (retvalue < 0)
+ {
+ string[0] = 0;
+ _SECURECRT__FILL_STRING(string, sizeInWords, 1);
+ if (retvalue == -2)
+ {
+ _VALIDATE_RETURN(("Buffer too small" && 0), ERANGE, -1);
+ }
+ return -1;
+ }
+
+ _SECURECRT__FILL_STRING(string, sizeInWords, retvalue + 1);
+
+ return (retvalue < 0 ? -1 : retvalue);
+}
diff --git a/src/pal/src/safecrt/wcscat_s.c b/src/pal/src/safecrt/wcscat_s.cpp
index 06179888ff..06179888ff 100644
--- a/src/pal/src/safecrt/wcscat_s.c
+++ b/src/pal/src/safecrt/wcscat_s.cpp
diff --git a/src/pal/src/safecrt/wcscpy_s.c b/src/pal/src/safecrt/wcscpy_s.cpp
index 4c60a81489..4c60a81489 100644
--- a/src/pal/src/safecrt/wcscpy_s.c
+++ b/src/pal/src/safecrt/wcscpy_s.cpp
diff --git a/src/pal/src/safecrt/wcslen_s.c b/src/pal/src/safecrt/wcslen_s.cpp
index 4fd5371035..4fd5371035 100644
--- a/src/pal/src/safecrt/wcslen_s.c
+++ b/src/pal/src/safecrt/wcslen_s.cpp
diff --git a/src/pal/src/safecrt/wcsncat_s.c b/src/pal/src/safecrt/wcsncat_s.cpp
index 1ff39d55f3..1ff39d55f3 100644
--- a/src/pal/src/safecrt/wcsncat_s.c
+++ b/src/pal/src/safecrt/wcsncat_s.cpp
diff --git a/src/pal/src/safecrt/wcsncpy_s.c b/src/pal/src/safecrt/wcsncpy_s.cpp
index 7902ded43a..7902ded43a 100644
--- a/src/pal/src/safecrt/wcsncpy_s.c
+++ b/src/pal/src/safecrt/wcsncpy_s.cpp
diff --git a/src/pal/src/safecrt/wcstok_s.c b/src/pal/src/safecrt/wcstok_s.cpp
index c99b30c773..c99b30c773 100644
--- a/src/pal/src/safecrt/wcstok_s.c
+++ b/src/pal/src/safecrt/wcstok_s.cpp
diff --git a/src/pal/src/safecrt/wmakepath_s.c b/src/pal/src/safecrt/wmakepath_s.cpp
index 35ab7d386e..35ab7d386e 100644
--- a/src/pal/src/safecrt/wmakepath_s.c
+++ b/src/pal/src/safecrt/wmakepath_s.cpp
diff --git a/src/pal/src/safecrt/wsplitpath_s.c b/src/pal/src/safecrt/wsplitpath_s.cpp
index c7fb107803..c7fb107803 100644
--- a/src/pal/src/safecrt/wsplitpath_s.c
+++ b/src/pal/src/safecrt/wsplitpath_s.cpp
diff --git a/src/pal/src/safecrt/xtoa_s.c b/src/pal/src/safecrt/xtoa_s.cpp
index 42cc5786d1..42cc5786d1 100644
--- a/src/pal/src/safecrt/xtoa_s.c
+++ b/src/pal/src/safecrt/xtoa_s.cpp
diff --git a/src/pal/src/safecrt/xtow_s.c b/src/pal/src/safecrt/xtow_s.cpp
index 7a02424c85..7a02424c85 100644
--- a/src/pal/src/safecrt/xtow_s.c
+++ b/src/pal/src/safecrt/xtow_s.cpp
diff --git a/src/pal/src/safecrt/xtox_s.inl b/src/pal/src/safecrt/xtox_s.inl
index e07d87adf5..7c8b2f2fd6 100644
--- a/src/pal/src/safecrt/xtox_s.inl
+++ b/src/pal/src/safecrt/xtox_s.inl
@@ -21,12 +21,9 @@
#define _i64tox_s _i64tow_s
#define _ui64tox_s _ui64tow_s
#define xtox xtow
-#define _itox _itow
#define _ltox _ltow
#define _ultox _ultow
#define x64tox x64tow
-#define _i64tox _i64tow
-#define _ui64tox _ui64tow
#else /* _UNICODE */
#define xtox_s xtoa_s
#define _itox_s _itoa_s
@@ -36,12 +33,9 @@
#define _i64tox_s _i64toa_s
#define _ui64tox_s _ui64toa_s
#define xtox xtoa
-#define _itox _itoa
#define _ltox _ltoa
#define _ultox _ultoa
#define x64tox x64toa
-#define _i64tox _i64toa
-#define _ui64tox _ui64toa
#endif /* _UNICODE */
/***
@@ -224,19 +218,6 @@ errno_t __cdecl _ultox_s (
/* Actual functions just call conversion helper with neg flag set correctly,
and return pointer to buffer. */
-TCHAR * __cdecl _itox (
- int val,
- TCHAR *buf,
- int radix
- )
-{
- if (radix == 10 && val < 0)
- xtox((unsigned long)val, buf, radix, 1);
- else
- xtox((unsigned long)(unsigned int)val, buf, radix, 0);
- return buf;
-}
-
TCHAR * __cdecl _ltox (
long val,
TCHAR *buf,
@@ -425,16 +406,6 @@ errno_t __cdecl _ui64tox_s (
/* Actual functions just call conversion helper with neg flag set correctly,
and return pointer to buffer. */
-TCHAR * __cdecl _i64tox (
- __int64 val,
- TCHAR *buf,
- int radix
- )
-{
- x64tox((unsigned __int64)val, buf, radix, (radix == 10 && val < 0));
- return buf;
-}
-
TCHAR * __cdecl _ui64tox (
unsigned __int64 val,
TCHAR *buf,
diff --git a/src/pal/src/synchmgr/synchmanager.cpp b/src/pal/src/synchmgr/synchmanager.cpp
index 473918cb68..3aec140474 100644
--- a/src/pal/src/synchmgr/synchmanager.cpp
+++ b/src/pal/src/synchmgr/synchmanager.cpp
@@ -1648,7 +1648,7 @@ namespace CorUnix
}
// Entry point routine for the thread that initiates process termination.
- DWORD TerminationRequestHandlingRoutine(LPVOID pArg)
+ DWORD PALAPI TerminationRequestHandlingRoutine(LPVOID pArg)
{
// Call the termination request handler if one is registered.
if (g_terminationRequestHandler != NULL)
diff --git a/src/pal/src/thread/context.cpp b/src/pal/src/thread/context.cpp
index f832015710..0449df568b 100644
--- a/src/pal/src/thread/context.cpp
+++ b/src/pal/src/thread/context.cpp
@@ -33,9 +33,7 @@ SET_DEFAULT_DEBUG_CHANNEL(THREAD); // some headers have code with asserts, so do
extern PGET_GCMARKER_EXCEPTION_CODE g_getGcMarkerExceptionCode;
-// in context2.S
-extern void CONTEXT_CaptureContext(LPCONTEXT lpContext);
-
+#define CONTEXT_AREA_MASK 0xffff
#ifdef _X86_
#define CONTEXT_ALL_FLOATING (CONTEXT_FLOATING_POINT | CONTEXT_EXTENDED_REGISTERS)
#elif defined(_AMD64_)
@@ -288,7 +286,7 @@ CONTEXT_GetThreadContext(
}
if (lpContext->ContextFlags &
- (CONTEXT_CONTROL | CONTEXT_INTEGER))
+ (CONTEXT_CONTROL | CONTEXT_INTEGER) & CONTEXT_AREA_MASK)
{
if (CONTEXT_GetRegisters(dwProcessId, lpContext) == FALSE)
{
@@ -348,7 +346,7 @@ CONTEXT_SetThreadContext(
}
if (lpContext->ContextFlags &
- (CONTEXT_CONTROL | CONTEXT_INTEGER))
+ (CONTEXT_CONTROL | CONTEXT_INTEGER) & CONTEXT_AREA_MASK)
{
#if HAVE_PT_REGS
if (ptrace((__ptrace_request)PT_GETREGS, dwProcessId, (caddr_t)&ptrace_registers, 0) == -1)
@@ -371,11 +369,11 @@ CONTEXT_SetThreadContext(
ASSERT("Don't know how to set the context of another process on this platform!");
return FALSE;
#endif
- if (lpContext->ContextFlags & CONTEXT_CONTROL)
+ if (lpContext->ContextFlags & CONTEXT_CONTROL & CONTEXT_AREA_MASK)
{
ASSIGN_CONTROL_REGS
}
- if (lpContext->ContextFlags & CONTEXT_INTEGER)
+ if (lpContext->ContextFlags & CONTEXT_INTEGER & CONTEXT_AREA_MASK)
{
ASSIGN_INTEGER_REGS
}
@@ -467,13 +465,13 @@ void CONTEXTToNativeContext(CONST CONTEXT *lpContext, native_context_t *native)
}
// TODO: Enable for all Unix systems
-#if defined(_AMD64_) && defined(__linux__)
+#if defined(_AMD64_) && defined(XSTATE_SUPPORTED)
if ((lpContext->ContextFlags & CONTEXT_XSTATE) == CONTEXT_XSTATE)
{
_ASSERTE(FPREG_HasExtendedState(native));
memcpy_s(FPREG_Xstate_Ymmh(native), sizeof(M128A) * 16, lpContext->VectorRegister, sizeof(M128A) * 16);
}
-#endif // _AMD64_
+#endif //_AMD64_ && XSTATE_SUPPORTED
}
/*++
@@ -564,22 +562,24 @@ void CONTEXTFromNativeContext(const native_context_t *native, LPCONTEXT lpContex
#endif
}
- // TODO: Enable for all Unix systems
-#if defined(_AMD64_) && defined(__linux__)
+#ifdef _AMD64_
if ((contextFlags & CONTEXT_XSTATE) == CONTEXT_XSTATE)
{
+ // TODO: Enable for all Unix systems
+#if XSTATE_SUPPORTED
if (FPREG_HasExtendedState(native))
{
memcpy_s(lpContext->VectorRegister, sizeof(M128A) * 16, FPREG_Xstate_Ymmh(native), sizeof(M128A) * 16);
}
else
+#endif // XSTATE_SUPPORTED
{
// Reset the CONTEXT_XSTATE bit(s) so it's clear that the extended state data in
// the CONTEXT is not valid.
const ULONG xstateFlags = CONTEXT_XSTATE & ~(CONTEXT_CONTROL & CONTEXT_INTEGER);
lpContext->ContextFlags &= ~xstateFlags;
}
- }
+ }
#endif // _AMD64_
}
@@ -855,7 +855,7 @@ CONTEXT_GetThreadContextFromPort(
mach_msg_type_number_t StateCount;
thread_state_flavor_t StateFlavor;
- if (lpContext->ContextFlags & (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS))
+ if (lpContext->ContextFlags & (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) & CONTEXT_AREA_MASK)
{
#ifdef _X86_
x86_thread_state32_t State;
@@ -877,7 +877,7 @@ CONTEXT_GetThreadContextFromPort(
CONTEXT_GetThreadContextFromThreadState(StateFlavor, (thread_state_t)&State, lpContext);
}
- if (lpContext->ContextFlags & CONTEXT_ALL_FLOATING) {
+ if (lpContext->ContextFlags & CONTEXT_ALL_FLOATING & CONTEXT_AREA_MASK) {
#ifdef _X86_
x86_float_state32_t State;
StateFlavor = x86_FLOAT_STATE32;
@@ -898,6 +898,22 @@ CONTEXT_GetThreadContextFromPort(
CONTEXT_GetThreadContextFromThreadState(StateFlavor, (thread_state_t)&State, lpContext);
}
+#if defined(_AMD64_) && defined(XSTATE_SUPPORTED)
+ if (lpContext->ContextFlags & CONTEXT_XSTATE & CONTEXT_AREA_MASK) {
+ x86_avx_state64_t State;
+ StateFlavor = x86_AVX_STATE64;
+ StateCount = sizeof(State) / sizeof(natural_t);
+ MachRet = thread_get_state(Port, StateFlavor, (thread_state_t)&State, &StateCount);
+ if (MachRet != KERN_SUCCESS)
+ {
+ ASSERT("thread_get_state(XSTATE) failed: %d\n", MachRet);
+ goto exit;
+ }
+
+ CONTEXT_GetThreadContextFromThreadState(StateFlavor, (thread_state_t)&State, lpContext);
+ }
+#endif
+
exit:
return MachRet;
}
@@ -917,7 +933,7 @@ CONTEXT_GetThreadContextFromThreadState(
{
#ifdef _X86_
case x86_THREAD_STATE32:
- if (lpContext->ContextFlags & (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS))
+ if (lpContext->ContextFlags & (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) & CONTEXT_AREA_MASK)
{
x86_thread_state32_t *pState = (x86_thread_state32_t *)threadState;
@@ -944,7 +960,7 @@ CONTEXT_GetThreadContextFromThreadState(
{
x86_float_state32_t *pState = (x86_float_state32_t *)threadState;
- if (lpContext->ContextFlags & CONTEXT_FLOATING_POINT)
+ if (lpContext->ContextFlags & CONTEXT_FLOATING_POINT & CONTEXT_AREA_MASK)
{
lpContext->FloatSave.ControlWord = *(DWORD*)&pState->fpu_fcw;
lpContext->FloatSave.StatusWord = *(DWORD*)&pState->fpu_fsw;
@@ -963,7 +979,7 @@ CONTEXT_GetThreadContextFromThreadState(
memcpy(&lpContext->FloatSave.RegisterArea[i * 10], (&pState->fpu_stmm0)[i].mmst_reg, 10);
}
- if (lpContext->ContextFlags & CONTEXT_EXTENDED_REGISTERS)
+ if (lpContext->ContextFlags & CONTEXT_EXTENDED_REGISTERS & CONTEXT_AREA_MASK)
{
// The only extended register information that Mach will tell us about are the xmm register values.
// Both Windows and Mach store the registers in a packed layout (each of the 8 registers is 16 bytes)
@@ -975,7 +991,7 @@ CONTEXT_GetThreadContextFromThreadState(
#elif defined(_AMD64_)
case x86_THREAD_STATE64:
- if (lpContext->ContextFlags & (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS))
+ if (lpContext->ContextFlags & (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS) & CONTEXT_AREA_MASK)
{
x86_thread_state64_t *pState = (x86_thread_state64_t *)threadState;
@@ -1009,7 +1025,7 @@ CONTEXT_GetThreadContextFromThreadState(
break;
case x86_FLOAT_STATE64:
- if (lpContext->ContextFlags & CONTEXT_FLOATING_POINT)
+ if (lpContext->ContextFlags & CONTEXT_FLOATING_POINT & CONTEXT_AREA_MASK)
{
x86_float_state64_t *pState = (x86_float_state64_t *)threadState;
@@ -1031,9 +1047,19 @@ CONTEXT_GetThreadContextFromThreadState(
memcpy(&lpContext->FltSave.FloatRegisters[i], (&pState->__fpu_stmm0)[i].__mmst_reg, 10);
// AMD64's FLOATING_POINT includes the xmm registers.
- memcpy(&lpContext->Xmm0, &pState->__fpu_xmm0, 8 * 16);
+ memcpy(&lpContext->Xmm0, &pState->__fpu_xmm0, 16 * 16);
+ }
+ break;
+
+#ifdef XSTATE_SUPPORTED
+ case x86_AVX_STATE64:
+ if (lpContext->ContextFlags & CONTEXT_XSTATE & CONTEXT_AREA_MASK)
+ {
+ x86_avx_state64_t *pState = (x86_avx_state64_t *)threadState;
+ memcpy(&lpContext->VectorRegister, &pState->__fpu_ymmh0, 16 * 16);
}
break;
+#endif
#else
#error Unexpected architecture.
#endif
@@ -1120,7 +1146,7 @@ CONTEXT_SetThreadContextOnPort(
mach_msg_type_number_t StateCount;
thread_state_flavor_t StateFlavor;
- if (lpContext->ContextFlags & (CONTEXT_CONTROL|CONTEXT_INTEGER))
+ if (lpContext->ContextFlags & (CONTEXT_CONTROL|CONTEXT_INTEGER) & CONTEXT_AREA_MASK)
{
#ifdef _X86_
x86_thread_state32_t State;
@@ -1187,21 +1213,42 @@ CONTEXT_SetThreadContextOnPort(
}
}
- if (lpContext->ContextFlags & CONTEXT_ALL_FLOATING)
+ if (lpContext->ContextFlags & CONTEXT_ALL_FLOATING & CONTEXT_AREA_MASK)
{
#ifdef _X86_
x86_float_state32_t State;
StateFlavor = x86_FLOAT_STATE32;
+ StateCount = sizeof(State) / sizeof(natural_t);
#elif defined(_AMD64_)
+#ifdef XSTATE_SUPPORTED
+ // We're relying on the fact that the initial portion of
+ // x86_avx_state64_t is identical to x86_float_state64_t.
+ // Check a few fields to make sure the assumption is correct.
+ static_assert_no_msg(sizeof(x86_avx_state64_t) > sizeof(x86_float_state64_t));
+ static_assert_no_msg(offsetof(x86_avx_state64_t, __fpu_fcw) == offsetof(x86_float_state64_t, __fpu_fcw));
+ static_assert_no_msg(offsetof(x86_avx_state64_t, __fpu_xmm0) == offsetof(x86_float_state64_t, __fpu_xmm0));
+
+ x86_avx_state64_t State;
+ if (lpContext->ContextFlags & CONTEXT_XSTATE & CONTEXT_AREA_MASK)
+ {
+ StateFlavor = x86_AVX_STATE64;
+ StateCount = sizeof(State) / sizeof(natural_t);
+ }
+ else
+ {
+ StateFlavor = x86_FLOAT_STATE64;
+ StateCount = sizeof(x86_float_state64_t) / sizeof(natural_t);
+ }
+#else
x86_float_state64_t State;
StateFlavor = x86_FLOAT_STATE64;
+ StateCount = sizeof(State) / sizeof(natural_t);
+#endif
#else
#error Unexpected architecture.
#endif
- StateCount = sizeof(State) / sizeof(natural_t);
-
// If we're setting only one of the floating point or extended registers (of which Mach supports only
// the xmm values) then we don't have values for the other set. This is a problem since Mach only
// supports setting both groups as a single unit. So in this case we'll need to fetch the current
@@ -1222,7 +1269,7 @@ CONTEXT_SetThreadContextOnPort(
_ASSERTE(StateCountGet == StateCount);
}
- if (lpContext->ContextFlags & CONTEXT_FLOATING_POINT)
+ if (lpContext->ContextFlags & CONTEXT_FLOATING_POINT & CONTEXT_AREA_MASK)
{
#ifdef _X86_
*(DWORD*)&State.fpu_fcw = lpContext->FloatSave.ControlWord;
@@ -1258,14 +1305,14 @@ CONTEXT_SetThreadContextOnPort(
for (int i = 0; i < 8; i++)
memcpy((&State.__fpu_stmm0)[i].__mmst_reg, &lpContext->FltSave.FloatRegisters[i], 10);
- memcpy(&State.__fpu_xmm0, &lpContext->Xmm0, 8 * 16);
+ memcpy(&State.__fpu_xmm0, &lpContext->Xmm0, 16 * 16);
#else
#error Unexpected architecture.
#endif
}
#ifdef _X86_
- if (lpContext->ContextFlags & CONTEXT_EXTENDED_REGISTERS)
+ if (lpContext->ContextFlags & CONTEXT_EXTENDED_REGISTERS & CONTEXT_AREA_MASK)
{
// The only extended register information that Mach will tell us about are the xmm register
// values. Both Windows and Mach store the registers in a packed layout (each of the 8 registers
@@ -1274,6 +1321,13 @@ CONTEXT_SetThreadContextOnPort(
}
#endif // _X86_
+#if defined(_AMD64_) && defined(XSTATE_SUPPORTED)
+ if (lpContext->ContextFlags & CONTEXT_XSTATE & CONTEXT_AREA_MASK)
+ {
+ memcpy(&State.__fpu_ymmh0, lpContext->VectorRegister, 16 * 16);
+ }
+#endif
+
MachRet = thread_set_state(Port,
StateFlavor,
(thread_state_t)&State,
diff --git a/src/pal/src/thread/process.cpp b/src/pal/src/thread/process.cpp
index 315145dc03..a64bfb8ab1 100644
--- a/src/pal/src/thread/process.cpp
+++ b/src/pal/src/thread/process.cpp
@@ -2049,18 +2049,18 @@ GetProcessIdDisambiguationKey(DWORD processId, UINT64 *disambiguationKey)
// According to `man proc`, the second field in the stat file is the filename of the executable,
// in parentheses. Tokenizing the stat file using spaces as separators breaks when that name
- // has spaces in it, so we start using sscanf after skipping everything up to and including the
+ // has spaces in it, so we start using sscanf_s after skipping everything up to and including the
// last closing paren and the space after it.
char *scanStartPosition = strrchr(line, ')') + 2;
// All the format specifiers for the fields in the stat file are provided by 'man proc'.
- int sscanfRet = sscanf(scanStartPosition,
+ int sscanfRet = sscanf_s(scanStartPosition,
"%*c %*d %*d %*d %*d %*d %*u %*lu %*lu %*lu %*lu %*lu %*lu %*ld %*ld %*ld %*ld %*ld %*ld %llu \n",
&starttime);
if (sscanfRet != 1)
{
- _ASSERTE(!"Failed to parse stat file contents with sscanf.");
+ _ASSERTE(!"Failed to parse stat file contents with sscanf_s.");
return FALSE;
}
@@ -2095,7 +2095,7 @@ PAL_GetTransportPipeName(char *name, DWORD id, const char *suffix)
// also try to use 0 as the value.
_ASSERTE(ret == TRUE || disambiguationKey == 0);
- int chars = _snprintf(name, MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH, PipeNameFormat, id, disambiguationKey, suffix);
+ int chars = snprintf(name, MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH, PipeNameFormat, id, disambiguationKey, suffix);
_ASSERTE(chars > 0 && chars < MAX_DEBUGGER_TRANSPORT_PIPE_NAME_LENGTH);
}
@@ -2690,7 +2690,7 @@ CreateProcessModules(
char moduleName[PATH_MAX];
int size;
- if (sscanf(line, "__TEXT %p-%p [ %dK] %*[-/rwxsp] SM=%*[A-Z] %s\n", &startAddress, &endAddress, &size, moduleName) == 4)
+ if (sscanf_s(line, "__TEXT %p-%p [ %dK] %*[-/rwxsp] SM=%*[A-Z] %s\n", &startAddress, &endAddress, &size, moduleName, _countof(moduleName)) == 4)
{
bool dup = false;
for (ProcessModules *entry = listHead; entry != NULL; entry = entry->Next)
@@ -2768,7 +2768,7 @@ exit:
int devHi, devLo, inode;
char moduleName[PATH_MAX];
- if (sscanf(line, "%p-%p %*[-rwxsp] %p %x:%x %d %s\n", &startAddress, &endAddress, &offset, &devHi, &devLo, &inode, moduleName) == 7)
+ if (sscanf_s(line, "%p-%p %*[-rwxsp] %p %x:%x %d %s\n", &startAddress, &endAddress, &offset, &devHi, &devLo, &inode, moduleName, _countof(moduleName)) == 7)
{
if (inode != 0)
{
diff --git a/src/pal/tests/CMakeLists.txt b/src/pal/tests/CMakeLists.txt
index a6d1ba4d5b..39d5852889 100644
--- a/src/pal/tests/CMakeLists.txt
+++ b/src/pal/tests/CMakeLists.txt
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 2.8.12.2)
-if(CLR_CMAKE_PLATFORM_ARCH_AMD64)
+if(CLR_CMAKE_PLATFORM_ARCH_I386)
+ set(PAL_CMAKE_PLATFORM_ARCH_I386 1)
+elseif(CLR_CMAKE_PLATFORM_ARCH_AMD64)
set(PAL_CMAKE_PLATFORM_ARCH_AMD64 1)
elseif(CLR_CMAKE_PLATFORM_ARCH_ARM)
set(PAL_CMAKE_PLATFORM_ARCH_ARM 1)
@@ -14,7 +16,9 @@ add_definitions(-DLP64COMPATIBLE=1)
add_definitions(-DFEATURE_PAL=1)
add_definitions(-DCORECLR=1)
add_definitions(-DPIC=1)
-if(PAL_CMAKE_PLATFORM_ARCH_AMD64)
+if(PAL_CMAKE_PLATFORM_ARCH_I386)
+ add_definitions(-DBIT32=1)
+elseif(PAL_CMAKE_PLATFORM_ARCH_AMD64)
add_definitions(-DBIT64=1)
add_definitions(-D_WIN64=1)
elseif(PAL_CMAKE_PLATFORM_ARCH_ARM)
@@ -23,10 +27,15 @@ elseif(PAL_CMAKE_PLATFORM_ARCH_ARM64)
add_definitions(-DBIT64=1)
add_definitions(-D_WIN64=1)
else()
- message(FATAL_ERROR "Only ARM, ARM64 and AMD64 is supported")
+ message(FATAL_ERROR "Only ARM, ARM64, I386, and AMD64 is supported")
endif()
+# C++ emits errors and warnings for c-string literal fed into char* parameter
+# this is just to take care of the warnings
+add_compile_options(-Wno-writable-strings)
+
add_compile_options(-Wno-empty-body)
add_subdirectory(palsuite)
+
diff --git a/src/pal/tests/palsuite/c_runtime/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/CMakeLists.txt
index 533454c285..cf062530eb 100644
--- a/src/pal/tests/palsuite/c_runtime/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/CMakeLists.txt
@@ -2,16 +2,23 @@ cmake_minimum_required(VERSION 2.8.12.2)
add_subdirectory(abs)
add_subdirectory(acos)
+add_subdirectory(acosf)
add_subdirectory(asin)
+add_subdirectory(asinf)
add_subdirectory(atan)
add_subdirectory(atan2)
+add_subdirectory(atan2f)
+add_subdirectory(atanf)
add_subdirectory(atof)
add_subdirectory(atoi)
add_subdirectory(atol)
add_subdirectory(bsearch)
add_subdirectory(ceil)
+add_subdirectory(ceilf)
add_subdirectory(cos)
+add_subdirectory(cosf)
add_subdirectory(cosh)
+add_subdirectory(coshf)
# TODO: make this test compile
# add_subdirectory(ctime)
@@ -19,6 +26,7 @@ add_subdirectory(cosh)
add_subdirectory(errno)
add_subdirectory(exit)
add_subdirectory(exp)
+add_subdirectory(expf)
add_subdirectory(fabs)
add_subdirectory(fabsf)
add_subdirectory(fclose)
@@ -27,6 +35,7 @@ add_subdirectory(ferror)
add_subdirectory(fflush)
add_subdirectory(fgets)
add_subdirectory(floor)
+add_subdirectory(floorf)
add_subdirectory(fmod)
add_subdirectory(fmodf)
add_subdirectory(fopen)
@@ -57,6 +66,8 @@ add_subdirectory(llabs)
add_subdirectory(localtime)
add_subdirectory(log)
add_subdirectory(log10)
+add_subdirectory(log10f)
+add_subdirectory(logf)
add_subdirectory(malloc)
add_subdirectory(memchr)
add_subdirectory(memcmp)
@@ -66,15 +77,19 @@ add_subdirectory(memset)
add_subdirectory(modf)
add_subdirectory(modff)
add_subdirectory(pow)
+add_subdirectory(powf)
add_subdirectory(printf)
add_subdirectory(qsort)
add_subdirectory(rand_srand)
add_subdirectory(realloc)
add_subdirectory(sin)
+add_subdirectory(sinf)
add_subdirectory(sinh)
-add_subdirectory(sprintf)
+add_subdirectory(sinhf)
+add_subdirectory(sprintf_s)
add_subdirectory(sqrt)
-add_subdirectory(sscanf)
+add_subdirectory(sqrtf)
+add_subdirectory(sscanf_s)
add_subdirectory(strcat)
add_subdirectory(strchr)
add_subdirectory(strcmp)
@@ -94,7 +109,9 @@ add_subdirectory(strtoul)
add_subdirectory(swprintf)
add_subdirectory(swscanf)
add_subdirectory(tan)
+add_subdirectory(tanf)
add_subdirectory(tanh)
+add_subdirectory(tanhf)
add_subdirectory(time)
add_subdirectory(tolower)
add_subdirectory(toupper)
@@ -125,6 +142,7 @@ add_subdirectory(_alloca)
add_subdirectory(_ecvt)
add_subdirectory(_fdopen)
add_subdirectory(_finite)
+add_subdirectory(_finitef)
add_subdirectory(_fullpath)
# TODO: make this test compile
@@ -132,31 +150,26 @@ add_subdirectory(_fullpath)
add_subdirectory(_getw)
add_subdirectory(_isnan)
+add_subdirectory(_isnanf)
add_subdirectory(_itow)
-add_subdirectory(_makepath)
add_subdirectory(_mbsdec)
add_subdirectory(_mbsinc)
-add_subdirectory(_mbslen)
add_subdirectory(_mbsninc)
add_subdirectory(_open_osfhandle)
add_subdirectory(_putenv)
add_subdirectory(_putw)
add_subdirectory(_rotl)
add_subdirectory(_rotr)
-add_subdirectory(_snprintf)
-add_subdirectory(_snwprintf)
-add_subdirectory(_splitpath)
+add_subdirectory(_snprintf_s)
+add_subdirectory(_snwprintf_s)
add_subdirectory(_stricmp)
add_subdirectory(_strlwr)
add_subdirectory(_strnicmp)
-add_subdirectory(_swab)
add_subdirectory(_vsnprintf)
-add_subdirectory(_vsnwprintf)
+add_subdirectory(_vsnwprintf_s)
add_subdirectory(_wcsicmp)
add_subdirectory(_wcslwr)
add_subdirectory(_wcsnicmp)
add_subdirectory(_wfopen)
-add_subdirectory(_wmakepath)
-add_subdirectory(_wsplitpath)
add_subdirectory(_wtoi)
add_subdirectory(__iscsym)
diff --git a/src/pal/tests/palsuite/c_runtime/__iscsym/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/__iscsym/test1/CMakeLists.txt
index a283161f7d..b4421e77a1 100644
--- a/src/pal/tests/palsuite/c_runtime/__iscsym/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/__iscsym/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- __iscsym.c
+ __iscsym.cpp
)
add_executable(paltest_iscsym_test1
diff --git a/src/pal/tests/palsuite/c_runtime/__iscsym/test1/__iscsym.c b/src/pal/tests/palsuite/c_runtime/__iscsym/test1/__iscsym.cpp
index 9c8f1d0f25..9c8f1d0f25 100644
--- a/src/pal/tests/palsuite/c_runtime/__iscsym/test1/__iscsym.c
+++ b/src/pal/tests/palsuite/c_runtime/__iscsym/test1/__iscsym.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_alloca/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_alloca/test1/CMakeLists.txt
index 236b356185..434633be20 100644
--- a/src/pal/tests/palsuite/c_runtime/_alloca/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_alloca/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_alloca_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.cpp
index c533d84234..c533d84234 100644
--- a/src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_alloca/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_ecvt/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_ecvt/test1/CMakeLists.txt
index 86f4547b2b..e78a802723 100644
--- a/src/pal/tests/palsuite/c_runtime/_ecvt/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_ecvt/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_ecvt_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_ecvt/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_ecvt/test1/test1.cpp
index fbcf11ecfc..fbcf11ecfc 100644
--- a/src/pal/tests/palsuite/c_runtime/_ecvt/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_ecvt/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_fdopen/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_fdopen/test1/CMakeLists.txt
index 441d32bd5c..60b036f44d 100644
--- a/src/pal/tests/palsuite/c_runtime/_fdopen/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_fdopen/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fdopen_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_fdopen/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_fdopen/test1/test1.cpp
index b88267c6e4..b88267c6e4 100644
--- a/src/pal/tests/palsuite/c_runtime/_fdopen/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_fdopen/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_finite/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_finite/test1/CMakeLists.txt
index 8aca58a8dc..ac2f25d85a 100644
--- a/src/pal/tests/palsuite/c_runtime/_finite/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_finite/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_finite_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_finite/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_finite/test1/test1.cpp
index c815055b38..c815055b38 100644
--- a/src/pal/tests/palsuite/c_runtime/_finite/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_finite/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_finitef/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_finitef/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_finitef/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/_finitef/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_finitef/test1/CMakeLists.txt
new file mode 100644
index 0000000000..9ef630fbb2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_finitef/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_finitef_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_finitef_test1 coreclrpal)
+
+target_link_libraries(paltest_finitef_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_finitef/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_finitef/test1/test1.c
new file mode 100644
index 0000000000..f9a1109a66
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_finitef/test1/test1.c
@@ -0,0 +1,119 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Checks that _finitef correctly classifies all types
+** of floating point numbers (NaN, -Infinity, Infinity,
+** finite nonzero, unnormalized, 0, and -0)
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+
+/*
+The IEEE single precision floating point standard looks like this:
+
+ S EEEEEEEE FFFFFFFFFFFFFFFFFFFFFFF
+ 0 1 8 9 31
+
+S is the sign bit. The E bits are the exponent, and the 23 F bits are
+the fraction. These represent a value, V.
+
+If E=255 and F is nonzero, then V=NaN ("Not a number")
+If E=255 and F is zero and S is 1, then V=-Infinity
+If E=255 and F is zero and S is 0, then V=Infinity
+If 0<E<255 then V=(-1)^S * 2^(E-1028) * (1.F) where "1.F" is the binary
+ number created by prefixing F with a leading 1 and a binary point.
+If E=0 and F is nonzero, then V=(-1)^S * 2^(-127) * (0.F) These are
+ "unnormalized" values.
+If E=0 and F is zero and S is 1, then V=-0
+If E=0 and F is zero and S is 0, then V=0
+
+*/
+
+#define TO_FLOAT(x) (*((float*)((void*)&x)))
+
+int __cdecl main(int argc, char **argv)
+{
+ /*non-finite numbers*/
+ UINT32 lsnan = 0xffffffffu;
+ UINT32 lqnan = 0x7fffffffu;
+ UINT32 lneginf = 0xff800000u;
+ UINT32 lposinf = 0x7f800000u;
+
+ float snan = TO_FLOAT(lsnan);
+ float qnan = TO_FLOAT(lqnan);
+ float neginf = TO_FLOAT(lneginf);
+ float posinf = TO_FLOAT(lposinf);
+
+ /*finite numbers*/
+ UINT32 lnegunnormalized = 0x807fffffu;
+ UINT32 lposunnormalized = 0x007fffffu;
+ UINT32 lnegzero = 0x80000000u;
+
+ float negunnormalized = TO_FLOAT(lnegunnormalized);
+ float posunnormalized = TO_FLOAT(lposunnormalized);
+ float negzero = TO_FLOAT(lnegzero);
+
+ /*
+ * Initialize the PAL and return FAIL if this fails
+ */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ /*non-finite numbers*/
+ if (_finitef(snan) || _finitef(qnan))
+ {
+ Fail("_finitef() found NAN to be finite.\n");
+ }
+
+ if (_finitef(neginf))
+ {
+ Fail("_finitef() found negative infinity to be finite.\n");
+ }
+
+ if (_finitef(posinf))
+ {
+ Fail("_finitef() found infinity to be finite.\n");
+ }
+
+ /*finite numbers*/
+ if (!_finitef(negunnormalized))
+ {
+ Fail("_finitef() found a negative unnormalized value to be infinite.\n");
+ }
+
+ if (!_finitef(posunnormalized))
+ {
+ Fail("_finitef() found an unnormalized value to be infinite.\n");
+ }
+
+ if (!_finitef(negzero))
+ {
+ Fail("_finitef() found negative zero to be infinite.\n");
+ }
+
+ if (!_finitef(+0.0f))
+ {
+ Fail("_finitef() found zero to be infinite.\n");
+ }
+
+ if (!_finitef(-123.456f))
+ {
+ Fail("_finitef() found %f to be infinite.\n", -123.456f);
+ }
+
+ if (!_finitef(+123.456f))
+ {
+ Fail("_finitef() found %f to be infinite.\n", +123.456f);
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_finitef/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_finitef/test1/testinfo.dat
new file mode 100644
index 0000000000..b0767431e5
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_finitef/test1/testinfo.dat
@@ -0,0 +1,13 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _finitef
+Name = Positive Test for _finitef
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Checks that _finitef correctly classifies all types of floating point
+= numbers (NaN, -Infinity, Infinity, finite nonzero, unnormalized, 0, and -0).
diff --git a/src/pal/tests/palsuite/c_runtime/_fullpath/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_fullpath/test1/CMakeLists.txt
index 9306efa700..0c9029f6e2 100644
--- a/src/pal/tests/palsuite/c_runtime/_fullpath/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_fullpath/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fullpath_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_fullpath/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_fullpath/test1/test1.cpp
index f390f4309b..f390f4309b 100644
--- a/src/pal/tests/palsuite/c_runtime/_fullpath/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_fullpath/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_gcvt/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_gcvt/test1/CMakeLists.txt
index 33eb5cf19c..47dcb95754 100644
--- a/src/pal/tests/palsuite/c_runtime/_gcvt/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_gcvt/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- _gcvt.c
+ _gcvt.cpp
)
add_executable(paltest_gcvt_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_gcvt/test1/_gcvt.c b/src/pal/tests/palsuite/c_runtime/_gcvt/test1/_gcvt.cpp
index ccfc286898..ccfc286898 100644
--- a/src/pal/tests/palsuite/c_runtime/_gcvt/test1/_gcvt.c
+++ b/src/pal/tests/palsuite/c_runtime/_gcvt/test1/_gcvt.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_gcvt/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_gcvt/test2/CMakeLists.txt
index 05641b9b78..5b0f5608f3 100644
--- a/src/pal/tests/palsuite/c_runtime/_gcvt/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_gcvt/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_gcvt_test2
diff --git a/src/pal/tests/palsuite/c_runtime/_gcvt/test2/test2.c b/src/pal/tests/palsuite/c_runtime/_gcvt/test2/test2.cpp
index 7ac9a4fcf0..7ac9a4fcf0 100644
--- a/src/pal/tests/palsuite/c_runtime/_gcvt/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/_gcvt/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_getw/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_getw/test1/CMakeLists.txt
index d44477b232..4f763bed6b 100644
--- a/src/pal/tests/palsuite/c_runtime/_getw/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_getw/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getw_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_getw/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_getw/test1/test1.cpp
index 34ce4ee7de..34ce4ee7de 100644
--- a/src/pal/tests/palsuite/c_runtime/_getw/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_getw/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_isnan/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_isnan/test1/CMakeLists.txt
index e14d0cc64b..106ccb93d7 100644
--- a/src/pal/tests/palsuite/c_runtime/_isnan/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_isnan/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isnan_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_isnan/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_isnan/test1/test1.cpp
index d793c9b371..d793c9b371 100644
--- a/src/pal/tests/palsuite/c_runtime/_isnan/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_isnan/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_isnanf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_isnanf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_isnanf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/_isnanf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_isnanf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..a8d42aa975
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_isnanf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_isnanf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_isnanf_test1 coreclrpal)
+
+target_link_libraries(paltest_isnanf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_isnanf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_isnanf/test1/test1.c
new file mode 100644
index 0000000000..9b75a7236d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_isnanf/test1/test1.c
@@ -0,0 +1,115 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose:
+** Test _isnanf with a number of trivial values, to ensure they indicated that
+** they are numbers. Then try with Positive/Negative Infinite, which should
+** also be numbers. Finally set the least and most significant bits of
+** the fraction to positive and negative, at which point it should return
+** the true value.
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+
+#define TO_FLOAT(x) (*((float*)((void*)&x)))
+#define TO_I32(x) (*((INT32*)((void*)&x)))
+
+/*
+ * NaN: any float with maximum exponent (0x7f8) and non-zero fraction
+ */
+int __cdecl main(int argc, char *argv[])
+{
+ /*
+ * Initialize the PAL and return FAIL if this fails
+ */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ /*
+ * Try some trivial values
+ */
+ if (_isnanf(0.0f))
+ {
+ Fail("_isnanf() incorrectly identified %f as NaN!\n", 0.0f);
+ }
+
+ if (_isnanf(1.234567f))
+ {
+ Fail("_isnanf() incorrectly identified %f as NaN!\n", 1.234567f);
+ }
+
+ if (_isnanf(42.0f))
+ {
+ Fail("_isnanf() incorrectly identified %f as NaN!\n", 42.0f);
+ }
+
+ UINT32 lneginf = 0xff800000u;
+ UINT32 lposinf = 0x7f800000u;
+
+ float neginf = TO_FLOAT(lneginf);
+ float posinf = TO_FLOAT(lposinf);
+
+ /*
+ * Try positive and negative infinity
+ */
+ if (_isnanf(neginf))
+ {
+ Fail("_isnanf() incorrectly identified negative infinity as NaN!\n");
+ }
+
+ if (_isnanf(posinf))
+ {
+ Fail("_isnanf() incorrectly identified infinity as NaN!\n");
+ }
+
+ /*
+ * Try setting the least significant bit of the fraction,
+ * positive and negative
+ */
+ UINT32 lsnan = 0xff800001u;
+ float snan = TO_FLOAT(lsnan);
+
+ if (!_isnanf(snan))
+ {
+ Fail("_isnanf() failed to identify %I32x as NaN!\n", lsnan);
+ }
+
+ UINT32 lqnan = 0x7f800001u;
+ float qnan = TO_FLOAT(lqnan);
+
+ if (!_isnanf(qnan))
+ {
+ Fail("_isnanf() failed to identify %I32x as NaN!\n", lqnan);
+ }
+
+ /*
+ * Try setting the most significant bit of the fraction,
+ * positive and negative
+ */
+ lsnan = 0xffc00000u;
+ snan = TO_FLOAT(lsnan);
+
+ if (!_isnanf(snan))
+ {
+ Fail ("_isnanf() failed to identify %I32x as NaN!\n", lsnan);
+ }
+
+ lqnan = 0x7fc00000u;
+ qnan = TO_FLOAT(lqnan);
+
+ if (!_isnanf(qnan))
+ {
+ Fail ("_isnanf() failed to identify %I32x as NaN!\n", lqnan);
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_isnanf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_isnanf/test1/testinfo.dat
new file mode 100644
index 0000000000..22b0edbd74
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_isnanf/test1/testinfo.dat
@@ -0,0 +1,16 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _isnanf
+Name = Test #1 for _isnanf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Test _isnanf with a number of trivial values, to ensure they indicated that
+= they are numbers. Then try with Positive/Negative Infinite, which should
+= also be numbers. Finally set the least and most significant bits of
+= the fraction to positive and negative, at which point it should return
+= the true value.
diff --git a/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt
index bd37f31216..2c5d57bd34 100644
--- a/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_itow/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_itow_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.c
deleted file mode 100644
index 745ce4acaa..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.c
+++ /dev/null
@@ -1,102 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test1.c
-**
-** Purpose: Tests the PAL implementation of the _itow function.
-** Test a number of ints with different radix on each,
-** to ensure that the string returned is correct.
-**
-**
-**===================================================================*/
-
-#define UNICODE
-
-#include <palsuite.h>
-
-struct testCase
-{
- wchar_t *CorrectResult;
- int value;
- int radix;
-};
-
-int __cdecl main(int argc, char **argv)
-{
-
- wchar_t result[20];
- wchar_t *pResult = NULL;
- char *PrintResult = NULL; /* Use with convertC so we can */
- char *PrintCorrectResult = NULL; /* print out the results */
- int i = 0;
-
- WCHAR case1[] = {'5','0','\0'};
- WCHAR case2[] = {'5','5','5','\0'};
- WCHAR case3[] = {'1','0','1','0','\0'};
- WCHAR case4[] = {'2','2','\0'};
- WCHAR case5[] = {'a','\0'};
- WCHAR case6[] = {'c','g','\0'};
-
- /* Correct Result, Value to Convert, Radix to use */
- struct testCase testCases[] =
- {
- {case1, 50, 10},
- {case2,555,10},
- {case3,10,2},
- {case4,10,4},
- {case5,10,16},
- {case6,400,32}
- };
-
- /*
- * Initialize the PAL and return FAIL if this fails
- */
- if (0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Loop through each case. Convert the ints to strings. Check
- to ensure they were converted properly.
- */
-
- for(i = 0; i < sizeof(testCases) / sizeof(struct testCase); i++)
- {
- pResult = _itow(testCases[i].value,result,testCases[i].radix);
-
- if(pResult != &result[0])
- {
- Fail("ERROR: _itow didn't return a correct pointer to the "
- "newly formed string.\n");
- }
-
- if (0 != wcscmp(testCases[i].CorrectResult,pResult))
- {
- PrintResult = convertC(pResult);
- PrintCorrectResult = convertC(testCases[i].CorrectResult);
- Fail("ERROR: _itow was called on %i, returning the string %s "
- "when it should have returned the string %s.\n"
- , testCases[i].value, PrintResult, PrintCorrectResult);
- }
-
- }
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp
new file mode 100644
index 0000000000..01f32f2520
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_itow/test1/test1.cpp
@@ -0,0 +1,101 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test1.c
+**
+** Purpose: Tests the PAL implementation of the _itow_s function.
+** Test a number of ints with different radix on each,
+** to ensure that the string returned is correct.
+**
+**
+**===================================================================*/
+
+#define UNICODE
+
+#include <palsuite.h>
+
+struct testCase
+{
+ wchar_t *CorrectResult;
+ int value;
+ int radix;
+};
+
+int __cdecl main(int argc, char **argv)
+{
+
+ wchar_t result[20];
+ wchar_t *pResult = NULL;
+ char *PrintResult = NULL; /* Use with convertC so we can */
+ char *PrintCorrectResult = NULL; /* print out the results */
+ int i = 0;
+
+ WCHAR case1[] = {'5','0','\0'};
+ WCHAR case2[] = {'5','5','5','\0'};
+ WCHAR case3[] = {'1','0','1','0','\0'};
+ WCHAR case4[] = {'2','2','\0'};
+ WCHAR case5[] = {'a','\0'};
+ WCHAR case6[] = {'c','g','\0'};
+
+ /* Correct Result, Value to Convert, Radix to use */
+ struct testCase testCases[] =
+ {
+ {case1, 50, 10},
+ {case2,555,10},
+ {case3,10,2},
+ {case4,10,4},
+ {case5,10,16},
+ {case6,400,32}
+ };
+
+ /*
+ * Initialize the PAL and return FAIL if this fails
+ */
+ if (0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Loop through each case. Convert the ints to strings. Check
+ to ensure they were converted properly.
+ */
+
+ for(i = 0; i < sizeof(testCases) / sizeof(struct testCase); i++)
+ {
+ errno_t err = _itow_s(testCases[i].value, result, sizeof(result) / sizeof(result[0]), testCases[i].radix);
+
+ if(err != 0)
+ {
+ Fail("ERROR: _itow_s didn't return success, error code %d.\n", err);
+ }
+
+ if (0 != wcscmp(testCases[i].CorrectResult, result))
+ {
+ PrintResult = convertC(pResult);
+ PrintCorrectResult = convertC(testCases[i].CorrectResult);
+ Fail("ERROR: _itow_s was called on %i, returning the string %s "
+ "when it should have returned the string %s.\n"
+ , testCases[i].value, PrintResult, PrintCorrectResult);
+ }
+
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat
index 394c34dff3..91f0e62e09 100644
--- a/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_itow/test1/testinfo.dat
@@ -4,12 +4,12 @@
Version = 1.0
Section = C Runtime
-Function = _itow
-Name = Positive Test for _itow
+Function = _itow_s
+Name = Positive Test for _itow_s
TYPE = DEFAULT
EXE1 = test1
Description
-= Tests the PAL implementation of the _itow function.
+= Tests the PAL implementation of the _itow_s function.
= Test a number of ints with different radix on each, to ensure that the
= string returned is correct.
diff --git a/src/pal/tests/palsuite/c_runtime/_makepath/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_makepath/test1/CMakeLists.txt
deleted file mode 100644
index 9fd81cce1a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_makepath/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_makepath_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_makepath_test1 coreclrpal)
-
-target_link_libraries(paltest_makepath_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_makepath/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_makepath/test1/test1.c
deleted file mode 100644
index 94b366a7bb..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_makepath/test1/test1.c
+++ /dev/null
@@ -1,65 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test1.c
-**
-** Purpose: Tests the PAL implementation of the _makepath function.
-** Create a path, and ensure that it builds how it is
-** supposed to.
-**
-**
-**
-**===================================================================*/
-
-#if WIN32
-#define PATHNAME "C:\\test\\test.txt"
-#else
-#define PATHNAME "/test/test.txt"
-#endif
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char **argv)
-{
- char FullPath[128];
-
- /*
- * Initialize the PAL and return FAIL if this fails
- */
- if (0 != (PAL_Initialize(argc,argv)))
- {
- return FAIL;
- }
-
-#if WIN32
- _makepath(FullPath,"C","\\test","test","txt");
-#else
- _makepath(FullPath,NULL,"/test","test","txt");
-#endif
-
- if(strcmp(FullPath,PATHNAME) != 0)
- {
- Fail("ERROR: The pathname which was created turned out to be %s "
- "when it was supposed to be %s.\n",FullPath,PATHNAME);
- }
-
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/_makepath/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_makepath/test1/testinfo.dat
deleted file mode 100644
index 2aed8e549b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_makepath/test1/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _makepath
-Name = Positive Test for _makepath
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= Purpose: Tests the PAL implementation of the _makepath function.
-= Create a path, and ensure that it builds how it is supposed to.
-
diff --git a/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/CMakeLists.txt
index 064f241f24..b016f27982 100644
--- a/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_mbsdec_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/test1.cpp
index 1cd7513293..1cd7513293 100644
--- a/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_mbsdec/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/CMakeLists.txt
index 531ba8e793..c7325b9513 100644
--- a/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_mbsinc_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/test1.cpp
index 95a5041af2..95a5041af2 100644
--- a/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_mbsinc/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_mbslen/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_mbslen/CMakeLists.txt
deleted file mode 100644
index f6aa0cb2d9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_mbslen/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-
diff --git a/src/pal/tests/palsuite/c_runtime/_mbslen/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_mbslen/test1/CMakeLists.txt
deleted file mode 100644
index 38aa6fb16e..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_mbslen/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_mbslen_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_mbslen_test1 coreclrpal)
-
-target_link_libraries(paltest_mbslen_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_mbslen/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_mbslen/test1/test1.c
deleted file mode 100644
index fa24c77d8a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_mbslen/test1/test1.c
+++ /dev/null
@@ -1,66 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*========================================================================
-**
-** Source: test1.c
-**
-** Purpose:
-** Check the length of a number of arrays. The first is a normal string
-** which should return its length. The second has two bytes and a null
-** character, which only returns a size of 2, and the last is just a NULL
-** array which should return 0.
-**
-**
-**========================================================================*/
-
-#include <palsuite.h>
-
-/*
- * Note: it seems like these functions would only be useful if they
- * didn't assume a character was equivalent to a single byte. Be that
- * as it may, I haven't seen a way to get it to behave otherwise
- * (eg locale)
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- unsigned char *str1 = (unsigned char*) "foo";
- unsigned char str2[] = {0xC0, 0x80, 0}; /* the char U+0080 */
- unsigned char str3[] = {0};
- int ret=0;
-
- /*
- * Initialize the PAL and return FAIL if this fails
- */
- if (0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- ret = _mbslen(str1);
- if (ret != 3)
- {
- Fail ("ERROR: _mbslen(\"%s\") returned %d. Expected %d\n",
- str1, ret, 3);
- }
-
- ret = _mbslen(str2);
- if (ret != 2)
- {
- Fail ("ERROR: _mbslen(\"%s\") returned %d. Expected %d\n",
- str2, ret, 2);
- }
-
- ret = _mbslen(str3);
- if (ret != 0)
- {
- Fail ("ERROR: _mbslen(\"%s\") returned %d. Expected %d\n",
- str3, ret, 0);
- }
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_mbslen/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_mbslen/test1/testinfo.dat
deleted file mode 100644
index cf830a7539..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_mbslen/test1/testinfo.dat
+++ /dev/null
@@ -1,15 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _mbsinc
-Name = Positive Test for _mbslen
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= Check the length of a number of arrays. The first is a normal string
-= which should return its length. The second has two bytes and a null
-= character, which only returns a size of 2, and the last is just a NULL
-= array which should return 0.
diff --git a/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/CMakeLists.txt
index 7285ce229e..81c6c23a53 100644
--- a/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_mbsninc_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/test1.cpp
index 59ef50dcc3..59ef50dcc3 100644
--- a/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_mbsninc/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/CMakeLists.txt
index e9a3e29192..f4fedb61ae 100644
--- a/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_open_osfhandle_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/test1.cpp
index ee2c8ea418..ee2c8ea418 100644
--- a/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/CMakeLists.txt
index 1031ec1df9..6086868de2 100644
--- a/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_open_osfhandle_test2
diff --git a/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/test2.c b/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/test2.cpp
index 6c756b177a..6c756b177a 100644
--- a/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/_open_osfhandle/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_putenv/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_putenv/test1/CMakeLists.txt
index 0a75b41113..9096bc1033 100644
--- a/src/pal/tests/palsuite/c_runtime/_putenv/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_putenv/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_putenv_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_putenv/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_putenv/test1/test1.cpp
index 2d096adc78..2d096adc78 100644
--- a/src/pal/tests/palsuite/c_runtime/_putenv/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_putenv/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_putenv/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_putenv/test2/CMakeLists.txt
index e0539681cd..ad99eba373 100644
--- a/src/pal/tests/palsuite/c_runtime/_putenv/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_putenv/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_putenv_test2
diff --git a/src/pal/tests/palsuite/c_runtime/_putenv/test2/test2.c b/src/pal/tests/palsuite/c_runtime/_putenv/test2/test2.cpp
index 39be4f68b4..39be4f68b4 100644
--- a/src/pal/tests/palsuite/c_runtime/_putenv/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/_putenv/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_putenv/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_putenv/test3/CMakeLists.txt
index a67241022b..fc97b951b3 100644
--- a/src/pal/tests/palsuite/c_runtime/_putenv/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_putenv/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_putenv_test3
diff --git a/src/pal/tests/palsuite/c_runtime/_putenv/test3/test3.c b/src/pal/tests/palsuite/c_runtime/_putenv/test3/test3.cpp
index 8aa6777307..8aa6777307 100644
--- a/src/pal/tests/palsuite/c_runtime/_putenv/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/_putenv/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_putenv/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_putenv/test4/CMakeLists.txt
index 518282ccc7..3881626d01 100644
--- a/src/pal/tests/palsuite/c_runtime/_putenv/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_putenv/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_putenv_test4
diff --git a/src/pal/tests/palsuite/c_runtime/_putenv/test4/test4.c b/src/pal/tests/palsuite/c_runtime/_putenv/test4/test4.cpp
index 48d7ba963c..48d7ba963c 100644
--- a/src/pal/tests/palsuite/c_runtime/_putenv/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/_putenv/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_putw/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_putw/test1/CMakeLists.txt
index c3018ad322..78833d4e13 100644
--- a/src/pal/tests/palsuite/c_runtime/_putw/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_putw/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_putw_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_putw/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_putw/test1/test1.c
deleted file mode 100644
index ecfc9046ac..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_putw/test1/test1.c
+++ /dev/null
@@ -1,112 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: Writes a series of integers to a file, test.dat,
-** then verifies the results.
-**
-** Dependency: fopen(...)
-** fclose(...)
-** CloseHandle(...)
-** DeleteFileA(...)
-** _getw(...)
-**
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-
-const char testFileName[] = "test.dat";
-
-static void Cleanup(HANDLE hFile)
-{
- if (fclose(hFile))
- {
- Trace("_putw: ERROR -> Unable to close file \"%s\".\n",
- testFileName);
- }
- if (!DeleteFileA(testFileName))
- {
- Trace("_putw: ERROR -> Unable to delete file \"%s\". ",
- "GetLastError returned %u.\n",
- testFileName,
- GetLastError());
- }
-}
-
-
-int __cdecl main(int argc, char **argv)
-{
-
- FILE * pfTest = NULL;
- int testArray[] = {0,1,-1,0x7FFFFFFF,0x80000000,0xFFFFFFFF,0xFFFFAAAA};
- int i = 0;
- int retValue = 0;
-
- /*
- * Initialize the PAL and return FAIL if this fails
- */
- if (0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /*write the file that we will use to test */
- pfTest = fopen(testFileName, "w");
- if (pfTest == NULL)
- {
- Fail ("Unable to write test file.\n");
- }
-
- for (i = 0; i < sizeof(testArray)/sizeof(int) ; i++)
- {
- _putw(testArray[i], pfTest);
-
- if( ferror( pfTest ) )
- {
- Cleanup(pfTest);
- Fail( "Error:in _putw -> error has occurred in the "
- "stream while writing to the file: \"test.dat\"\n");
- }
-
- }
-
- if (fclose(pfTest) != 0)
- {
- Cleanup(pfTest);
- Fail ("Error closing file after writing with _putw(..).\n");
- }
-
- /*open the new test file and compare*/
- pfTest = fopen(testFileName, "r");
- if (pfTest == NULL)
- {
- Fail ("Error opening \"%s\", which is odd, since I just finished "
- "creating that file.\n", testFileName);
- }
- retValue =_getw( pfTest );
- i = 0;
- while(retValue != EOF)
- {
- if(retValue != testArray[i])
- {
- Cleanup(pfTest);
- Fail ("Integers written by _putw are not in the correct format\n",
- testFileName);
- }
- retValue = _getw( pfTest );
- i++ ;
- }
-
- Cleanup(pfTest);
- PAL_Terminate();
- return PASS;
-}
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/_putw/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/_putw/test1/test1.cpp
new file mode 100644
index 0000000000..02b7cc7a49
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_putw/test1/test1.cpp
@@ -0,0 +1,112 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Writes a series of integers to a file, test.dat,
+** then verifies the results.
+**
+** Dependency: fopen(...)
+** fclose(...)
+** CloseHandle(...)
+** DeleteFileA(...)
+** _getw(...)
+**
+**
+**
+**==========================================================================*/
+
+
+#include <palsuite.h>
+
+const char testFileName[] = "test.dat";
+
+static void Cleanup(HANDLE hFile)
+{
+ if (fclose((PAL_FILE*)hFile))
+ {
+ Trace("_putw: ERROR -> Unable to close file \"%s\".\n",
+ testFileName);
+ }
+ if (!DeleteFileA(testFileName))
+ {
+ Trace("_putw: ERROR -> Unable to delete file \"%s\". ",
+ "GetLastError returned %u.\n",
+ testFileName,
+ GetLastError());
+ }
+}
+
+
+int __cdecl main(int argc, char **argv)
+{
+
+ FILE * pfTest = NULL;
+ int testArray[] = {0,1,-1,0x7FFFFFFF,0x80000000,0xFFFFFFFF,0xFFFFAAAA};
+ int i = 0;
+ int retValue = 0;
+
+ /*
+ * Initialize the PAL and return FAIL if this fails
+ */
+ if (0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /*write the file that we will use to test */
+ pfTest = fopen(testFileName, "w");
+ if (pfTest == NULL)
+ {
+ Fail ("Unable to write test file.\n");
+ }
+
+ for (i = 0; i < sizeof(testArray)/sizeof(int) ; i++)
+ {
+ _putw(testArray[i], pfTest);
+
+ if( ferror( pfTest ) )
+ {
+ Cleanup(pfTest);
+ Fail( "Error:in _putw -> error has occurred in the "
+ "stream while writing to the file: \"test.dat\"\n");
+ }
+
+ }
+
+ if (fclose(pfTest) != 0)
+ {
+ Cleanup(pfTest);
+ Fail ("Error closing file after writing with _putw(..).\n");
+ }
+
+ /*open the new test file and compare*/
+ pfTest = fopen(testFileName, "r");
+ if (pfTest == NULL)
+ {
+ Fail ("Error opening \"%s\", which is odd, since I just finished "
+ "creating that file.\n", testFileName);
+ }
+ retValue =_getw( pfTest );
+ i = 0;
+ while(retValue != EOF)
+ {
+ if(retValue != testArray[i])
+ {
+ Cleanup(pfTest);
+ Fail ("Integers written by _putw are not in the correct format\n",
+ testFileName);
+ }
+ retValue = _getw( pfTest );
+ i++ ;
+ }
+
+ Cleanup(pfTest);
+ PAL_Terminate();
+ return PASS;
+}
+
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/CMakeLists.txt
deleted file mode 100644
index cafb9536b0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-add_subdirectory(test10)
-add_subdirectory(test11)
-add_subdirectory(test12)
-add_subdirectory(test13)
-add_subdirectory(test14)
-add_subdirectory(test15)
-add_subdirectory(test16)
-add_subdirectory(test17)
-add_subdirectory(test18)
-add_subdirectory(test19)
-add_subdirectory(test2)
-add_subdirectory(test3)
-add_subdirectory(test4)
-add_subdirectory(test5)
-add_subdirectory(test6)
-add_subdirectory(test7)
-add_subdirectory(test8)
-add_subdirectory(test9)
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/_snprintf.h b/src/pal/tests/palsuite/c_runtime/_snprintf/_snprintf.h
deleted file mode 100644
index 84abf62f0b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/_snprintf.h
+++ /dev/null
@@ -1,194 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: _snprintf.h
-**
-** Purpose: Containts common testing functions for _snprintf
-**
-**
-**==========================================================================*/
-
-#ifndef __STRINGTEST_H__
-#define __STRINGTEST_H__
-
-void DoStrTest(char *formatstr, char* param, char *checkstr)
-{
- char buf[256] = { 0 };
-
- _snprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: failed to insert string \"%s\" into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- param, formatstr, checkstr, buf);
- }
-}
-
-void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
-{
- char buf[256] = { 0 };
-
- _snprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: failed to insert wide string \"%s\" into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- convertC(param), formatstr, checkstr, buf);
- }
-}
-
-
-void DoPointerTest(char *formatstr, void* param, char* paramstr, char
- *checkstr1)
-{
- char buf[256] = { 0 };
-
- _snprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\"\n"
- "Expected \"%s\", got \"%s\".\n",
- paramstr, formatstr, checkstr1, buf);
- }
-}
-
-void DoCountTest(char *formatstr, int param, char *checkstr)
-{
- char buf[512] = { 0 };
- int n = -1;
-
- _snprintf(buf, 512, formatstr, &n);
-
- if (n != param)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- param, n);
- }
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf);
- }
-}
-
-void DoShortCountTest(char *formatstr, int param, char *checkstr)
-{
- char buf[256] = { 0 };
- short int n = -1;
-
- _snprintf(buf, 256, formatstr, &n);
-
- if (n != param)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- param, n);
- }
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf);
- }
-}
-
-void DoCharTest(char *formatstr, char param, char *checkstr)
-{
- char buf[256] = { 0 };
-
- _snprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- param, param, formatstr, checkstr, buf);
- }
-}
-
-void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
-{
- char buf[256] = { 0 };
-
- _snprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- (char)param, param, formatstr, checkstr, buf);
- }
-}
-
-void DoNumTest(char *formatstr, int value, char *checkstr)
-{
- char buf[256] = { 0 };
-
- _snprintf(buf, 256, formatstr, value);
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: failed to insert %#x into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- value, formatstr, checkstr, buf);
- }
-}
-
-void DoI64Test(char *formatstr, INT64 value, char *valuestr, char *checkstr1)
-{
- char buf[256] = { 0 };
-
- _snprintf(buf, 256, formatstr, value);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\"\n"
- "Expected \"%s\", got \"%s\".\n",
- valuestr, formatstr, checkstr1, buf);
- }
-}
-
-void DoDoubleTest(char *formatstr, double value, char *checkstr1, char
-*checkstr2)
-{
- char buf[256] = { 0 };
-
- _snprintf(buf, 256, formatstr, value);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0
- && memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\"\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- value, formatstr, checkstr1, checkstr2, buf);
- }
-}
-
-void DoArgumentPrecTest(char *formatstr, int precision, void *param, char
-*paramstr, char *checkstr1, char*checkstr2)
-{
- char buf[256];
-
- _snprintf(buf, 256, formatstr, precision, param);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
- memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- paramstr, formatstr, precision, checkstr1, checkstr2, buf);
- }
-
-}
-
-void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param,
-char *checkstr1, char *checkstr2)
-{
- char buf[256];
-
- _snprintf(buf, 256, formatstr, precision, param);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
- memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- param, formatstr, precision, checkstr1, checkstr2, buf);
- }
-
-}
-
-#endif
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test1/CMakeLists.txt
deleted file mode 100644
index ab126fc59d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_snprintf_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test1 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test1/test1.c
deleted file mode 100644
index eef7406baa..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test1/test1.c
+++ /dev/null
@@ -1,58 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: General test to see if _snprintf works correctly
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- char checkstr[] = "hello world";
- char buf[256] = { 0 };
- int ret;
-
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- _snprintf(buf, 256, "hello world");
- if (memcmp(checkstr, buf, strlen(checkstr)+1) != 0)
- {
- Fail("ERROR: expected \"%s\" (up to %d chars), got \"%s\"\n",
- checkstr, 256, buf);
- }
-
- _snprintf(buf, 256, "xxxxxxxxxxxxxxxxx");
- ret = _snprintf(buf, 8, "hello world");
-
- if (ret >= 0)
- {
- Fail("ERROR: expected negative return value, got %d", ret);
- }
- if (memcmp(checkstr, buf, 8) != 0 || buf[8] != 'x')
- {
- Fail("ERROR: expected %s (up to %d chars), got %s\n",
- checkstr, 8, buf);
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test1/testinfo.dat
deleted file mode 100644
index c15ce1dcba..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test1/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= General test to see if _snprintf works correctly
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test10/CMakeLists.txt
deleted file mode 100644
index e8e9308849..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test10/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test10.c
-)
-
-add_executable(paltest_snprintf_test10
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test10 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test10
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test10/test10.c
deleted file mode 100644
index 9191ccef27..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test10/test10.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test10.c
-**
-** Purpose: Tests _snprintf with octal numbers
-**
-**
-**==========================================================================*/
-
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %o", pos, "foo 52");
- DoNumTest("foo %lo", 0xFFFF, "foo 177777");
- DoNumTest("foo %ho", 0xFFFF, "foo 177777");
- DoNumTest("foo %Lo", pos, "foo 52");
- DoI64Test("foo %I64o", l, "42", "foo 52");
- DoNumTest("foo %3o", pos, "foo 52");
- DoNumTest("foo %-3o", pos, "foo 52 ");
- DoNumTest("foo %.1o", pos, "foo 52");
- DoNumTest("foo %.3o", pos, "foo 052");
- DoNumTest("foo %03o", pos, "foo 052");
- DoNumTest("foo %#o", pos, "foo 052");
- DoNumTest("foo %+o", pos, "foo 52");
- DoNumTest("foo % o", pos, "foo 52");
- DoNumTest("foo %+o", neg, "foo 37777777726");
- DoNumTest("foo % o", neg, "foo 37777777726");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test10/testinfo.dat
deleted file mode 100644
index 44ff48e030..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test10/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test10
-Description
-= Tests _snprintf with octal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test11/CMakeLists.txt
deleted file mode 100644
index ccf3dc2572..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test11/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test11.c
-)
-
-add_executable(paltest_snprintf_test11
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test11 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test11
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test11/test11.c
deleted file mode 100644
index 9d9302dee0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test11/test11.c
+++ /dev/null
@@ -1,54 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test11.c
-**
-** Purpose: Tests _snprintf with unsigned numbers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %u", pos, "foo 42");
- DoNumTest("foo %lu", 0xFFFF, "foo 65535");
- DoNumTest("foo %hu", 0xFFFF, "foo 65535");
- DoNumTest("foo %Lu", pos, "foo 42");
- DoI64Test("foo %I64u", l, "42", "foo 42");
- DoNumTest("foo %3u", pos, "foo 42");
- DoNumTest("foo %-3u", pos, "foo 42 ");
- DoNumTest("foo %.1u", pos, "foo 42");
- DoNumTest("foo %.3u", pos, "foo 042");
- DoNumTest("foo %03u", pos, "foo 042");
- DoNumTest("foo %#u", pos, "foo 42");
- DoNumTest("foo %+u", pos, "foo 42");
- DoNumTest("foo % u", pos, "foo 42");
- DoNumTest("foo %+u", neg, "foo 4294967254");
- DoNumTest("foo % u", neg, "foo 4294967254");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test11/testinfo.dat
deleted file mode 100644
index 1a77077950..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test11/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test11
-Description
-= Tests _snprintf with unsigned numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test12/CMakeLists.txt
deleted file mode 100644
index 68b442f1d9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test12/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test12.c
-)
-
-add_executable(paltest_snprintf_test12
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test12 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test12
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test12/test12.c
deleted file mode 100644
index d782fce788..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test12/test12.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test12.c
-**
-** Purpose: Tests _snprintf with hex numbers (lowercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 0x1234ab;
- INT64 l = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %x", pos, "foo 1234ab");
- DoNumTest("foo %lx", pos, "foo 1234ab");
- DoNumTest("foo %hx", pos, "foo 34ab");
- DoNumTest("foo %Lx", pos, "foo 1234ab");
- DoI64Test("foo %I64x", l, "0x1234567887654321", "foo 1234567887654321");
- DoNumTest("foo %7x", pos, "foo 1234ab");
- DoNumTest("foo %-7x", pos, "foo 1234ab ");
- DoNumTest("foo %.1x", pos, "foo 1234ab");
- DoNumTest("foo %.7x", pos, "foo 01234ab");
- DoNumTest("foo %07x", pos, "foo 01234ab");
- DoNumTest("foo %#x", pos, "foo 0x1234ab");
- DoNumTest("foo %+x", pos, "foo 1234ab");
- DoNumTest("foo % x", pos, "foo 1234ab");
- DoNumTest("foo %+x", neg, "foo ffffffd6");
- DoNumTest("foo % x", neg, "foo ffffffd6");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test12/testinfo.dat
deleted file mode 100644
index 6801c7417e..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test12/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test12
-Description
-= Tests _snprintf with hex numbers (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test13/CMakeLists.txt
deleted file mode 100644
index 832b3fefbf..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test13/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test13.c
-)
-
-add_executable(paltest_snprintf_test13
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test13 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test13
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test13/test13.c
deleted file mode 100644
index 68ba554d93..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test13/test13.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test13.c
-**
-** Purpose: Tests _snprintf with hex numbers (uppercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 0x1234AB;
- INT64 l = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %X", pos, "foo 1234AB");
- DoNumTest("foo %lX", pos, "foo 1234AB");
- DoNumTest("foo %hX", pos, "foo 34AB");
- DoNumTest("foo %LX", pos, "foo 1234AB");
- DoI64Test("foo %I64X", l, "0x1234567887654321", "foo 1234567887654321");
- DoNumTest("foo %7X", pos, "foo 1234AB");
- DoNumTest("foo %-7X", pos, "foo 1234AB ");
- DoNumTest("foo %.1X", pos, "foo 1234AB");
- DoNumTest("foo %.7X", pos, "foo 01234AB");
- DoNumTest("foo %07X", pos, "foo 01234AB");
- DoNumTest("foo %#X", pos, "foo 0X1234AB");
- DoNumTest("foo %+X", pos, "foo 1234AB");
- DoNumTest("foo % X", pos, "foo 1234AB");
- DoNumTest("foo %+X", neg, "foo FFFFFFD6");
- DoNumTest("foo % X", neg, "foo FFFFFFD6");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test13/testinfo.dat
deleted file mode 100644
index 6901589a1b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test13/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test13
-Description
-= Tests _snprintf with hex numbers (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test14/CMakeLists.txt
deleted file mode 100644
index c2e3be148d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test14/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test14.c
-)
-
-add_executable(paltest_snprintf_test14
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test14 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test14
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test14/test14.c
deleted file mode 100644
index d874690ba4..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test14/test14.c
+++ /dev/null
@@ -1,57 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test14.c
-**
-** Purpose: Tests _snprintf with exponential format doubles (lowercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 256.0;
- double neg = -256.0;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest("foo %e", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %le", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %he", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %Le", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %I64e", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %14e", val, "foo 2.560000e+002",
- "foo 2.560000e+02");
- DoDoubleTest("foo %-14e", val, "foo 2.560000e+002 ",
- "foo 2.560000e+02 ");
- DoDoubleTest("foo %.1e", val, "foo 2.6e+002", "foo 2.6e+02");
- DoDoubleTest("foo %.8e", val, "foo 2.56000000e+002",
- "foo 2.56000000e+02");
- DoDoubleTest("foo %014e", val, "foo 02.560000e+002",
- "foo 002.560000e+02");
- DoDoubleTest("foo %#e", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %+e", val, "foo +2.560000e+002", "foo +2.560000e+02");
- DoDoubleTest("foo % e", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %+e", neg, "foo -2.560000e+002", "foo -2.560000e+02");
- DoDoubleTest("foo % e", neg, "foo -2.560000e+002", "foo -2.560000e+02");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test14/testinfo.dat
deleted file mode 100644
index 0f32b9b59a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test14/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test14
-Description
-= Tests _snprintf with exponential format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test15/CMakeLists.txt
deleted file mode 100644
index 1bd24d5ccd..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test15/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test15.c
-)
-
-add_executable(paltest_snprintf_test15
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test15 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test15
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test15/test15.c
deleted file mode 100644
index a637a706f5..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test15/test15.c
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test15.c
-**
-** Purpose: Tests _snprintf with exponential format doubles (uppercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 256.0;
- double neg = -256.0;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest("foo %E", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %lE", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %hE", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %LE", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %I64E", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %14E", val, "foo 2.560000E+002",
- "foo 2.560000E+02");
- DoDoubleTest("foo %-14E", val, "foo 2.560000E+002 ",
- "foo 2.560000E+02 ");
- DoDoubleTest("foo %.1E", val, "foo 2.6E+002", "foo 2.6E+02");
- DoDoubleTest("foo %.8E", val, "foo 2.56000000E+002",
- "foo 2.56000000E+02");
- DoDoubleTest("foo %014E", val, "foo 02.560000E+002",
- "foo 002.560000E+02");
- DoDoubleTest("foo %#E", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %+E", val, "foo +2.560000E+002", "foo +2.560000E+02");
- DoDoubleTest("foo % E", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %+E", neg, "foo -2.560000E+002", "foo -2.560000E+02");
- DoDoubleTest("foo % E", neg, "foo -2.560000E+002", "foo -2.560000E+02");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test15/testinfo.dat
deleted file mode 100644
index 8008cff0b5..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test15/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test15
-Description
-= Tests _snprintf with exponential format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test16/CMakeLists.txt
deleted file mode 100644
index 952192e560..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test16/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test16.c
-)
-
-add_executable(paltest_snprintf_test16
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test16 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test16
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test16/test16.c
deleted file mode 100644
index 6793019383..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test16/test16.c
+++ /dev/null
@@ -1,52 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test16.c
-**
-** Purpose: Test #15 for the _snprintf function
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest("foo %f", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %lf", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %hf", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %Lf", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %I64f", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %12f", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %-12f", val, "foo 2560.001000 ", "foo 2560.001000 ");
- DoDoubleTest("foo %.1f", val, "foo 2560.0", "foo 2560.0");
- DoDoubleTest("foo %.8f", val, "foo 2560.00100000", "foo 2560.00100000");
- DoDoubleTest("foo %012f", val, "foo 02560.001000", "foo 02560.001000");
- DoDoubleTest("foo %#f", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %+f", val, "foo +2560.001000", "foo +2560.001000");
- DoDoubleTest("foo % f", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %+f", neg, "foo -2560.001000", "foo -2560.001000");
- DoDoubleTest("foo % f", neg, "foo -2560.001000", "foo -2560.001000");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test16/testinfo.dat
deleted file mode 100644
index e7a7df8f53..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test16/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test16
-Description
-= Tests _snprintf with decimal point format doubles
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test17/CMakeLists.txt
deleted file mode 100644
index ce5cc1623e..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test17/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test17.c
-)
-
-add_executable(paltest_snprintf_test17
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test17 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test17
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test17/test17.c
deleted file mode 100644
index 9981b44619..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test17/test17.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test17.c
-**
-** Purpose: Tests _snprintf with compact format doubles (lowercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest("foo %g", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %lg", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %hg", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %Lg", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %I64g", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %5g", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %-5g", val, "foo 2560 ", "foo 2560 ");
- DoDoubleTest("foo %.1g", val, "foo 3e+003", "foo 3e+03");
- DoDoubleTest("foo %.2g", val, "foo 2.6e+003", "foo 2.6e+03");
- DoDoubleTest("foo %.12g", val, "foo 2560.001", "foo 2560.001");
- DoDoubleTest("foo %06g", val, "foo 002560", "foo 002560");
- DoDoubleTest("foo %#g", val, "foo 2560.00", "foo 2560.00");
- DoDoubleTest("foo %+g", val, "foo +2560", "foo +2560");
- DoDoubleTest("foo % g", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %+g", neg, "foo -2560", "foo -2560");
- DoDoubleTest("foo % g", neg, "foo -2560", "foo -2560");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test17/testinfo.dat
deleted file mode 100644
index 4756bd0d78..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test17/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test17
-Description
-= Tests _snprintf with compact format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test18/CMakeLists.txt
deleted file mode 100644
index bb9c9c37cc..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test18/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test18.c
-)
-
-add_executable(paltest_snprintf_test18
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test18 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test18
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test18/test18.c
deleted file mode 100644
index d28aec57d0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test18/test18.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test18.c
-**
-** Purpose: Tests _snprintf with compact format doubles (uppercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest("foo %G", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %lG", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %hG", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %LG", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %I64G", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %5G", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %-5G", val, "foo 2560 ", "foo 2560 ");
- DoDoubleTest("foo %.1G", val, "foo 3E+003", "foo 3E+03");
- DoDoubleTest("foo %.2G", val, "foo 2.6E+003", "foo 2.6E+03");
- DoDoubleTest("foo %.12G", val, "foo 2560.001", "foo 2560.001");
- DoDoubleTest("foo %06G", val, "foo 002560", "foo 002560");
- DoDoubleTest("foo %#G", val, "foo 2560.00", "foo 2560.00");
- DoDoubleTest("foo %+G", val, "foo +2560", "foo +2560");
- DoDoubleTest("foo % G", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %+G", neg, "foo -2560", "foo -2560");
- DoDoubleTest("foo % G", neg, "foo -2560", "foo -2560");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test18/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test18/testinfo.dat
deleted file mode 100644
index 819d28cec9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test18/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test18
-Description
-= Tests _snprintf with compact format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test19/CMakeLists.txt
deleted file mode 100644
index f3fbb95013..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test19/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test19.c
-)
-
-add_executable(paltest_snprintf_test19
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test19 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test19
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test19/test19.c
deleted file mode 100644
index 26dffd9214..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test19/test19.c
+++ /dev/null
@@ -1,76 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test19.c
-**
-** Purpose:Tests _snprintf with argument specified precision
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int n = -1;
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- DoArgumentPrecTest("%.*s", 2, "bar", "bar", "ba", "ba");
- DoArgumentPrecTest("%.*S", 2, convert("bar"), "bar", "ba", "ba");
- DoArgumentPrecTest("%.*n", 3, &n, "pointer to int", "", "");
- if (n != 0)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- 0, n);
- }
-
- DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
- DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
- DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
- DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42") ;
- DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
-
-
- DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
- DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
- DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
- DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
- DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
- DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
- DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
- DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
- DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
- DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test19/testinfo.dat
deleted file mode 100644
index 875abf7071..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test19/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test19
-Description
-= Tests _snprintf with argument specified precision
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test2/CMakeLists.txt
deleted file mode 100644
index 8c617df108..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test2/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test2.c
-)
-
-add_executable(paltest_snprintf_test2
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test2 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test2
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test2/test2.c
deleted file mode 100644
index 3ccb66c23e..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test2/test2.c
+++ /dev/null
@@ -1,44 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test2.c
-**
-** Purpose:Tests _snprintf with strings
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- DoStrTest("foo %s", "bar", "foo bar");
- DoStrTest("foo %hs", "bar", "foo bar");
- DoWStrTest("foo %ls", convert("bar"), "foo bar");
- DoWStrTest("foo %ws", convert("bar"), "foo bar");
- DoStrTest("foo %Ls", "bar", "foo bar");
- DoStrTest("foo %I64s", "bar", "foo bar");
- DoStrTest("foo %5s", "bar", "foo bar");
- DoStrTest("foo %.2s", "bar", "foo ba");
- DoStrTest("foo %5.2s", "bar", "foo ba");
- DoStrTest("foo %-5s", "bar", "foo bar ");
- DoStrTest("foo %05s", "bar", "foo 00bar");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test2/testinfo.dat
deleted file mode 100644
index 40a1ede3d5..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test2/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test2
-Description
-= Tests _snprintf with strings
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test3/CMakeLists.txt
deleted file mode 100644
index 13330464a7..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test3/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test3.c
-)
-
-add_executable(paltest_snprintf_test3
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test3 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test3
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test3/test3.c
deleted file mode 100644
index 496159c51e..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test3/test3.c
+++ /dev/null
@@ -1,45 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test3.c
-**
-** Purpose: Tests _snprintf with wide strings
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- DoWStrTest("foo %S", convert("bar"), "foo bar");
- DoStrTest("foo %hS", "bar", "foo bar");
- DoWStrTest("foo %lS", convert("bar"), "foo bar");
- DoWStrTest("foo %wS", convert("bar"), "foo bar");
- DoWStrTest("foo %LS", convert("bar"), "foo bar");
- DoWStrTest("foo %I64S", convert("bar"), "foo bar");
- DoWStrTest("foo %5S", convert("bar"), "foo bar");
- DoWStrTest("foo %.2S", convert("bar"), "foo ba");
- DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
- DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
- DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test3/testinfo.dat
deleted file mode 100644
index fa53224510..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test3/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test3
-Description
-= Tests _snprintf with wide strings
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test4/CMakeLists.txt
deleted file mode 100644
index 5132aa02de..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test4/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test4.c
-)
-
-add_executable(paltest_snprintf_test4
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test4 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test4
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test4/test4.c
deleted file mode 100644
index 8c39f222cc..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test4/test4.c
+++ /dev/null
@@ -1,69 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test4.c
-**
-** Purpose: Tests _snprintf with pointers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- void *ptr = (void*) 0x123456;
- INT64 lptr = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
- /*
- ** Run only on 64 bit platforms
- */
- #if defined(BIT64) && defined(PLATFORM_UNIX)
- Trace("Testing for 64 Bit Platforms \n");
- DoPointerTest("%p", NULL, "NULL", "0000000000000000");
- DoPointerTest("%p", ptr, "pointer to 0x123456", "0000000000123456");
- DoPointerTest("%17p", ptr, "pointer to 0x123456", " 0000000000123456");
- DoPointerTest("%17p", ptr, "pointer to 0x123456", " 0000000000123456");
- DoPointerTest("%-17p", ptr, "pointer to 0x123456", "0000000000123456 ");
- DoPointerTest("%+p", ptr, "pointer to 0x123456", "0000000000123456");
- DoPointerTest("%#p", ptr, "pointer to 0x123456", "0X0000000000123456");
- DoPointerTest("%lp", ptr, "pointer to 0x123456", "00123456");
- DoPointerTest("%hp", ptr, "pointer to 0x123456", "00003456");
- DoPointerTest("%Lp", ptr, "pointer to 0x123456", "00123456");
- DoI64Test("%I64p", lptr, "pointer to 0x1234567887654321",
- "1234567887654321");
- #else
- Trace("Testing for Non 64 Bit Platforms \n");
- DoPointerTest("%p", NULL, "NULL", "00000000");
- DoPointerTest("%p", ptr, "pointer to 0x123456", "00123456");
- DoPointerTest("%9p", ptr, "pointer to 0x123456", " 00123456");
- DoPointerTest("%09p", ptr, "pointer to 0x123456", " 00123456");
- DoPointerTest("%-9p", ptr, "pointer to 0x123456", "00123456 ");
- DoPointerTest("%+p", ptr, "pointer to 0x123456", "00123456");
- DoPointerTest("%#p", ptr, "pointer to 0x123456", "0X00123456");
- DoPointerTest("%lp", ptr, "pointer to 0x123456", "00123456");
- DoPointerTest("%hp", ptr, "pointer to 0x123456", "00003456");
- DoPointerTest("%Lp", ptr, "pointer to 0x123456", "00123456");
- DoI64Test("%I64p", lptr, "pointer to 0x1234567887654321",
- "1234567887654321");
- #endif //defined(BIT64) && defined(PLATFORM_UNIX)
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test4/testinfo.dat
deleted file mode 100644
index 5d822d160b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test4/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test4
-Description
-= Tests _snprintf with pointers
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test5/CMakeLists.txt
deleted file mode 100644
index 07e441cee0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test5/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test5.c
-)
-
-add_executable(paltest_snprintf_test5
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test5 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test5
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test5/test5.c
deleted file mode 100644
index 46ab1dd35e..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test5/test5.c
+++ /dev/null
@@ -1,61 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test5.c
-**
-** Purpose: Tests _snprintf with the count specifier
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- char *longStr =
- "really-long-string-that-just-keeps-going-on-and-on-and-on.."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "%n bar";
- char *longResult =
- "really-long-string-that-just-keeps-going-on-and-on-and-on.."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- " bar";
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- DoCountTest("foo %n bar", 4, "foo bar");
- DoCountTest(longStr, 257, longResult);
- DoCountTest("fo%n bar", 2, "fo bar");
- DoCountTest("%n", 0, "");
- DoCountTest("foo %#n bar", 4, "foo bar");
- DoCountTest("foo % n bar", 4, "foo bar");
- DoCountTest("foo %+n bar", 4, "foo bar");
- DoCountTest("foo %-n bar", 4, "foo bar");
- DoCountTest("foo %0n bar", 4, "foo bar");
- DoShortCountTest("foo %hn bar", 4, "foo bar");
- DoCountTest("foo %ln bar", 4, "foo bar");
- DoCountTest("foo %Ln bar", 4, "foo bar");
- DoCountTest("foo %I64n bar", 4, "foo bar");
- DoCountTest("foo %20.3n bar", 4, "foo bar");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test5/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test5/testinfo.dat
deleted file mode 100644
index 33056defd8..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test5/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test5
-Description
-= Tests _snprintf with the count specifier
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test6/CMakeLists.txt
deleted file mode 100644
index 9ee5d90544..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test6/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test6.c
-)
-
-add_executable(paltest_snprintf_test6
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test6 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test6
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test6/test6.c
deleted file mode 100644
index 32001c2d20..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test6/test6.c
+++ /dev/null
@@ -1,47 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test6.c
-**
-** Purpose: Tests _snprintf with characters
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR wc = (WCHAR) 'c';
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoCharTest("foo %c", 'b', "foo b");
- DoCharTest("foo %hc", 'b', "foo b");
- DoWCharTest("foo %lc", wc, "foo c");
- DoCharTest("foo %Lc", 'b', "foo b");
- DoCharTest("foo %I64c", 'b', "foo b");
- DoCharTest("foo %5c", 'b', "foo b");
- DoCharTest("foo %.0c", 'b', "foo b");
- DoCharTest("foo %-5c", 'b', "foo b ");
- DoCharTest("foo %05c", 'b', "foo 0000b");
- DoCharTest("foo % c", 'b', "foo b");
- DoCharTest("foo %#c", 'b', "foo b");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test6/testinfo.dat
deleted file mode 100644
index ba2ff818aa..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test6/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name =Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test6
-Description
-= Tests _snprintf with characters
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test7/CMakeLists.txt
deleted file mode 100644
index f7651218e0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test7/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test7.c
-)
-
-add_executable(paltest_snprintf_test7
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test7 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test7
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test7/test7.c
deleted file mode 100644
index bfd5c3f4f1..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test7/test7.c
+++ /dev/null
@@ -1,47 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test7.c
-**
-** Purpose: Tests _snprintf with wide characters
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR wb = (WCHAR) 'b';
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoWCharTest("foo %C", wb, "foo b");
- DoWCharTest("foo %hC", wb, "foo b");
- DoCharTest("foo %lC", 'c', "foo c");
- DoWCharTest("foo %LC", wb, "foo b");
- DoWCharTest("foo %I64C", wb, "foo b");
- DoWCharTest("foo %5C", wb, "foo b");
- DoWCharTest("foo %.0C", wb, "foo b");
- DoWCharTest("foo %-5C", wb, "foo b ");
- DoWCharTest("foo %05C", wb, "foo 0000b");
- DoWCharTest("foo % C", wb, "foo b");
- DoWCharTest("foo %#C", wb, "foo b");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test7/testinfo.dat
deleted file mode 100644
index 5c2406c7b2..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test7/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test7
-Description
-= Tests _snprintf with wide characters
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test8/CMakeLists.txt
deleted file mode 100644
index 26af119852..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test8/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test8.c
-)
-
-add_executable(paltest_snprintf_test8
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test8 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test8
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test8/test8.c
deleted file mode 100644
index 60ff1b05b8..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test8/test8.c
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test8.c
-**
-** Purpose: Tests _snprintf with decimal numbers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %d", pos, "foo 42");
- DoNumTest("foo %ld", 0xFFFF, "foo 65535");
- DoNumTest("foo %hd", 0xFFFF, "foo -1");
- DoNumTest("foo %Ld", pos, "foo 42");
- DoI64Test("foo %I64d", l, "42", "foo 42");
- DoNumTest("foo %3d", pos, "foo 42");
- DoNumTest("foo %-3d", pos, "foo 42 ");
- DoNumTest("foo %.1d", pos, "foo 42");
- DoNumTest("foo %.3d", pos, "foo 042");
- DoNumTest("foo %03d", pos, "foo 042");
- DoNumTest("foo %#d", pos, "foo 42");
- DoNumTest("foo %+d", pos, "foo +42");
- DoNumTest("foo % d", pos, "foo 42");
- DoNumTest("foo %+d", neg, "foo -42");
- DoNumTest("foo % d", neg, "foo -42");
-
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test8/testinfo.dat
deleted file mode 100644
index f6520d8dde..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test8/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test8
-Description
-= Tests _snprintf with decimal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf/test9/CMakeLists.txt
deleted file mode 100644
index 484075919e..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test9/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test9.c
-)
-
-add_executable(paltest_snprintf_test9
- ${SOURCES}
-)
-
-add_dependencies(paltest_snprintf_test9 coreclrpal)
-
-target_link_libraries(paltest_snprintf_test9
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/_snprintf/test9/test9.c
deleted file mode 100644
index e836bcaee3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test9/test9.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test9.c
-**
-** Purpose: Tests _snprintf with integer numbers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %i", pos, "foo 42");
- DoNumTest("foo %li", 0xFFFF, "foo 65535");
- DoNumTest("foo %hi", 0xFFFF, "foo -1");
- DoNumTest("foo %Li", pos, "foo 42");
- DoI64Test("foo %I64i", l, "42", "foo 42");
- DoNumTest("foo %3i", pos, "foo 42");
- DoNumTest("foo %-3i", pos, "foo 42 ");
- DoNumTest("foo %.1i", pos, "foo 42");
- DoNumTest("foo %.3i", pos, "foo 042");
- DoNumTest("foo %03i", pos, "foo 042");
- DoNumTest("foo %#i", pos, "foo 42");
- DoNumTest("foo %+i", pos, "foo +42");
- DoNumTest("foo % i", pos, "foo 42");
- DoNumTest("foo %+i", neg, "foo -42");
- DoNumTest("foo % i", neg, "foo -42");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf/test9/testinfo.dat
deleted file mode 100644
index 2a64b26030..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snprintf/test9/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snprintf
-Name = Positive Test for _snprintf
-TYPE = DEFAULT
-EXE1 = test9
-Description
-= Tests _snprintf with integer numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/CMakeLists.txt
new file mode 100644
index 0000000000..8fe1cb60ac
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/CMakeLists.txt
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
+add_subdirectory(test10)
+add_subdirectory(test11)
+add_subdirectory(test12)
+add_subdirectory(test13)
+add_subdirectory(test14)
+add_subdirectory(test15)
+add_subdirectory(test16)
+add_subdirectory(test17)
+add_subdirectory(test18)
+add_subdirectory(test19)
+add_subdirectory(test2)
+add_subdirectory(test3)
+add_subdirectory(test4)
+add_subdirectory(test6)
+add_subdirectory(test7)
+add_subdirectory(test8)
+add_subdirectory(test9)
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/_snprintf_s.h b/src/pal/tests/palsuite/c_runtime/_snprintf_s/_snprintf_s.h
new file mode 100644
index 0000000000..9ed5209bea
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/_snprintf_s.h
@@ -0,0 +1,194 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: sprintf_s.h
+**
+** Purpose: Containts common testing functions for sprintf_s
+**
+**
+**==========================================================================*/
+
+#ifndef __STRINGTEST_H__
+#define __STRINGTEST_H__
+
+void DoStrTest(const char *formatstr, char* param, const char *checkstr)
+{
+ char buf[256] = { 0 };
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert string \"%s\" into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ param, formatstr, checkstr, buf);
+ }
+}
+
+void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr)
+{
+ char buf[256] = { 0 };
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert wide string \"%s\" into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ convertC(param), formatstr, checkstr, buf);
+ }
+}
+
+
+void DoPointerTest(const char *formatstr, void* param, char* paramstr, char
+ *checkstr1)
+{
+ char buf[256] = { 0 };
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\"\n"
+ "Expected \"%s\", got \"%s\".\n",
+ paramstr, formatstr, checkstr1, buf);
+ }
+}
+
+void DoCountTest(const char *formatstr, int param, const char *checkstr)
+{
+ char buf[512] = { 0 };
+ int n = -1;
+
+ sprintf_s(buf, 512, formatstr, &n);
+
+ if (n != param)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
+ param, n);
+ }
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf);
+ }
+}
+
+void DoShortCountTest(const char *formatstr, int param, const char *checkstr)
+{
+ char buf[256] = { 0 };
+ short int n = -1;
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, &n);
+
+ if (n != param)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
+ param, n);
+ }
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf);
+ }
+}
+
+void DoCharTest(const char *formatstr, char param, const char *checkstr)
+{
+ char buf[256] = { 0 };
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ param, param, formatstr, checkstr, buf);
+ }
+}
+
+void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr)
+{
+ char buf[256] = { 0 };
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ (char)param, param, formatstr, checkstr, buf);
+ }
+}
+
+void DoNumTest(const char *formatstr, int value, const char *checkstr)
+{
+ char buf[256] = { 0 };
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, value);
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %#x into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ value, formatstr, checkstr, buf);
+ }
+}
+
+void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1)
+{
+ char buf[256] = { 0 };
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, value);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\"\n"
+ "Expected \"%s\", got \"%s\".\n",
+ valuestr, formatstr, checkstr1, buf);
+ }
+}
+
+void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, char
+*checkstr2)
+{
+ char buf[256] = { 0 };
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, value);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0
+ && memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %f into \"%s\"\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ value, formatstr, checkstr1, checkstr2, buf);
+ }
+}
+
+void DoArgumentPrecTest(const char *formatstr, int precision, void *param, char
+*paramstr, const char *checkstr1, const char *checkstr2)
+{
+ char buf[256];
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, precision, param);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
+ memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ paramstr, formatstr, precision, checkstr1, checkstr2, buf);
+ }
+
+}
+
+void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param,
+const char *checkstr1, const char *checkstr2)
+{
+ char buf[256];
+
+ _snprintf_s(buf, 256, _TRUNCATE, formatstr, precision, param);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
+ memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ param, formatstr, precision, checkstr1, checkstr2, buf);
+ }
+
+}
+
+#endif
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/CMakeLists.txt
new file mode 100644
index 0000000000..9e4c671ec8
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.cpp
+)
+
+add_executable(paltest_snprintf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test1 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/test1.cpp
new file mode 100644
index 0000000000..d180b05df5
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/test1.cpp
@@ -0,0 +1,58 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: General test to see if sprintf_s works correctly
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ char checkstr[] = "hello world";
+ char buf[256] = { 0 };
+ int ret;
+
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ _snprintf_s(buf, 256, _TRUNCATE, "hello world");
+ if (memcmp(checkstr, buf, strlen(checkstr)+1) != 0)
+ {
+ Fail("ERROR: expected \"%s\" (up to %d chars), got \"%s\"\n",
+ checkstr, 256, buf);
+ }
+
+ _snprintf_s(buf, 256, _TRUNCATE, "xxxxxxxxxxxxxxxxx");
+ ret = _snprintf_s(buf, 8, _TRUNCATE, "hello world");
+
+ if (ret >= 0)
+ {
+ Fail("ERROR: expected negative return value, got %d", ret);
+ }
+ if (memcmp(checkstr, buf, 7) != 0 || buf[7] != 0 || buf[8] != 'x')
+ {
+ Fail("ERROR: expected %s (up to %d chars), got %s\n",
+ checkstr, 8, buf);
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/testinfo.dat
new file mode 100644
index 0000000000..255c534cdf
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test1/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= General test to see if sprintf_s works correctly
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/CMakeLists.txt
new file mode 100644
index 0000000000..57e7fb16d3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test10.cpp
+)
+
+add_executable(paltest_snprintf_test10
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test10 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test10
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/test10.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/test10.cpp
new file mode 100644
index 0000000000..7ecb9102e4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/test10.cpp
@@ -0,0 +1,55 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test10.c
+**
+** Purpose: Tests sprintf_s with octal numbers
+**
+**
+**==========================================================================*/
+
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %o", pos, "foo 52");
+ DoNumTest("foo %lo", 0xFFFF, "foo 177777");
+ DoNumTest("foo %ho", 0xFFFF, "foo 177777");
+ DoNumTest("foo %Lo", pos, "foo 52");
+ DoI64Test("foo %I64o", l, "42", "foo 52");
+ DoNumTest("foo %3o", pos, "foo 52");
+ DoNumTest("foo %-3o", pos, "foo 52 ");
+ DoNumTest("foo %.1o", pos, "foo 52");
+ DoNumTest("foo %.3o", pos, "foo 052");
+ DoNumTest("foo %03o", pos, "foo 052");
+ DoNumTest("foo %#o", pos, "foo 052");
+ DoNumTest("foo %+o", pos, "foo 52");
+ DoNumTest("foo % o", pos, "foo 52");
+ DoNumTest("foo %+o", neg, "foo 37777777726");
+ DoNumTest("foo % o", neg, "foo 37777777726");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/testinfo.dat
new file mode 100644
index 0000000000..25ed554ea3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test10/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test10
+Description
+= Tests sprintf_s with octal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/CMakeLists.txt
new file mode 100644
index 0000000000..4fc179c5a8
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test11.cpp
+)
+
+add_executable(paltest_snprintf_test11
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test11 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test11
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/test11.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/test11.cpp
new file mode 100644
index 0000000000..c2ac015698
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/test11.cpp
@@ -0,0 +1,54 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test11.c
+**
+** Purpose: Tests sprintf_s with unsigned numbers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %u", pos, "foo 42");
+ DoNumTest("foo %lu", 0xFFFF, "foo 65535");
+ DoNumTest("foo %hu", 0xFFFF, "foo 65535");
+ DoNumTest("foo %Lu", pos, "foo 42");
+ DoI64Test("foo %I64u", l, "42", "foo 42");
+ DoNumTest("foo %3u", pos, "foo 42");
+ DoNumTest("foo %-3u", pos, "foo 42 ");
+ DoNumTest("foo %.1u", pos, "foo 42");
+ DoNumTest("foo %.3u", pos, "foo 042");
+ DoNumTest("foo %03u", pos, "foo 042");
+ DoNumTest("foo %#u", pos, "foo 42");
+ DoNumTest("foo %+u", pos, "foo 42");
+ DoNumTest("foo % u", pos, "foo 42");
+ DoNumTest("foo %+u", neg, "foo 4294967254");
+ DoNumTest("foo % u", neg, "foo 4294967254");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/testinfo.dat
new file mode 100644
index 0000000000..3144f1290e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test11/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test11
+Description
+= Tests sprintf_s with unsigned numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/CMakeLists.txt
new file mode 100644
index 0000000000..a35609eb57
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test12.cpp
+)
+
+add_executable(paltest_snprintf_test12
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test12 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test12
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/test12.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/test12.cpp
new file mode 100644
index 0000000000..52171838cc
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/test12.cpp
@@ -0,0 +1,55 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test12.c
+**
+** Purpose: Tests sprintf_s with hex numbers (lowercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 0x1234ab;
+ INT64 l = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %x", pos, "foo 1234ab");
+ DoNumTest("foo %lx", pos, "foo 1234ab");
+ DoNumTest("foo %hx", pos, "foo 34ab");
+ DoNumTest("foo %Lx", pos, "foo 1234ab");
+ DoI64Test("foo %I64x", l, "0x1234567887654321", "foo 1234567887654321");
+ DoNumTest("foo %7x", pos, "foo 1234ab");
+ DoNumTest("foo %-7x", pos, "foo 1234ab ");
+ DoNumTest("foo %.1x", pos, "foo 1234ab");
+ DoNumTest("foo %.7x", pos, "foo 01234ab");
+ DoNumTest("foo %07x", pos, "foo 01234ab");
+ DoNumTest("foo %#x", pos, "foo 0x1234ab");
+ DoNumTest("foo %+x", pos, "foo 1234ab");
+ DoNumTest("foo % x", pos, "foo 1234ab");
+ DoNumTest("foo %+x", neg, "foo ffffffd6");
+ DoNumTest("foo % x", neg, "foo ffffffd6");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/testinfo.dat
new file mode 100644
index 0000000000..ed91cecc46
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test12/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test12
+Description
+= Tests sprintf_s with hex numbers (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/CMakeLists.txt
new file mode 100644
index 0000000000..3bf986e851
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test13.cpp
+)
+
+add_executable(paltest_snprintf_test13
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test13 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test13
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/test13.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/test13.cpp
new file mode 100644
index 0000000000..15e47558b0
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/test13.cpp
@@ -0,0 +1,55 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test13.c
+**
+** Purpose: Tests sprintf_s with hex numbers (uppercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 0x1234AB;
+ INT64 l = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %X", pos, "foo 1234AB");
+ DoNumTest("foo %lX", pos, "foo 1234AB");
+ DoNumTest("foo %hX", pos, "foo 34AB");
+ DoNumTest("foo %LX", pos, "foo 1234AB");
+ DoI64Test("foo %I64X", l, "0x1234567887654321", "foo 1234567887654321");
+ DoNumTest("foo %7X", pos, "foo 1234AB");
+ DoNumTest("foo %-7X", pos, "foo 1234AB ");
+ DoNumTest("foo %.1X", pos, "foo 1234AB");
+ DoNumTest("foo %.7X", pos, "foo 01234AB");
+ DoNumTest("foo %07X", pos, "foo 01234AB");
+ DoNumTest("foo %#X", pos, "foo 0X1234AB");
+ DoNumTest("foo %+X", pos, "foo 1234AB");
+ DoNumTest("foo % X", pos, "foo 1234AB");
+ DoNumTest("foo %+X", neg, "foo FFFFFFD6");
+ DoNumTest("foo % X", neg, "foo FFFFFFD6");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/testinfo.dat
new file mode 100644
index 0000000000..fd5f53017c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test13/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test13
+Description
+= Tests sprintf_s with hex numbers (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/CMakeLists.txt
new file mode 100644
index 0000000000..985303ecf8
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test14.cpp
+)
+
+add_executable(paltest_snprintf_test14
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test14 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test14
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/test14.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/test14.cpp
new file mode 100644
index 0000000000..331475e962
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/test14.cpp
@@ -0,0 +1,57 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test14.c
+**
+** Purpose: Tests sprintf_s with exponential format doubles (lowercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 256.0;
+ double neg = -256.0;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest("foo %e", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %le", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %he", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %Le", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %I64e", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %14e", val, "foo 2.560000e+002",
+ "foo 2.560000e+02");
+ DoDoubleTest("foo %-14e", val, "foo 2.560000e+002 ",
+ "foo 2.560000e+02 ");
+ DoDoubleTest("foo %.1e", val, "foo 2.6e+002", "foo 2.6e+02");
+ DoDoubleTest("foo %.8e", val, "foo 2.56000000e+002",
+ "foo 2.56000000e+02");
+ DoDoubleTest("foo %014e", val, "foo 02.560000e+002",
+ "foo 002.560000e+02");
+ DoDoubleTest("foo %#e", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %+e", val, "foo +2.560000e+002", "foo +2.560000e+02");
+ DoDoubleTest("foo % e", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %+e", neg, "foo -2.560000e+002", "foo -2.560000e+02");
+ DoDoubleTest("foo % e", neg, "foo -2.560000e+002", "foo -2.560000e+02");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/testinfo.dat
new file mode 100644
index 0000000000..23cf423354
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test14/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test14
+Description
+= Tests sprintf_s with exponential format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/CMakeLists.txt
new file mode 100644
index 0000000000..c7f5796089
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test15.cpp
+)
+
+add_executable(paltest_snprintf_test15
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test15 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test15
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/test15.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/test15.cpp
new file mode 100644
index 0000000000..d43613b6cf
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/test15.cpp
@@ -0,0 +1,56 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test15.c
+**
+** Purpose: Tests sprintf_s with exponential format doubles (uppercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 256.0;
+ double neg = -256.0;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest("foo %E", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %lE", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %hE", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %LE", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %I64E", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %14E", val, "foo 2.560000E+002",
+ "foo 2.560000E+02");
+ DoDoubleTest("foo %-14E", val, "foo 2.560000E+002 ",
+ "foo 2.560000E+02 ");
+ DoDoubleTest("foo %.1E", val, "foo 2.6E+002", "foo 2.6E+02");
+ DoDoubleTest("foo %.8E", val, "foo 2.56000000E+002",
+ "foo 2.56000000E+02");
+ DoDoubleTest("foo %014E", val, "foo 02.560000E+002",
+ "foo 002.560000E+02");
+ DoDoubleTest("foo %#E", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %+E", val, "foo +2.560000E+002", "foo +2.560000E+02");
+ DoDoubleTest("foo % E", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %+E", neg, "foo -2.560000E+002", "foo -2.560000E+02");
+ DoDoubleTest("foo % E", neg, "foo -2.560000E+002", "foo -2.560000E+02");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/testinfo.dat
new file mode 100644
index 0000000000..537e6d1db2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test15/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test15
+Description
+= Tests sprintf_s with exponential format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/CMakeLists.txt
new file mode 100644
index 0000000000..9a224bc23b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test16.cpp
+)
+
+add_executable(paltest_snprintf_test16
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test16 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test16
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/test16.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/test16.cpp
new file mode 100644
index 0000000000..21cbb1ed30
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/test16.cpp
@@ -0,0 +1,52 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test16.c
+**
+** Purpose: Test #15 for the sprintf_s function
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest("foo %f", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %lf", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %hf", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %Lf", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %I64f", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %12f", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %-12f", val, "foo 2560.001000 ", "foo 2560.001000 ");
+ DoDoubleTest("foo %.1f", val, "foo 2560.0", "foo 2560.0");
+ DoDoubleTest("foo %.8f", val, "foo 2560.00100000", "foo 2560.00100000");
+ DoDoubleTest("foo %012f", val, "foo 02560.001000", "foo 02560.001000");
+ DoDoubleTest("foo %#f", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %+f", val, "foo +2560.001000", "foo +2560.001000");
+ DoDoubleTest("foo % f", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %+f", neg, "foo -2560.001000", "foo -2560.001000");
+ DoDoubleTest("foo % f", neg, "foo -2560.001000", "foo -2560.001000");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/testinfo.dat
new file mode 100644
index 0000000000..4e98eccac2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test16/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test16
+Description
+= Tests sprintf_s with decimal point format doubles
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/CMakeLists.txt
new file mode 100644
index 0000000000..3a8a349c84
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test17.cpp
+)
+
+add_executable(paltest_snprintf_test17
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test17 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test17
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/test17.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/test17.cpp
new file mode 100644
index 0000000000..d161270b84
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/test17.cpp
@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test17.c
+**
+** Purpose: Tests sprintf_s with compact format doubles (lowercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest("foo %g", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %lg", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %hg", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %Lg", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %I64g", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %5g", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %-5g", val, "foo 2560 ", "foo 2560 ");
+ DoDoubleTest("foo %.1g", val, "foo 3e+003", "foo 3e+03");
+ DoDoubleTest("foo %.2g", val, "foo 2.6e+003", "foo 2.6e+03");
+ DoDoubleTest("foo %.12g", val, "foo 2560.001", "foo 2560.001");
+ DoDoubleTest("foo %06g", val, "foo 002560", "foo 002560");
+ DoDoubleTest("foo %#g", val, "foo 2560.00", "foo 2560.00");
+ DoDoubleTest("foo %+g", val, "foo +2560", "foo +2560");
+ DoDoubleTest("foo % g", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %+g", neg, "foo -2560", "foo -2560");
+ DoDoubleTest("foo % g", neg, "foo -2560", "foo -2560");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/testinfo.dat
new file mode 100644
index 0000000000..5e41e20d44
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test17/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test17
+Description
+= Tests sprintf_s with compact format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/CMakeLists.txt
new file mode 100644
index 0000000000..96e39e8f41
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test18.cpp
+)
+
+add_executable(paltest_snprintf_test18
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test18 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test18
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/test18.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/test18.cpp
new file mode 100644
index 0000000000..46ec287cc1
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/test18.cpp
@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test18.c
+**
+** Purpose: Tests sprintf_s with compact format doubles (uppercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest("foo %G", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %lG", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %hG", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %LG", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %I64G", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %5G", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %-5G", val, "foo 2560 ", "foo 2560 ");
+ DoDoubleTest("foo %.1G", val, "foo 3E+003", "foo 3E+03");
+ DoDoubleTest("foo %.2G", val, "foo 2.6E+003", "foo 2.6E+03");
+ DoDoubleTest("foo %.12G", val, "foo 2560.001", "foo 2560.001");
+ DoDoubleTest("foo %06G", val, "foo 002560", "foo 002560");
+ DoDoubleTest("foo %#G", val, "foo 2560.00", "foo 2560.00");
+ DoDoubleTest("foo %+G", val, "foo +2560", "foo +2560");
+ DoDoubleTest("foo % G", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %+G", neg, "foo -2560", "foo -2560");
+ DoDoubleTest("foo % G", neg, "foo -2560", "foo -2560");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/testinfo.dat
new file mode 100644
index 0000000000..06ae3a632e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test18/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test18
+Description
+= Tests sprintf_s with compact format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/CMakeLists.txt
new file mode 100644
index 0000000000..be3570f163
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test19.cpp
+)
+
+add_executable(paltest_snprintf_test19
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test19 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test19
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/test19.cpp
new file mode 100644
index 0000000000..91b1dae583
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/test19.cpp
@@ -0,0 +1,70 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test19.c
+**
+** Purpose:Tests sprintf_s with argument specified precision
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n = -1;
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ DoArgumentPrecTest("%.*s", 2, (void*)"bar", "bar", "ba", "ba");
+ DoArgumentPrecTest("%.*S", 2, (void*)convert("bar"), "bar", "ba", "ba");
+
+ DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
+ DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
+ DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
+ DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42") ;
+ DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
+
+
+ DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
+ DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
+ DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
+ DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
+ DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
+ DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
+ DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
+ DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
+ DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
+ DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/testinfo.dat
new file mode 100644
index 0000000000..7064c01771
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test19/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test19
+Description
+= Tests sprintf_s with argument specified precision
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/CMakeLists.txt
new file mode 100644
index 0000000000..11d18e61c3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test2.cpp
+)
+
+add_executable(paltest_snprintf_test2
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test2 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test2
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/test2.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/test2.cpp
new file mode 100644
index 0000000000..e58669466f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/test2.cpp
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test2.c
+**
+** Purpose:Tests sprintf_s with strings
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ DoStrTest("foo %s", "bar", "foo bar");
+ DoStrTest("foo %hs", "bar", "foo bar");
+ DoWStrTest("foo %ls", convert("bar"), "foo bar");
+ DoWStrTest("foo %ws", convert("bar"), "foo bar");
+ DoStrTest("foo %Ls", "bar", "foo bar");
+ DoStrTest("foo %I64s", "bar", "foo bar");
+ DoStrTest("foo %5s", "bar", "foo bar");
+ DoStrTest("foo %.2s", "bar", "foo ba");
+ DoStrTest("foo %5.2s", "bar", "foo ba");
+ DoStrTest("foo %-5s", "bar", "foo bar ");
+ DoStrTest("foo %05s", "bar", "foo 00bar");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/testinfo.dat
new file mode 100644
index 0000000000..cce2dc67e7
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test2/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test2
+Description
+= Tests sprintf_s with strings
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/CMakeLists.txt
new file mode 100644
index 0000000000..b8d4178962
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test3.cpp
+)
+
+add_executable(paltest_snprintf_test3
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test3 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test3
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/test3.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/test3.cpp
new file mode 100644
index 0000000000..3c52b44246
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/test3.cpp
@@ -0,0 +1,45 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test3.c
+**
+** Purpose: Tests sprintf_s with wide strings
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ DoWStrTest("foo %S", convert("bar"), "foo bar");
+ DoStrTest("foo %hS", "bar", "foo bar");
+ DoWStrTest("foo %lS", convert("bar"), "foo bar");
+ DoWStrTest("foo %wS", convert("bar"), "foo bar");
+ DoWStrTest("foo %LS", convert("bar"), "foo bar");
+ DoWStrTest("foo %I64S", convert("bar"), "foo bar");
+ DoWStrTest("foo %5S", convert("bar"), "foo bar");
+ DoWStrTest("foo %.2S", convert("bar"), "foo ba");
+ DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
+ DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
+ DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/testinfo.dat
new file mode 100644
index 0000000000..cc8de0eae5
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test3/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test3
+Description
+= Tests sprintf_s with wide strings
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/CMakeLists.txt
new file mode 100644
index 0000000000..568b7122de
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test4.cpp
+)
+
+add_executable(paltest_snprintf_test4
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test4 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test4
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/test4.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/test4.cpp
new file mode 100644
index 0000000000..216557f10a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/test4.cpp
@@ -0,0 +1,69 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test4.c
+**
+** Purpose: Tests sprintf_s with pointers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ void *ptr = (void*) 0x123456;
+ INT64 lptr = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+ /*
+ ** Run only on 64 bit platforms
+ */
+ #if defined(BIT64) && defined(PLATFORM_UNIX)
+ Trace("Testing for 64 Bit Platforms \n");
+ DoPointerTest("%p", NULL, "NULL", "0000000000000000");
+ DoPointerTest("%p", ptr, "pointer to 0x123456", "0000000000123456");
+ DoPointerTest("%17p", ptr, "pointer to 0x123456", " 0000000000123456");
+ DoPointerTest("%17p", ptr, "pointer to 0x123456", " 0000000000123456");
+ DoPointerTest("%-17p", ptr, "pointer to 0x123456", "0000000000123456 ");
+ DoPointerTest("%+p", ptr, "pointer to 0x123456", "0000000000123456");
+ DoPointerTest("%#p", ptr, "pointer to 0x123456", "0X0000000000123456");
+ DoPointerTest("%lp", ptr, "pointer to 0x123456", "00123456");
+ DoPointerTest("%hp", ptr, "pointer to 0x123456", "00003456");
+ DoPointerTest("%Lp", ptr, "pointer to 0x123456", "00123456");
+ DoI64Test("%I64p", lptr, "pointer to 0x1234567887654321",
+ "1234567887654321");
+ #else
+ Trace("Testing for Non 64 Bit Platforms \n");
+ DoPointerTest("%p", NULL, "NULL", "00000000");
+ DoPointerTest("%p", ptr, "pointer to 0x123456", "00123456");
+ DoPointerTest("%9p", ptr, "pointer to 0x123456", " 00123456");
+ DoPointerTest("%09p", ptr, "pointer to 0x123456", " 00123456");
+ DoPointerTest("%-9p", ptr, "pointer to 0x123456", "00123456 ");
+ DoPointerTest("%+p", ptr, "pointer to 0x123456", "00123456");
+ DoPointerTest("%#p", ptr, "pointer to 0x123456", "0X00123456");
+ DoPointerTest("%lp", ptr, "pointer to 0x123456", "00123456");
+ DoPointerTest("%hp", ptr, "pointer to 0x123456", "00003456");
+ DoPointerTest("%Lp", ptr, "pointer to 0x123456", "00123456");
+ DoI64Test("%I64p", lptr, "pointer to 0x1234567887654321",
+ "1234567887654321");
+ #endif //defined(BIT64) && defined(PLATFORM_UNIX)
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/testinfo.dat
new file mode 100644
index 0000000000..f53f784991
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test4/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test4
+Description
+= Tests sprintf_s with pointers
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/CMakeLists.txt
new file mode 100644
index 0000000000..820cc66d55
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test6.cpp
+)
+
+add_executable(paltest_snprintf_test6
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test6 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test6
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/test6.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/test6.cpp
new file mode 100644
index 0000000000..45c9e2b79b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/test6.cpp
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test6.c
+**
+** Purpose: Tests sprintf_s with characters
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR wc = (WCHAR) 'c';
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoCharTest("foo %c", 'b', "foo b");
+ DoCharTest("foo %hc", 'b', "foo b");
+ DoWCharTest("foo %lc", wc, "foo c");
+ DoCharTest("foo %Lc", 'b', "foo b");
+ DoCharTest("foo %I64c", 'b', "foo b");
+ DoCharTest("foo %5c", 'b', "foo b");
+ DoCharTest("foo %.0c", 'b', "foo b");
+ DoCharTest("foo %-5c", 'b', "foo b ");
+ DoCharTest("foo %05c", 'b', "foo 0000b");
+ DoCharTest("foo % c", 'b', "foo b");
+ DoCharTest("foo %#c", 'b', "foo b");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/testinfo.dat
new file mode 100644
index 0000000000..06e31e85d6
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test6/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name =Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test6
+Description
+= Tests sprintf_s with characters
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/CMakeLists.txt
new file mode 100644
index 0000000000..a2af7c4a8c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test7.cpp
+)
+
+add_executable(paltest_snprintf_test7
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test7 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test7
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/test7.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/test7.cpp
new file mode 100644
index 0000000000..5c10fc8ea7
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/test7.cpp
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test7.c
+**
+** Purpose: Tests sprintf_s with wide characters
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR wb = (WCHAR) 'b';
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoWCharTest("foo %C", wb, "foo b");
+ DoWCharTest("foo %hC", wb, "foo b");
+ DoCharTest("foo %lC", 'c', "foo c");
+ DoWCharTest("foo %LC", wb, "foo b");
+ DoWCharTest("foo %I64C", wb, "foo b");
+ DoWCharTest("foo %5C", wb, "foo b");
+ DoWCharTest("foo %.0C", wb, "foo b");
+ DoWCharTest("foo %-5C", wb, "foo b ");
+ DoWCharTest("foo %05C", wb, "foo 0000b");
+ DoWCharTest("foo % C", wb, "foo b");
+ DoWCharTest("foo %#C", wb, "foo b");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/testinfo.dat
new file mode 100644
index 0000000000..647c9d80fd
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test7/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test7
+Description
+= Tests sprintf_s with wide characters
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/CMakeLists.txt
new file mode 100644
index 0000000000..53545c5dbf
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test8.cpp
+)
+
+add_executable(paltest_snprintf_test8
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test8 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test8
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/test8.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/test8.cpp
new file mode 100644
index 0000000000..416e357e1e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/test8.cpp
@@ -0,0 +1,56 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test8.c
+**
+** Purpose: Tests sprintf_s with decimal numbers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %d", pos, "foo 42");
+ DoNumTest("foo %ld", 0xFFFF, "foo 65535");
+ DoNumTest("foo %hd", 0xFFFF, "foo -1");
+ DoNumTest("foo %Ld", pos, "foo 42");
+ DoI64Test("foo %I64d", l, "42", "foo 42");
+ DoNumTest("foo %3d", pos, "foo 42");
+ DoNumTest("foo %-3d", pos, "foo 42 ");
+ DoNumTest("foo %.1d", pos, "foo 42");
+ DoNumTest("foo %.3d", pos, "foo 042");
+ DoNumTest("foo %03d", pos, "foo 042");
+ DoNumTest("foo %#d", pos, "foo 42");
+ DoNumTest("foo %+d", pos, "foo +42");
+ DoNumTest("foo % d", pos, "foo 42");
+ DoNumTest("foo %+d", neg, "foo -42");
+ DoNumTest("foo % d", neg, "foo -42");
+
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/testinfo.dat
new file mode 100644
index 0000000000..524834e53e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test8/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test8
+Description
+= Tests sprintf_s with decimal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/CMakeLists.txt
new file mode 100644
index 0000000000..33ca9db7a8
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test9.cpp
+)
+
+add_executable(paltest_snprintf_test9
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snprintf_test9 coreclrpal)
+
+target_link_libraries(paltest_snprintf_test9
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/test9.cpp b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/test9.cpp
new file mode 100644
index 0000000000..18b1cb7830
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/test9.cpp
@@ -0,0 +1,55 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test9.c
+**
+** Purpose: Tests sprintf_s with integer numbers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snprintf_s.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %i", pos, "foo 42");
+ DoNumTest("foo %li", 0xFFFF, "foo 65535");
+ DoNumTest("foo %hi", 0xFFFF, "foo -1");
+ DoNumTest("foo %Li", pos, "foo 42");
+ DoI64Test("foo %I64i", l, "42", "foo 42");
+ DoNumTest("foo %3i", pos, "foo 42");
+ DoNumTest("foo %-3i", pos, "foo 42 ");
+ DoNumTest("foo %.1i", pos, "foo 42");
+ DoNumTest("foo %.3i", pos, "foo 042");
+ DoNumTest("foo %03i", pos, "foo 042");
+ DoNumTest("foo %#i", pos, "foo 42");
+ DoNumTest("foo %+i", pos, "foo +42");
+ DoNumTest("foo % i", pos, "foo 42");
+ DoNumTest("foo %+i", neg, "foo -42");
+ DoNumTest("foo % i", neg, "foo -42");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/testinfo.dat
new file mode 100644
index 0000000000..7c51443a3d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snprintf_s/test9/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test9
+Description
+= Tests sprintf_s with integer numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/CMakeLists.txt
deleted file mode 100644
index cafb9536b0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-add_subdirectory(test10)
-add_subdirectory(test11)
-add_subdirectory(test12)
-add_subdirectory(test13)
-add_subdirectory(test14)
-add_subdirectory(test15)
-add_subdirectory(test16)
-add_subdirectory(test17)
-add_subdirectory(test18)
-add_subdirectory(test19)
-add_subdirectory(test2)
-add_subdirectory(test3)
-add_subdirectory(test4)
-add_subdirectory(test5)
-add_subdirectory(test6)
-add_subdirectory(test7)
-add_subdirectory(test8)
-add_subdirectory(test9)
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/_snwprintf.h b/src/pal/tests/palsuite/c_runtime/_snwprintf/_snwprintf.h
deleted file mode 100644
index 73bf4d6c12..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/_snwprintf.h
+++ /dev/null
@@ -1,199 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: _snwprintf.h
-**
-** Purpose: Containts common testing functions for _snwprintf
-**
-**
-**==========================================================================*/
-
-#ifndef ___SNWPRINTF_H__
-#define ___SNWPRINTF_H__
-
-void DoWStrTest(WCHAR *formatstr, WCHAR *param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- _snwprintf(buf, 256, formatstr, param);
-
- if (memcmp(buf, checkstr, wcslen(checkstr) * 2 + 2) != 0)
- {
- Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n"
- "Expected \"%s\", got \"%s\".\n", convertC(param),
- convertC(formatstr), convertC(checkstr), convertC(buf));
- }
-}
-
-void DoStrTest(WCHAR *formatstr, char *param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- _snwprintf(buf, 256, formatstr, param);
-
- if (memcmp(buf, checkstr, wcslen(checkstr) * 2 + 2) != 0)
- {
- Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n"
- "Expected \"%s\", got \"%s\".\n",
- param, convertC(formatstr), convertC(checkstr), convertC(buf));
- }
-}
-
-void DoPointerTest(WCHAR *formatstr, void* param, WCHAR *checkstr1)
-{
- WCHAR buf[256] = { 0 };
-
- _snwprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0)
- {
- Fail("ERROR: failed to insert pointer to %#p into \"%s\"\n"
- "Expected \"%s\", got \"%s\".\n", param, convertC(formatstr),
- convertC(checkstr1), convertC(buf));
- }
-}
-
-void DoCountTest(WCHAR *formatstr, int param, WCHAR *checkstr)
-{
- WCHAR buf[512] = { 0 };
- int n = -1;
-
- _snwprintf(buf, 512, formatstr, &n);
-
- if (n != param)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %d\n",
- param, n);
- }
-
- if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0)
- {
- Fail("ERROR: Expected \"%s\" got \"%s\".\n",
- convertC(checkstr), convertC(buf));
- }
-}
-
-void DoShortCountTest(WCHAR *formatstr, int param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
- short int n = -1;
-
- _snwprintf(buf, 256, formatstr, &n);
-
- if (n != param)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %d\n",
- param, n);
- }
-
- if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0)
- {
- Fail("ERROR: Expected \"%s\" got \"%s\".\n",
- convertC(checkstr), convertC(buf));
- }
-}
-
-void DoCharTest(WCHAR *formatstr, char param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- _snwprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0)
- {
- Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n", param, param,
- convertC(formatstr), convertC(checkstr), convertC(buf));
- }
-}
-
-void DoWCharTest(WCHAR *formatstr, WCHAR param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- _snwprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0)
- {
- Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n", (char) param, param,
- convertC(formatstr), convertC(checkstr), convertC(buf));
- }
-}
-
-void DoNumTest(WCHAR *formatstr, int value, WCHAR*checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- _snwprintf(buf, 256, formatstr, value);
- if (memcmp(buf, checkstr, wcslen(checkstr)* 2 + 2) != 0)
- {
- Fail("ERROR: failed to insert %#x into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n", value, convertC(formatstr),
- convertC(checkstr), convertC(buf));
- }
-}
-
-
-void DoI64Test(WCHAR *formatstr, INT64 param, char *paramdesc,
- WCHAR *checkstr1)
-{
- WCHAR buf[256] = { 0 };
-
- _snwprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\"\n"
- "Expected \"%s\", got \"%s\".\n", paramdesc,
- convertC(formatstr), convertC(checkstr1), convertC(buf));
- }
-}
-
-void DoDoubleTest(WCHAR *formatstr, double value, WCHAR *checkstr1,
- WCHAR *checkstr2)
-{
- WCHAR buf[256] = { 0 };
-
- _snwprintf(buf, 256, formatstr, value);
- if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0 &&
- memcmp(buf, checkstr2, wcslen(checkstr2)*2 + 2) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\"\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- value, convertC(formatstr), convertC(checkstr1),
- convertC(checkstr2), convertC(buf));
- }
-}
-
-void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
- char *paramstr, WCHAR *checkstr1, WCHAR *checkstr2)
-{
- WCHAR buf[256];
-
- _snwprintf(buf, 256, formatstr, precision, param);
- if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
- memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- paramstr, convertC(formatstr), precision,
- convertC(checkstr1), convertC(checkstr2) ,convertC(buf));
- }
-}
-
-void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param,
- WCHAR *checkstr)
-{
- WCHAR buf[256];
-
- _snwprintf(buf, 256, formatstr, precision, param);
- if (memcmp(buf, checkstr, wcslen(checkstr) + 2) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
- "Expected \"%s\", got \"%s\".\n", param, convertC(formatstr),
- precision, convertC(checkstr), convertC(buf));
- }
-}
-
-#endif
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test1/CMakeLists.txt
deleted file mode 100644
index b4ab6d5161..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_snwprintf_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test1 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test1/test1.c
deleted file mode 100644
index 5d13aaf05d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test1/test1.c
+++ /dev/null
@@ -1,62 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: General test to see if _snwprintf works correctly
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR *checkstr;
- WCHAR buf[256] = { 0 };
- int ret;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- checkstr = convert("hello world");
- _snwprintf(buf, 256, checkstr);
- if (memcmp(checkstr, buf, wcslen(checkstr)*2+2) != 0)
- {
- Fail("ERROR: Expected \"%s\", got \"%s\"\n",
- convertC(checkstr), convertC(buf));
- }
-
- _snwprintf(buf, 256, convert("xxxxxxxxxxxxxxxxx"));
- ret = _snwprintf(buf, 8, checkstr);
- if (memcmp(checkstr, buf, 16) != 0)
- {
- Fail("ERROR: Expected \"%8s\", got \"%8s\"\n",
- convertC(checkstr), convertC(buf));
- }
- if (ret >= 0)
- {
- Fail("ERROR: Expected negative return value, got %d.\n", ret);
- }
- if (buf[8] != (WCHAR) 'x')
- {
- Fail("ERROR: buffer overflow using \"%s\" with length 8.\n",
- convertC(checkstr));
- }
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test1/testinfo.dat
deleted file mode 100644
index 079a3b3989..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test1/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= General test to see if _snwprintf works correctly
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test10/CMakeLists.txt
deleted file mode 100644
index 27aaca3bb9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test10/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test10.c
-)
-
-add_executable(paltest_snwprintf_test10
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test10 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test10
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test10/test10.c
deleted file mode 100644
index e8a6d93ea3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test10/test10.c
+++ /dev/null
@@ -1,54 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test10.c
-**
-** Purpose: Tests _snwprintf with octal numbers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest(convert("foo %o"), pos, convert("foo 52"));
- DoNumTest(convert("foo %lo"), 0xFFFF, convert("foo 177777"));
- DoNumTest(convert("foo %ho"), 0xFFFF, convert("foo 177777"));
- DoNumTest(convert("foo %Lo"), pos, convert("foo 52"));
- DoI64Test(convert("foo %I64o"), l, "42", convert("foo 52"));
- DoNumTest(convert("foo %3o"), pos, convert("foo 52"));
- DoNumTest(convert("foo %-3o"), pos, convert("foo 52 "));
- DoNumTest(convert("foo %.1o"), pos, convert("foo 52"));
- DoNumTest(convert("foo %.3o"), pos, convert("foo 052"));
- DoNumTest(convert("foo %03o"), pos, convert("foo 052"));
- DoNumTest(convert("foo %#o"), pos, convert("foo 052"));
- DoNumTest(convert("foo %+o"), pos, convert("foo 52"));
- DoNumTest(convert("foo % o"), pos, convert("foo 52"));
- DoNumTest(convert("foo %+o"), neg, convert("foo 37777777726"));
- DoNumTest(convert("foo % o"), neg, convert("foo 37777777726"));
-
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test10/testinfo.dat
deleted file mode 100644
index 2c07cc6e45..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test10/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test10
-Description
-= Tests _snwprintf with octal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test11/CMakeLists.txt
deleted file mode 100644
index e18ad4a31b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test11/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test11.c
-)
-
-add_executable(paltest_snwprintf_test11
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test11 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test11
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test11/test11.c
deleted file mode 100644
index 95f7f53210..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test11/test11.c
+++ /dev/null
@@ -1,54 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test11.c
-**
-** Purpose: Tests _snwprintf with unsigned numbers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest(convert("foo %u"), pos, convert("foo 42"));
- DoNumTest(convert("foo %lu"), 0xFFFF, convert("foo 65535"));
- DoNumTest(convert("foo %hu"), 0xFFFF, convert("foo 65535"));
- DoNumTest(convert("foo %Lu"), pos, convert("foo 42"));
- DoI64Test(convert("foo %I64u"), l, "42", convert("foo 42"));
- DoNumTest(convert("foo %3u"), pos, convert("foo 42"));
- DoNumTest(convert("foo %-3u"), pos, convert("foo 42 "));
- DoNumTest(convert("foo %.1u"), pos, convert("foo 42"));
- DoNumTest(convert("foo %.3u"), pos, convert("foo 042"));
- DoNumTest(convert("foo %03u"), pos, convert("foo 042"));
- DoNumTest(convert("foo %#u"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+u"), pos, convert("foo 42"));
- DoNumTest(convert("foo % u"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+u"), neg, convert("foo 4294967254"));
- DoNumTest(convert("foo % u"), neg, convert("foo 4294967254"));
-
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test11/testinfo.dat
deleted file mode 100644
index f81a7861bf..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test11/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test11
-Description
-= Tests _snwprintf with unsigned numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test12/CMakeLists.txt
deleted file mode 100644
index f2ae07c1b0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test12/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test12.c
-)
-
-add_executable(paltest_snwprintf_test12
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test12 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test12
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test12/test12.c
deleted file mode 100644
index ab58fa345f..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test12/test12.c
+++ /dev/null
@@ -1,54 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test12.c
-**
-** Purpose: Tests _snwprintf with hex numbers (lowercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 0x1234ab;
- INT64 l = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest(convert("foo %x"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo %lx"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo %hx"), pos, convert("foo 34ab"));
- DoNumTest(convert("foo %Lx"), pos, convert("foo 1234ab"));
- DoI64Test(convert("foo %I64x"), l, "0x1234567887654321",
- convert("foo 1234567887654321"));
- DoNumTest(convert("foo %7x"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo %-7x"), pos, convert("foo 1234ab "));
- DoNumTest(convert("foo %.1x"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo %.7x"), pos, convert("foo 01234ab"));
- DoNumTest(convert("foo %07x"), pos, convert("foo 01234ab"));
- DoNumTest(convert("foo %#x"), pos, convert("foo 0x1234ab"));
- DoNumTest(convert("foo %+x"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo % x"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo %+x"), neg, convert("foo ffffffd6"));
- DoNumTest(convert("foo % x"), neg, convert("foo ffffffd6"));
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test12/testinfo.dat
deleted file mode 100644
index 653babae84..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test12/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test12
-Description
-= Tests _snwprintf with hex numbers (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test13/CMakeLists.txt
deleted file mode 100644
index 42847b6bcd..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test13/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test13.c
-)
-
-add_executable(paltest_snwprintf_test13
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test13 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test13
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test13/test13.c
deleted file mode 100644
index 5a3e22802d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test13/test13.c
+++ /dev/null
@@ -1,54 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test13.c
-**
-** Purpose: Tests _snwprintf with hex numbers (uppercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 0x1234ab;
- INT64 l = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest(convert("foo %X"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo %lX"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo %hX"), pos, convert("foo 34AB"));
- DoNumTest(convert("foo %LX"), pos, convert("foo 1234AB"));
- DoI64Test(convert("foo %I64X"), l, "0x1234567887654321",
- convert("foo 1234567887654321"));
- DoNumTest(convert("foo %7X"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo %-7X"), pos, convert("foo 1234AB "));
- DoNumTest(convert("foo %.1X"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo %.7X"), pos, convert("foo 01234AB"));
- DoNumTest(convert("foo %07X"), pos, convert("foo 01234AB"));
- DoNumTest(convert("foo %#X"), pos, convert("foo 0X1234AB"));
- DoNumTest(convert("foo %+X"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo % X"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo %+X"), neg, convert("foo FFFFFFD6"));
- DoNumTest(convert("foo % X"), neg, convert("foo FFFFFFD6"));
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test13/testinfo.dat
deleted file mode 100644
index cdeced6654..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test13/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test13
-Description
-= Tests _snwprintf with hex numbers (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test14/CMakeLists.txt
deleted file mode 100644
index e5cdbfad87..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test14/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test14.c
-)
-
-add_executable(paltest_snwprintf_test14
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test14 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test14
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test14/test14.c
deleted file mode 100644
index c34875246d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test14/test14.c
+++ /dev/null
@@ -1,66 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test14.c
-**
-** Purpose: Tests _snwprintf with exponential format doubles (lowercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 256.0;
- double neg = -256.0;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest(convert("foo %e"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %le"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %he"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %Le"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %I64e"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %14e"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %-14e"), val, convert("foo 2.560000e+002 "),
- convert("foo 2.560000e+02 "));
- DoDoubleTest(convert("foo %.1e"), val, convert("foo 2.6e+002"),
- convert("foo 2.6e+02"));
- DoDoubleTest(convert("foo %.8e"), val, convert("foo 2.56000000e+002"),
- convert("foo 2.56000000e+02"));
- DoDoubleTest(convert("foo %014e"), val, convert("foo 02.560000e+002"),
- convert("foo 002.560000e+02"));
- DoDoubleTest(convert("foo %#e"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %+e"), val, convert("foo +2.560000e+002"),
- convert("foo +2.560000e+02"));
- DoDoubleTest(convert("foo % e"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %+e"), neg, convert("foo -2.560000e+002"),
- convert("foo -2.560000e+02"));
- DoDoubleTest(convert("foo % e"), neg, convert("foo -2.560000e+002"),
- convert("foo -2.560000e+02"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test14/testinfo.dat
deleted file mode 100644
index b47611aa44..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test14/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test14
-Description
-= Tests _snwprintf with exponential format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test15/CMakeLists.txt
deleted file mode 100644
index dc7b4d66e9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test15/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test15.c
-)
-
-add_executable(paltest_snwprintf_test15
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test15 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test15
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test15/test15.c
deleted file mode 100644
index f45005b758..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test15/test15.c
+++ /dev/null
@@ -1,67 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test15.c
-**
-** Purpose: Tests _snwprintf with exponential format doubles (uppercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 256.0;
- double neg = -256.0;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest(convert("foo %E"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %lE"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %hE"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %LE"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %I64E"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %14E"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %-14E"), val, convert("foo 2.560000E+002 "),
- convert("foo 2.560000E+02 "));
- DoDoubleTest(convert("foo %.1E"), val, convert("foo 2.6E+002"),
- convert("foo 2.6E+02"));
- DoDoubleTest(convert("foo %.8E"), val, convert("foo 2.56000000E+002"),
- convert("foo 2.56000000E+02"));
- DoDoubleTest(convert("foo %014E"), val, convert("foo 02.560000E+002"),
- convert("foo 002.560000E+02"));
- DoDoubleTest(convert("foo %#E"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %+E"), val, convert("foo +2.560000E+002"),
- convert("foo +2.560000E+02"));
- DoDoubleTest(convert("foo % E"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %+E"), neg, convert("foo -2.560000E+002"),
- convert("foo -2.560000E+02"));
- DoDoubleTest(convert("foo % E"), neg, convert("foo -2.560000E+002"),
- convert("foo -2.560000E+02"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test15/testinfo.dat
deleted file mode 100644
index 2c81391689..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test15/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test15
-Description
-= Tests _snwprintf with exponential format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test16/CMakeLists.txt
deleted file mode 100644
index f147ad7e67..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test16/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test16.c
-)
-
-add_executable(paltest_snwprintf_test16
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test16 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test16
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test16/test16.c
deleted file mode 100644
index 88f55bdc10..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test16/test16.c
+++ /dev/null
@@ -1,65 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test16.c
-**
-** Purpose: Tests _snwprintf with decimal point format doubles
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest(convert("foo %f"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %lf"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %hf"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %Lf"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %I64f"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %12f"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %-12f"), val, convert("foo 2560.001000 "),
- convert("foo 2560.001000 "));
- DoDoubleTest(convert("foo %.1f"), val, convert("foo 2560.0"),
- convert("foo 2560.0"));
- DoDoubleTest(convert("foo %.8f"), val, convert("foo 2560.00100000"),
- convert("foo 2560.00100000"));
- DoDoubleTest(convert("foo %012f"), val, convert("foo 02560.001000"),
- convert("foo 02560.001000"));
- DoDoubleTest(convert("foo %#f"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %+f"), val, convert("foo +2560.001000"),
- convert("foo +2560.001000"));
- DoDoubleTest(convert("foo % f"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %+f"), neg, convert("foo -2560.001000"),
- convert("foo -2560.001000"));
- DoDoubleTest(convert("foo % f"), neg, convert("foo -2560.001000"),
- convert("foo -2560.001000"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test16/testinfo.dat
deleted file mode 100644
index 8d844e0b18..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test16/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test16
-Description
-= Tests _snwprintf with decimal point format doubles
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test17/CMakeLists.txt
deleted file mode 100644
index e40d3f4106..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test17/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test17.c
-)
-
-add_executable(paltest_snwprintf_test17
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test17 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test17
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test17/test17.c
deleted file mode 100644
index 82f2330b48..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test17/test17.c
+++ /dev/null
@@ -1,68 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test17.c
-**
-** Purpose: Tests _snwprintf with compact format doubles (lowercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest(convert("foo %g"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %lg"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %hg"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %Lg"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %I64g"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %5g"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %-5g"), val, convert("foo 2560 "),
- convert("foo 2560 "));
- DoDoubleTest(convert("foo %.1g"), val, convert("foo 3e+003"),
- convert("foo 3e+03"));
- DoDoubleTest(convert("foo %.2g"), val, convert("foo 2.6e+003"),
- convert("foo 2.6e+03"));
- DoDoubleTest(convert("foo %.12g"), val, convert("foo 2560.001"),
- convert("foo 2560.001"));
- DoDoubleTest(convert("foo %06g"), val, convert("foo 002560"),
- convert("foo 002560"));
- DoDoubleTest(convert("foo %#g"), val, convert("foo 2560.00"),
- convert("foo 2560.00"));
- DoDoubleTest(convert("foo %+g"), val, convert("foo +2560"),
- convert("foo +2560"));
- DoDoubleTest(convert("foo % g"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %+g"), neg, convert("foo -2560"),
- convert("foo -2560"));
- DoDoubleTest(convert("foo % g"), neg, convert("foo -2560"),
- convert("foo -2560"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test17/testinfo.dat
deleted file mode 100644
index 6b01fb3d7d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test17/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test17
-Description
-= Tests _snwprintf with compact format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test18/CMakeLists.txt
deleted file mode 100644
index 68a014cb66..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test18/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test18.c
-)
-
-add_executable(paltest_snwprintf_test18
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test18 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test18
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test18/test18.c
deleted file mode 100644
index dbb6233061..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test18/test18.c
+++ /dev/null
@@ -1,69 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test18.c
-**
-** Purpose: Tests _snwprintf with compact format doubles (uppercase)
-**
-**
-**==========================================================================*/
-
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest(convert("foo %G"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %lG"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %hG"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %LG"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %I64G"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %5G"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %-5G"), val, convert("foo 2560 "),
- convert("foo 2560 "));
- DoDoubleTest(convert("foo %.1G"), val, convert("foo 3E+003"),
- convert("foo 3E+03"));
- DoDoubleTest(convert("foo %.2G"), val, convert("foo 2.6E+003"),
- convert("foo 2.6E+03"));
- DoDoubleTest(convert("foo %.12G"), val, convert("foo 2560.001"),
- convert("foo 2560.001"));
- DoDoubleTest(convert("foo %06G"), val, convert("foo 002560"),
- convert("foo 002560"));
- DoDoubleTest(convert("foo %#G"), val, convert("foo 2560.00"),
- convert("foo 2560.00"));
- DoDoubleTest(convert("foo %+G"), val, convert("foo +2560"),
- convert("foo +2560"));
- DoDoubleTest(convert("foo % G"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %+G"), neg, convert("foo -2560"),
- convert("foo -2560"));
- DoDoubleTest(convert("foo % G"), neg, convert("foo -2560"),
- convert("foo -2560"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test18/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test18/testinfo.dat
deleted file mode 100644
index 480087f560..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test18/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test18
-Description
-= Tests _snwprintf with compact format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test19/CMakeLists.txt
deleted file mode 100644
index 6dc30b4d33..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test19/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test19.c
-)
-
-add_executable(paltest_snwprintf_test19
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test19 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test19
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test19/test19.c
deleted file mode 100644
index efb222c6ba..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test19/test19.c
+++ /dev/null
@@ -1,90 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test19.c
-**
-** Purpose: Tests _snwprintf with argument specified precision
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- int n = -1;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- DoArgumentPrecTest(convert("%.*s"), 2, convert("bar"), "bar",
- convert("ba"), convert("ba"));
- DoArgumentPrecTest(convert("%.*S"), 2, "bar", "bar",
- convert("ba"), convert("ba"));
- DoArgumentPrecTest(convert("%.*n"), 3, &n, "pointer to int",
- convert(""), convert(""));
- if (n != 0)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- 0, n);
- }
-
- DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', "a",
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', "a",
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', "a",
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', "a",
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, "42",
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, "42",
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, "42",
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, "42",
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, "42",
- convert("52"), convert("52"));
- DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, "42",
- convert("052"), convert("052"));
- DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, "42",
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, "42",
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, "0x42",
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, "0x42",
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, "0x42",
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, "0x42",
- convert("042"), convert("042"));
- DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, convert("2.0e+000"));
- DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, convert("2.010e+000"));
- DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, convert("2.0E+000"));
- DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, convert("2.010E+000"));
- DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, convert("2.0"));
- DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, convert("2.010"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, convert("3e+002"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, convert("256.01"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, convert("3E+002"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, convert("256.01"));
-
- PAL_Terminate();
- return PASS;
-
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test19/testinfo.dat
deleted file mode 100644
index 376cbc84d1..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test19/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test19
-Description
-= Tests _snwprintf with argument specified precision
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test2/CMakeLists.txt
deleted file mode 100644
index 9e0d950885..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test2/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test2.c
-)
-
-add_executable(paltest_snwprintf_test2
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test2 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test2
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test2/test2.c
deleted file mode 100644
index 974b7967f2..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test2/test2.c
+++ /dev/null
@@ -1,44 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test2.c
-**
-** Purpose:Tests _snwprintf with strings
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- DoWStrTest(convert("foo %s"), convert("bar"), convert("foo bar"));
- DoStrTest(convert("foo %hs"), "bar", convert("foo bar"));
- DoWStrTest(convert("foo %ls"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %ws"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %Ls"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %I64s"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %5s"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %.2s"), convert("bar"), convert("foo ba"));
- DoWStrTest(convert("foo %5.2s"), convert("bar"), convert("foo ba"));
- DoWStrTest(convert("foo %-5s"), convert("bar"), convert("foo bar "));
- DoWStrTest(convert("foo %05s"), convert("bar"), convert("foo 00bar"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test2/testinfo.dat
deleted file mode 100644
index 9c65c93e5a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test2/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test2
-Description
-= Tests _snwprintf with strings
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test3/CMakeLists.txt
deleted file mode 100644
index 4d5a28b0fe..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test3/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test3.c
-)
-
-add_executable(paltest_snwprintf_test3
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test3 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test3
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test3/test3.c
deleted file mode 100644
index bfb75ce323..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test3/test3.c
+++ /dev/null
@@ -1,44 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test3.c
-**
-** Purpose: Tests _snwprintf with wide strings
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- DoStrTest(convert("foo %S"), "bar", convert("foo bar"));
- DoStrTest(convert("foo %hS"), "bar", convert("foo bar"));
- DoWStrTest(convert("foo %lS"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %wS"), convert("bar"), convert("foo bar"));
- DoStrTest(convert("foo %LS"), "bar", convert("foo bar"));
- DoStrTest(convert("foo %I64S"), "bar", convert("foo bar"));
- DoStrTest(convert("foo %5S"), "bar", convert("foo bar"));
- DoStrTest(convert("foo %.2S"), "bar", convert("foo ba"));
- DoStrTest(convert("foo %5.2S"), "bar", convert("foo ba"));
- DoStrTest(convert("foo %-5S"), "bar", convert("foo bar "));
- DoStrTest(convert("foo %05S"), "bar", convert("foo 00bar"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test3/testinfo.dat
deleted file mode 100644
index b39f4f56b7..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test3/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test3
-Description
-= Tests _snwprintf with wide strings
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test4/CMakeLists.txt
deleted file mode 100644
index 0102b0acea..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test4/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test4.c
-)
-
-add_executable(paltest_snwprintf_test4
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test4 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test4
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test4/test4.c
deleted file mode 100644
index 28f7998591..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test4/test4.c
+++ /dev/null
@@ -1,71 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test4.c
-**
-** Purpose: Tests _snwprintf with pointers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- void *ptr = (void*) 0x123456;
- INT64 lptr = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-/*
-** Run only on 64 bit platforms
-*/
-#if defined(BIT64) && defined(PLATFORM_UNIX)
- Trace("Testing for 64 Bit Platforms \n");
- DoPointerTest(convert("%p"), NULL, convert("0000000000000000"));
- DoPointerTest(convert("%p"), ptr, convert("0000000000123456"));
- DoPointerTest(convert("%17p"), ptr, convert(" 0000000000123456"));
- DoPointerTest(convert("%17p"), ptr, convert(" 0000000000123456"));
- DoPointerTest(convert("%-17p"), ptr, convert("0000000000123456 "));
- DoPointerTest(convert("%+p"), ptr, convert("0000000000123456"));
- DoPointerTest(convert("% p"), ptr, convert("0000000000123456"));
- DoPointerTest(convert("%#p"), ptr, convert("0X0000000000123456"));
- DoPointerTest(convert("%lp"), ptr, convert("00123456"));
- DoPointerTest(convert("%hp"), ptr, convert("00003456"));
- DoPointerTest(convert("%Lp"), ptr, convert("00123456"));
- DoI64Test(convert("%I64p"), lptr, "1234567887654321",
- convert("1234567887654321"));
-#else
- Trace("Testing for Non 64 Bit Platforms \n");
- DoPointerTest(convert("%p"), NULL, convert("00000000"));
- DoPointerTest(convert("%p"), ptr, convert("00123456"));
- DoPointerTest(convert("%9p"), ptr, convert(" 00123456"));
- DoPointerTest(convert("%09p"), ptr, convert(" 00123456"));
- DoPointerTest(convert("%-9p"), ptr, convert("00123456 "));
- DoPointerTest(convert("%+p"), ptr, convert("00123456"));
- DoPointerTest(convert("% p"), ptr, convert("00123456"));
- DoPointerTest(convert("%#p"), ptr, convert("0X00123456"));
- DoPointerTest(convert("%lp"), ptr, convert("00123456"));
- DoPointerTest(convert("%hp"), ptr, convert("00003456"));
- DoPointerTest(convert("%Lp"), ptr, convert("00123456"));
- DoI64Test(convert("%I64p"), lptr, "1234567887654321",
- convert("1234567887654321"));
-#endif
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test4/testinfo.dat
deleted file mode 100644
index 3f3600160f..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test4/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test4
-Description
-= Tests _snwprintf with pointers
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test5/CMakeLists.txt
deleted file mode 100644
index c835c94845..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test5/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test5.c
-)
-
-add_executable(paltest_snwprintf_test5
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test5 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test5
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test5/test5.c
deleted file mode 100644
index bbe459751b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test5/test5.c
+++ /dev/null
@@ -1,63 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test5.c
-**
-** Purpose: Tests _snwprintf with the count specifier
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR *longStr;
- WCHAR *longResult;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- longStr = convert("really-long-string-that-just-keeps-going-on-and-on-and-on.."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "%n bar");
- longResult = convert("really-long-string-that-just-keeps-going-on-and-on-and-on.."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- " bar");
- DoCountTest(convert("foo %n bar"), 4, convert("foo bar"));
- DoCountTest(longStr, 257, longResult);
- DoCountTest(convert("fo%n bar"), 2, convert("fo bar"));
- DoCountTest(convert("%n"), 0, convert(""));
- DoCountTest(convert("foo %#n bar"), 4, convert("foo bar"));
- DoCountTest(convert("foo % n bar"), 4, convert("foo bar"));
- DoCountTest(convert("foo %+n bar"), 4, convert("foo bar"));
- DoCountTest(convert("foo %-n bar"), 4, convert("foo bar"));
- DoCountTest(convert("foo %0n bar"), 4, convert("foo bar"));
- DoShortCountTest(convert("foo %hn bar"), 4, convert("foo bar"));
- DoCountTest(convert("foo %ln bar"), 4, convert("foo bar"));
- DoCountTest(convert("foo %Ln bar"), 4, convert("foo bar"));
- DoCountTest(convert("foo %I64n bar"), 4, convert("foo bar"));
- DoCountTest(convert("foo %20.3n bar"), 4, convert("foo bar"));
-
- free(longStr);
- free(longResult);
-
- PAL_Terminate();
-
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test5/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test5/testinfo.dat
deleted file mode 100644
index 2180b81cf5..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test5/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test5
-Description
-= Tests _snwprintf with the count specifier
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test6/CMakeLists.txt
deleted file mode 100644
index 37a415ed86..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test6/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test6.c
-)
-
-add_executable(paltest_snwprintf_test6
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test6 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test6
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test6/test6.c
deleted file mode 100644
index 3d4ed3f882..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test6/test6.c
+++ /dev/null
@@ -1,46 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test6.c
-**
-** Purpose: Tests _snwprintf with characters
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR wc = (WCHAR) 'c';
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoWCharTest(convert("foo %c"), wc, convert("foo c"));
- DoCharTest(convert("foo %hc"), 'b', convert("foo b"));
- DoWCharTest(convert("foo %lc"), wc, convert("foo c"));
- DoWCharTest(convert("foo %Lc"), wc, convert("foo c"));
- DoWCharTest(convert("foo %I64c"), wc, convert("foo c"));
- DoWCharTest(convert("foo %5c"), wc, convert("foo c"));
- DoWCharTest(convert("foo %.0c"), wc, convert("foo c"));
- DoWCharTest(convert("foo %-5c"), wc, convert("foo c "));
- DoWCharTest(convert("foo %05c"), wc, convert("foo 0000c"));
- DoWCharTest(convert("foo % c"), wc, convert("foo c"));
- DoWCharTest(convert("foo %#c"), wc, convert("foo c"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test6/testinfo.dat
deleted file mode 100644
index 6a170cd549..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test6/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test6
-Description
-= Tests _snwprintf with characters
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test7/CMakeLists.txt
deleted file mode 100644
index b1a07eeaa4..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test7/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test7.c
-)
-
-add_executable(paltest_snwprintf_test7
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test7 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test7
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test7/test7.c
deleted file mode 100644
index 7954ff71ca..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test7/test7.c
+++ /dev/null
@@ -1,46 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test7.c
-**
-** Purpose: Tests _snwprintf with wide characters
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR wc = (WCHAR) 'c';
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoCharTest(convert("foo %C"), 'b', convert("foo b"));
- DoWCharTest(convert("foo %hC"), wc, convert("foo c"));
- DoCharTest(convert("foo %lC"), 'b', convert("foo b"));
- DoCharTest(convert("foo %LC"), 'b', convert("foo b"));
- DoCharTest(convert("foo %I64C"), 'b', convert("foo b"));
- DoCharTest(convert("foo %5C"), 'b', convert("foo b"));
- DoCharTest(convert("foo %.0C"), 'b', convert("foo b"));
- DoCharTest(convert("foo %-5C"), 'b', convert("foo b "));
- DoCharTest(convert("foo %05C"), 'b', convert("foo 0000b"));
- DoCharTest(convert("foo % C"), 'b', convert("foo b"));
- DoCharTest(convert("foo %#C"), 'b', convert("foo b"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test7/testinfo.dat
deleted file mode 100644
index 5749539e3f..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test7/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test7
-Description
-= Tests _snwprintf with wide characters
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test8/CMakeLists.txt
deleted file mode 100644
index 063ee2b9b6..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test8/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test8.c
-)
-
-add_executable(paltest_snwprintf_test8
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test8 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test8
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test8/test8.c
deleted file mode 100644
index 91c2820076..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test8/test8.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test8.c
-**
-** Purpose: Tests _snwprintf with decimal numbers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest(convert("foo %d"), pos, convert("foo 42"));
- DoNumTest(convert("foo %ld"), 0xFFFF, convert("foo 65535"));
- DoNumTest(convert("foo %hd"), 0xFFFF, convert("foo -1"));
- DoNumTest(convert("foo %Ld"), pos, convert("foo 42"));
- DoI64Test(convert("foo %I64d"), l, "42", convert("foo 42"));
- DoNumTest(convert("foo %3d"), pos, convert("foo 42"));
- DoNumTest(convert("foo %-3d"), pos, convert("foo 42 "));
- DoNumTest(convert("foo %.1d"), pos, convert("foo 42"));
- DoNumTest(convert("foo %.3d"), pos, convert("foo 042"));
- DoNumTest(convert("foo %03d"), pos, convert("foo 042"));
- DoNumTest(convert("foo %#d"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+d"), pos, convert("foo +42"));
- DoNumTest(convert("foo % d"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+d"), neg, convert("foo -42"));
- DoNumTest(convert("foo % d"), neg, convert("foo -42"));
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test8/testinfo.dat
deleted file mode 100644
index 6398f60183..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test8/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test8
-Description
-= Tests _snwprintf with decimal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf/test9/CMakeLists.txt
deleted file mode 100644
index 8d5e41131d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test9/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test9.c
-)
-
-add_executable(paltest_snwprintf_test9
- ${SOURCES}
-)
-
-add_dependencies(paltest_snwprintf_test9 coreclrpal)
-
-target_link_libraries(paltest_snwprintf_test9
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/_snwprintf/test9/test9.c
deleted file mode 100644
index f8f994fdcc..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test9/test9.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test9.c
-**
-** Purpose: Tests _snwprintf with integer numbers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../_snwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest(convert("foo %i"), pos, convert("foo 42"));
- DoNumTest(convert("foo %li"), 0xFFFF, convert("foo 65535"));
- DoNumTest(convert("foo %hi"), 0xFFFF, convert("foo -1"));
- DoNumTest(convert("foo %Li"), pos, convert("foo 42"));
- DoI64Test(convert("foo %I64i"), l, "42", convert("foo 42"));
- DoNumTest(convert("foo %3i"), pos, convert("foo 42"));
- DoNumTest(convert("foo %-3i"), pos, convert("foo 42 "));
- DoNumTest(convert("foo %.1i"), pos, convert("foo 42"));
- DoNumTest(convert("foo %.3i"), pos, convert("foo 042"));
- DoNumTest(convert("foo %03i"), pos, convert("foo 042"));
- DoNumTest(convert("foo %#i"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+i"), pos, convert("foo +42"));
- DoNumTest(convert("foo % i"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+i"), neg, convert("foo -42"));
- DoNumTest(convert("foo % i"), neg, convert("foo -42"));
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf/test9/testinfo.dat
deleted file mode 100644
index 287de4a9e9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_snwprintf/test9/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _snwprintf
-Name = Positive Test for _snwprintf
-TYPE = DEFAULT
-EXE1 = test9
-Description
-= Tests _snwprintf with integer numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/CMakeLists.txt
new file mode 100644
index 0000000000..8fe1cb60ac
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/CMakeLists.txt
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
+add_subdirectory(test10)
+add_subdirectory(test11)
+add_subdirectory(test12)
+add_subdirectory(test13)
+add_subdirectory(test14)
+add_subdirectory(test15)
+add_subdirectory(test16)
+add_subdirectory(test17)
+add_subdirectory(test18)
+add_subdirectory(test19)
+add_subdirectory(test2)
+add_subdirectory(test3)
+add_subdirectory(test4)
+add_subdirectory(test6)
+add_subdirectory(test7)
+add_subdirectory(test8)
+add_subdirectory(test9)
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/_snwprintf_s.h b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/_snwprintf_s.h
new file mode 100644
index 0000000000..19d192114b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/_snwprintf_s.h
@@ -0,0 +1,199 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: swprintf_s.h
+**
+** Purpose: Containts common testing functions for swprintf_s
+**
+**
+**==========================================================================*/
+
+#ifndef ___SNWPRINTF_H__
+#define ___SNWPRINTF_H__
+
+void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+
+ if (memcmp(buf, checkstr, wcslen(checkstr) * 2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n"
+ "Expected \"%s\", got \"%s\".\n", convertC(param),
+ convertC(formatstr), convertC(checkstr), convertC(buf));
+ }
+}
+
+void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+
+ if (memcmp(buf, checkstr, wcslen(checkstr) * 2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n"
+ "Expected \"%s\", got \"%s\".\n",
+ param, convertC(formatstr), convertC(checkstr), convertC(buf));
+ }
+}
+
+void DoPointerTest(const WCHAR *formatstr, void* param, const WCHAR *checkstr1)
+{
+ WCHAR buf[256] = { 0 };
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert pointer to %#p into \"%s\"\n"
+ "Expected \"%s\", got \"%s\".\n", param, convertC(formatstr),
+ convertC(checkstr1), convertC(buf));
+ }
+}
+
+void DoCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr)
+{
+ WCHAR buf[512] = { 0 };
+ int n = -1;
+
+ swprintf_s(buf, 512, formatstr, &n);
+
+ if (n != param)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %d\n",
+ param, n);
+ }
+
+ if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0)
+ {
+ Fail("ERROR: Expected \"%s\" got \"%s\".\n",
+ convertC(checkstr), convertC(buf));
+ }
+}
+
+void DoShortCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+ short int n = -1;
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, &n);
+
+ if (n != param)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %d\n",
+ param, n);
+ }
+
+ if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0)
+ {
+ Fail("ERROR: Expected \"%s\" got \"%s\".\n",
+ convertC(checkstr), convertC(buf));
+ }
+}
+
+void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+ if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n", param, param,
+ convertC(formatstr), convertC(checkstr), convertC(buf));
+ }
+}
+
+void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+ if (memcmp(buf, checkstr, wcslen(checkstr)*2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n", (char) param, param,
+ convertC(formatstr), convertC(checkstr), convertC(buf));
+ }
+}
+
+void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, value);
+ if (memcmp(buf, checkstr, wcslen(checkstr)* 2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %#x into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n", value, convertC(formatstr),
+ convertC(checkstr), convertC(buf));
+ }
+}
+
+
+void DoI64Test(const WCHAR *formatstr, INT64 param, char *paramdesc,
+ const WCHAR *checkstr1)
+{
+ WCHAR buf[256] = { 0 };
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, param);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\"\n"
+ "Expected \"%s\", got \"%s\".\n", paramdesc,
+ convertC(formatstr), convertC(checkstr1), convertC(buf));
+ }
+}
+
+void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1,
+ const WCHAR *checkstr2)
+{
+ WCHAR buf[256] = { 0 };
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, value);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1)*2 + 2) != 0 &&
+ memcmp(buf, checkstr2, wcslen(checkstr2)*2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %f into \"%s\"\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ value, convertC(formatstr), convertC(checkstr1),
+ convertC(checkstr2), convertC(buf));
+ }
+}
+
+void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param,
+ char *paramstr, const WCHAR *checkstr1, const WCHAR *checkstr2)
+{
+ WCHAR buf[256];
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, precision, param);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
+ memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ paramstr, convertC(formatstr), precision,
+ convertC(checkstr1), convertC(checkstr2) ,convertC(buf));
+ }
+}
+
+void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double param,
+ const WCHAR *checkstr)
+{
+ WCHAR buf[256];
+
+ _snwprintf_s(buf, 256, _TRUNCATE, formatstr, precision, param);
+ if (memcmp(buf, checkstr, wcslen(checkstr) + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
+ "Expected \"%s\", got \"%s\".\n", param, convertC(formatstr),
+ precision, convertC(checkstr), convertC(buf));
+ }
+}
+
+#endif
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/CMakeLists.txt
new file mode 100644
index 0000000000..eac86f30e4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.cpp
+)
+
+add_executable(paltest_snwprintf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test1 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/test1.cpp
new file mode 100644
index 0000000000..ba85103cb1
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/test1.cpp
@@ -0,0 +1,62 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: General test to see if swprintf_s works correctly
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR *checkstr;
+ WCHAR buf[256] = { 0 };
+ int ret;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ checkstr = convert("hello world");
+ _snwprintf_s(buf, 256, _TRUNCATE, checkstr);
+ if (memcmp(checkstr, buf, wcslen(checkstr)*2+2) != 0)
+ {
+ Fail("ERROR: Expected \"%s\", got \"%s\"\n",
+ convertC(checkstr), convertC(buf));
+ }
+
+ _snwprintf_s(buf, 256, _TRUNCATE, convert("xxxxxxxxxxxxxxxxx"));
+ ret = _snwprintf_s(buf, 8, _TRUNCATE, checkstr);
+ if ((memcmp(checkstr, buf, 14) != 0) || (buf[7] != 0))
+ {
+ Fail("ERROR: Expected \"%8s\", got \"%8s\"\n",
+ convertC(checkstr), convertC(buf));
+ }
+ if (ret >= 0)
+ {
+ Fail("ERROR: Expected negative return value, got %d.\n", ret);
+ }
+ if (buf[8] != (WCHAR) 'x')
+ {
+ Fail("ERROR: buffer overflow using \"%s\" with length 8.\n",
+ convertC(checkstr));
+ }
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/testinfo.dat
new file mode 100644
index 0000000000..96d7914ce0
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test1/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= General test to see if swprintf_s works correctly
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/CMakeLists.txt
new file mode 100644
index 0000000000..82ee739587
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test10.cpp
+)
+
+add_executable(paltest_snwprintf_test10
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test10 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test10
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/test10.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/test10.cpp
new file mode 100644
index 0000000000..298f82b002
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/test10.cpp
@@ -0,0 +1,54 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test10.c
+**
+** Purpose: Tests swprintf_s with octal numbers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest(convert("foo %o"), pos, convert("foo 52"));
+ DoNumTest(convert("foo %lo"), 0xFFFF, convert("foo 177777"));
+ DoNumTest(convert("foo %ho"), 0xFFFF, convert("foo 177777"));
+ DoNumTest(convert("foo %Lo"), pos, convert("foo 52"));
+ DoI64Test(convert("foo %I64o"), l, "42", convert("foo 52"));
+ DoNumTest(convert("foo %3o"), pos, convert("foo 52"));
+ DoNumTest(convert("foo %-3o"), pos, convert("foo 52 "));
+ DoNumTest(convert("foo %.1o"), pos, convert("foo 52"));
+ DoNumTest(convert("foo %.3o"), pos, convert("foo 052"));
+ DoNumTest(convert("foo %03o"), pos, convert("foo 052"));
+ DoNumTest(convert("foo %#o"), pos, convert("foo 052"));
+ DoNumTest(convert("foo %+o"), pos, convert("foo 52"));
+ DoNumTest(convert("foo % o"), pos, convert("foo 52"));
+ DoNumTest(convert("foo %+o"), neg, convert("foo 37777777726"));
+ DoNumTest(convert("foo % o"), neg, convert("foo 37777777726"));
+
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/testinfo.dat
new file mode 100644
index 0000000000..887bbf76c8
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test10/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test10
+Description
+= Tests swprintf_s with octal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/CMakeLists.txt
new file mode 100644
index 0000000000..f7d7845571
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test11.cpp
+)
+
+add_executable(paltest_snwprintf_test11
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test11 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test11
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/test11.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/test11.cpp
new file mode 100644
index 0000000000..519668791b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/test11.cpp
@@ -0,0 +1,54 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test11.c
+**
+** Purpose: Tests swprintf_s with unsigned numbers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest(convert("foo %u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %lu"), 0xFFFF, convert("foo 65535"));
+ DoNumTest(convert("foo %hu"), 0xFFFF, convert("foo 65535"));
+ DoNumTest(convert("foo %Lu"), pos, convert("foo 42"));
+ DoI64Test(convert("foo %I64u"), l, "42", convert("foo 42"));
+ DoNumTest(convert("foo %3u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %-3u"), pos, convert("foo 42 "));
+ DoNumTest(convert("foo %.1u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %.3u"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %03u"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %#u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo % u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+u"), neg, convert("foo 4294967254"));
+ DoNumTest(convert("foo % u"), neg, convert("foo 4294967254"));
+
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/testinfo.dat
new file mode 100644
index 0000000000..3bda85e335
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test11/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test11
+Description
+= Tests swprintf_s with unsigned numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/CMakeLists.txt
new file mode 100644
index 0000000000..5b926fb548
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test12.cpp
+)
+
+add_executable(paltest_snwprintf_test12
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test12 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test12
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/test12.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/test12.cpp
new file mode 100644
index 0000000000..52780aff0a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/test12.cpp
@@ -0,0 +1,54 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test12.c
+**
+** Purpose: Tests swprintf_s with hex numbers (lowercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 0x1234ab;
+ INT64 l = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest(convert("foo %x"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo %lx"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo %hx"), pos, convert("foo 34ab"));
+ DoNumTest(convert("foo %Lx"), pos, convert("foo 1234ab"));
+ DoI64Test(convert("foo %I64x"), l, "0x1234567887654321",
+ convert("foo 1234567887654321"));
+ DoNumTest(convert("foo %7x"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo %-7x"), pos, convert("foo 1234ab "));
+ DoNumTest(convert("foo %.1x"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo %.7x"), pos, convert("foo 01234ab"));
+ DoNumTest(convert("foo %07x"), pos, convert("foo 01234ab"));
+ DoNumTest(convert("foo %#x"), pos, convert("foo 0x1234ab"));
+ DoNumTest(convert("foo %+x"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo % x"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo %+x"), neg, convert("foo ffffffd6"));
+ DoNumTest(convert("foo % x"), neg, convert("foo ffffffd6"));
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/testinfo.dat
new file mode 100644
index 0000000000..d808a3b8f4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test12/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test12
+Description
+= Tests swprintf_s with hex numbers (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/CMakeLists.txt
new file mode 100644
index 0000000000..52a3c75a15
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test13.cpp
+)
+
+add_executable(paltest_snwprintf_test13
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test13 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test13
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/test13.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/test13.cpp
new file mode 100644
index 0000000000..fa948b3a1b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/test13.cpp
@@ -0,0 +1,54 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test13.c
+**
+** Purpose: Tests swprintf_s with hex numbers (uppercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 0x1234ab;
+ INT64 l = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest(convert("foo %X"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo %lX"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo %hX"), pos, convert("foo 34AB"));
+ DoNumTest(convert("foo %LX"), pos, convert("foo 1234AB"));
+ DoI64Test(convert("foo %I64X"), l, "0x1234567887654321",
+ convert("foo 1234567887654321"));
+ DoNumTest(convert("foo %7X"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo %-7X"), pos, convert("foo 1234AB "));
+ DoNumTest(convert("foo %.1X"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo %.7X"), pos, convert("foo 01234AB"));
+ DoNumTest(convert("foo %07X"), pos, convert("foo 01234AB"));
+ DoNumTest(convert("foo %#X"), pos, convert("foo 0X1234AB"));
+ DoNumTest(convert("foo %+X"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo % X"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo %+X"), neg, convert("foo FFFFFFD6"));
+ DoNumTest(convert("foo % X"), neg, convert("foo FFFFFFD6"));
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/testinfo.dat
new file mode 100644
index 0000000000..2e5800ec31
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test13/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test13
+Description
+= Tests swprintf_s with hex numbers (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/CMakeLists.txt
new file mode 100644
index 0000000000..d557a30b42
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test14.cpp
+)
+
+add_executable(paltest_snwprintf_test14
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test14 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test14
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/test14.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/test14.cpp
new file mode 100644
index 0000000000..aea289d1a1
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/test14.cpp
@@ -0,0 +1,66 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test14.c
+**
+** Purpose: Tests swprintf_s with exponential format doubles (lowercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 256.0;
+ double neg = -256.0;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest(convert("foo %e"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %le"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %he"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %Le"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %I64e"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %14e"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %-14e"), val, convert("foo 2.560000e+002 "),
+ convert("foo 2.560000e+02 "));
+ DoDoubleTest(convert("foo %.1e"), val, convert("foo 2.6e+002"),
+ convert("foo 2.6e+02"));
+ DoDoubleTest(convert("foo %.8e"), val, convert("foo 2.56000000e+002"),
+ convert("foo 2.56000000e+02"));
+ DoDoubleTest(convert("foo %014e"), val, convert("foo 02.560000e+002"),
+ convert("foo 002.560000e+02"));
+ DoDoubleTest(convert("foo %#e"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %+e"), val, convert("foo +2.560000e+002"),
+ convert("foo +2.560000e+02"));
+ DoDoubleTest(convert("foo % e"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %+e"), neg, convert("foo -2.560000e+002"),
+ convert("foo -2.560000e+02"));
+ DoDoubleTest(convert("foo % e"), neg, convert("foo -2.560000e+002"),
+ convert("foo -2.560000e+02"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/testinfo.dat
new file mode 100644
index 0000000000..25bd5099c9
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test14/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test14
+Description
+= Tests swprintf_s with exponential format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/CMakeLists.txt
new file mode 100644
index 0000000000..2e5ee362fc
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test15.cpp
+)
+
+add_executable(paltest_snwprintf_test15
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test15 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test15
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/test15.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/test15.cpp
new file mode 100644
index 0000000000..14db14b498
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/test15.cpp
@@ -0,0 +1,67 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test15.c
+**
+** Purpose: Tests swprintf_s with exponential format doubles (uppercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 256.0;
+ double neg = -256.0;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest(convert("foo %E"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %lE"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %hE"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %LE"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %I64E"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %14E"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %-14E"), val, convert("foo 2.560000E+002 "),
+ convert("foo 2.560000E+02 "));
+ DoDoubleTest(convert("foo %.1E"), val, convert("foo 2.6E+002"),
+ convert("foo 2.6E+02"));
+ DoDoubleTest(convert("foo %.8E"), val, convert("foo 2.56000000E+002"),
+ convert("foo 2.56000000E+02"));
+ DoDoubleTest(convert("foo %014E"), val, convert("foo 02.560000E+002"),
+ convert("foo 002.560000E+02"));
+ DoDoubleTest(convert("foo %#E"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %+E"), val, convert("foo +2.560000E+002"),
+ convert("foo +2.560000E+02"));
+ DoDoubleTest(convert("foo % E"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %+E"), neg, convert("foo -2.560000E+002"),
+ convert("foo -2.560000E+02"));
+ DoDoubleTest(convert("foo % E"), neg, convert("foo -2.560000E+002"),
+ convert("foo -2.560000E+02"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/testinfo.dat
new file mode 100644
index 0000000000..95d90e82e7
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test15/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test15
+Description
+= Tests swprintf_s with exponential format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/CMakeLists.txt
new file mode 100644
index 0000000000..f4ce409dcb
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test16.cpp
+)
+
+add_executable(paltest_snwprintf_test16
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test16 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test16
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/test16.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/test16.cpp
new file mode 100644
index 0000000000..4d9a717f24
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/test16.cpp
@@ -0,0 +1,65 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test16.c
+**
+** Purpose: Tests swprintf_s with decimal point format doubles
+**
+**
+**==========================================================================*/
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest(convert("foo %f"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %lf"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %hf"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %Lf"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %I64f"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %12f"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %-12f"), val, convert("foo 2560.001000 "),
+ convert("foo 2560.001000 "));
+ DoDoubleTest(convert("foo %.1f"), val, convert("foo 2560.0"),
+ convert("foo 2560.0"));
+ DoDoubleTest(convert("foo %.8f"), val, convert("foo 2560.00100000"),
+ convert("foo 2560.00100000"));
+ DoDoubleTest(convert("foo %012f"), val, convert("foo 02560.001000"),
+ convert("foo 02560.001000"));
+ DoDoubleTest(convert("foo %#f"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %+f"), val, convert("foo +2560.001000"),
+ convert("foo +2560.001000"));
+ DoDoubleTest(convert("foo % f"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %+f"), neg, convert("foo -2560.001000"),
+ convert("foo -2560.001000"));
+ DoDoubleTest(convert("foo % f"), neg, convert("foo -2560.001000"),
+ convert("foo -2560.001000"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/testinfo.dat
new file mode 100644
index 0000000000..b81c847c69
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test16/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test16
+Description
+= Tests swprintf_s with decimal point format doubles
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/CMakeLists.txt
new file mode 100644
index 0000000000..159e15dafe
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test17.cpp
+)
+
+add_executable(paltest_snwprintf_test17
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test17 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test17
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/test17.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/test17.cpp
new file mode 100644
index 0000000000..6af1815b85
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/test17.cpp
@@ -0,0 +1,68 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test17.c
+**
+** Purpose: Tests swprintf_s with compact format doubles (lowercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest(convert("foo %g"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %lg"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %hg"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %Lg"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %I64g"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %5g"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %-5g"), val, convert("foo 2560 "),
+ convert("foo 2560 "));
+ DoDoubleTest(convert("foo %.1g"), val, convert("foo 3e+003"),
+ convert("foo 3e+03"));
+ DoDoubleTest(convert("foo %.2g"), val, convert("foo 2.6e+003"),
+ convert("foo 2.6e+03"));
+ DoDoubleTest(convert("foo %.12g"), val, convert("foo 2560.001"),
+ convert("foo 2560.001"));
+ DoDoubleTest(convert("foo %06g"), val, convert("foo 002560"),
+ convert("foo 002560"));
+ DoDoubleTest(convert("foo %#g"), val, convert("foo 2560.00"),
+ convert("foo 2560.00"));
+ DoDoubleTest(convert("foo %+g"), val, convert("foo +2560"),
+ convert("foo +2560"));
+ DoDoubleTest(convert("foo % g"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %+g"), neg, convert("foo -2560"),
+ convert("foo -2560"));
+ DoDoubleTest(convert("foo % g"), neg, convert("foo -2560"),
+ convert("foo -2560"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/testinfo.dat
new file mode 100644
index 0000000000..d64366702a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test17/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test17
+Description
+= Tests swprintf_s with compact format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/CMakeLists.txt
new file mode 100644
index 0000000000..5964e849a4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test18.cpp
+)
+
+add_executable(paltest_snwprintf_test18
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test18 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test18
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/test18.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/test18.cpp
new file mode 100644
index 0000000000..020a885090
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/test18.cpp
@@ -0,0 +1,69 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test18.c
+**
+** Purpose: Tests swprintf_s with compact format doubles (uppercase)
+**
+**
+**==========================================================================*/
+
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest(convert("foo %G"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %lG"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %hG"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %LG"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %I64G"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %5G"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %-5G"), val, convert("foo 2560 "),
+ convert("foo 2560 "));
+ DoDoubleTest(convert("foo %.1G"), val, convert("foo 3E+003"),
+ convert("foo 3E+03"));
+ DoDoubleTest(convert("foo %.2G"), val, convert("foo 2.6E+003"),
+ convert("foo 2.6E+03"));
+ DoDoubleTest(convert("foo %.12G"), val, convert("foo 2560.001"),
+ convert("foo 2560.001"));
+ DoDoubleTest(convert("foo %06G"), val, convert("foo 002560"),
+ convert("foo 002560"));
+ DoDoubleTest(convert("foo %#G"), val, convert("foo 2560.00"),
+ convert("foo 2560.00"));
+ DoDoubleTest(convert("foo %+G"), val, convert("foo +2560"),
+ convert("foo +2560"));
+ DoDoubleTest(convert("foo % G"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %+G"), neg, convert("foo -2560"),
+ convert("foo -2560"));
+ DoDoubleTest(convert("foo % G"), neg, convert("foo -2560"),
+ convert("foo -2560"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/testinfo.dat
new file mode 100644
index 0000000000..dfc2cd5f43
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test18/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test18
+Description
+= Tests swprintf_s with compact format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/CMakeLists.txt
new file mode 100644
index 0000000000..5d84847ec1
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test19.cpp
+)
+
+add_executable(paltest_snwprintf_test19
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test19 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test19
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/test19.cpp
new file mode 100644
index 0000000000..d335d1d10c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/test19.cpp
@@ -0,0 +1,82 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test19.c
+**
+** Purpose: Tests swprintf_s with argument specified precision
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n = -1;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ DoArgumentPrecTest(convert("%.*s"), 2, (void*)convert("bar"), "bar",
+ convert("ba"), convert("ba"));
+ DoArgumentPrecTest(convert("%.*S"), 2, (void*)"bar", "bar",
+ convert("ba"), convert("ba"));
+ DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', "a",
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', "a",
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', "a",
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', "a",
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, "42",
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, "42",
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, "42",
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, "42",
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, "42",
+ convert("52"), convert("52"));
+ DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, "42",
+ convert("052"), convert("052"));
+ DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, "42",
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, "42",
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, "0x42",
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, "0x42",
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, "0x42",
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, "0x42",
+ convert("042"), convert("042"));
+ DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, convert("2.0e+000"));
+ DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, convert("2.010e+000"));
+ DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, convert("2.0E+000"));
+ DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, convert("2.010E+000"));
+ DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, convert("2.0"));
+ DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, convert("2.010"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, convert("3e+002"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, convert("256.01"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, convert("3E+002"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, convert("256.01"));
+
+ PAL_Terminate();
+ return PASS;
+
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/testinfo.dat
new file mode 100644
index 0000000000..95269cdd39
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test19/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test19
+Description
+= Tests swprintf_s with argument specified precision
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/CMakeLists.txt
new file mode 100644
index 0000000000..ea33d48bd5
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test2.cpp
+)
+
+add_executable(paltest_snwprintf_test2
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test2 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test2
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/test2.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/test2.cpp
new file mode 100644
index 0000000000..86bfdc9839
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/test2.cpp
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test2.c
+**
+** Purpose:Tests swprintf_s with strings
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ DoWStrTest(convert("foo %s"), convert("bar"), convert("foo bar"));
+ DoStrTest(convert("foo %hs"), "bar", convert("foo bar"));
+ DoWStrTest(convert("foo %ls"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %ws"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %Ls"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %I64s"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %5s"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %.2s"), convert("bar"), convert("foo ba"));
+ DoWStrTest(convert("foo %5.2s"), convert("bar"), convert("foo ba"));
+ DoWStrTest(convert("foo %-5s"), convert("bar"), convert("foo bar "));
+ DoWStrTest(convert("foo %05s"), convert("bar"), convert("foo 00bar"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/testinfo.dat
new file mode 100644
index 0000000000..88f1981609
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test2/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test2
+Description
+= Tests swprintf_s with strings
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/CMakeLists.txt
new file mode 100644
index 0000000000..5095b1a12e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test3.cpp
+)
+
+add_executable(paltest_snwprintf_test3
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test3 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test3
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/test3.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/test3.cpp
new file mode 100644
index 0000000000..f6db6f265d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/test3.cpp
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test3.c
+**
+** Purpose: Tests swprintf_s with wide strings
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ DoStrTest(convert("foo %S"), "bar", convert("foo bar"));
+ DoStrTest(convert("foo %hS"), "bar", convert("foo bar"));
+ DoWStrTest(convert("foo %lS"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %wS"), convert("bar"), convert("foo bar"));
+ DoStrTest(convert("foo %LS"), "bar", convert("foo bar"));
+ DoStrTest(convert("foo %I64S"), "bar", convert("foo bar"));
+ DoStrTest(convert("foo %5S"), "bar", convert("foo bar"));
+ DoStrTest(convert("foo %.2S"), "bar", convert("foo ba"));
+ DoStrTest(convert("foo %5.2S"), "bar", convert("foo ba"));
+ DoStrTest(convert("foo %-5S"), "bar", convert("foo bar "));
+ DoStrTest(convert("foo %05S"), "bar", convert("foo 00bar"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/testinfo.dat
new file mode 100644
index 0000000000..5ed59e61ac
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test3/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test3
+Description
+= Tests swprintf_s with wide strings
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/CMakeLists.txt
new file mode 100644
index 0000000000..9cf81ea1bd
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test4.cpp
+)
+
+add_executable(paltest_snwprintf_test4
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test4 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test4
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/test4.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/test4.cpp
new file mode 100644
index 0000000000..02d4781bd3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/test4.cpp
@@ -0,0 +1,71 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test4.c
+**
+** Purpose: Tests swprintf_s with pointers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ void *ptr = (void*) 0x123456;
+ INT64 lptr = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+/*
+** Run only on 64 bit platforms
+*/
+#if defined(BIT64) && defined(PLATFORM_UNIX)
+ Trace("Testing for 64 Bit Platforms \n");
+ DoPointerTest(convert("%p"), NULL, convert("0000000000000000"));
+ DoPointerTest(convert("%p"), ptr, convert("0000000000123456"));
+ DoPointerTest(convert("%17p"), ptr, convert(" 0000000000123456"));
+ DoPointerTest(convert("%17p"), ptr, convert(" 0000000000123456"));
+ DoPointerTest(convert("%-17p"), ptr, convert("0000000000123456 "));
+ DoPointerTest(convert("%+p"), ptr, convert("0000000000123456"));
+ DoPointerTest(convert("% p"), ptr, convert("0000000000123456"));
+ DoPointerTest(convert("%#p"), ptr, convert("0X0000000000123456"));
+ DoPointerTest(convert("%lp"), ptr, convert("00123456"));
+ DoPointerTest(convert("%hp"), ptr, convert("00003456"));
+ DoPointerTest(convert("%Lp"), ptr, convert("00123456"));
+ DoI64Test(convert("%I64p"), lptr, "1234567887654321",
+ convert("1234567887654321"));
+#else
+ Trace("Testing for Non 64 Bit Platforms \n");
+ DoPointerTest(convert("%p"), NULL, convert("00000000"));
+ DoPointerTest(convert("%p"), ptr, convert("00123456"));
+ DoPointerTest(convert("%9p"), ptr, convert(" 00123456"));
+ DoPointerTest(convert("%09p"), ptr, convert(" 00123456"));
+ DoPointerTest(convert("%-9p"), ptr, convert("00123456 "));
+ DoPointerTest(convert("%+p"), ptr, convert("00123456"));
+ DoPointerTest(convert("% p"), ptr, convert("00123456"));
+ DoPointerTest(convert("%#p"), ptr, convert("0X00123456"));
+ DoPointerTest(convert("%lp"), ptr, convert("00123456"));
+ DoPointerTest(convert("%hp"), ptr, convert("00003456"));
+ DoPointerTest(convert("%Lp"), ptr, convert("00123456"));
+ DoI64Test(convert("%I64p"), lptr, "1234567887654321",
+ convert("1234567887654321"));
+#endif
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/testinfo.dat
new file mode 100644
index 0000000000..2b35f2d0d3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test4/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test4
+Description
+= Tests swprintf_s with pointers
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/CMakeLists.txt
new file mode 100644
index 0000000000..4996c7716f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test6.cpp
+)
+
+add_executable(paltest_snwprintf_test6
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test6 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test6
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/test6.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/test6.cpp
new file mode 100644
index 0000000000..576e061acd
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/test6.cpp
@@ -0,0 +1,46 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test6.c
+**
+** Purpose: Tests swprintf_s with characters
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR wc = (WCHAR) 'c';
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoWCharTest(convert("foo %c"), wc, convert("foo c"));
+ DoCharTest(convert("foo %hc"), 'b', convert("foo b"));
+ DoWCharTest(convert("foo %lc"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %Lc"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %I64c"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %5c"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %.0c"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %-5c"), wc, convert("foo c "));
+ DoWCharTest(convert("foo %05c"), wc, convert("foo 0000c"));
+ DoWCharTest(convert("foo % c"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %#c"), wc, convert("foo c"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/testinfo.dat
new file mode 100644
index 0000000000..d8db7f8335
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test6/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test6
+Description
+= Tests swprintf_s with characters
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/CMakeLists.txt
new file mode 100644
index 0000000000..0e55fbf4d7
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test7.cpp
+)
+
+add_executable(paltest_snwprintf_test7
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test7 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test7
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/test7.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/test7.cpp
new file mode 100644
index 0000000000..54dd32b433
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/test7.cpp
@@ -0,0 +1,46 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test7.c
+**
+** Purpose: Tests swprintf_s with wide characters
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR wc = (WCHAR) 'c';
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoCharTest(convert("foo %C"), 'b', convert("foo b"));
+ DoWCharTest(convert("foo %hC"), wc, convert("foo c"));
+ DoCharTest(convert("foo %lC"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %LC"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %I64C"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %5C"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %.0C"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %-5C"), 'b', convert("foo b "));
+ DoCharTest(convert("foo %05C"), 'b', convert("foo 0000b"));
+ DoCharTest(convert("foo % C"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %#C"), 'b', convert("foo b"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/testinfo.dat
new file mode 100644
index 0000000000..fa5bd30008
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test7/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test7
+Description
+= Tests swprintf_s with wide characters
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/CMakeLists.txt
new file mode 100644
index 0000000000..8f7fbda5a0
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test8.cpp
+)
+
+add_executable(paltest_snwprintf_test8
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test8 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test8
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/test8.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/test8.cpp
new file mode 100644
index 0000000000..9f1b555e3c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/test8.cpp
@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test8.c
+**
+** Purpose: Tests swprintf_s with decimal numbers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest(convert("foo %d"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %ld"), 0xFFFF, convert("foo 65535"));
+ DoNumTest(convert("foo %hd"), 0xFFFF, convert("foo -1"));
+ DoNumTest(convert("foo %Ld"), pos, convert("foo 42"));
+ DoI64Test(convert("foo %I64d"), l, "42", convert("foo 42"));
+ DoNumTest(convert("foo %3d"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %-3d"), pos, convert("foo 42 "));
+ DoNumTest(convert("foo %.1d"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %.3d"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %03d"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %#d"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+d"), pos, convert("foo +42"));
+ DoNumTest(convert("foo % d"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+d"), neg, convert("foo -42"));
+ DoNumTest(convert("foo % d"), neg, convert("foo -42"));
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/testinfo.dat
new file mode 100644
index 0000000000..d76a421ea3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test8/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test8
+Description
+= Tests swprintf_s with decimal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/CMakeLists.txt
new file mode 100644
index 0000000000..f769c9eaa5
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test9.cpp
+)
+
+add_executable(paltest_snwprintf_test9
+ ${SOURCES}
+)
+
+add_dependencies(paltest_snwprintf_test9 coreclrpal)
+
+target_link_libraries(paltest_snwprintf_test9
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/test9.cpp b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/test9.cpp
new file mode 100644
index 0000000000..76d60631a2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/test9.cpp
@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test9.c
+**
+** Purpose: Tests swprintf_s with integer numbers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../_snwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest(convert("foo %i"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %li"), 0xFFFF, convert("foo 65535"));
+ DoNumTest(convert("foo %hi"), 0xFFFF, convert("foo -1"));
+ DoNumTest(convert("foo %Li"), pos, convert("foo 42"));
+ DoI64Test(convert("foo %I64i"), l, "42", convert("foo 42"));
+ DoNumTest(convert("foo %3i"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %-3i"), pos, convert("foo 42 "));
+ DoNumTest(convert("foo %.1i"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %.3i"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %03i"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %#i"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+i"), pos, convert("foo +42"));
+ DoNumTest(convert("foo % i"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+i"), neg, convert("foo -42"));
+ DoNumTest(convert("foo % i"), neg, convert("foo -42"));
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/testinfo.dat
new file mode 100644
index 0000000000..b2a038df62
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_snwprintf_s/test9/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = swprintf_s
+Name = Positive Test for swprintf_s
+TYPE = DEFAULT
+EXE1 = test9
+Description
+= Tests swprintf_s with integer numbers
diff --git a/src/pal/tests/palsuite/c_runtime/_splitpath/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_splitpath/CMakeLists.txt
deleted file mode 100644
index f6aa0cb2d9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_splitpath/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-
diff --git a/src/pal/tests/palsuite/c_runtime/_splitpath/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_splitpath/test1/CMakeLists.txt
deleted file mode 100644
index 361b9084d7..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_splitpath/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_splitpath_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_splitpath_test1 coreclrpal)
-
-target_link_libraries(paltest_splitpath_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_splitpath/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_splitpath/test1/test1.c
deleted file mode 100644
index e98354c2ee..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_splitpath/test1/test1.c
+++ /dev/null
@@ -1,108 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: Passes _splitpath() a series of sample paths and checks that it
-** parses them as expected.
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-
-struct testCase
-{
- const char path[_MAX_PATH]; /* The path to parse. */
- const char drive[_MAX_DRIVE]; /* The expected values... */
- const char dir[_MAX_DIR];
- const char fname[_MAX_FNAME];
- const char ext[_MAX_EXT];
-};
-
-
-int __cdecl main(int argc, char **argv)
-{
- struct testCase testCases[] =
- {
-#if WIN32
- {"c:\\foo\\bar\\foo.bar", "c:", "\\foo\\bar\\", "foo", ".bar"},
- {"c:/foo/bar/foo.bar", "c:", "/foo/bar/", "foo", ".bar"},
- {"c:/foo/bar/foo", "c:", "/foo/bar/", "foo", ""},
- {"c:/foo/bar/.bar", "c:", "/foo/bar/", "", ".bar"},
- {"c:/foo/bar/", "c:", "/foo/bar/", "", ""},
- {"/foo/bar/foo.bar", "", "/foo/bar/", "foo", ".bar"},
- {"c:foo.bar", "c:", "", "foo", ".bar"}
-#else
- {"c:\\foo\\bar\\foo.bar", "","c:/foo/bar/", "foo", ".bar"},
- {"c:/foo/bar/foo.bar", "", "c:/foo/bar/", "foo", ".bar"},
- {"c:/foo/bar/foo", "", "c:/foo/bar/", "foo", ""},
- {"c:/foo/bar/.bar", "", "c:/foo/bar/", ".bar", ""},
- {"c:/foo/bar/", "", "c:/foo/bar/", "", ""},
- {"/foo/bar/foo.bar", "", "/foo/bar/", "foo", ".bar"},
- {"c:foo.bar", "", "", "c:foo", ".bar"}
-#endif
- };
- char drive[_MAX_DRIVE];
- char dir[_MAX_DIR];
- char fname[_MAX_FNAME];
- char ext[_MAX_EXT];
-
- int i=0;
-
- /*
- * Initialize the PAL and return FAIL if this fails
- */
- if (0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- for (i = 0; i < sizeof(testCases)/sizeof(struct testCase); i++)
- {
- _splitpath(testCases[i].path, drive, dir, fname, ext);
-
-
- /*on platforms that don't support drive letters, the drive
- returned should always be "" */
- if (strcmp(drive, testCases[i].drive) != 0)
- {
- Fail("_splitpath read the path \"%s\" and thought the drive was "
- "\"%s\" instead of \"%s\"\n"
- , testCases[i].path, drive, testCases[i].drive);
- }
-
- if (strcmp(dir, testCases[i].dir) != 0)
- {
- Fail("_splitpath read the path \"%s\" and thought the directory "
- "was \"%s\" instead of \"%s\"\n"
- , testCases[i].path, dir, testCases[i].dir);
- }
-
- if (strcmp(fname, testCases[i].fname) != 0)
- {
- Fail("_splitpath read the path \"%s\" and thought the filename "
- "was \"%s\" instead of \"%s\"\n"
- , testCases[i].path, fname, testCases[i].fname);
- }
-
- if (strcmp(ext, testCases[i].ext) != 0)
- {
- Fail("_splitpath read the path \"%s\" and thought the file "
- "extension was \"%s\" instead of \"%s\"\n"
- , testCases[i].path, ext, testCases[i].ext);
- }
- }
- PAL_Terminate();
- return PASS;
-}
-
-
-
-
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/_splitpath/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_splitpath/test1/testinfo.dat
deleted file mode 100644
index 0a93e27456..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_splitpath/test1/testinfo.dat
+++ /dev/null
@@ -1,15 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _splitpath
-Name = Positive Test for _splitpath
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= Passes _splitpath() a series of sample paths and checks that it
-= parses them as expected.
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/_stricmp/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_stricmp/test1/CMakeLists.txt
index 766660ccfc..03aa3a523e 100644
--- a/src/pal/tests/palsuite/c_runtime/_stricmp/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_stricmp/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_stricmp_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_stricmp/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_stricmp/test1/test1.cpp
index 60e2f9eb8b..60e2f9eb8b 100644
--- a/src/pal/tests/palsuite/c_runtime/_stricmp/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_stricmp/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_strlwr/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_strlwr/test1/CMakeLists.txt
index 3a9394ca60..ca26961b3c 100644
--- a/src/pal/tests/palsuite/c_runtime/_strlwr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_strlwr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strlwr_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_strlwr/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_strlwr/test1/test1.cpp
index 1c4015e3e2..1c4015e3e2 100644
--- a/src/pal/tests/palsuite/c_runtime/_strlwr/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_strlwr/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/CMakeLists.txt
index 6a38747592..03f9992198 100644
--- a/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strnicmp_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/test1.cpp
index 3c915dc621..3c915dc621 100644
--- a/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_strnicmp/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_swab/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_swab/CMakeLists.txt
deleted file mode 100644
index f6aa0cb2d9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_swab/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-
diff --git a/src/pal/tests/palsuite/c_runtime/_swab/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_swab/test1/CMakeLists.txt
deleted file mode 100644
index fc7fbef8b4..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_swab/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_swab_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_swab_test1 coreclrpal)
-
-target_link_libraries(paltest_swab_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_swab/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_swab/test1/test1.c
deleted file mode 100644
index 203e3b3a06..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_swab/test1/test1.c
+++ /dev/null
@@ -1,45 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: Calls _swab on a buffer, and checks that it has correctly
-** swapped adjacent bytes
-**
-**
-**==========================================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char **argv)
-{
- char before[] = "abcdefghijklmn";
- char after[] = "--------------";
- const char check[] = "badcfehgjilknm";
-
- /*
- * Initialize the PAL and return FAIL if this fails
- */
- if (0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- _swab(before, after, sizeof(before));
- if (memcmp(after, check, sizeof(after)) != 0)
- {
- Fail ("_swab did not correctly swap adjacent bytes in a buffer.\n");
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
-
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/_swab/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_swab/test1/testinfo.dat
deleted file mode 100644
index c59b017762..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_swab/test1/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _swab
-Name = Positive Test for _swab
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= Calls _swab on a buffer, and checks that it has correctly swapped
-= adjacent bytes
-
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/_vsnprintf.h b/src/pal/tests/palsuite/c_runtime/_vsnprintf/_vsnprintf.h
index 240a72f017..30e70648c3 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/_vsnprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/_vsnprintf.h
@@ -28,7 +28,7 @@ int Testvsnprintf(char* buf, size_t count, const char* format, ...)
}
-void DoStrTest(char *formatstr, char* param, char *checkstr)
+void DoStrTest(const char *formatstr, char* param, const char *checkstr)
{
char buf[256] = { 0 };
@@ -41,7 +41,7 @@ void DoStrTest(char *formatstr, char* param, char *checkstr)
}
}
-void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
+void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr)
{
char buf[256] = { 0 };
@@ -55,7 +55,7 @@ void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
}
-void DoCharTest(char *formatstr, char param, char *checkstr)
+void DoCharTest(const char *formatstr, char param, const char *checkstr)
{
char buf[256] = { 0 };
@@ -68,7 +68,7 @@ void DoCharTest(char *formatstr, char param, char *checkstr)
}
}
-void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
+void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr)
{
char buf[256] = { 0 };
@@ -81,7 +81,7 @@ void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
}
}
-void DoNumTest(char *formatstr, int value, char *checkstr)
+void DoNumTest(const char *formatstr, int value, const char *checkstr)
{
char buf[256] = { 0 };
@@ -94,7 +94,7 @@ void DoNumTest(char *formatstr, int value, char *checkstr)
}
}
-void DoI64Test(char *formatstr, INT64 value, char *valuestr, char *checkstr)
+void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr)
{
char buf[256] = { 0 };
@@ -106,7 +106,7 @@ void DoI64Test(char *formatstr, INT64 value, char *valuestr, char *checkstr)
valuestr, formatstr, checkstr, buf);
}
}
-void DoDoubleTest(char *formatstr, double value, char *checkstr1, char
+void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, char
*checkstr2)
{
char buf[256] = { 0 };
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/CMakeLists.txt
index 7c346a4638..489b7bf566 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_vsnprintf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/test1.cpp
index 88aeec27a5..88aeec27a5 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/testinfo.dat
index 0e97856927..f96bf084f2 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test1/testinfo.dat
@@ -10,4 +10,4 @@ TYPE = DEFAULT
EXE1 = test1
Description
= Tests the PAL implementation of the _vsnprintf function.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/CMakeLists.txt
index 00dccc260d..bc35dbd0c2 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_vsnprintf_test10
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/test10.cpp
index 3099957ab7..3099957ab7 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/test10.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/testinfo.dat
index 1399afae05..a3d8eca54e 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test10/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test10
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with octal numbers.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/CMakeLists.txt
index fd709f2a31..bf3dd9a534 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_vsnprintf_test11
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/test11.cpp
index 74b0435c6d..74b0435c6d 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/test11.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/testinfo.dat
index faa7428eff..17e9f04946 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test11/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test11
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with unsigned numbers.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/CMakeLists.txt
index 02dac0cb91..9fceeaf7a5 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_vsnprintf_test12
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/test12.cpp
index 3718620971..3718620971 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/test12.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/testinfo.dat
index d48a5cc60d..82f58e4371 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test12/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test12
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with hex numbers (lowercase).
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/CMakeLists.txt
index 52562c99f8..7e805f6ad4 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test13.c
+ test13.cpp
)
add_executable(paltest_vsnprintf_test13
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/test13.cpp
index 1abada4033..1abada4033 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/test13.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/test13.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/testinfo.dat
index a3f14c21dc..d308edf871 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test13/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test13
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with hex numbers (uppercase).
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/CMakeLists.txt
index 3fc8c814a6..6e4566b577 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test14.c
+ test14.cpp
)
add_executable(paltest_vsnprintf_test14
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/test14.cpp
index 2e98f6ad4e..2e98f6ad4e 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/test14.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/test14.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/testinfo.dat
index f4d921c139..8d11b1d6ff 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test14/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test14
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with exponential format doubles (lowercase).
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/CMakeLists.txt
index f6bdc83779..d9039b39b7 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test15.c
+ test15.cpp
)
add_executable(paltest_vsnprintf_test15
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/test15.cpp
index 4d32e9c638..4d32e9c638 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/test15.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/test15.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/testinfo.dat
index 3a6620ba46..913912508e 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test15/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test15
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with exponential format doubles (uppercase).
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/CMakeLists.txt
index b7b06d19bb..b298df318b 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test16.c
+ test16.cpp
)
add_executable(paltest_vsnprintf_test16
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/test16.cpp
index 118ba1453c..118ba1453c 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/test16.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/test16.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/testinfo.dat
index 6363f294af..fc2f13071b 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test16/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test16
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with decimal point format doubles.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/CMakeLists.txt
index 2c91cccd4a..b195f334d3 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test17.c
+ test17.cpp
)
add_executable(paltest_vsnprintf_test17
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/test17.cpp
index 9b5063ddf0..9b5063ddf0 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/test17.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/test17.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/testinfo.dat
index ecec515de3..aeb924495c 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test17/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test17
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with compact format doubles (lowercase).
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/CMakeLists.txt
index 1a06ce01ee..f0f6d1124e 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test18.c
+ test18.cpp
)
add_executable(paltest_vsnprintf_test18
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/test18.cpp
index 5232befc7f..5232befc7f 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/test18.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/test18.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/testinfo.dat
index 34fd7ae2ff..57aaed5953 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test18/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test18
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with compact format doubles (uppercase).
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/CMakeLists.txt
index 6f2e42cc6b..44b38902ef 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test19.c
+ test19.cpp
)
add_executable(paltest_vsnprintf_test19
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.c
deleted file mode 100644
index 075a528aba..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.c
+++ /dev/null
@@ -1,103 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test19.c
-**
-** Purpose: Test #19 for the _vsnprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-#define DOTEST(a,b,c,d,e) DoTest(a,b,(void*)c,d,e)
-
-void DoArgumentPrecTest(char *formatstr, int precision, void *param,
- char *paramstr, char *checkstr1, char *checkstr2)
-{
- char buf[256];
-
- Testvsnprintf(buf,256,formatstr, precision, param);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
- memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- paramstr, formatstr, precision, checkstr1, checkstr2, buf);
- }
-
-}
-
-void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param,
- char *checkstr1, char *checkstr2)
-{
- char buf[256];
-
- Testvsnprintf(buf,256,formatstr, precision, param);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
- memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- param, formatstr, precision, checkstr1, checkstr2, buf);
- }
-
-}
-
-
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
-
- DoArgumentPrecTest("%.*s", 2, "bar", "bar", "ba", "ba");
- DoArgumentPrecTest("%.*S", 2, convert("bar"), "bar", "ba", "ba");
- DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
- DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
- DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
- DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
-
-
- DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
- DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
- DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
- DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
- DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
- DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
- DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
- DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
- DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
- DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.cpp
new file mode 100644
index 0000000000..211354bc3a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/test19.cpp
@@ -0,0 +1,103 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test19.c
+**
+** Purpose: Test #19 for the _vsnprintf function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnprintf.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+#define DOTEST(a,b,c,d,e) DoTest(a,b,(void*)c,d,e)
+
+void DoArgumentPrecTest(char *formatstr, int precision, void *param,
+ char *paramstr, char *checkstr1, char *checkstr2)
+{
+ char buf[256];
+
+ Testvsnprintf(buf,256,formatstr, precision, param);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
+ memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ paramstr, formatstr, precision, checkstr1, checkstr2, buf);
+ }
+
+}
+
+void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param,
+ char *checkstr1, char *checkstr2)
+{
+ char buf[256];
+
+ Testvsnprintf(buf,256,formatstr, precision, param);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
+ memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ param, formatstr, precision, checkstr1, checkstr2, buf);
+ }
+
+}
+
+
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+
+ DoArgumentPrecTest("%.*s", 2, (void*)"bar", "bar", "ba", "ba");
+ DoArgumentPrecTest("%.*S", 2, (void*)convert("bar"), "bar", "ba", "ba");
+ DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
+ DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
+ DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
+ DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
+
+
+ DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
+ DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
+ DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
+ DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
+ DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
+ DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
+ DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
+ DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
+ DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
+ DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/testinfo.dat
index 05f4b5bd87..cda8966865 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test19/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test19
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with argument specified precision.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/CMakeLists.txt
index a3871d64cf..1d3910e70c 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_vsnprintf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/test2.cpp
index 4bac4d2c83..4bac4d2c83 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/testinfo.dat
index 5ee925e3f6..6e8f03e639 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test2/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test2
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with strings.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/CMakeLists.txt
index 1beae06277..62d765ec5f 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_vsnprintf_test3
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/test3.cpp
index 2b30c9ad99..2b30c9ad99 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/testinfo.dat
index 626949c7c8..638cef69ef 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test3/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test3
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with wide strings.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/CMakeLists.txt
index daf7757ddb..5662bd57ad 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_vsnprintf_test4
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/test4.cpp
index 33fc49deba..33fc49deba 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/testinfo.dat
index bdfdef85ae..03ff2931bc 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test4/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test4
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with pointers.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/CMakeLists.txt
index c255b07b42..92540541f3 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_vsnprintf_test5
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/test5.cpp
index 534e42e293..534e42e293 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/testinfo.dat
index 3cd3f7ee86..c3848824f1 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test5/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test5
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with the count specifier.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/CMakeLists.txt
index 8e041f4af8..d80d433c22 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_vsnprintf_test6
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/test6.cpp
index 103d1181c2..103d1181c2 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/testinfo.dat
index e379e0b3b8..e375f9238d 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test6/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test6
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with characters.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/CMakeLists.txt
index 01f9620184..a1dc0a7c2c 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_vsnprintf_test7
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/test7.cpp
index c7e45d67fa..c7e45d67fa 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/testinfo.dat
index 90749400a5..09eb481b59 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test7/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test7
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with wide characters.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/CMakeLists.txt
index 9c525de15a..1ca4732492 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_vsnprintf_test8
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/test8.cpp
index 2cefbeac25..2cefbeac25 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/test8.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/testinfo.dat
index 0afc334a67..1bdf411983 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test8/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test8
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with decimal numbers.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/CMakeLists.txt
index bfe2572a6d..583971fe5a 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_vsnprintf_test9
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/test9.cpp
index d2cd8165c0..d2cd8165c0 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/test9.c
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/testinfo.dat
index 125724a36b..bdaae87ce8 100644
--- a/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/_vsnprintf/test9/testinfo.dat
@@ -11,4 +11,4 @@ EXE1 = test9
Description
= Tests the PAL implementation of the _vsnprintf function.
= Tests _vsnprintf with integer numbers.
-= This test is modeled after _snprintf.
+= This test is modeled after sprintf_s.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/CMakeLists.txt
deleted file mode 100644
index cafb9536b0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-add_subdirectory(test10)
-add_subdirectory(test11)
-add_subdirectory(test12)
-add_subdirectory(test13)
-add_subdirectory(test14)
-add_subdirectory(test15)
-add_subdirectory(test16)
-add_subdirectory(test17)
-add_subdirectory(test18)
-add_subdirectory(test19)
-add_subdirectory(test2)
-add_subdirectory(test3)
-add_subdirectory(test4)
-add_subdirectory(test5)
-add_subdirectory(test6)
-add_subdirectory(test7)
-add_subdirectory(test8)
-add_subdirectory(test9)
-
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/_vsnwprintf.h b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/_vsnwprintf.h
deleted file mode 100644
index a3a932f822..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/_vsnwprintf.h
+++ /dev/null
@@ -1,133 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: _vsnwprintf.h
-**
-** Purpose: Containts common testing functions for _vsnwprintf
-**
-**
-**==========================================================================*/
-
-#ifndef ___VSNWPRINTF_H__
-#define ___VSNWPRINTF_H__
-
-/* These functions leaks memory like crazy. C'est la vie. */
-int TestVsnwprintf(wchar_t* buf, size_t count, const wchar_t* format, ...)
-{
- int retVal = 0;
- va_list arglist;
-
- va_start(arglist, format);
- retVal = _vsnwprintf(buf, count, format, arglist);
- va_end(arglist);
-
- return( retVal);
-}
-
-
-void DoWStrTest(WCHAR *formatstr, WCHAR *param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- TestVsnwprintf(buf, 256, formatstr, param);
-
- if (memcmp(buf, checkstr, wcslen(buf) * 2 + 2) != 0)
- {
- Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n"
- "Expected \"%s\", got \"%s\".\n",
- convertC(param), convertC(formatstr),
- convertC(checkstr), convertC(buf));
- }
-}
-
-void DoStrTest(WCHAR *formatstr, char *param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- TestVsnwprintf(buf, 256, formatstr, param);
-
- if (memcmp(buf, checkstr, wcslen(buf) * 2 + 2) != 0)
- {
- Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n"
- "Expected \"%s\", got \"%s\".\n",
- param, convertC(formatstr), convertC(checkstr),
- convertC(buf));
- }
-}
-
-void DoCharTest(WCHAR *formatstr, char param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- TestVsnwprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr, wcslen(buf)*2 + 2) != 0)
- {
- Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- param, param, convertC(formatstr), convertC(checkstr),
- convertC(buf));
- }
-}
-
-void DoWCharTest(WCHAR *formatstr, WCHAR param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- TestVsnwprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr, wcslen(buf)*2 + 2) != 0)
- {
- Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- (char) param, param, convertC(formatstr),
- convertC(checkstr), convertC(buf));
- }
-}
-
-void DoNumTest(WCHAR *formatstr, int value, WCHAR*checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- TestVsnwprintf(buf, 256, formatstr, value);
- if (memcmp(buf, checkstr, wcslen(buf)* 2 + 2) != 0)
- {
- Fail("ERROR: failed to insert %#x into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n", value, convertC(formatstr),
- convertC(checkstr), convertC(buf));
- }
-}
-
-void DoI64NumTest(WCHAR *formatstr, INT64 value, char *valuestr, WCHAR*checkstr)
-{
- WCHAR buf[256] = { 0 };
-
- TestVsnwprintf(buf, 256, formatstr, value);
- if (memcmp(buf, checkstr, wcslen(buf)* 2 + 2) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n", valuestr, convertC(formatstr),
- convertC(checkstr), convertC(buf));
- }
-}
-void DoDoubleTest(WCHAR *formatstr, double value,
- WCHAR *checkstr1, WCHAR *checkstr2)
-{
- WCHAR buf[256] = { 0 };
-
- TestVsnwprintf(buf, 256, formatstr, value);
- if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
- memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\"\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- value,
- convertC(formatstr),
- convertC(checkstr1),
- convertC(checkstr2),
- convertC(buf));
- }
-}
-
-#endif
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/CMakeLists.txt
deleted file mode 100644
index 52c442d572..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_vsnwprintf_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test1 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/test1.c
deleted file mode 100644
index 0238e42611..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/test1.c
+++ /dev/null
@@ -1,60 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test1.c
-**
-** Purpose: Test #1 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR *checkstr;
- WCHAR buf[256] = { 0 };
- int ret;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- checkstr = convert("hello world");
- TestVsnwprintf(buf, 256, checkstr);
- if (memcmp(checkstr, buf, wcslen(checkstr)*2+2) != 0)
- {
- Fail("ERROR: Expected \"%s\", got \"%s\"\n",
- convertC(checkstr), convertC(buf));
- }
-
- TestVsnwprintf(buf, 256, convert("xxxxxxxxxxxxxxxxx"));
- ret = TestVsnwprintf(buf, 8, checkstr);
- if (memcmp(checkstr, buf, 16) != 0)
- {
- Fail("ERROR: Expected \"%8s\", got \"%8s\"\n",
- convertC(checkstr), convertC(buf));
- }
- if (ret >= 0)
- {
- Fail("ERROR: Expected negative return value, got %d.\n", ret);
- }
- if (buf[8] != (WCHAR) 'x')
- {
- Fail("ERROR: buffer overflow using \"%s\" with length 8.\n",
- convertC(checkstr));
- }
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/testinfo.dat
deleted file mode 100644
index d806fb8ed8..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test1/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= General test to see if _vsnwprintf works correctly.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/CMakeLists.txt
deleted file mode 100644
index 86ea1a3160..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test10.c
-)
-
-add_executable(paltest_vsnwprintf_test10
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test10 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test10
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/test10.c
deleted file mode 100644
index 6e188e56ff..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/test10.c
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test10.c
-**
-** Purpose: Test #10 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoNumTest(convert("foo %o"), pos, convert("foo 52"));
- DoNumTest(convert("foo %lo"), 0xFFFF, convert("foo 177777"));
- DoNumTest(convert("foo %ho"), 0xFFFF, convert("foo 177777"));
- DoNumTest(convert("foo %Lo"), pos, convert("foo 52"));
- DoI64NumTest(convert("foo %I64o"), l, "42", convert("foo 52"));
- DoNumTest(convert("foo %3o"), pos, convert("foo 52"));
- DoNumTest(convert("foo %-3o"), pos, convert("foo 52 "));
- DoNumTest(convert("foo %.1o"), pos, convert("foo 52"));
- DoNumTest(convert("foo %.3o"), pos, convert("foo 052"));
- DoNumTest(convert("foo %03o"), pos, convert("foo 052"));
- DoNumTest(convert("foo %#o"), pos, convert("foo 052"));
- DoNumTest(convert("foo %+o"), pos, convert("foo 52"));
- DoNumTest(convert("foo % o"), pos, convert("foo 52"));
- DoNumTest(convert("foo %+o"), neg, convert("foo 37777777726"));
- DoNumTest(convert("foo % o"), neg, convert("foo 37777777726"));
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/testinfo.dat
deleted file mode 100644
index beb5b41be9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test10/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test10
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with octal numbers.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/CMakeLists.txt
deleted file mode 100644
index c6011dc1de..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test11.c
-)
-
-add_executable(paltest_vsnwprintf_test11
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test11 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test11
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/test11.c
deleted file mode 100644
index af54985bdc..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/test11.c
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test11.c
-**
-** Purpose: Test #11 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoNumTest(convert("foo %u"), pos, convert("foo 42"));
- DoNumTest(convert("foo %lu"), 0xFFFF, convert("foo 65535"));
- DoNumTest(convert("foo %hu"), 0xFFFF, convert("foo 65535"));
- DoNumTest(convert("foo %Lu"), pos, convert("foo 42"));
- DoI64NumTest(convert("foo %I64u"), l, "42", convert("foo 42"));
- DoNumTest(convert("foo %3u"), pos, convert("foo 42"));
- DoNumTest(convert("foo %-3u"), pos, convert("foo 42 "));
- DoNumTest(convert("foo %.1u"), pos, convert("foo 42"));
- DoNumTest(convert("foo %.3u"), pos, convert("foo 042"));
- DoNumTest(convert("foo %03u"), pos, convert("foo 042"));
- DoNumTest(convert("foo %#u"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+u"), pos, convert("foo 42"));
- DoNumTest(convert("foo % u"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+u"), neg, convert("foo 4294967254"));
- DoNumTest(convert("foo % u"), neg, convert("foo 4294967254"));
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/testinfo.dat
deleted file mode 100644
index 083b0fa5af..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test11/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test11
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with unsigned numbers.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/CMakeLists.txt
deleted file mode 100644
index bd9652c2fb..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test12.c
-)
-
-add_executable(paltest_vsnwprintf_test12
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test12 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test12
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/test12.c
deleted file mode 100644
index b593a82b4b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/test12.c
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test12.c
-**
-** Purpose: Test #12 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 0x1234ab;
- INT64 l = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoNumTest(convert("foo %x"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo %lx"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo %hx"), pos, convert("foo 34ab"));
- DoNumTest(convert("foo %Lx"), pos, convert("foo 1234ab"));
- DoI64NumTest(convert("foo %I64x"), l, "0x1234567887654321",
- convert("foo 1234567887654321"));
- DoNumTest(convert("foo %7x"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo %-7x"), pos, convert("foo 1234ab "));
- DoNumTest(convert("foo %.1x"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo %.7x"), pos, convert("foo 01234ab"));
- DoNumTest(convert("foo %07x"), pos, convert("foo 01234ab"));
- DoNumTest(convert("foo %#x"), pos, convert("foo 0x1234ab"));
- DoNumTest(convert("foo %+x"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo % x"), pos, convert("foo 1234ab"));
- DoNumTest(convert("foo %+x"), neg, convert("foo ffffffd6"));
- DoNumTest(convert("foo % x"), neg, convert("foo ffffffd6"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/testinfo.dat
deleted file mode 100644
index a4450ed8d0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test12/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test12
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with hex numbers (lowercase).
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/CMakeLists.txt
deleted file mode 100644
index c608ab84e3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test13.c
-)
-
-add_executable(paltest_vsnwprintf_test13
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test13 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test13
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/test13.c
deleted file mode 100644
index 59a9dc496f..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/test13.c
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test13.c
-**
-** Purpose: Test #13 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 0x1234ab;
- INT64 l = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoNumTest(convert("foo %X"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo %lX"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo %hX"), pos, convert("foo 34AB"));
- DoNumTest(convert("foo %LX"), pos, convert("foo 1234AB"));
- DoI64NumTest(convert("foo %I64X"), l, "0x1234567887654321",
- convert("foo 1234567887654321"));
- DoNumTest(convert("foo %7X"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo %-7X"), pos, convert("foo 1234AB "));
- DoNumTest(convert("foo %.1X"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo %.7X"), pos, convert("foo 01234AB"));
- DoNumTest(convert("foo %07X"), pos, convert("foo 01234AB"));
- DoNumTest(convert("foo %#X"), pos, convert("foo 0X1234AB"));
- DoNumTest(convert("foo %+X"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo % X"), pos, convert("foo 1234AB"));
- DoNumTest(convert("foo %+X"), neg, convert("foo FFFFFFD6"));
- DoNumTest(convert("foo % X"), neg, convert("foo FFFFFFD6"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/testinfo.dat
deleted file mode 100644
index fa54ae8a62..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test13/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test13
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with hex numbers (uppercase).
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/CMakeLists.txt
deleted file mode 100644
index 3bf157a2b3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test14.c
-)
-
-add_executable(paltest_vsnwprintf_test14
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test14 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test14
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/test14.c
deleted file mode 100644
index 633f9d68ae..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/test14.c
+++ /dev/null
@@ -1,63 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test14.c
-**
-** Purpose: Test #14 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 256.0;
- double neg = -256.0;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoDoubleTest(convert("foo %e"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %le"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %he"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %Le"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %I64e"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %14e"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %-14e"), val, convert("foo 2.560000e+002 "),
- convert("foo 2.560000e+02 "));
- DoDoubleTest(convert("foo %.1e"), val, convert("foo 2.6e+002"),
- convert("foo 2.6e+02"));
- DoDoubleTest(convert("foo %.8e"), val, convert("foo 2.56000000e+002"),
- convert("foo 2.56000000e+02"));
- DoDoubleTest(convert("foo %014e"), val, convert("foo 02.560000e+002"),
- convert("foo 002.560000e+02"));
- DoDoubleTest(convert("foo %#e"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %+e"), val, convert("foo +2.560000e+002"),
- convert("foo +2.560000e+02"));
- DoDoubleTest(convert("foo % e"), val, convert("foo 2.560000e+002"),
- convert("foo 2.560000e+02"));
- DoDoubleTest(convert("foo %+e"), neg, convert("foo -2.560000e+002"),
- convert("foo -2.560000e+02"));
- DoDoubleTest(convert("foo % e"), neg, convert("foo -2.560000e+002"),
- convert("foo -2.560000e+02"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/testinfo.dat
deleted file mode 100644
index 0796f5e81c..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test14/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test14
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with exponential format doubles (lowercase).
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/CMakeLists.txt
deleted file mode 100644
index eedc7bb9db..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test15.c
-)
-
-add_executable(paltest_vsnwprintf_test15
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test15 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test15
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/test15.c
deleted file mode 100644
index 0af41fe1dc..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/test15.c
+++ /dev/null
@@ -1,64 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test15.c
-**
-** Purpose: Test #15 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 256.0;
- double neg = -256.0;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoDoubleTest(convert("foo %E"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %lE"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %hE"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %LE"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %I64E"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %14E"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %-14E"), val, convert("foo 2.560000E+002 "),
- convert("foo 2.560000E+02 "));
- DoDoubleTest(convert("foo %.1E"), val, convert("foo 2.6E+002"),
- convert("foo 2.6E+02"));
- DoDoubleTest(convert("foo %.8E"), val, convert("foo 2.56000000E+002"),
- convert("foo 2.56000000E+02"));
- DoDoubleTest(convert("foo %014E"), val, convert("foo 02.560000E+002"),
- convert("foo 002.560000E+02"));
- DoDoubleTest(convert("foo %#E"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %+E"), val, convert("foo +2.560000E+002"),
- convert("foo +2.560000E+02"));
- DoDoubleTest(convert("foo % E"), val, convert("foo 2.560000E+002"),
- convert("foo 2.560000E+02"));
- DoDoubleTest(convert("foo %+E"), neg, convert("foo -2.560000E+002"),
- convert("foo -2.560000E+02"));
- DoDoubleTest(convert("foo % E"), neg, convert("foo -2.560000E+002"),
- convert("foo -2.560000E+002"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/testinfo.dat
deleted file mode 100644
index 9de3c83b8a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test15/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test15
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with exponential format doubles (uppercase).
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/CMakeLists.txt
deleted file mode 100644
index a469c497e9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test16.c
-)
-
-add_executable(paltest_vsnwprintf_test16
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test16 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test16
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/test16.c
deleted file mode 100644
index 77571b01b3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/test16.c
+++ /dev/null
@@ -1,63 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test16.c
-**
-** Purpose: Test #16 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoDoubleTest(convert("foo %f"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %lf"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %hf"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %Lf"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %I64f"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %12f"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %-12f"), val, convert("foo 2560.001000 "),
- convert("foo 2560.001000 "));
- DoDoubleTest(convert("foo %.1f"), val, convert("foo 2560.0"),
- convert("foo 2560.0"));
- DoDoubleTest(convert("foo %.8f"), val, convert("foo 2560.00100000"),
- convert("foo 2560.00100000"));
- DoDoubleTest(convert("foo %012f"), val, convert("foo 02560.001000"),
- convert("foo 02560.001000"));
- DoDoubleTest(convert("foo %#f"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %+f"), val, convert("foo +2560.001000"),
- convert("foo +2560.001000"));
- DoDoubleTest(convert("foo % f"), val, convert("foo 2560.001000"),
- convert("foo 2560.001000"));
- DoDoubleTest(convert("foo %+f"), neg, convert("foo -2560.001000"),
- convert("foo -2560.001000"));
- DoDoubleTest(convert("foo % f"), neg, convert("foo -2560.001000"),
- convert("foo -2560.001000"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/testinfo.dat
deleted file mode 100644
index b7134c785b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test16/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test16
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with decimal point format doubles.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/CMakeLists.txt
deleted file mode 100644
index f429e94417..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test17.c
-)
-
-add_executable(paltest_vsnwprintf_test17
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test17 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test17
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/test17.c
deleted file mode 100644
index 3a9d70ad03..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/test17.c
+++ /dev/null
@@ -1,65 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test17.c
-**
-** Purpose: Test #17 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoDoubleTest(convert("foo %g"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %lg"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %hg"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %Lg"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %I64g"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %5g"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %-5g"), val, convert("foo 2560 "),
- convert("foo 2560 "));
- DoDoubleTest(convert("foo %.1g"), val, convert("foo 3e+003"),
- convert("foo 3e+03"));
- DoDoubleTest(convert("foo %.2g"), val, convert("foo 2.6e+003"),
- convert("foo 2.6e+03"));
- DoDoubleTest(convert("foo %.12g"), val, convert("foo 2560.001"),
- convert("foo 2560.001"));
- DoDoubleTest(convert("foo %06g"), val, convert("foo 002560"),
- convert("foo 002560"));
- DoDoubleTest(convert("foo %#g"), val, convert("foo 2560.00"),
- convert("foo 2560.00"));
- DoDoubleTest(convert("foo %+g"), val, convert("foo +2560"),
- convert("foo +2560"));
- DoDoubleTest(convert("foo % g"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %+g"), neg, convert("foo -2560"),
- convert("foo -2560"));
- DoDoubleTest(convert("foo % g"), neg, convert("foo -2560"),
- convert("foo -2560"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/testinfo.dat
deleted file mode 100644
index 5d5553151e..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test17/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test17
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with compact format doubles (lowercase).
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/CMakeLists.txt
deleted file mode 100644
index 25dd6a2c5b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test18.c
-)
-
-add_executable(paltest_vsnwprintf_test18
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test18 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test18
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/test18.c
deleted file mode 100644
index 03f9870113..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/test18.c
+++ /dev/null
@@ -1,65 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test18.c
-**
-** Purpose: Test #18 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoDoubleTest(convert("foo %G"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %lG"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %hG"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %LG"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %I64G"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %5G"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %-5G"), val, convert("foo 2560 "),
- convert("foo 2560 "));
- DoDoubleTest(convert("foo %.1G"), val, convert("foo 3E+003"),
- convert("foo 3E+03"));
- DoDoubleTest(convert("foo %.2G"), val, convert("foo 2.6E+003"),
- convert("foo 2.6E+03"));
- DoDoubleTest(convert("foo %.12G"), val, convert("foo 2560.001"),
- convert("foo 2560.001"));
- DoDoubleTest(convert("foo %06G"), val, convert("foo 002560"),
- convert("foo 002560"));
- DoDoubleTest(convert("foo %#G"), val, convert("foo 2560.00"),
- convert("foo 2560.00"));
- DoDoubleTest(convert("foo %+G"), val, convert("foo +2560"),
- convert("foo +2560"));
- DoDoubleTest(convert("foo % G"), val, convert("foo 2560"),
- convert("foo 2560"));
- DoDoubleTest(convert("foo %+G"), neg, convert("foo -2560"),
- convert("foo -2560"));
- DoDoubleTest(convert("foo % G"), neg, convert("foo -2560"),
- convert("foo -2560"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/testinfo.dat
deleted file mode 100644
index f56c80980d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test18/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test18
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with compact format doubles (uppercase).
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/CMakeLists.txt
deleted file mode 100644
index 9c636b8b0a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test19.c
-)
-
-add_executable(paltest_vsnwprintf_test19
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test19 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test19
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/test19.c
deleted file mode 100644
index fea275a242..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/test19.c
+++ /dev/null
@@ -1,139 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test18.c
-**
-** Purpose: Test #18 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-#define DOTEST(a,b,c,d,e) DoTest(a,b,(void*)c,d,e)
-
-void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
- WCHAR *paramstr, WCHAR *checkstr1, WCHAR *checkstr2)
-{
- WCHAR buf[256];
-
- TestVsnwprintf(buf, 256, formatstr, precision, param);
- if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
- memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- paramstr,
- convertC(formatstr),
- precision,
- convertC(checkstr1),
- convertC(checkstr2),
- convertC(buf));
- }
-}
-void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param,
- WCHAR *checkstr1, WCHAR *checkstr2)
-{
- WCHAR buf[256];
-
- TestVsnwprintf(buf, 256, formatstr, precision, param);
- if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
- memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- param, convertC(formatstr),
- precision,
- convertC(checkstr1),
- convertC(checkstr2),
- convertC(buf));
- }
-}
-
-/*
- * Uses memcmp & wcslen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoArgumentPrecTest(convert("%.*s"), 2, convert("bar"), convert("bar"),
- convert("ba"), convert("ba"));
- DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', convert("a"),
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', convert("a"),
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', convert("a"),
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', convert("a"),
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, convert("42"),
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, convert("42"),
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, convert("42"),
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, convert("42"),
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, convert("42"),
- convert("52"), convert("52"));
- DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, convert("42"),
- convert("052"), convert("052"));
- DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, convert("42"),
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, convert("42"),
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, convert("0x42"),
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, convert("0x42"),
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, convert("0x42"),
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, convert("0x42"),
- convert("042"), convert("042"));
-
-
- DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, convert("2.0e+000"),
- convert("2.0e+00"));
- DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, convert("2.010e+000"),
- convert("2.010e+00"));
- DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, convert("2.0E+000"),
- convert("2.0E+00"));
- DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, convert("2.010E+000"),
- convert("2.010E+00"));
- DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, convert("2.0"),
- convert("2.0"));
- DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, convert("2.010"),
- convert("2.010"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, convert("3e+002"),
- convert("3e+02"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, convert("256.01"),
- convert("256.01"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, convert("3E+002"),
- convert("3E+02"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, convert("256.01"),
- convert("256.01"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/testinfo.dat
deleted file mode 100644
index 77178f1471..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test19/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test19
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with argument specified precision.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/CMakeLists.txt
deleted file mode 100644
index 817657ea61..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test2.c
-)
-
-add_executable(paltest_vsnwprintf_test2
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test2 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test2
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/test2.c
deleted file mode 100644
index 20499954db..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/test2.c
+++ /dev/null
@@ -1,40 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test2.c
-**
-** Purpose: Test #2 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv) != 0)
- return(FAIL);
-
- DoWStrTest(convert("foo %s"), convert("bar"), convert("foo bar"));
- DoStrTest(convert("foo %hs"), "bar", convert("foo bar"));
- DoWStrTest(convert("foo %ls"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %ws"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %Ls"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %I64s"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %5s"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %.2s"), convert("bar"), convert("foo ba"));
- DoWStrTest(convert("foo %5.2s"), convert("bar"), convert("foo ba"));
- DoWStrTest(convert("foo %-5s"), convert("bar"), convert("foo bar "));
- DoWStrTest(convert("foo %05s"), convert("bar"), convert("foo 00bar"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/testinfo.dat
deleted file mode 100644
index 429911bd83..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test2/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test2
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with strings.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/CMakeLists.txt
deleted file mode 100644
index 4af3e36f3b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test3.c
-)
-
-add_executable(paltest_vsnwprintf_test3
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test3 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test3
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/test3.c
deleted file mode 100644
index 9a37d3fc4b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/test3.c
+++ /dev/null
@@ -1,40 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test3.c
-**
-** Purpose: Test #3 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv) != 0)
- return(FAIL);
-
- DoStrTest(convert("foo %S"), "bar", convert("foo bar"));
- DoStrTest(convert("foo %hS"), "bar", convert("foo bar"));
- DoWStrTest(convert("foo %lS"), convert("bar"), convert("foo bar"));
- DoWStrTest(convert("foo %wS"), convert("bar"), convert("foo bar"));
- DoStrTest(convert("foo %LS"), "bar", convert("foo bar"));
- DoStrTest(convert("foo %I64S"), "bar", convert("foo bar"));
- DoStrTest(convert("foo %5S"), "bar", convert("foo bar"));
- DoStrTest(convert("foo %.2S"), "bar", convert("foo ba"));
- DoStrTest(convert("foo %5.2S"), "bar", convert("foo ba"));
- DoStrTest(convert("foo %-5S"), "bar", convert("foo bar "));
- DoStrTest(convert("foo %05S"), "bar", convert("foo 00bar"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/testinfo.dat
deleted file mode 100644
index d4e2686763..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test3/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test3
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with wide strings.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/CMakeLists.txt
deleted file mode 100644
index b7ff9e7bb3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test4.c
-)
-
-add_executable(paltest_vsnwprintf_test4
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test4 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test4
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/test4.c
deleted file mode 100644
index 6f39be2a80..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/test4.c
+++ /dev/null
@@ -1,121 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test4.c
-**
-** Purpose: Test #4 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-static void DoPointerTest(WCHAR *formatstr, void* param, WCHAR* paramstr,
- WCHAR *checkstr1)
-{
- WCHAR buf[256] = { 0 };
-
- TestVsnwprintf(buf, 256, formatstr, param);
- if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0)
-
- {
- Fail("ERROR: failed to insert pointer to %#p into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- paramstr,
- convertC(formatstr),
- convertC(checkstr1),
- convertC(buf));
- }
-}
-
-static void DoI64DoubleTest(WCHAR *formatstr, INT64 value, WCHAR *valuestr,
- WCHAR *checkstr1)
-{
- WCHAR buf[256] = { 0 };
-
- TestVsnwprintf(buf, 256, formatstr, value);
- if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\"\n"
- "Expected \"%s\", got \"%s\".\n",
- value,
- convertC(formatstr),
- convertC(checkstr1),
- convertC(buf));
- }
-}
-
-int __cdecl main(int argc, char *argv[])
-{
- void *ptr = (void*) 0x123456;
- INT64 lptr = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
-/*
-** Run only on 64 bit platforms
-*/
-#if defined(BIT64) && defined(PLATFORM_UNIX)
- Trace("Testing for 64 Bit Platforms \n");
- DoPointerTest(convert("%p"), NULL, convert("NULL"), convert("00000000"));
- DoPointerTest(convert("%p"), ptr, convert("pointer to 0x123456"),
- convert("0000000000123456"));
- DoPointerTest(convert("%17p"), ptr, convert("pointer to 0x123456"),
- convert(" 0000000000123456"));
- DoPointerTest(convert("%17p"), ptr, convert("pointer to 0x123456"),
- convert(" 0000000000123456"));
- DoPointerTest(convert("%-17p"), ptr, convert("pointer to 0x123456"),
- convert("0000000000123456 "));
- DoPointerTest(convert("%+p"), ptr, convert("pointer to 0x123456"),
- convert("0000000000123456"));
- DoPointerTest(convert("%#p"), ptr, convert("pointer to 0x123456"),
- convert("0X0000000000123456"));
- DoPointerTest(convert("%lp"), ptr, convert("pointer to 0x123456"),
- convert("00123456"));
- DoPointerTest(convert("%hp"), ptr, convert("pointer to 0x123456"),
- convert("00003456"));
- DoPointerTest(convert("%Lp"), ptr, convert("pointer to 0x123456"),
- convert("00123456"));
- DoI64DoubleTest(convert("%I64p"), lptr,
- convert("pointer to 0x1234567887654321"),
- convert("1234567887654321"));
-
-#else
- Trace("Testing for Non 64 Bit Platforms \n");
- DoPointerTest(convert("%p"), NULL, convert("NULL"), convert("00000000"));
- DoPointerTest(convert("%p"), ptr, convert("pointer to 0x123456"),
- convert("00123456"));
- DoPointerTest(convert("%9p"), ptr, convert("pointer to 0x123456"),
- convert(" 00123456"));
- DoPointerTest(convert("%09p"), ptr, convert("pointer to 0x123456"),
- convert(" 00123456"));
- DoPointerTest(convert("%-9p"), ptr, convert("pointer to 0x123456"),
- convert("00123456 "));
- DoPointerTest(convert("%+p"), ptr, convert("pointer to 0x123456"),
- convert("00123456"));
- DoPointerTest(convert("%#p"), ptr, convert("pointer to 0x123456"),
- convert("0X00123456"));
- DoPointerTest(convert("%lp"), ptr, convert("pointer to 0x123456"),
- convert("00123456"));
- DoPointerTest(convert("%hp"), ptr, convert("pointer to 0x123456"),
- convert("00003456"));
- DoPointerTest(convert("%Lp"), ptr, convert("pointer to 0x123456"),
- convert("00123456"));
- DoI64DoubleTest(convert("%I64p"), lptr,
- convert("pointer to 0x1234567887654321"),
- convert("1234567887654321"));
-#endif
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/testinfo.dat
deleted file mode 100644
index 56f488a66a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test4/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test4
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with pointers.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/CMakeLists.txt
deleted file mode 100644
index 9b316b9f90..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test5.c
-)
-
-add_executable(paltest_vsnwprintf_test5
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test5 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test5
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/test5.c
deleted file mode 100644
index 224db766ff..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/test5.c
+++ /dev/null
@@ -1,81 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test5.c
-**
-** Purpose: Test #5 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-static void DoTest(WCHAR *formatstr, int param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
- int n = -1;
-
- TestVsnwprintf(buf, 256, formatstr, &n);
-
- if (n != param)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %d\n",
- param, n);
- }
-
- if (memcmp(buf, checkstr, wcslen(buf)*2 + 2) != 0)
- {
- Fail("ERROR: Expected \"%s\" got \"%s\".\n",
- convertC(checkstr), convertC(buf));
- }
-}
-
-static void DoShortTest(WCHAR *formatstr, int param, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
- short int n = -1;
-
- TestVsnwprintf(buf, 256, formatstr, &n);
-
- if (n != param)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %d\n",
- param, n);
- }
-
- if (memcmp(buf, checkstr, wcslen(buf)*2 + 2) != 0)
- {
- Fail("ERROR: Expected \"%s\" got \"%s\".\n",
- convertC(checkstr), convertC(buf));
- }
-}
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoTest(convert("foo %n bar"), 4, convert("foo bar"));
- DoTest(convert("foo %#n bar"), 4, convert("foo bar"));
- DoTest(convert("foo % n bar"), 4, convert("foo bar"));
- DoTest(convert("foo %+n bar"), 4, convert("foo bar"));
- DoTest(convert("foo %-n bar"), 4, convert("foo bar"));
- DoTest(convert("foo %0n bar"), 4, convert("foo bar"));
- DoShortTest(convert("foo %hn bar"), 4, convert("foo bar"));
- DoTest(convert("foo %ln bar"), 4, convert("foo bar"));
- DoTest(convert("foo %Ln bar"), 4, convert("foo bar"));
- DoTest(convert("foo %I64n bar"), 4, convert("foo bar"));
- DoTest(convert("foo %20.3n bar"), 4, convert("foo bar"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/testinfo.dat
deleted file mode 100644
index 35d3816a76..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test5/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test5
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with the count specifier.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/CMakeLists.txt
deleted file mode 100644
index d3fad03597..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test6.c
-)
-
-add_executable(paltest_vsnwprintf_test6
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test6 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test6
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/test6.c
deleted file mode 100644
index 1bd83ea85c..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/test6.c
+++ /dev/null
@@ -1,43 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test6.c
-**
-** Purpose: Test #6 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR wc = (WCHAR) 'c';
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoWCharTest(convert("foo %c"), wc, convert("foo c"));
- DoCharTest(convert("foo %hc"), 'b', convert("foo b"));
- DoWCharTest(convert("foo %lc"), wc, convert("foo c"));
- DoWCharTest(convert("foo %Lc"), wc, convert("foo c"));
- DoWCharTest(convert("foo %I64c"), wc, convert("foo c"));
- DoWCharTest(convert("foo %5c"), wc, convert("foo c"));
- DoWCharTest(convert("foo %.0c"), wc, convert("foo c"));
- DoWCharTest(convert("foo %-5c"), wc, convert("foo c "));
- DoWCharTest(convert("foo %05c"), wc, convert("foo 0000c"));
- DoWCharTest(convert("foo % c"), wc, convert("foo c"));
- DoWCharTest(convert("foo %#c"), wc, convert("foo c"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/testinfo.dat
deleted file mode 100644
index 6afe96d1cd..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test6/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test6
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with characters.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/CMakeLists.txt
deleted file mode 100644
index cede861358..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test7.c
-)
-
-add_executable(paltest_vsnwprintf_test7
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test7 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test7
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/test7.c
deleted file mode 100644
index e13798b784..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/test7.c
+++ /dev/null
@@ -1,43 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test7.c
-**
-** Purpose: Test #7 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR wc = (WCHAR) 'c';
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoCharTest(convert("foo %C"), 'b', convert("foo b"));
- DoWCharTest(convert("foo %hC"), wc, convert("foo c"));
- DoCharTest(convert("foo %lC"), 'b', convert("foo b"));
- DoCharTest(convert("foo %LC"), 'b', convert("foo b"));
- DoCharTest(convert("foo %I64C"), 'b', convert("foo b"));
- DoCharTest(convert("foo %5C"), 'b', convert("foo b"));
- DoCharTest(convert("foo %.0C"), 'b', convert("foo b"));
- DoCharTest(convert("foo %-5C"), 'b', convert("foo b "));
- DoCharTest(convert("foo %05C"), 'b', convert("foo 0000b"));
- DoCharTest(convert("foo % C"), 'b', convert("foo b"));
- DoCharTest(convert("foo %#C"), 'b', convert("foo b"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/testinfo.dat
deleted file mode 100644
index ece40aa195..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test7/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test7
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with wide characters.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/CMakeLists.txt
deleted file mode 100644
index 846e7b9219..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test8.c
-)
-
-add_executable(paltest_vsnwprintf_test8
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test8 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test8
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/test8.c
deleted file mode 100644
index 8f02412eb0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/test8.c
+++ /dev/null
@@ -1,49 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test8.c
-**
-** Purpose: Test #8 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoNumTest(convert("foo %d"), pos, convert("foo 42"));
- DoNumTest(convert("foo %ld"), 0xFFFF, convert("foo 65535"));
- DoNumTest(convert("foo %hd"), 0xFFFF, convert("foo -1"));
- DoNumTest(convert("foo %Ld"), pos, convert("foo 42"));
- DoI64NumTest(convert("foo %I64d"), l, "42", convert("foo 42"));
- DoNumTest(convert("foo %3d"), pos, convert("foo 42"));
- DoNumTest(convert("foo %-3d"), pos, convert("foo 42 "));
- DoNumTest(convert("foo %.1d"), pos, convert("foo 42"));
- DoNumTest(convert("foo %.3d"), pos, convert("foo 042"));
- DoNumTest(convert("foo %03d"), pos, convert("foo 042"));
- DoNumTest(convert("foo %#d"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+d"), pos, convert("foo +42"));
- DoNumTest(convert("foo % d"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+d"), neg, convert("foo -42"));
- DoNumTest(convert("foo % d"), neg, convert("foo -42"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/testinfo.dat
deleted file mode 100644
index d7a567a6d6..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test8/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test8
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with decimal numbers.
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/CMakeLists.txt
deleted file mode 100644
index e25eded172..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test9.c
-)
-
-add_executable(paltest_vsnwprintf_test9
- ${SOURCES}
-)
-
-add_dependencies(paltest_vsnwprintf_test9 coreclrpal)
-
-target_link_libraries(paltest_vsnwprintf_test9
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/test9.c
deleted file mode 100644
index 7b5b6cd8a6..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/test9.c
+++ /dev/null
@@ -1,49 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test9.c
-**
-** Purpose: Test #9 for the _vsnwprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../_vsnwprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoNumTest(convert("foo %i"), pos, convert("foo 42"));
- DoNumTest(convert("foo %li"), 0xFFFF, convert("foo 65535"));
- DoNumTest(convert("foo %hi"), 0xFFFF, convert("foo -1"));
- DoNumTest(convert("foo %Li"), pos, convert("foo 42"));
- DoI64NumTest(convert("foo %I64i"), l, "42", convert("foo 42"));
- DoNumTest(convert("foo %3i"), pos, convert("foo 42"));
- DoNumTest(convert("foo %-3i"), pos, convert("foo 42 "));
- DoNumTest(convert("foo %.1i"), pos, convert("foo 42"));
- DoNumTest(convert("foo %.3i"), pos, convert("foo 042"));
- DoNumTest(convert("foo %03i"), pos, convert("foo 042"));
- DoNumTest(convert("foo %#i"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+i"), pos, convert("foo +42"));
- DoNumTest(convert("foo % i"), pos, convert("foo 42"));
- DoNumTest(convert("foo %+i"), neg, convert("foo -42"));
- DoNumTest(convert("foo % i"), neg, convert("foo -42"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/testinfo.dat
deleted file mode 100644
index 726b060240..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_vsnwprintf/test9/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _vsnwprintf
-Name = Positive Test for _vsnwprintf
-TYPE = DEFAULT
-EXE1 = test9
-Description
-= Tests the PAL implementation of the _vsnwprintf function.
-= Tests _vsnwprintf with integer numbers
-= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/CMakeLists.txt
new file mode 100644
index 0000000000..8fe1cb60ac
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/CMakeLists.txt
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
+add_subdirectory(test10)
+add_subdirectory(test11)
+add_subdirectory(test12)
+add_subdirectory(test13)
+add_subdirectory(test14)
+add_subdirectory(test15)
+add_subdirectory(test16)
+add_subdirectory(test17)
+add_subdirectory(test18)
+add_subdirectory(test19)
+add_subdirectory(test2)
+add_subdirectory(test3)
+add_subdirectory(test4)
+add_subdirectory(test6)
+add_subdirectory(test7)
+add_subdirectory(test8)
+add_subdirectory(test9)
+
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/_vsnwprintf_s.h b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/_vsnwprintf_s.h
new file mode 100644
index 0000000000..34cf411c25
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/_vsnwprintf_s.h
@@ -0,0 +1,133 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: _vsnwprintf_s.h
+**
+** Purpose: Containts common testing functions for _vsnwprintf_s
+**
+**
+**==========================================================================*/
+
+#ifndef ___VSNWPRINTF_H__
+#define ___VSNWPRINTF_H__
+
+/* These functions leaks memory like crazy. C'est la vie. */
+int TestVsnwprintf_s(wchar_t* buf, size_t count, const wchar_t* format, ...)
+{
+ int retVal = 0;
+ va_list arglist;
+
+ va_start(arglist, format);
+ retVal = _vsnwprintf_s(buf, count, _TRUNCATE, format, arglist);
+ va_end(arglist);
+
+ return( retVal);
+}
+
+
+void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ TestVsnwprintf_s(buf, 256, formatstr, param);
+
+ if (memcmp(buf, checkstr, wcslen(buf) * 2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n"
+ "Expected \"%s\", got \"%s\".\n",
+ convertC(param), convertC(formatstr),
+ convertC(checkstr), convertC(buf));
+ }
+}
+
+void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ TestVsnwprintf_s(buf, 256, formatstr, param);
+
+ if (memcmp(buf, checkstr, wcslen(buf) * 2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert wide string \"%s\" into \"%s\".\n"
+ "Expected \"%s\", got \"%s\".\n",
+ param, convertC(formatstr), convertC(checkstr),
+ convertC(buf));
+ }
+}
+
+void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ TestVsnwprintf_s(buf, 256, formatstr, param);
+ if (memcmp(buf, checkstr, wcslen(buf)*2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ param, param, convertC(formatstr), convertC(checkstr),
+ convertC(buf));
+ }
+}
+
+void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ TestVsnwprintf_s(buf, 256, formatstr, param);
+ if (memcmp(buf, checkstr, wcslen(buf)*2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ (char) param, param, convertC(formatstr),
+ convertC(checkstr), convertC(buf));
+ }
+}
+
+void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ TestVsnwprintf_s(buf, 256, formatstr, value);
+ if (memcmp(buf, checkstr, wcslen(buf)* 2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %#x into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n", value, convertC(formatstr),
+ convertC(checkstr), convertC(buf));
+ }
+}
+
+void DoI64NumTest(const WCHAR *formatstr, INT64 value, char *valuestr, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+
+ TestVsnwprintf_s(buf, 256, formatstr, value);
+ if (memcmp(buf, checkstr, wcslen(buf)* 2 + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n", valuestr, convertC(formatstr),
+ convertC(checkstr), convertC(buf));
+ }
+}
+void DoDoubleTest(const WCHAR *formatstr, double value,
+ const WCHAR *checkstr1, const WCHAR *checkstr2)
+{
+ WCHAR buf[256] = { 0 };
+
+ TestVsnwprintf_s(buf, 256, formatstr, value);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
+ memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %f into \"%s\"\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ value,
+ convertC(formatstr),
+ convertC(checkstr1),
+ convertC(checkstr2),
+ convertC(buf));
+ }
+}
+
+#endif
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/CMakeLists.txt
new file mode 100644
index 0000000000..d1245168f3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.cpp
+)
+
+add_executable(paltest_vsnwprintf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test1 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/test1.cpp
new file mode 100644
index 0000000000..4a7a02e778
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/test1.cpp
@@ -0,0 +1,60 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test #1 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR *checkstr;
+ WCHAR buf[256] = { 0 };
+ int ret;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ checkstr = convert("hello world");
+ TestVsnwprintf_s(buf, 256, checkstr);
+ if (memcmp(checkstr, buf, wcslen(checkstr)*2+2) != 0)
+ {
+ Fail("ERROR: Expected \"%s\", got \"%s\"\n",
+ convertC(checkstr), convertC(buf));
+ }
+
+ TestVsnwprintf_s(buf, 256, convert("xxxxxxxxxxxxxxxxx"));
+ ret = TestVsnwprintf_s(buf, 8, checkstr);
+ if ((memcmp(checkstr, buf, 14)) != 0 || (buf[7] != 0))
+ {
+ Fail("ERROR: Expected \"%8s\", got \"%8s\"\n",
+ convertC(checkstr), convertC(buf));
+ }
+ if (ret >= 0)
+ {
+ Fail("ERROR: Expected negative return value, got %d.\n", ret);
+ }
+ if (buf[8] != (WCHAR) 'x')
+ {
+ Fail("ERROR: buffer overflow using \"%s\" with length 8.\n",
+ convertC(checkstr));
+ }
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/testinfo.dat
new file mode 100644
index 0000000000..450c5b9034
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test1/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= General test to see if _vsnwprintf_s works correctly.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/CMakeLists.txt
new file mode 100644
index 0000000000..6367964f1d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test10.cpp
+)
+
+add_executable(paltest_vsnwprintf_test10
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test10 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test10
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/test10.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/test10.cpp
new file mode 100644
index 0000000000..e33f2281df
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/test10.cpp
@@ -0,0 +1,50 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test10.c
+**
+** Purpose: Test #10 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoNumTest(convert("foo %o"), pos, convert("foo 52"));
+ DoNumTest(convert("foo %lo"), 0xFFFF, convert("foo 177777"));
+ DoNumTest(convert("foo %ho"), 0xFFFF, convert("foo 177777"));
+ DoNumTest(convert("foo %Lo"), pos, convert("foo 52"));
+ DoI64NumTest(convert("foo %I64o"), l, "42", convert("foo 52"));
+ DoNumTest(convert("foo %3o"), pos, convert("foo 52"));
+ DoNumTest(convert("foo %-3o"), pos, convert("foo 52 "));
+ DoNumTest(convert("foo %.1o"), pos, convert("foo 52"));
+ DoNumTest(convert("foo %.3o"), pos, convert("foo 052"));
+ DoNumTest(convert("foo %03o"), pos, convert("foo 052"));
+ DoNumTest(convert("foo %#o"), pos, convert("foo 052"));
+ DoNumTest(convert("foo %+o"), pos, convert("foo 52"));
+ DoNumTest(convert("foo % o"), pos, convert("foo 52"));
+ DoNumTest(convert("foo %+o"), neg, convert("foo 37777777726"));
+ DoNumTest(convert("foo % o"), neg, convert("foo 37777777726"));
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/testinfo.dat
new file mode 100644
index 0000000000..59af082f49
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test10/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test10
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with octal numbers.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/CMakeLists.txt
new file mode 100644
index 0000000000..b45fd0ed1e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test11.cpp
+)
+
+add_executable(paltest_vsnwprintf_test11
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test11 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test11
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/test11.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/test11.cpp
new file mode 100644
index 0000000000..4e860bbc21
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/test11.cpp
@@ -0,0 +1,50 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test11.c
+**
+** Purpose: Test #11 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoNumTest(convert("foo %u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %lu"), 0xFFFF, convert("foo 65535"));
+ DoNumTest(convert("foo %hu"), 0xFFFF, convert("foo 65535"));
+ DoNumTest(convert("foo %Lu"), pos, convert("foo 42"));
+ DoI64NumTest(convert("foo %I64u"), l, "42", convert("foo 42"));
+ DoNumTest(convert("foo %3u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %-3u"), pos, convert("foo 42 "));
+ DoNumTest(convert("foo %.1u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %.3u"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %03u"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %#u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo % u"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+u"), neg, convert("foo 4294967254"));
+ DoNumTest(convert("foo % u"), neg, convert("foo 4294967254"));
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/testinfo.dat
new file mode 100644
index 0000000000..10c0014fca
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test11/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test11
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with unsigned numbers.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/CMakeLists.txt
new file mode 100644
index 0000000000..2a15b198c0
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test12.cpp
+)
+
+add_executable(paltest_vsnwprintf_test12
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test12 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test12
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/test12.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/test12.cpp
new file mode 100644
index 0000000000..2dcfcf5998
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/test12.cpp
@@ -0,0 +1,50 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test12.c
+**
+** Purpose: Test #12 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 0x1234ab;
+ INT64 l = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoNumTest(convert("foo %x"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo %lx"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo %hx"), pos, convert("foo 34ab"));
+ DoNumTest(convert("foo %Lx"), pos, convert("foo 1234ab"));
+ DoI64NumTest(convert("foo %I64x"), l, "0x1234567887654321",
+ convert("foo 1234567887654321"));
+ DoNumTest(convert("foo %7x"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo %-7x"), pos, convert("foo 1234ab "));
+ DoNumTest(convert("foo %.1x"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo %.7x"), pos, convert("foo 01234ab"));
+ DoNumTest(convert("foo %07x"), pos, convert("foo 01234ab"));
+ DoNumTest(convert("foo %#x"), pos, convert("foo 0x1234ab"));
+ DoNumTest(convert("foo %+x"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo % x"), pos, convert("foo 1234ab"));
+ DoNumTest(convert("foo %+x"), neg, convert("foo ffffffd6"));
+ DoNumTest(convert("foo % x"), neg, convert("foo ffffffd6"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/testinfo.dat
new file mode 100644
index 0000000000..de089895b9
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test12/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test12
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with hex numbers (lowercase).
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/CMakeLists.txt
new file mode 100644
index 0000000000..01ab97cc62
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test13.cpp
+)
+
+add_executable(paltest_vsnwprintf_test13
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test13 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test13
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/test13.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/test13.cpp
new file mode 100644
index 0000000000..c95278a56b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/test13.cpp
@@ -0,0 +1,50 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test13.c
+**
+** Purpose: Test #13 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 0x1234ab;
+ INT64 l = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoNumTest(convert("foo %X"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo %lX"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo %hX"), pos, convert("foo 34AB"));
+ DoNumTest(convert("foo %LX"), pos, convert("foo 1234AB"));
+ DoI64NumTest(convert("foo %I64X"), l, "0x1234567887654321",
+ convert("foo 1234567887654321"));
+ DoNumTest(convert("foo %7X"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo %-7X"), pos, convert("foo 1234AB "));
+ DoNumTest(convert("foo %.1X"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo %.7X"), pos, convert("foo 01234AB"));
+ DoNumTest(convert("foo %07X"), pos, convert("foo 01234AB"));
+ DoNumTest(convert("foo %#X"), pos, convert("foo 0X1234AB"));
+ DoNumTest(convert("foo %+X"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo % X"), pos, convert("foo 1234AB"));
+ DoNumTest(convert("foo %+X"), neg, convert("foo FFFFFFD6"));
+ DoNumTest(convert("foo % X"), neg, convert("foo FFFFFFD6"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/testinfo.dat
new file mode 100644
index 0000000000..94479d527c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test13/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test13
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with hex numbers (uppercase).
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/CMakeLists.txt
new file mode 100644
index 0000000000..c6c990312f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test14.cpp
+)
+
+add_executable(paltest_vsnwprintf_test14
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test14 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test14
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/test14.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/test14.cpp
new file mode 100644
index 0000000000..cab1b247df
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/test14.cpp
@@ -0,0 +1,63 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test14.c
+**
+** Purpose: Test #14 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 256.0;
+ double neg = -256.0;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoDoubleTest(convert("foo %e"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %le"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %he"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %Le"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %I64e"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %14e"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %-14e"), val, convert("foo 2.560000e+002 "),
+ convert("foo 2.560000e+02 "));
+ DoDoubleTest(convert("foo %.1e"), val, convert("foo 2.6e+002"),
+ convert("foo 2.6e+02"));
+ DoDoubleTest(convert("foo %.8e"), val, convert("foo 2.56000000e+002"),
+ convert("foo 2.56000000e+02"));
+ DoDoubleTest(convert("foo %014e"), val, convert("foo 02.560000e+002"),
+ convert("foo 002.560000e+02"));
+ DoDoubleTest(convert("foo %#e"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %+e"), val, convert("foo +2.560000e+002"),
+ convert("foo +2.560000e+02"));
+ DoDoubleTest(convert("foo % e"), val, convert("foo 2.560000e+002"),
+ convert("foo 2.560000e+02"));
+ DoDoubleTest(convert("foo %+e"), neg, convert("foo -2.560000e+002"),
+ convert("foo -2.560000e+02"));
+ DoDoubleTest(convert("foo % e"), neg, convert("foo -2.560000e+002"),
+ convert("foo -2.560000e+02"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/testinfo.dat
new file mode 100644
index 0000000000..0d46d97649
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test14/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test14
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with exponential format doubles (lowercase).
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/CMakeLists.txt
new file mode 100644
index 0000000000..e1a32b1825
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test15.cpp
+)
+
+add_executable(paltest_vsnwprintf_test15
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test15 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test15
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/test15.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/test15.cpp
new file mode 100644
index 0000000000..d5738991a6
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/test15.cpp
@@ -0,0 +1,64 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test15.c
+**
+** Purpose: Test #15 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 256.0;
+ double neg = -256.0;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoDoubleTest(convert("foo %E"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %lE"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %hE"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %LE"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %I64E"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %14E"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %-14E"), val, convert("foo 2.560000E+002 "),
+ convert("foo 2.560000E+02 "));
+ DoDoubleTest(convert("foo %.1E"), val, convert("foo 2.6E+002"),
+ convert("foo 2.6E+02"));
+ DoDoubleTest(convert("foo %.8E"), val, convert("foo 2.56000000E+002"),
+ convert("foo 2.56000000E+02"));
+ DoDoubleTest(convert("foo %014E"), val, convert("foo 02.560000E+002"),
+ convert("foo 002.560000E+02"));
+ DoDoubleTest(convert("foo %#E"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %+E"), val, convert("foo +2.560000E+002"),
+ convert("foo +2.560000E+02"));
+ DoDoubleTest(convert("foo % E"), val, convert("foo 2.560000E+002"),
+ convert("foo 2.560000E+02"));
+ DoDoubleTest(convert("foo %+E"), neg, convert("foo -2.560000E+002"),
+ convert("foo -2.560000E+02"));
+ DoDoubleTest(convert("foo % E"), neg, convert("foo -2.560000E+002"),
+ convert("foo -2.560000E+002"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/testinfo.dat
new file mode 100644
index 0000000000..7737f49a35
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test15/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test15
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with exponential format doubles (uppercase).
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/CMakeLists.txt
new file mode 100644
index 0000000000..9e2b25b308
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test16.cpp
+)
+
+add_executable(paltest_vsnwprintf_test16
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test16 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test16
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/test16.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/test16.cpp
new file mode 100644
index 0000000000..72c546eb63
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/test16.cpp
@@ -0,0 +1,63 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test16.c
+**
+** Purpose: Test #16 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoDoubleTest(convert("foo %f"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %lf"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %hf"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %Lf"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %I64f"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %12f"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %-12f"), val, convert("foo 2560.001000 "),
+ convert("foo 2560.001000 "));
+ DoDoubleTest(convert("foo %.1f"), val, convert("foo 2560.0"),
+ convert("foo 2560.0"));
+ DoDoubleTest(convert("foo %.8f"), val, convert("foo 2560.00100000"),
+ convert("foo 2560.00100000"));
+ DoDoubleTest(convert("foo %012f"), val, convert("foo 02560.001000"),
+ convert("foo 02560.001000"));
+ DoDoubleTest(convert("foo %#f"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %+f"), val, convert("foo +2560.001000"),
+ convert("foo +2560.001000"));
+ DoDoubleTest(convert("foo % f"), val, convert("foo 2560.001000"),
+ convert("foo 2560.001000"));
+ DoDoubleTest(convert("foo %+f"), neg, convert("foo -2560.001000"),
+ convert("foo -2560.001000"));
+ DoDoubleTest(convert("foo % f"), neg, convert("foo -2560.001000"),
+ convert("foo -2560.001000"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/testinfo.dat
new file mode 100644
index 0000000000..9aec1c008a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test16/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test16
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with decimal point format doubles.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/CMakeLists.txt
new file mode 100644
index 0000000000..2d8ba31a08
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test17.cpp
+)
+
+add_executable(paltest_vsnwprintf_test17
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test17 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test17
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/test17.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/test17.cpp
new file mode 100644
index 0000000000..e6860b930f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/test17.cpp
@@ -0,0 +1,65 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test17.c
+**
+** Purpose: Test #17 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoDoubleTest(convert("foo %g"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %lg"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %hg"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %Lg"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %I64g"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %5g"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %-5g"), val, convert("foo 2560 "),
+ convert("foo 2560 "));
+ DoDoubleTest(convert("foo %.1g"), val, convert("foo 3e+003"),
+ convert("foo 3e+03"));
+ DoDoubleTest(convert("foo %.2g"), val, convert("foo 2.6e+003"),
+ convert("foo 2.6e+03"));
+ DoDoubleTest(convert("foo %.12g"), val, convert("foo 2560.001"),
+ convert("foo 2560.001"));
+ DoDoubleTest(convert("foo %06g"), val, convert("foo 002560"),
+ convert("foo 002560"));
+ DoDoubleTest(convert("foo %#g"), val, convert("foo 2560.00"),
+ convert("foo 2560.00"));
+ DoDoubleTest(convert("foo %+g"), val, convert("foo +2560"),
+ convert("foo +2560"));
+ DoDoubleTest(convert("foo % g"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %+g"), neg, convert("foo -2560"),
+ convert("foo -2560"));
+ DoDoubleTest(convert("foo % g"), neg, convert("foo -2560"),
+ convert("foo -2560"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/testinfo.dat
new file mode 100644
index 0000000000..1487b7a17e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test17/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test17
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with compact format doubles (lowercase).
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/CMakeLists.txt
new file mode 100644
index 0000000000..503856c2f3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test18.cpp
+)
+
+add_executable(paltest_vsnwprintf_test18
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test18 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test18
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/test18.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/test18.cpp
new file mode 100644
index 0000000000..a164edbc0f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/test18.cpp
@@ -0,0 +1,65 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test18.c
+**
+** Purpose: Test #18 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoDoubleTest(convert("foo %G"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %lG"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %hG"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %LG"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %I64G"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %5G"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %-5G"), val, convert("foo 2560 "),
+ convert("foo 2560 "));
+ DoDoubleTest(convert("foo %.1G"), val, convert("foo 3E+003"),
+ convert("foo 3E+03"));
+ DoDoubleTest(convert("foo %.2G"), val, convert("foo 2.6E+003"),
+ convert("foo 2.6E+03"));
+ DoDoubleTest(convert("foo %.12G"), val, convert("foo 2560.001"),
+ convert("foo 2560.001"));
+ DoDoubleTest(convert("foo %06G"), val, convert("foo 002560"),
+ convert("foo 002560"));
+ DoDoubleTest(convert("foo %#G"), val, convert("foo 2560.00"),
+ convert("foo 2560.00"));
+ DoDoubleTest(convert("foo %+G"), val, convert("foo +2560"),
+ convert("foo +2560"));
+ DoDoubleTest(convert("foo % G"), val, convert("foo 2560"),
+ convert("foo 2560"));
+ DoDoubleTest(convert("foo %+G"), neg, convert("foo -2560"),
+ convert("foo -2560"));
+ DoDoubleTest(convert("foo % G"), neg, convert("foo -2560"),
+ convert("foo -2560"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/testinfo.dat
new file mode 100644
index 0000000000..54c4e87c89
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test18/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test18
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with compact format doubles (uppercase).
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/CMakeLists.txt
new file mode 100644
index 0000000000..68485eff12
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test19.cpp
+)
+
+add_executable(paltest_vsnwprintf_test19
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test19 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test19
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/test19.cpp
new file mode 100644
index 0000000000..c2a85478ae
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/test19.cpp
@@ -0,0 +1,139 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test18.c
+**
+** Purpose: Test #18 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+#define DOTEST(a,b,c,d,e) DoTest(a,b,(void*)c,d,e)
+
+void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
+ WCHAR *paramstr, WCHAR *checkstr1, WCHAR *checkstr2)
+{
+ WCHAR buf[256];
+
+ TestVsnwprintf_s(buf, 256, formatstr, precision, param);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
+ memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ paramstr,
+ convertC(formatstr),
+ precision,
+ convertC(checkstr1),
+ convertC(checkstr2),
+ convertC(buf));
+ }
+}
+void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param,
+ WCHAR *checkstr1, WCHAR *checkstr2)
+{
+ WCHAR buf[256];
+
+ TestVsnwprintf_s(buf, 256, formatstr, precision, param);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
+ memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ param, convertC(formatstr),
+ precision,
+ convertC(checkstr1),
+ convertC(checkstr2),
+ convertC(buf));
+ }
+}
+
+/*
+ * Uses memcmp & wcslen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoArgumentPrecTest(convert("%.*s"), 2, (void*)convert("bar"), convert("bar"),
+ convert("ba"), convert("ba"));
+ DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', convert("a"),
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', convert("a"),
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', convert("a"),
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', convert("a"),
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, convert("42"),
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, convert("42"),
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, convert("42"),
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, convert("42"),
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, convert("42"),
+ convert("52"), convert("52"));
+ DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, convert("42"),
+ convert("052"), convert("052"));
+ DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, convert("42"),
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, convert("42"),
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, convert("0x42"),
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, convert("0x42"),
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, convert("0x42"),
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, convert("0x42"),
+ convert("042"), convert("042"));
+
+
+ DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, convert("2.0e+000"),
+ convert("2.0e+00"));
+ DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, convert("2.010e+000"),
+ convert("2.010e+00"));
+ DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, convert("2.0E+000"),
+ convert("2.0E+00"));
+ DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, convert("2.010E+000"),
+ convert("2.010E+00"));
+ DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, convert("2.0"),
+ convert("2.0"));
+ DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, convert("2.010"),
+ convert("2.010"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, convert("3e+002"),
+ convert("3e+02"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, convert("256.01"),
+ convert("256.01"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, convert("3E+002"),
+ convert("3E+02"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, convert("256.01"),
+ convert("256.01"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/testinfo.dat
new file mode 100644
index 0000000000..2913e30406
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test19/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test19
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with argument specified precision.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/CMakeLists.txt
new file mode 100644
index 0000000000..a512be6e47
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test2.cpp
+)
+
+add_executable(paltest_vsnwprintf_test2
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test2 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test2
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/test2.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/test2.cpp
new file mode 100644
index 0000000000..18e5adffd3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/test2.cpp
@@ -0,0 +1,40 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test2.c
+**
+** Purpose: Test #2 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv) != 0)
+ return(FAIL);
+
+ DoWStrTest(convert("foo %s"), convert("bar"), convert("foo bar"));
+ DoStrTest(convert("foo %hs"), "bar", convert("foo bar"));
+ DoWStrTest(convert("foo %ls"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %ws"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %Ls"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %I64s"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %5s"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %.2s"), convert("bar"), convert("foo ba"));
+ DoWStrTest(convert("foo %5.2s"), convert("bar"), convert("foo ba"));
+ DoWStrTest(convert("foo %-5s"), convert("bar"), convert("foo bar "));
+ DoWStrTest(convert("foo %05s"), convert("bar"), convert("foo 00bar"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/testinfo.dat
new file mode 100644
index 0000000000..5b9b6292dc
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test2/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test2
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with strings.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/CMakeLists.txt
new file mode 100644
index 0000000000..7991c25afc
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test3.cpp
+)
+
+add_executable(paltest_vsnwprintf_test3
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test3 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test3
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/test3.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/test3.cpp
new file mode 100644
index 0000000000..5e2bfa21a0
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/test3.cpp
@@ -0,0 +1,40 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test3.c
+**
+** Purpose: Test #3 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv) != 0)
+ return(FAIL);
+
+ DoStrTest(convert("foo %S"), "bar", convert("foo bar"));
+ DoStrTest(convert("foo %hS"), "bar", convert("foo bar"));
+ DoWStrTest(convert("foo %lS"), convert("bar"), convert("foo bar"));
+ DoWStrTest(convert("foo %wS"), convert("bar"), convert("foo bar"));
+ DoStrTest(convert("foo %LS"), "bar", convert("foo bar"));
+ DoStrTest(convert("foo %I64S"), "bar", convert("foo bar"));
+ DoStrTest(convert("foo %5S"), "bar", convert("foo bar"));
+ DoStrTest(convert("foo %.2S"), "bar", convert("foo ba"));
+ DoStrTest(convert("foo %5.2S"), "bar", convert("foo ba"));
+ DoStrTest(convert("foo %-5S"), "bar", convert("foo bar "));
+ DoStrTest(convert("foo %05S"), "bar", convert("foo 00bar"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/testinfo.dat
new file mode 100644
index 0000000000..62160695e6
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test3/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test3
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with wide strings.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/CMakeLists.txt
new file mode 100644
index 0000000000..18f5d02df2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test4.cpp
+)
+
+add_executable(paltest_vsnwprintf_test4
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test4 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test4
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/test4.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/test4.cpp
new file mode 100644
index 0000000000..3627ff8bc8
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/test4.cpp
@@ -0,0 +1,121 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test4.c
+**
+** Purpose: Test #4 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+static void DoPointerTest(WCHAR *formatstr, void* param, WCHAR* paramstr,
+ WCHAR *checkstr1)
+{
+ WCHAR buf[256] = { 0 };
+
+ TestVsnwprintf_s(buf, 256, formatstr, param);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0)
+
+ {
+ Fail("ERROR: failed to insert pointer to %#p into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ paramstr,
+ convertC(formatstr),
+ convertC(checkstr1),
+ convertC(buf));
+ }
+}
+
+static void DoI64DoubleTest(WCHAR *formatstr, INT64 value, WCHAR *valuestr,
+ WCHAR *checkstr1)
+{
+ WCHAR buf[256] = { 0 };
+
+ TestVsnwprintf_s(buf, 256, formatstr, value);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\"\n"
+ "Expected \"%s\", got \"%s\".\n",
+ value,
+ convertC(formatstr),
+ convertC(checkstr1),
+ convertC(buf));
+ }
+}
+
+int __cdecl main(int argc, char *argv[])
+{
+ void *ptr = (void*) 0x123456;
+ INT64 lptr = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+/*
+** Run only on 64 bit platforms
+*/
+#if defined(BIT64) && defined(PLATFORM_UNIX)
+ Trace("Testing for 64 Bit Platforms \n");
+ DoPointerTest(convert("%p"), NULL, convert("NULL"), convert("00000000"));
+ DoPointerTest(convert("%p"), ptr, convert("pointer to 0x123456"),
+ convert("0000000000123456"));
+ DoPointerTest(convert("%17p"), ptr, convert("pointer to 0x123456"),
+ convert(" 0000000000123456"));
+ DoPointerTest(convert("%17p"), ptr, convert("pointer to 0x123456"),
+ convert(" 0000000000123456"));
+ DoPointerTest(convert("%-17p"), ptr, convert("pointer to 0x123456"),
+ convert("0000000000123456 "));
+ DoPointerTest(convert("%+p"), ptr, convert("pointer to 0x123456"),
+ convert("0000000000123456"));
+ DoPointerTest(convert("%#p"), ptr, convert("pointer to 0x123456"),
+ convert("0X0000000000123456"));
+ DoPointerTest(convert("%lp"), ptr, convert("pointer to 0x123456"),
+ convert("00123456"));
+ DoPointerTest(convert("%hp"), ptr, convert("pointer to 0x123456"),
+ convert("00003456"));
+ DoPointerTest(convert("%Lp"), ptr, convert("pointer to 0x123456"),
+ convert("00123456"));
+ DoI64DoubleTest(convert("%I64p"), lptr,
+ convert("pointer to 0x1234567887654321"),
+ convert("1234567887654321"));
+
+#else
+ Trace("Testing for Non 64 Bit Platforms \n");
+ DoPointerTest(convert("%p"), NULL, convert("NULL"), convert("00000000"));
+ DoPointerTest(convert("%p"), ptr, convert("pointer to 0x123456"),
+ convert("00123456"));
+ DoPointerTest(convert("%9p"), ptr, convert("pointer to 0x123456"),
+ convert(" 00123456"));
+ DoPointerTest(convert("%09p"), ptr, convert("pointer to 0x123456"),
+ convert(" 00123456"));
+ DoPointerTest(convert("%-9p"), ptr, convert("pointer to 0x123456"),
+ convert("00123456 "));
+ DoPointerTest(convert("%+p"), ptr, convert("pointer to 0x123456"),
+ convert("00123456"));
+ DoPointerTest(convert("%#p"), ptr, convert("pointer to 0x123456"),
+ convert("0X00123456"));
+ DoPointerTest(convert("%lp"), ptr, convert("pointer to 0x123456"),
+ convert("00123456"));
+ DoPointerTest(convert("%hp"), ptr, convert("pointer to 0x123456"),
+ convert("00003456"));
+ DoPointerTest(convert("%Lp"), ptr, convert("pointer to 0x123456"),
+ convert("00123456"));
+ DoI64DoubleTest(convert("%I64p"), lptr,
+ convert("pointer to 0x1234567887654321"),
+ convert("1234567887654321"));
+#endif
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/testinfo.dat
new file mode 100644
index 0000000000..9fbfcba5cf
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test4/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test4
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with pointers.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/CMakeLists.txt
new file mode 100644
index 0000000000..c431da4a00
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test6.cpp
+)
+
+add_executable(paltest_vsnwprintf_test6
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test6 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test6
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/test6.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/test6.cpp
new file mode 100644
index 0000000000..ecba5853a6
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/test6.cpp
@@ -0,0 +1,43 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test6.c
+**
+** Purpose: Test #6 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR wc = (WCHAR) 'c';
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoWCharTest(convert("foo %c"), wc, convert("foo c"));
+ DoCharTest(convert("foo %hc"), 'b', convert("foo b"));
+ DoWCharTest(convert("foo %lc"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %Lc"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %I64c"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %5c"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %.0c"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %-5c"), wc, convert("foo c "));
+ DoWCharTest(convert("foo %05c"), wc, convert("foo 0000c"));
+ DoWCharTest(convert("foo % c"), wc, convert("foo c"));
+ DoWCharTest(convert("foo %#c"), wc, convert("foo c"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/testinfo.dat
new file mode 100644
index 0000000000..1b411d7982
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test6/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test6
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with characters.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/CMakeLists.txt
new file mode 100644
index 0000000000..5759b836b5
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test7.cpp
+)
+
+add_executable(paltest_vsnwprintf_test7
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test7 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test7
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/test7.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/test7.cpp
new file mode 100644
index 0000000000..519657a202
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/test7.cpp
@@ -0,0 +1,43 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test7.c
+**
+** Purpose: Test #7 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR wc = (WCHAR) 'c';
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoCharTest(convert("foo %C"), 'b', convert("foo b"));
+ DoWCharTest(convert("foo %hC"), wc, convert("foo c"));
+ DoCharTest(convert("foo %lC"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %LC"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %I64C"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %5C"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %.0C"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %-5C"), 'b', convert("foo b "));
+ DoCharTest(convert("foo %05C"), 'b', convert("foo 0000b"));
+ DoCharTest(convert("foo % C"), 'b', convert("foo b"));
+ DoCharTest(convert("foo %#C"), 'b', convert("foo b"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/testinfo.dat
new file mode 100644
index 0000000000..8f2ccf0b58
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test7/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test7
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with wide characters.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/CMakeLists.txt
new file mode 100644
index 0000000000..5e8a6284a5
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test8.cpp
+)
+
+add_executable(paltest_vsnwprintf_test8
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test8 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test8
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/test8.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/test8.cpp
new file mode 100644
index 0000000000..15641f7b9e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/test8.cpp
@@ -0,0 +1,49 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test8.c
+**
+** Purpose: Test #8 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoNumTest(convert("foo %d"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %ld"), 0xFFFF, convert("foo 65535"));
+ DoNumTest(convert("foo %hd"), 0xFFFF, convert("foo -1"));
+ DoNumTest(convert("foo %Ld"), pos, convert("foo 42"));
+ DoI64NumTest(convert("foo %I64d"), l, "42", convert("foo 42"));
+ DoNumTest(convert("foo %3d"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %-3d"), pos, convert("foo 42 "));
+ DoNumTest(convert("foo %.1d"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %.3d"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %03d"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %#d"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+d"), pos, convert("foo +42"));
+ DoNumTest(convert("foo % d"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+d"), neg, convert("foo -42"));
+ DoNumTest(convert("foo % d"), neg, convert("foo -42"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/testinfo.dat
new file mode 100644
index 0000000000..905740c1bb
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test8/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test8
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with decimal numbers.
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/CMakeLists.txt
new file mode 100644
index 0000000000..323365dcd9
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test9.cpp
+)
+
+add_executable(paltest_vsnwprintf_test9
+ ${SOURCES}
+)
+
+add_dependencies(paltest_vsnwprintf_test9 coreclrpal)
+
+target_link_libraries(paltest_vsnwprintf_test9
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/test9.cpp b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/test9.cpp
new file mode 100644
index 0000000000..38f6be21e7
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/test9.cpp
@@ -0,0 +1,49 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test9.c
+**
+** Purpose: Test #9 for the _vsnwprintf_s function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../_vsnwprintf_s.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoNumTest(convert("foo %i"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %li"), 0xFFFF, convert("foo 65535"));
+ DoNumTest(convert("foo %hi"), 0xFFFF, convert("foo -1"));
+ DoNumTest(convert("foo %Li"), pos, convert("foo 42"));
+ DoI64NumTest(convert("foo %I64i"), l, "42", convert("foo 42"));
+ DoNumTest(convert("foo %3i"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %-3i"), pos, convert("foo 42 "));
+ DoNumTest(convert("foo %.1i"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %.3i"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %03i"), pos, convert("foo 042"));
+ DoNumTest(convert("foo %#i"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+i"), pos, convert("foo +42"));
+ DoNumTest(convert("foo % i"), pos, convert("foo 42"));
+ DoNumTest(convert("foo %+i"), neg, convert("foo -42"));
+ DoNumTest(convert("foo % i"), neg, convert("foo -42"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/testinfo.dat
new file mode 100644
index 0000000000..974efdb4cf
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/_vsnwprintf_s/test9/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = _vsnwprintf_s
+Name = Positive Test for _vsnwprintf_s
+TYPE = DEFAULT
+EXE1 = test9
+Description
+= Tests the PAL implementation of the _vsnwprintf_s function.
+= Tests _vsnwprintf_s with integer numbers
+= This test is modeled after _snwprintf.
diff --git a/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/CMakeLists.txt
index 5f085cc723..023b777cab 100644
--- a/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcsicmp_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/test1.cpp
index dd4bb54680..dd4bb54680 100644
--- a/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_wcsicmp/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/CMakeLists.txt
index a78098f86a..b9df132d29 100644
--- a/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcslwr_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.cpp
index 3a758de39b..3a758de39b 100644
--- a/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_wcslwr/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/CMakeLists.txt
index afd3560b10..ea22daa477 100644
--- a/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcsnicmp_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/test1.cpp
index 0271bcc60d..0271bcc60d 100644
--- a/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_wcsnicmp/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wfopen/test1/CMakeLists.txt
index 96df58ee54..f7aa22d5b2 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wfopen_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_wfopen/test1/test1.cpp
index 81d2502cd5..81d2502cd5 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wfopen/test2/CMakeLists.txt
index 47203d86d5..3159889f0a 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_wfopen_test2
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test2/test2.c b/src/pal/tests/palsuite/c_runtime/_wfopen/test2/test2.cpp
index 921ffef19d..921ffef19d 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wfopen/test3/CMakeLists.txt
index deec8bbfe6..06d0941471 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_wfopen_test3
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test3/test3.c b/src/pal/tests/palsuite/c_runtime/_wfopen/test3/test3.cpp
index 3b67818bc5..3b67818bc5 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wfopen/test4/CMakeLists.txt
index e93cdd58de..8253d75d8d 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_wfopen_test4
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test4/test4.c b/src/pal/tests/palsuite/c_runtime/_wfopen/test4/test4.cpp
index 0948fa11cc..0948fa11cc 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wfopen/test5/CMakeLists.txt
index 1530416795..8b3d064ec6 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_wfopen_test5
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test5/test5.c b/src/pal/tests/palsuite/c_runtime/_wfopen/test5/test5.cpp
index 21e5ec84ed..21e5ec84ed 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wfopen/test6/CMakeLists.txt
index c401c6f40f..bf1eaeca27 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_wfopen_test6
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test6/test6.c b/src/pal/tests/palsuite/c_runtime/_wfopen/test6/test6.cpp
index 17d36a0c50..17d36a0c50 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wfopen/test7/CMakeLists.txt
index 47f4804b43..5d04528a21 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_wfopen_test7
diff --git a/src/pal/tests/palsuite/c_runtime/_wfopen/test7/test7.c b/src/pal/tests/palsuite/c_runtime/_wfopen/test7/test7.cpp
index 0a889adc8a..0a889adc8a 100644
--- a/src/pal/tests/palsuite/c_runtime/_wfopen/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/_wfopen/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_wmakepath/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wmakepath/CMakeLists.txt
deleted file mode 100644
index f6aa0cb2d9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_wmakepath/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-
diff --git a/src/pal/tests/palsuite/c_runtime/_wmakepath/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wmakepath/test1/CMakeLists.txt
deleted file mode 100644
index 343cb41f51..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_wmakepath/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_wmakepath_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_wmakepath_test1 coreclrpal)
-
-target_link_libraries(paltest_wmakepath_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_wmakepath/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_wmakepath/test1/test1.c
deleted file mode 100644
index eb79dc6286..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_wmakepath/test1/test1.c
+++ /dev/null
@@ -1,76 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test1.c
-**
-** Purpose: Tests the PAL implementation of the _wmakepath function.
-** Create a path, and ensure that it builds how it is
-** supposed to.
-**
-**
-**===================================================================*/
-
-#define UNICODE
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char **argv)
-{
- WCHAR FullPath[128];
- WCHAR File[] = {'t','e','s','t','\0'};
- WCHAR Ext[] = {'t','x','t','\0'};
- char * PrintResult=NULL; /* Used for printing out errors */
- char * PrintCorrect=NULL;
-
-#if WIN32
- WCHAR Drive[] = {'C','\0'};
- WCHAR Dir[] = {'\\','t','e','s','t','\0'};
- WCHAR PathName[] =
- {'C',':','\\','t','e','s','t','\\','t','e',
- 's','t','.','t','x','t','\0'};
-#else
- WCHAR *Drive = NULL;
- WCHAR Dir[] = {'/','t','e','s','t','\0'};
- WCHAR PathName[] =
- {'/','t','e','s','t','/','t','e','s','t','.','t','x','t','\0'};
-#endif
-
- /*
- * Initialize the PAL and return FAIL if this fails
- */
- if (0 != (PAL_Initialize(argc,argv)))
- {
- return FAIL;
- }
-
- _wmakepath(FullPath, Drive, Dir, File, Ext);
-
- if(wcscmp(FullPath,PathName) != 0)
- {
- PrintResult = convertC(FullPath);
- PrintCorrect = convertC(PathName);
-
- Fail("ERROR: The pathname which was created turned out to be %s "
- "when it was supposed to be %s.\n",PrintResult,PrintCorrect);
- }
-
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/_wmakepath/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_wmakepath/test1/testinfo.dat
deleted file mode 100644
index 6720d342ce..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_wmakepath/test1/testinfo.dat
+++ /dev/null
@@ -1,13 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _wmakepath
-Name = Positive Test for _wmakepath
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= Purpose: Tests the PAL implementation of the _wmakepath function.
-= Create a path, and ensure that it builds how it is supposed to.
diff --git a/src/pal/tests/palsuite/c_runtime/_wsplitpath/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wsplitpath/CMakeLists.txt
deleted file mode 100644
index f6aa0cb2d9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_wsplitpath/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-
diff --git a/src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/CMakeLists.txt
deleted file mode 100644
index ee9a7a8e96..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_wsplitpath_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsplitpath_test1 coreclrpal)
-
-target_link_libraries(paltest_wsplitpath_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/test1.c
deleted file mode 100644
index 305768e53a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/test1.c
+++ /dev/null
@@ -1,151 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: Passes _wsplitpath() a series of sample paths and checks
-** that it parses them as expected.
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-
-struct testCase
-{
- char path[_MAX_PATH]; /* The path to parse. */
- char drive[_MAX_DRIVE]; /* The expected values... */
- char dir[_MAX_DIR];
- char fname[_MAX_FNAME];
- char ext[_MAX_EXT];
-};
-
-struct wTestCase
-{
- WCHAR *path; /* The path to parse. */
- WCHAR *drive; /* The expected values... */
- WCHAR *dir;
- WCHAR *fname;
- WCHAR *ext;
-};
-
-
-
-int __cdecl main(int argc, char **argv)
-{
- struct testCase testCases[] =
- {
-#if WIN32
- {"c:\\foo\\bar\\foo.bar", "c:", "\\foo\\bar\\", "foo", ".bar"},
- {"c:/foo/bar/foo.bar", "c:", "/foo/bar/", "foo", ".bar"},
- {"c:/foo/bar/foo", "c:", "/foo/bar/", "foo", ""},
- {"c:/foo/bar/.bar", "c:", "/foo/bar/", "", ".bar"},
- {"c:/foo/bar/", "c:", "/foo/bar/", "", ""},
- {"/foo/bar/foo.bar", "", "/foo/bar/", "foo", ".bar"},
- {"c:foo.bar", "c:", "", "foo", ".bar"}
-#else
- {"c:\\foo\\bar\\foo.bar", "","c:/foo/bar/", "foo", ".bar"},
- {"c:/foo/bar/foo.bar", "", "c:/foo/bar/", "foo", ".bar"},
- {"c:/foo/bar/foo", "", "c:/foo/bar/", "foo", ""},
- {"c:/foo/bar/.bar", "", "c:/foo/bar/", ".bar", ""},
- {"c:/foo/bar/", "", "c:/foo/bar/", "", ""},
- {"/foo/bar/foo.bar", "", "/foo/bar/", "foo", ".bar"},
- {"c:foo.bar", "", "", "c:foo", ".bar"}
-#endif
- };
-
- struct wTestCase wTestCases[sizeof(testCases)/sizeof(struct testCase)];
-
- wchar_t wDrive[_MAX_DRIVE];
- wchar_t wDir[_MAX_DIR];
- wchar_t wFname[_MAX_FNAME];
- wchar_t wExt[_MAX_EXT];
-
- char *drive;
- char *dir;
- char *fname;
- char *ext;
-
- int i;
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
-
- /*create wide character versions of the test cases*/
- for(i = 0; i < sizeof(testCases)/sizeof(struct testCase); i ++)
- {
- wTestCases[i].path = convert(testCases[i].path);
- wTestCases[i].drive = convert(testCases[i].drive);
- wTestCases[i].dir = convert(testCases[i].dir);
- wTestCases[i].fname = convert(testCases[i].fname);
- wTestCases[i].ext = convert(testCases[i].ext);
- }
-
-
- for (i = 0; i < sizeof(wTestCases)/sizeof(struct wTestCase); i++)
- {
- _wsplitpath(wTestCases[i].path, wDrive, wDir, wFname, wExt);
-
- /*Convert the results to regular ANSI strings.*/
- drive = convertC(wDrive);
- dir = convertC(wDir);
- fname = convertC(wFname);
- ext = convertC(wExt);
-
-
- /*on platforms that don't support drive letters, the drive
- returned should always be "" */
- if (wcscmp(wDrive, wTestCases[i].drive) != 0)
- {
- Fail("_wsplitpath read the path \"%s\" and thought the drive was "
- "\"%s\" instead of \"%s\""
- , testCases[i].path, drive, testCases[i].drive);
- }
-
- if (wcscmp(wDir, wTestCases[i].dir) != 0)
- {
- Fail("_wsplitpath read the path \"%s\" and thought the directory "
- "was \"%s\" instead of \"%s\""
- , testCases[i].path, dir, testCases[i].dir);
- }
-
- if (wcscmp(wFname, wTestCases[i].fname) != 0)
- {
- Fail("_wsplitpath read the path \"%s\" and thought the filename "
- "was \"%s\" instead of \"%s\""
- , testCases[i].path, fname, testCases[i].fname);
- }
-
- if (wcscmp(wExt, wTestCases[i].ext) != 0)
- {
- Fail("_wsplitpath read the path \"%s\" and thought the file "
- "extension was \"%s\" instead of \"%s\""
- , testCases[i].path, ext, testCases[i].ext);
- }
-
- free(drive);
- free(dir);
- free(fname);
- free(ext);
- }
-
- for(i = 0; i < sizeof(testCases)/sizeof(struct testCase); i++)
- {
- free(wTestCases[i].path);
- free(wTestCases[i].drive);
- free(wTestCases[i].dir);
- free(wTestCases[i].fname);
- free(wTestCases[i].ext);
- }
-
- PAL_Terminate();
-
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/testinfo.dat
deleted file mode 100644
index 30be680bb4..0000000000
--- a/src/pal/tests/palsuite/c_runtime/_wsplitpath/test1/testinfo.dat
+++ /dev/null
@@ -1,15 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = _wsplitpath
-Name = Positive Test for _wsplitpath
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= Passes _wsplitpath() a series of sample paths and checks that it
-= parses them as expected.
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/_wtoi/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/_wtoi/test1/CMakeLists.txt
index 9e6610fc0f..ed02fec3af 100644
--- a/src/pal/tests/palsuite/c_runtime/_wtoi/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/_wtoi/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wtoi_test1
diff --git a/src/pal/tests/palsuite/c_runtime/_wtoi/test1/test1.c b/src/pal/tests/palsuite/c_runtime/_wtoi/test1/test1.cpp
index 0b14dedd60..0b14dedd60 100644
--- a/src/pal/tests/palsuite/c_runtime/_wtoi/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/_wtoi/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/abs/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/abs/test1/CMakeLists.txt
index c8a8595d01..b01d97ff2f 100644
--- a/src/pal/tests/palsuite/c_runtime/abs/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/abs/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- abs.c
+ abs.cpp
)
add_executable(paltest_abs_test1
diff --git a/src/pal/tests/palsuite/c_runtime/abs/test1/abs.c b/src/pal/tests/palsuite/c_runtime/abs/test1/abs.cpp
index 233a5dcb30..233a5dcb30 100644
--- a/src/pal/tests/palsuite/c_runtime/abs/test1/abs.c
+++ b/src/pal/tests/palsuite/c_runtime/abs/test1/abs.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/acos/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/acos/test1/CMakeLists.txt
index 978ab427e8..5bd3ae06e8 100644
--- a/src/pal/tests/palsuite/c_runtime/acos/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/acos/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_acos_test1
diff --git a/src/pal/tests/palsuite/c_runtime/acos/test1/test1.c b/src/pal/tests/palsuite/c_runtime/acos/test1/test1.cpp
index c6ed0692c7..c6ed0692c7 100644
--- a/src/pal/tests/palsuite/c_runtime/acos/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/acos/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/acosf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/acosf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/acosf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/acosf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/acosf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..2643647438
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/acosf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_acosf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_acosf_test1 coreclrpal)
+
+target_link_libraries(paltest_acosf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/acosf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/acosf/test1/test1.c
new file mode 100644
index 0000000000..3d8668cebb
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/acosf/test1/test1.c
@@ -0,0 +1,129 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test to ensure that acosf return the correct values
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** fabs
+**
+**===========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = acosf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("acosf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = acosf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("acosf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { -1, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi
+ { -0.911733915f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e
+ { -0.668201510f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10)
+ { 0, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2
+ { 0.127751218f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e)
+ { 0.155943695f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2)
+ { 0.428125148f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi)
+ { 0.540302306f, 1, PAL_EPSILON * 10 },
+ { 0.707106781f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4, value: 1 / sqrtf(2)
+ { 0.760244597f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2)
+ { 0.769238901f, 0.693147181f, PAL_EPSILON }, // expected: ln(2)
+ { 0.804109828f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi
+ { 0.907167129f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e)
+ { 0.949765715f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi
+ { 1, 0, PAL_EPSILON },
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate(tests[i].value, tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NEGINF);
+ validate_isnan(PAL_NAN);
+ validate_isnan(PAL_POSINF);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/acosf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/acosf/test1/testinfo.dat
new file mode 100644
index 0000000000..41cead33bb
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/acosf/test1/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = acosf
+Name = Positive Test for acosf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes a series of values to the acosf() function,
+= checking each for the expfected result. Also checks
+= for proper handling of out-of-range values.
diff --git a/src/pal/tests/palsuite/c_runtime/asin/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/asin/test1/CMakeLists.txt
index a3aec3f60f..510b543a59 100644
--- a/src/pal/tests/palsuite/c_runtime/asin/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/asin/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_asin_test1
diff --git a/src/pal/tests/palsuite/c_runtime/asin/test1/test1.c b/src/pal/tests/palsuite/c_runtime/asin/test1/test1.cpp
index 0a63356ed0..0a63356ed0 100644
--- a/src/pal/tests/palsuite/c_runtime/asin/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/asin/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/asinf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/asinf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/asinf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/asinf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/asinf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..b167bd8715
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/asinf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_asinf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_asinf_test1 coreclrpal)
+
+target_link_libraries(paltest_asinf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/asinf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/asinf/test1/test1.c
new file mode 100644
index 0000000000..773015eec0
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/asinf/test1/test1.c
@@ -0,0 +1,145 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test to ensure that asinf return the correct values
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** fabs
+**
+**===========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = asinf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("asinf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = asinf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("asinf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning +INF
+ */
+void __cdecl validate_isinf_positive(float value)
+{
+ float result = asinf(value);
+
+ if (result != PAL_POSINF)
+ {
+ Fail("asinf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_POSINF);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0, 0, PAL_EPSILON },
+ { 0.312961796f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi
+ { 0.410781291f, 0.423310825f, PAL_EPSILON }, // expected: pi - e
+ { 0.420770483f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e)
+ { 0.594480769f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi
+ { 0.638961276f, 0.693147181f, PAL_EPSILON }, // expected: ln(2)
+ { 0.649636939f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2)
+ { 0.707106781f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4, value: 1 / sqrtf(2)
+ { 0.743980337f, 0.839007561f, PAL_EPSILON }, // expected: pi - ln(10)
+ { 0.841470985f, 1, PAL_EPSILON * 10 },
+ { 0.903719457f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi)
+ { 0.987765946f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2)
+ { 0.991806244f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e)
+ { 1, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate( tests[i].value, tests[i].expected, tests[i].variance);
+ validate(-tests[i].value, -tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NEGINF);
+ validate_isnan(PAL_NAN);
+ validate_isnan(PAL_POSINF);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/asinf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/asinf/test1/testinfo.dat
new file mode 100644
index 0000000000..ca2dd42150
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/asinf/test1/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = asinf
+Name = Positive Test for asinf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes a series of values to the asinf() function,
+= checking each for the expected result. Also checks
+= for proper handling of out-of-range values.
diff --git a/src/pal/tests/palsuite/c_runtime/atan/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/atan/test1/CMakeLists.txt
index b0b84e7c07..ace64e48bc 100644
--- a/src/pal/tests/palsuite/c_runtime/atan/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/atan/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_atan_test1
diff --git a/src/pal/tests/palsuite/c_runtime/atan/test1/test1.c b/src/pal/tests/palsuite/c_runtime/atan/test1/test1.cpp
index 6840d46172..6840d46172 100644
--- a/src/pal/tests/palsuite/c_runtime/atan/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/atan/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/atan2/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/atan2/test1/CMakeLists.txt
index 8bd69da2fa..cafa09f7fe 100644
--- a/src/pal/tests/palsuite/c_runtime/atan2/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/atan2/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_atan2_test1
diff --git a/src/pal/tests/palsuite/c_runtime/atan2/test1/test1.c b/src/pal/tests/palsuite/c_runtime/atan2/test1/test1.cpp
index 15aa8f53b9..15aa8f53b9 100644
--- a/src/pal/tests/palsuite/c_runtime/atan2/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/atan2/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/atan2f/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/atan2f/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/atan2f/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/atan2f/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/atan2f/test1/CMakeLists.txt
new file mode 100644
index 0000000000..d71a61b17b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/atan2f/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_atan2f_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_atan2f_test1 coreclrpal)
+
+target_link_libraries(paltest_atan2f_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/atan2f/test1/test1.c b/src/pal/tests/palsuite/c_runtime/atan2f/test1/test1.c
new file mode 100644
index 0000000000..2ee641e8d4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/atan2f/test1/test1.c
@@ -0,0 +1,147 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test1.c
+**
+** Purpose: Tests that atan2f returns correct values for a subset of values.
+** Tests with positive and negative values of x and y to ensure
+** atan2f is returning results from the correct quadrant.
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+struct test
+{
+ float y; /* second component of the value to test the function with */
+ float x; /* first component of the value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float y, float x, float expected, float variance)
+{
+ float result = atan2f(y, x);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("atan2f(%g, %g) returned %10.9g when it should have returned %10.9g",
+ y, x, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float y, float x)
+{
+ float result = atan2f(y, x);
+
+ if (!_isnanf(result))
+ {
+ Fail("atan2f(%g, %g) returned %10.9g when it should have returned %10.9g",
+ y, x, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* y x expected variance */
+ { 0, PAL_POSINF, 0, PAL_EPSILON },
+ { 0, 0, 0, PAL_EPSILON },
+ { 0.312961796f, 0.949765715f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi
+ { 0.420770483f, 0.907167129f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e)
+ { 0.594480769f, 0.804109828f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi
+ { 0.638961276f, 0.769238901f, 0.693147181f, PAL_EPSILON }, // expected: ln(2)
+ { 0.649636939f, 0.760244597f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2)
+ { 0.707106781f, 0.707106781f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4, value: 1 / sqrtf(2)
+ { 1, 1, 0.785398163f, PAL_EPSILON }, // expected: pi / 4
+ { PAL_POSINF, PAL_POSINF, 0.785398163f, PAL_EPSILON }, // expected: pi / 4
+ { 0.841470985f, 0.540302306f, 1, PAL_EPSILON * 10 },
+ { 0.903719457f, 0.428125148f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi)
+ { 0.987765946f, 0.155943695f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2)
+ { 0.991806244f, 0.127751218f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e)
+ { 1, 0, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2
+ { PAL_POSINF, 0, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2
+ { PAL_POSINF, 1, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2
+ { 0.743980337f, -0.668201510f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10)
+ { 0.410781291f, -0.911733915f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e
+ { 0, -1, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi
+ { 1, PAL_POSINF, 0, PAL_EPSILON },
+ };
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ const float pi = 3.14159265f;
+
+ validate( tests[i].y, tests[i].x, tests[i].expected, tests[i].variance);
+ validate(-tests[i].y, tests[i].x, -tests[i].expected, tests[i].variance);
+ validate( tests[i].y, -tests[i].x, pi - tests[i].expected, tests[i].variance);
+ validate(-tests[i].y, -tests[i].x, tests[i].expected - pi, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NEGINF, PAL_NAN);
+ validate_isnan(PAL_NAN, PAL_NEGINF);
+ validate_isnan(PAL_NAN, PAL_POSINF);
+ validate_isnan(PAL_POSINF, PAL_NAN);
+
+ validate_isnan(PAL_NAN, -1);
+ validate_isnan(PAL_NAN, -0.0f);
+ validate_isnan(PAL_NAN, 0);
+ validate_isnan(PAL_NAN, 1);
+
+ validate_isnan(-1, PAL_NAN);
+ validate_isnan(-0.0f, PAL_NAN);
+ validate_isnan( 0, PAL_NAN);
+ validate_isnan( 1, PAL_NAN);
+
+ validate_isnan(PAL_NAN, PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/atan2f/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/atan2f/test1/testinfo.dat
new file mode 100644
index 0000000000..bd9a9d9b93
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/atan2f/test1/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = atan2f
+Name = Test #1 for atan2f
+Type = DEFAULT
+EXE1 = test1
+Description
+=Tests that atan2f returns correct values for a subset of values.
+=Tests with positive and negative values of x and y to ensure
+=atan2f is returning results from the correct quadrant.
diff --git a/src/pal/tests/palsuite/c_runtime/atanf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/atanf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/atanf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/atanf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/atanf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..b71b1cf40c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/atanf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_atanf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_atanf_test1 coreclrpal)
+
+target_link_libraries(paltest_atanf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/atanf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/atanf/test1/test1.c
new file mode 100644
index 0000000000..543a0a8168
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/atanf/test1/test1.c
@@ -0,0 +1,127 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test to ensure that atanf return the correct values
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** fabs
+**
+**===========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = atanf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("atanf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = atanf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("atanf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0, 0, PAL_EPSILON },
+ { 0.329514733f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi
+ { 0.450549534f, 0.423310825f, PAL_EPSILON }, // expected: pi - e
+ { 0.463829067f, 0.434294482f, PAL_EPSILON }, // expected: logf10f(e)
+ { 0.739302950f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi
+ { 0.830640878f, 0.693147181f, PAL_EPSILON }, // expected: ln(2)
+ { 0.854510432f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2)
+ { 1, 0.785398163f, PAL_EPSILON }, // expected: pi / 4
+ { 1.11340715f, 0.839007561f, PAL_EPSILON }, // expected: pi - ln(10)
+ { 1.55740772f, 1, PAL_EPSILON * 10 },
+ { 2.11087684f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi)
+ { 6.33411917f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2)
+ { 7.76357567f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e)
+ { PAL_POSINF, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate( tests[i].value, tests[i].expected, tests[i].variance);
+ validate(-tests[i].value, -tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/atanf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/atanf/test1/testinfo.dat
new file mode 100644
index 0000000000..0d184272a2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/atanf/test1/testinfo.dat
@@ -0,0 +1,13 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = atanf
+Name = Positive Test for atanf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes a series of values to the atanf() function,
+= checking each for the expected result.
diff --git a/src/pal/tests/palsuite/c_runtime/atof/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/atof/test1/CMakeLists.txt
index 1f34b7ebf5..12e584b9a0 100644
--- a/src/pal/tests/palsuite/c_runtime/atof/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/atof/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_atof_test1
diff --git a/src/pal/tests/palsuite/c_runtime/atof/test1/test1.c b/src/pal/tests/palsuite/c_runtime/atof/test1/test1.cpp
index a973133f9e..a973133f9e 100644
--- a/src/pal/tests/palsuite/c_runtime/atof/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/atof/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/atoi/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/atoi/test1/CMakeLists.txt
index 3549aca737..225052213f 100644
--- a/src/pal/tests/palsuite/c_runtime/atoi/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/atoi/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_atoi_test1
diff --git a/src/pal/tests/palsuite/c_runtime/atoi/test1/test1.c b/src/pal/tests/palsuite/c_runtime/atoi/test1/test1.cpp
index 2554d4c353..2554d4c353 100644
--- a/src/pal/tests/palsuite/c_runtime/atoi/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/atoi/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/atol/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/atol/test1/CMakeLists.txt
index 4fea187ad8..29643aae6b 100644
--- a/src/pal/tests/palsuite/c_runtime/atol/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/atol/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_atol_test1
diff --git a/src/pal/tests/palsuite/c_runtime/atol/test1/test1.c b/src/pal/tests/palsuite/c_runtime/atol/test1/test1.cpp
index 5ad85d873f..5ad85d873f 100644
--- a/src/pal/tests/palsuite/c_runtime/atol/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/atol/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/bsearch/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/bsearch/test1/CMakeLists.txt
index d2018f3325..c5aab7b84d 100644
--- a/src/pal/tests/palsuite/c_runtime/bsearch/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/bsearch/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_bsearch_test1
diff --git a/src/pal/tests/palsuite/c_runtime/bsearch/test1/test1.c b/src/pal/tests/palsuite/c_runtime/bsearch/test1/test1.cpp
index c4b91738eb..c4b91738eb 100644
--- a/src/pal/tests/palsuite/c_runtime/bsearch/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/bsearch/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/bsearch/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/bsearch/test2/CMakeLists.txt
index dc65560196..7ad33b12e5 100644
--- a/src/pal/tests/palsuite/c_runtime/bsearch/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/bsearch/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_bsearch_test2
diff --git a/src/pal/tests/palsuite/c_runtime/bsearch/test2/test2.c b/src/pal/tests/palsuite/c_runtime/bsearch/test2/test2.cpp
index 6de1b3fada..6de1b3fada 100644
--- a/src/pal/tests/palsuite/c_runtime/bsearch/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/bsearch/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/ceil/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/ceil/test1/CMakeLists.txt
index c73ad1dbbe..f834914545 100644
--- a/src/pal/tests/palsuite/c_runtime/ceil/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/ceil/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_ceil_test1
diff --git a/src/pal/tests/palsuite/c_runtime/ceil/test1/test1.c b/src/pal/tests/palsuite/c_runtime/ceil/test1/test1.cpp
index e6e36e6e33..e6e36e6e33 100644
--- a/src/pal/tests/palsuite/c_runtime/ceil/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/ceil/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/ceilf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/ceilf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/ceilf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/ceilf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/ceilf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..64f14cda9a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/ceilf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_ceilf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_ceilf_test1 coreclrpal)
+
+target_link_libraries(paltest_ceilf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/ceilf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/ceilf/test1/test1.c
new file mode 100644
index 0000000000..4939fb7ccf
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/ceilf/test1/test1.c
@@ -0,0 +1,131 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Tests ceilf with simple positive and negative values. Also tests
+** extreme cases like extremely small values and positive and
+** negative infinity. Makes sure that calling ceilf on NaN returns
+** NaN
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = ceilf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("ceilf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = ceilf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("ceilf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char *argv[])
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0.318309886f, 1, PAL_EPSILON * 10 }, // value: 1 / pi
+ { 0.434294482f, 1, PAL_EPSILON * 10 }, // value: log10f(e)
+ { 0.636619772f, 1, PAL_EPSILON * 10 }, // value: 2 / pi
+ { 0.693147181f, 1, PAL_EPSILON * 10 }, // value: ln(2)
+ { 0.707106781f, 1, PAL_EPSILON * 10 }, // value: 1 / sqrtf(2)
+ { 0.785398163f, 1, PAL_EPSILON * 10 }, // value: pi / 4
+ { 1.12837917f, 2, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi)
+ { 1.41421356f, 2, PAL_EPSILON * 10 }, // value: sqrtf(2)
+ { 1.44269504f, 2, PAL_EPSILON * 10 }, // value: logf2(e)
+ { 1.57079633f, 2, PAL_EPSILON * 10 }, // value: pi / 2
+ { 2.30258509f, 3, PAL_EPSILON * 10 }, // value: ln(10)
+ { 2.71828183f, 3, PAL_EPSILON * 10 }, // value: e
+ { 3.14159265f, 4, PAL_EPSILON * 10 }, // value: pi
+ { PAL_POSINF, PAL_POSINF, 0 }
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ validate( 0, 0, PAL_EPSILON);
+ validate(-0.0f, 0, PAL_EPSILON);
+
+ validate( 1, 1, PAL_EPSILON * 10);
+ validate(-1.0f, -1, PAL_EPSILON * 10);
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate( tests[i].value, tests[i].expected, tests[i].variance);
+ validate(-tests[i].value, 1 - tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/ceilf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/ceilf/test1/testinfo.dat
new file mode 100644
index 0000000000..095b8b216a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/ceilf/test1/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = ceilf
+Name = Test #1 for ceilf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+=Tests ceilf with simple positive and negative values. Also tests
+=extreme cases like extremely small values and positive and negative
+=infinity. Makes sure that calling ceilf on NaN returns NaN
diff --git a/src/pal/tests/palsuite/c_runtime/cos/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/cos/test1/CMakeLists.txt
index 1dda9a2563..536664c128 100644
--- a/src/pal/tests/palsuite/c_runtime/cos/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/cos/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_cos_test1
diff --git a/src/pal/tests/palsuite/c_runtime/cos/test1/test1.c b/src/pal/tests/palsuite/c_runtime/cos/test1/test1.cpp
index 8c1c7300e6..8c1c7300e6 100644
--- a/src/pal/tests/palsuite/c_runtime/cos/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/cos/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/cosf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/cosf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/cosf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/cosf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/cosf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..b3a18ea271
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/cosf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_cosf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_cosf_test1 coreclrpal)
+
+target_link_libraries(paltest_cosf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/cosf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/cosf/test1/test1.c
new file mode 100644
index 0000000000..210851a2fa
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/cosf/test1/test1.c
@@ -0,0 +1,130 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test to ensure that cosf return the correct values
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** fabs
+**
+**===========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = cosf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("cosf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = cosf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("cosf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0, 1, PAL_EPSILON * 10 },
+ { 0.318309886f, 0.949765715f, PAL_EPSILON }, // value: 1 / pi
+ { 0.434294482f, 0.907167129f, PAL_EPSILON }, // value: log10f(e)
+ { 0.636619772f, 0.804109828f, PAL_EPSILON }, // value: 2 / pi
+ { 0.693147181f, 0.769238901f, PAL_EPSILON }, // value: ln(2)
+ { 0.707106781f, 0.760244597f, PAL_EPSILON }, // value: 1 / sqrtf(2)
+ { 0.785398163f, 0.707106781f, PAL_EPSILON }, // value: pi / 4, expected: 1 / sqrtf(2)
+ { 1, 0.540302306f, PAL_EPSILON },
+ { 1.12837917f, 0.428125148f, PAL_EPSILON }, // value: 2 / sqrtf(pi)
+ { 1.41421356f, 0.155943695f, PAL_EPSILON }, // value: sqrtf(2)
+ { 1.44269504f, 0.127751218f, PAL_EPSILON }, // value: logf2(e)
+ { 1.57079633f, 0, PAL_EPSILON }, // value: pi / 2
+ { 2.30258509f, -0.668201510f, PAL_EPSILON }, // value: ln(10)
+ { 2.71828183f, -0.911733918f, PAL_EPSILON }, // value: e
+ { 3.14159265f, -1, PAL_EPSILON * 10 }, // value: pi
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate( tests[i].value, tests[i].expected, tests[i].variance);
+ validate(-tests[i].value, tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NEGINF);
+ validate_isnan(PAL_NAN);
+ validate_isnan(PAL_POSINF);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/cosf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/cosf/test1/testinfo.dat
new file mode 100644
index 0000000000..a0265add2f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/cosf/test1/testinfo.dat
@@ -0,0 +1,13 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = cosf
+Name = Positive Test for cosf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes to cosf() a series of angle value, checking that
+= each one return the correct value.
diff --git a/src/pal/tests/palsuite/c_runtime/cosh/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/cosh/test1/CMakeLists.txt
index bea7b7a3b7..e1fff0e9f1 100644
--- a/src/pal/tests/palsuite/c_runtime/cosh/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/cosh/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_cosh_test1
diff --git a/src/pal/tests/palsuite/c_runtime/cosh/test1/test1.c b/src/pal/tests/palsuite/c_runtime/cosh/test1/test1.cpp
index 40c2fca85d..40c2fca85d 100644
--- a/src/pal/tests/palsuite/c_runtime/cosh/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/cosh/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/coshf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/coshf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/coshf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/coshf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/coshf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..92fcfdea6d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/coshf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_coshf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_coshf_test1 coreclrpal)
+
+target_link_libraries(paltest_coshf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/coshf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/coshf/test1/test1.c
new file mode 100644
index 0000000000..e1ab745acb
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/coshf/test1/test1.c
@@ -0,0 +1,129 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test to ensure that coshf return the correct values
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** fabs
+**
+**===========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = coshf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("coshf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning PAL_NAN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = coshf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("coshf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0, 1, PAL_EPSILON * 10 },
+ { 0.318309886f, 1.05108979f, PAL_EPSILON * 10 }, // value: 1 / pi
+ { 0.434294482f, 1.09579746f, PAL_EPSILON * 10 }, // value: log10f(e)
+ { 0.636619772f, 1.20957949f, PAL_EPSILON * 10 }, // value: 2 / pi
+ { 0.693147181f, 1.25f, PAL_EPSILON * 10 }, // value: ln(2)
+ { 0.707106781f, 1.26059184f, PAL_EPSILON * 10 }, // value: 1 / sqrtf(2)
+ { 0.785398163f, 1.32460909f, PAL_EPSILON * 10 }, // value: pi / 4
+ { 1, 1.54308063f, PAL_EPSILON * 10 },
+ { 1.12837917f, 1.70710014f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi)
+ { 1.41421356f, 2.17818356f, PAL_EPSILON * 10 }, // value: sqrtf(2)
+ { 1.44269504f, 2.23418810f, PAL_EPSILON * 10 }, // value: logf2(e)
+ { 1.57079633f, 2.50917848f, PAL_EPSILON * 10 }, // value: pi / 2
+ { 2.30258509f, 5.05f, PAL_EPSILON * 10 }, // value: ln(10)
+ { 2.71828183f, 7.61012514f, PAL_EPSILON * 10 }, // value: e
+ { 3.14159265f, 11.5919533f, PAL_EPSILON * 100 }, // value: pi
+ { PAL_POSINF, PAL_POSINF, 0 },
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate( tests[i].value, tests[i].expected, tests[i].variance);
+ validate(-tests[i].value, tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/coshf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/coshf/test1/testinfo.dat
new file mode 100644
index 0000000000..814ed98698
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/coshf/test1/testinfo.dat
@@ -0,0 +1,13 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = coshf
+Name = Positive Test for coshf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes to coshf() a series of angle value, checking that
+= each one return to correct value.
diff --git a/src/pal/tests/palsuite/c_runtime/ctime/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/ctime/test1/CMakeLists.txt
index aa64a71d1e..3eeffb0e39 100644
--- a/src/pal/tests/palsuite/c_runtime/ctime/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/ctime/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_ctime_test1
diff --git a/src/pal/tests/palsuite/c_runtime/ctime/test1/test1.c b/src/pal/tests/palsuite/c_runtime/ctime/test1/test1.cpp
index 5d5e22ce89..5d5e22ce89 100644
--- a/src/pal/tests/palsuite/c_runtime/ctime/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/ctime/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/errno/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/errno/test1/CMakeLists.txt
index 89b25a4fac..91b8d094b1 100644
--- a/src/pal/tests/palsuite/c_runtime/errno/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/errno/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_errno_test1
diff --git a/src/pal/tests/palsuite/c_runtime/errno/test1/test1.c b/src/pal/tests/palsuite/c_runtime/errno/test1/test1.cpp
index 3ae25fb02a..3ae25fb02a 100644
--- a/src/pal/tests/palsuite/c_runtime/errno/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/errno/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/errno/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/errno/test2/CMakeLists.txt
index edd4cf7975..ab7c4a27f2 100644
--- a/src/pal/tests/palsuite/c_runtime/errno/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/errno/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_errno_test2
diff --git a/src/pal/tests/palsuite/c_runtime/errno/test2/test2.c b/src/pal/tests/palsuite/c_runtime/errno/test2/test2.cpp
index f418d2f199..f418d2f199 100644
--- a/src/pal/tests/palsuite/c_runtime/errno/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/errno/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/exit/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/exit/test1/CMakeLists.txt
index eb9ca4e780..bb2cbccb9b 100644
--- a/src/pal/tests/palsuite/c_runtime/exit/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/exit/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_exit_test1
diff --git a/src/pal/tests/palsuite/c_runtime/exit/test1/test1.c b/src/pal/tests/palsuite/c_runtime/exit/test1/test1.cpp
index 87c9d22b8a..87c9d22b8a 100644
--- a/src/pal/tests/palsuite/c_runtime/exit/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/exit/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/exit/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/exit/test2/CMakeLists.txt
index 47d3a44c85..8a74e75ed5 100644
--- a/src/pal/tests/palsuite/c_runtime/exit/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/exit/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_exit_test2
diff --git a/src/pal/tests/palsuite/c_runtime/exit/test2/test2.c b/src/pal/tests/palsuite/c_runtime/exit/test2/test2.cpp
index 16fbdfed2f..16fbdfed2f 100644
--- a/src/pal/tests/palsuite/c_runtime/exit/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/exit/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/exp/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/exp/test1/CMakeLists.txt
index 9cdd4ec5ed..3377ed22f2 100644
--- a/src/pal/tests/palsuite/c_runtime/exp/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/exp/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_exp_test1
diff --git a/src/pal/tests/palsuite/c_runtime/exp/test1/test1.c b/src/pal/tests/palsuite/c_runtime/exp/test1/test1.cpp
index 20e071aa68..20e071aa68 100644
--- a/src/pal/tests/palsuite/c_runtime/exp/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/exp/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/expf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/expf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/expf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/expf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/expf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..fb12b65c2f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/expf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_expf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_expf_test1 coreclrpal)
+
+target_link_libraries(paltest_expf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/expf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/expf/test1/test1.c
new file mode 100644
index 0000000000..32f4e8d26c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/expf/test1/test1.c
@@ -0,0 +1,137 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test1.c
+**
+** Purpose: Tests expf with a normal set of values.
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = expf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("expf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = expf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("expf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { PAL_NEGINF, 0, PAL_EPSILON },
+ { -3.14159265f, 0.0432139183f, PAL_EPSILON / 10 }, // value: -(pi)
+ { -2.71828183f, 0.0659880358f, PAL_EPSILON / 10 }, // value: -(e)
+ { -2.30258509f, 0.1f, PAL_EPSILON }, // value: -(ln(10))
+ { -1.57079633f, 0.207879576f, PAL_EPSILON }, // value: -(pi / 2)
+ { -1.44269504f, 0.236290088f, PAL_EPSILON }, // value: -(logf2(e))
+ { -1.41421356f, 0.243116734f, PAL_EPSILON }, // value: -(sqrtf(2))
+ { -1.12837917f, 0.323557264f, PAL_EPSILON }, // value: -(2 / sqrtf(pi))
+ { -1, 0.367879441f, PAL_EPSILON }, // value: -(1)
+ { -0.785398163f, 0.455938128f, PAL_EPSILON }, // value: -(pi / 4)
+ { -0.707106781f, 0.493068691f, PAL_EPSILON }, // value: -(1 / sqrtf(2))
+ { -0.693147181f, 0.5f, PAL_EPSILON }, // value: -(ln(2))
+ { -0.636619772f, 0.529077808f, PAL_EPSILON }, // value: -(2 / pi)
+ { -0.434294482f, 0.647721485f, PAL_EPSILON }, // value: -(log10f(e))
+ { -0.318309886f, 0.727377349f, PAL_EPSILON }, // value: -(1 / pi)
+ { 0, 1, PAL_EPSILON * 10 },
+ { 0.318309886f, 1.37480223f, PAL_EPSILON * 10 }, // value: 1 / pi
+ { 0.434294482f, 1.54387344f, PAL_EPSILON * 10 }, // value: log10f(e)
+ { 0.636619772f, 1.89008116f, PAL_EPSILON * 10 }, // value: 2 / pi
+ { 0.693147181f, 2, PAL_EPSILON * 10 }, // value: ln(2)
+ { 0.707106781f, 2.02811498f, PAL_EPSILON * 10 }, // value: 1 / sqrtf(2)
+ { 0.785398163f, 2.19328005f, PAL_EPSILON * 10 }, // value: pi / 4
+ { 1, 2.71828183f, PAL_EPSILON * 10 }, // expected: e
+ { 1.12837917f, 3.09064302f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi)
+ { 1.41421356f, 4.11325038f, PAL_EPSILON * 10 }, // value: sqrtf(2)
+ { 1.44269504f, 4.23208611f, PAL_EPSILON * 10 }, // value: logf2(e)
+ { 1.57079633f, 4.81047738f, PAL_EPSILON * 10 }, // value: pi / 2
+ { 2.30258509f, 10, PAL_EPSILON * 100 }, // value: ln(10)
+ { 2.71828183f, 15.1542622f, PAL_EPSILON * 100 }, // value: e
+ { 3.14159265f, 23.1406926f, PAL_EPSILON * 100 }, // value: pi
+ { PAL_POSINF, PAL_POSINF, 0 },
+ };
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate(tests[i].value, tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/expf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/expf/test1/testinfo.dat
new file mode 100644
index 0000000000..c35928501e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/expf/test1/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = expf
+Name = Test #1 for expf
+Type = DEFAULT
+EXE1 = test1
+Description
+=Tests expf with a normal set of values.
diff --git a/src/pal/tests/palsuite/c_runtime/fabs/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fabs/test1/CMakeLists.txt
index ab27230ac2..fa01a34dd9 100644
--- a/src/pal/tests/palsuite/c_runtime/fabs/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fabs/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fabs_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fabs/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fabs/test1/test1.cpp
index 0a74d5c1c5..0a74d5c1c5 100644
--- a/src/pal/tests/palsuite/c_runtime/fabs/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fabs/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fabsf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fabsf/test1/CMakeLists.txt
index 06512ebd7c..a1823e25e5 100644
--- a/src/pal/tests/palsuite/c_runtime/fabsf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fabsf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fabsf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fabsf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fabsf/test1/test1.cpp
index 0b020729b8..0b020729b8 100644
--- a/src/pal/tests/palsuite/c_runtime/fabsf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fabsf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fclose/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fclose/test1/CMakeLists.txt
index 55ed7c674e..64cfef0e18 100644
--- a/src/pal/tests/palsuite/c_runtime/fclose/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fclose/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fclose_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fclose/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fclose/test1/test1.cpp
index 0a8463823d..0a8463823d 100644
--- a/src/pal/tests/palsuite/c_runtime/fclose/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fclose/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fclose/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fclose/test2/CMakeLists.txt
index 178dc7d19a..3b5538608f 100644
--- a/src/pal/tests/palsuite/c_runtime/fclose/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fclose/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_fclose_test2
diff --git a/src/pal/tests/palsuite/c_runtime/fclose/test2/test2.c b/src/pal/tests/palsuite/c_runtime/fclose/test2/test2.cpp
index f4da535535..f4da535535 100644
--- a/src/pal/tests/palsuite/c_runtime/fclose/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/fclose/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/feof/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/feof/test1/CMakeLists.txt
index ee1389deb0..9f689503e6 100644
--- a/src/pal/tests/palsuite/c_runtime/feof/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/feof/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_feof_test1
diff --git a/src/pal/tests/palsuite/c_runtime/feof/test1/test1.c b/src/pal/tests/palsuite/c_runtime/feof/test1/test1.cpp
index ba018aa91d..ba018aa91d 100644
--- a/src/pal/tests/palsuite/c_runtime/feof/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/feof/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/ferror/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/ferror/test1/CMakeLists.txt
index 2ab12b5db3..cd1fe52381 100644
--- a/src/pal/tests/palsuite/c_runtime/ferror/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/ferror/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_ferror_test1
diff --git a/src/pal/tests/palsuite/c_runtime/ferror/test1/test1.c b/src/pal/tests/palsuite/c_runtime/ferror/test1/test1.cpp
index 516f2531ed..516f2531ed 100644
--- a/src/pal/tests/palsuite/c_runtime/ferror/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/ferror/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/ferror/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/ferror/test2/CMakeLists.txt
index 077dde0bc6..05bd7fd2f1 100644
--- a/src/pal/tests/palsuite/c_runtime/ferror/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/ferror/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_ferror_test2
diff --git a/src/pal/tests/palsuite/c_runtime/ferror/test2/test2.c b/src/pal/tests/palsuite/c_runtime/ferror/test2/test2.cpp
index fdf9e032c8..fdf9e032c8 100644
--- a/src/pal/tests/palsuite/c_runtime/ferror/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/ferror/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fflush/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fflush/test1/CMakeLists.txt
index 743f1d2111..58c7c5a3a4 100644
--- a/src/pal/tests/palsuite/c_runtime/fflush/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fflush/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fflush_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fflush/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fflush/test1/test1.cpp
index 7baf9ba5b9..7baf9ba5b9 100644
--- a/src/pal/tests/palsuite/c_runtime/fflush/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fflush/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fgets/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fgets/test1/CMakeLists.txt
index 672d910c85..d327d6882a 100644
--- a/src/pal/tests/palsuite/c_runtime/fgets/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fgets/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fgets_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fgets/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fgets/test1/test1.cpp
index 5e0e62dece..5e0e62dece 100644
--- a/src/pal/tests/palsuite/c_runtime/fgets/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fgets/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fgets/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fgets/test2/CMakeLists.txt
index d39401536b..23bcdef686 100644
--- a/src/pal/tests/palsuite/c_runtime/fgets/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fgets/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_fgets_test2
diff --git a/src/pal/tests/palsuite/c_runtime/fgets/test2/test2.c b/src/pal/tests/palsuite/c_runtime/fgets/test2/test2.cpp
index fa37cdbc13..fa37cdbc13 100644
--- a/src/pal/tests/palsuite/c_runtime/fgets/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/fgets/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fgets/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fgets/test3/CMakeLists.txt
index 50f0901ee1..0833ad0130 100644
--- a/src/pal/tests/palsuite/c_runtime/fgets/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fgets/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_fgets_test3
diff --git a/src/pal/tests/palsuite/c_runtime/fgets/test3/test3.c b/src/pal/tests/palsuite/c_runtime/fgets/test3/test3.cpp
index 525ba9327f..525ba9327f 100644
--- a/src/pal/tests/palsuite/c_runtime/fgets/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/fgets/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/floor/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/floor/test1/CMakeLists.txt
index dbc5abde5b..3222ed8ba3 100644
--- a/src/pal/tests/palsuite/c_runtime/floor/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/floor/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_floor_test1
diff --git a/src/pal/tests/palsuite/c_runtime/floor/test1/test1.c b/src/pal/tests/palsuite/c_runtime/floor/test1/test1.cpp
index dba320919b..dba320919b 100644
--- a/src/pal/tests/palsuite/c_runtime/floor/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/floor/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/floorf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/floorf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/floorf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/floorf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/floorf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..f6e24adcd9
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/floorf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_floorf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_floorf_test1 coreclrpal)
+
+target_link_libraries(paltest_floorf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/floorf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/floorf/test1/test1.c
new file mode 100644
index 0000000000..57dca21382
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/floorf/test1/test1.c
@@ -0,0 +1,131 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Tests floorf with simple positive and negative values. Also tests
+** extreme cases like extremely small values and positive and
+** negative infinity. Makes sure that calling floorf on NaN returns
+** NaN
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = floorf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("floorf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = floorf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("floorf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char *argv[])
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0.318309886f, 0, PAL_EPSILON }, // value: 1 / pi
+ { 0.434294482f, 0, PAL_EPSILON }, // value: log10f(e)
+ { 0.636619772f, 0, PAL_EPSILON }, // value: 2 / pi
+ { 0.693147181f, 0, PAL_EPSILON }, // value: ln(2)
+ { 0.707106781f, 0, PAL_EPSILON }, // value: 1 / sqrtf(2)
+ { 0.785398163f, 0, PAL_EPSILON }, // value: pi / 4
+ { 1.12837917f, 1, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi)
+ { 1.41421356f, 1, PAL_EPSILON * 10 }, // value: sqrtf(2)
+ { 1.44269504f, 1, PAL_EPSILON * 10 }, // value: logf2(e)
+ { 1.57079633f, 1, PAL_EPSILON * 10 }, // value: pi / 2
+ { 2.30258509f, 2, PAL_EPSILON * 10 }, // value: ln(10)
+ { 2.71828183f, 2, PAL_EPSILON * 10 }, // value: e
+ { 3.14159265f, 3, PAL_EPSILON * 10 }, // value: pi
+ { PAL_POSINF, PAL_POSINF, 0 }
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ validate( 0, 0, PAL_EPSILON);
+ validate(-0.0f, 0, PAL_EPSILON);
+
+ validate( 1, 1, PAL_EPSILON * 10);
+ validate(-1.0f, -1, PAL_EPSILON * 10);
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate( tests[i].value, tests[i].expected, tests[i].variance);
+ validate(-tests[i].value, -(tests[i].expected + 1), tests[i].variance);
+ }
+
+ validate_isnan(PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/floorf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/floorf/test1/testinfo.dat
new file mode 100644
index 0000000000..006540141a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/floorf/test1/testinfo.dat
@@ -0,0 +1,13 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = floorf
+Name = Positive Test for floorf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes to floorf() a series of value, checking that
+= each one return to correct value.
diff --git a/src/pal/tests/palsuite/c_runtime/fmod/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fmod/test1/CMakeLists.txt
index c76df1f0bf..33fbfb2653 100644
--- a/src/pal/tests/palsuite/c_runtime/fmod/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fmod/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fmod_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fmod/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fmod/test1/test1.cpp
index fd69ca52cb..fd69ca52cb 100644
--- a/src/pal/tests/palsuite/c_runtime/fmod/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fmod/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fmodf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fmodf/test1/CMakeLists.txt
index d1ea238a98..487b3adda4 100644
--- a/src/pal/tests/palsuite/c_runtime/fmodf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fmodf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fmodf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fmodf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fmodf/test1/test1.cpp
index 31b45d3606..31b45d3606 100644
--- a/src/pal/tests/palsuite/c_runtime/fmodf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fmodf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fopen/test1/CMakeLists.txt
index 6578c43659..7603fc623e 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fopen_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fopen/test1/test1.cpp
index 565b4eb77d..565b4eb77d 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fopen/test2/CMakeLists.txt
index 4458ed21d8..b8569921de 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_fopen_test2
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test2/test2.c b/src/pal/tests/palsuite/c_runtime/fopen/test2/test2.cpp
index 4026efe89a..4026efe89a 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fopen/test3/CMakeLists.txt
index 2c80f72ae7..5b28caf4ba 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_fopen_test3
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test3/test3.c b/src/pal/tests/palsuite/c_runtime/fopen/test3/test3.cpp
index f3af42dc8a..f3af42dc8a 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fopen/test4/CMakeLists.txt
index 92e0ef0bd8..db5779f282 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_fopen_test4
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test4/test4.c b/src/pal/tests/palsuite/c_runtime/fopen/test4/test4.cpp
index 04683d52c5..04683d52c5 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fopen/test5/CMakeLists.txt
index 82529b9aab..6341e4a7d2 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_fopen_test5
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test5/test5.c b/src/pal/tests/palsuite/c_runtime/fopen/test5/test5.cpp
index 0a760314e1..0a760314e1 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fopen/test6/CMakeLists.txt
index 9a01cfb9a8..39cf9158bb 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_fopen_test6
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test6/test6.c b/src/pal/tests/palsuite/c_runtime/fopen/test6/test6.cpp
index 03b6067fdd..03b6067fdd 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fopen/test7/CMakeLists.txt
index 168a5aff53..ee22e347d6 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_fopen_test7
diff --git a/src/pal/tests/palsuite/c_runtime/fopen/test7/test7.c b/src/pal/tests/palsuite/c_runtime/fopen/test7/test7.cpp
index 3ef8602ddb..3ef8602ddb 100644
--- a/src/pal/tests/palsuite/c_runtime/fopen/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/fopen/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/fprintf.h b/src/pal/tests/palsuite/c_runtime/fprintf/fprintf.h
index 380eb0a0b3..87ee0d1232 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/fprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/fprintf.h
@@ -11,7 +11,7 @@ function with this as a return type.
#ifndef __FPRINTF_H__
#define __FPRINTF_H__
-void DoStrTest(char *formatstr, char* param, char *checkstr)
+void DoStrTest(const char *formatstr, char* param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -34,7 +34,7 @@ void DoStrTest(char *formatstr, char* param, char *checkstr)
fclose(fp);
}
-void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
+void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -58,7 +58,7 @@ void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
}
-void DoCharTest(char *formatstr, char param, char *checkstr)
+void DoCharTest(const char *formatstr, char param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -81,7 +81,7 @@ void DoCharTest(char *formatstr, char param, char *checkstr)
fclose(fp);
}
-void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
+void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -104,7 +104,7 @@ void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
fclose(fp);
}
-void DoNumTest(char *formatstr, int value, char *checkstr)
+void DoNumTest(const char *formatstr, int value, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -127,7 +127,7 @@ void DoNumTest(char *formatstr, int value, char *checkstr)
fclose(fp);
}
-void DoI64Test(char *formatstr, INT64 value, char *valuestr, char *checkstr1, char *checkstr2)
+void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1, const char *checkstr2)
{
FILE *fp;
char buf[256] = { 0 };
@@ -151,7 +151,7 @@ void DoI64Test(char *formatstr, INT64 value, char *valuestr, char *checkstr1, ch
fclose(fp);
}
-void DoDoubleTest(char *formatstr, double value, char *checkstr1, char *checkstr2)
+void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, const char *checkstr2)
{
FILE *fp;
char buf[256] = { 0 };
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test1/CMakeLists.txt
index ab4176563d..60ffd49cf5 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fprintf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fprintf/test1/test1.cpp
index d55fc2534c..d55fc2534c 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test10/CMakeLists.txt
index f718ad7934..3fb57c217c 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_fprintf_test10
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/fprintf/test10/test10.cpp
index 5988e8da74..5988e8da74 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test10/test10.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test11/CMakeLists.txt
index 6ccd58ddd2..d325ce225e 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_fprintf_test11
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/fprintf/test11/test11.cpp
index 01880552b7..01880552b7 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test11/test11.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test12/CMakeLists.txt
index 17bc7f100b..8bd3970e80 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_fprintf_test12
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/fprintf/test12/test12.cpp
index 0292e15014..0292e15014 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test12/test12.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test13/CMakeLists.txt
index c6eb0f9075..702058b797 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test13.c
+ test13.cpp
)
add_executable(paltest_fprintf_test13
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/fprintf/test13/test13.cpp
index e171aeacce..e171aeacce 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test13/test13.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test13/test13.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test14/CMakeLists.txt
index 6bb281bc62..b92ede7c87 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test14.c
+ test14.cpp
)
add_executable(paltest_fprintf_test14
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/fprintf/test14/test14.cpp
index 5d7d77387d..5d7d77387d 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test14/test14.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test14/test14.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test15/CMakeLists.txt
index ce1a8b6111..20f1e42aab 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test15.c
+ test15.cpp
)
add_executable(paltest_fprintf_test15
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/fprintf/test15/test15.cpp
index d024bdbd8a..d024bdbd8a 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test15/test15.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test15/test15.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test16/CMakeLists.txt
index 011cd13fb1..8d72421210 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test16.c
+ test16.cpp
)
add_executable(paltest_fprintf_test16
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/fprintf/test16/test16.cpp
index 079faeaf59..079faeaf59 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test16/test16.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test16/test16.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test17/CMakeLists.txt
index 4516f4b769..82d1f84f31 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test17.c
+ test17.cpp
)
add_executable(paltest_fprintf_test17
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/fprintf/test17/test17.cpp
index 7bd817d7db..7bd817d7db 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test17/test17.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test17/test17.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test18/CMakeLists.txt
index fc035020ca..1ca54e42b7 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test18/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test18.c
+ test18.cpp
)
add_executable(paltest_fprintf_test18
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/fprintf/test18/test18.cpp
index 6582c41e0f..6582c41e0f 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test18/test18.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test18/test18.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test19/CMakeLists.txt
index 3781b426f2..2c66239801 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test19/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test19.c
+ test19.cpp
)
add_executable(paltest_fprintf_test19
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/fprintf/test19/test19.cpp
index 9d9a28c325..9d9a28c325 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test19/test19.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test19/test19.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test2/CMakeLists.txt
index 0ef44b6b7d..ae1d9dc64d 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_fprintf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/fprintf/test2/test2.cpp
index 1ed7f3fd23..1ed7f3fd23 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test3/CMakeLists.txt
index adfd36fce7..4b10c4c407 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_fprintf_test3
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/fprintf/test3/test3.cpp
index 6185135581..6185135581 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test4/CMakeLists.txt
index 7d471b1b9c..292bdb6625 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_fprintf_test4
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/fprintf/test4/test4.cpp
index 51ec1f099c..51ec1f099c 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test5/CMakeLists.txt
index 1e3a568513..370ed3329a 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_fprintf_test5
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/fprintf/test5/test5.cpp
index c53e3f45b4..c53e3f45b4 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test6/CMakeLists.txt
index 89620dd453..bd1cbda924 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_fprintf_test6
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/fprintf/test6/test6.cpp
index 0a8bc6b103..0a8bc6b103 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test7/CMakeLists.txt
index 3dc10dd6dc..38429e7900 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_fprintf_test7
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/fprintf/test7/test7.cpp
index 088e328de5..088e328de5 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test8/CMakeLists.txt
index f6dd984af9..990eca26b0 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_fprintf_test8
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/fprintf/test8/test8.cpp
index c781abc968..c781abc968 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test8/test8.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fprintf/test9/CMakeLists.txt
index 62aa85e6ff..715d38a431 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_fprintf_test9
diff --git a/src/pal/tests/palsuite/c_runtime/fprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/fprintf/test9/test9.cpp
index 3b06daec48..3b06daec48 100644
--- a/src/pal/tests/palsuite/c_runtime/fprintf/test9/test9.c
+++ b/src/pal/tests/palsuite/c_runtime/fprintf/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fputs/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fputs/test1/CMakeLists.txt
index e4a92d5966..d0f1aca0e6 100644
--- a/src/pal/tests/palsuite/c_runtime/fputs/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fputs/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fputs_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fputs/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fputs/test1/test1.cpp
index b90ea082e9..b90ea082e9 100644
--- a/src/pal/tests/palsuite/c_runtime/fputs/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fputs/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fputs/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fputs/test2/CMakeLists.txt
index 6e939f3346..9242ea16e5 100644
--- a/src/pal/tests/palsuite/c_runtime/fputs/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fputs/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_fputs_test2
diff --git a/src/pal/tests/palsuite/c_runtime/fputs/test2/test2.c b/src/pal/tests/palsuite/c_runtime/fputs/test2/test2.cpp
index b8e2f410bb..b8e2f410bb 100644
--- a/src/pal/tests/palsuite/c_runtime/fputs/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/fputs/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fread/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fread/test1/CMakeLists.txt
index a2e09579b1..1bd84b5c62 100644
--- a/src/pal/tests/palsuite/c_runtime/fread/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fread/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fread_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fread/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fread/test1/test1.cpp
index b706b2e91c..b706b2e91c 100644
--- a/src/pal/tests/palsuite/c_runtime/fread/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fread/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fread/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fread/test2/CMakeLists.txt
index 0538e0c3af..93e0394832 100644
--- a/src/pal/tests/palsuite/c_runtime/fread/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fread/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_fread_test2
diff --git a/src/pal/tests/palsuite/c_runtime/fread/test2/test2.c b/src/pal/tests/palsuite/c_runtime/fread/test2/test2.cpp
index d7262a9321..d7262a9321 100644
--- a/src/pal/tests/palsuite/c_runtime/fread/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/fread/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fread/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fread/test3/CMakeLists.txt
index f3c636f3df..285608bc3d 100644
--- a/src/pal/tests/palsuite/c_runtime/fread/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fread/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_fread_test3
diff --git a/src/pal/tests/palsuite/c_runtime/fread/test3/test3.c b/src/pal/tests/palsuite/c_runtime/fread/test3/test3.cpp
index 8c79bee582..8c79bee582 100644
--- a/src/pal/tests/palsuite/c_runtime/fread/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/fread/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/free/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/free/test1/CMakeLists.txt
index bd94cb5733..92ee9896c7 100644
--- a/src/pal/tests/palsuite/c_runtime/free/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/free/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_free_test1
diff --git a/src/pal/tests/palsuite/c_runtime/free/test1/test1.c b/src/pal/tests/palsuite/c_runtime/free/test1/test1.cpp
index 4ff8dfb094..4ff8dfb094 100644
--- a/src/pal/tests/palsuite/c_runtime/free/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/free/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fseek/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fseek/test1/CMakeLists.txt
index fb55bd1051..59ee8b4563 100644
--- a/src/pal/tests/palsuite/c_runtime/fseek/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fseek/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fseek_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fseek/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fseek/test1/test1.c
deleted file mode 100644
index 8496289a01..0000000000
--- a/src/pal/tests/palsuite/c_runtime/fseek/test1/test1.c
+++ /dev/null
@@ -1,193 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: Call fseek to move a file pointer to the start of a file,
-** a position offset from the start, a position offset from the
-** current position, and a position offset from the end of the
-** file. Check that the file pointer is at the correct position
-** after each seek.
-**
-**
-**==========================================================================*/
-
-#include <palsuite.h>
-
-const char filename[] = "testfile.txt";
-
-static BOOL Cleanup(HANDLE hFile)
-{
- BOOL result= TRUE;
-
- if (fclose(hFile))
- {
- Trace("fseek: ERROR -> Unable to close file \"%s\".\n",
- filename);
- result= FALSE;
- }
- if (!DeleteFileA(filename))
- {
- result= FALSE;
- Trace("fseek: ERROR -> Unable to delete file \"%s\". ",
- "GetLastError returned %u.\n",
- filename,
- GetLastError());
- }
- return result;
-}
-
-int __cdecl main(int argc, char **argv)
-{
- char outBuf[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- char inBuf[20];
- FILE * fp;
- int size = ( sizeof(outBuf)/sizeof(char) ) - 1;
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
-
- /*create the file*/
- fp = fopen(filename, "w");
- if (fp == NULL)
- {
- Fail("Unable to open a file for write.\n");
- }
- if(fprintf(fp, outBuf) != size)
- {
- Trace("Unable to write to %s.\n", filename);
- Cleanup(fp);
- Fail("");
- }
-
- if (fclose(fp) != 0)
- {
- Trace("Unable to close newly written file.\n");
- if (!DeleteFileA(filename))
- {
- Trace("fseek: ERROR -> Unable to delete file \"%s\". ",
- "GetLastError returned %u.\n",
- filename,
- GetLastError());
- }
- Fail("");
- }
-
- fp = fopen(filename, "r");
- if (fp == NULL)
- {
- if (!DeleteFileA(filename))
- {
- Trace("_putw: ERROR -> Unable to delete file \"%s\". ",
- "GetLastError returned %u.\n",
- filename,
- GetLastError());
- }
- Fail("Unable to open a file for read.\n");
- }
-
- /*seek to the start*/
- if (fseek(fp, 0, SEEK_SET) != 0)
- {
- Cleanup(fp);
- Fail("fseek failed when seeking the start of a file.\n");
- }
- if (fgets(inBuf, 11, fp) != inBuf)
- {
- Cleanup(fp);
- Fail("Unable to read from file after using fseek to move to the start.\n");
- }
- if (strncmp(inBuf, outBuf, 10) != 0)
- {
- Cleanup(fp);
- Fail("fseek was asked to seek the start of a file,"
- "but didn't get there.\n");
- }
-
- /*Seek with an offset from the start*/
-
- if (fseek(fp, 10, SEEK_SET) != 0)
- {
- Cleanup(fp);
- Fail("fseek failed when called with SEEK_SET and a positive offset.\n");
- }
-
- if (fgets(inBuf, 6, fp) != inBuf)
- {
- Cleanup(fp);
- Fail("fgets failed after feek was called with SEEK_SET"
- "and a positive offset.\n");
- }
-
-
- if (strncmp(inBuf, "ABCDE", 5) != 0)
- {
- Cleanup(fp);
- Fail("fseek did not move to the correct position when passed SEEK_SET"
- " and a positive offset.\n");
- }
-
- /*now move backwards and read the same string*/
- if (fseek(fp, -5, SEEK_CUR) != 0)
- {
- Cleanup(fp);
- Fail("fseek failed when passed SEEK_CUR and a negative offset.\n");
- }
-
- if (fgets(inBuf, 6, fp) != inBuf)
- {
- Cleanup(fp);
- Fail("fgets failed after fseek was called with SEEK_CUR and a "
- "negative offset.\n");
- }
-
- if (strncmp(inBuf, "ABCDE", 5) != 0)
- {
- Cleanup(fp);
- Fail("fseek did not move to the correct position when called with"
- " SEEK_CUR and a negative offset.\n");
- }
-
- /*Try seeking relative to the end of the file.*/
- if (fseek(fp, -10, SEEK_END) != 0)
- {
- Cleanup(fp);
- Fail("fseek failed when called with SEEK_END and a negative"
- " offset.\n");
- }
- if (fgets(inBuf, 2, fp) != inBuf)
- {
- Cleanup(fp);
- Fail("fgets failed after fseek was called with SEEK_END and a "
- "negative offset\n");
- }
-
- if (strncmp(inBuf, "Q", 1) != 0)
- {
- Cleanup(fp);
- Fail("fseek did not move to the correct position when called with "
- "SEEK_END and a negative offset.\n");
- }
-
-
- /*close the file*/
- if(!Cleanup(fp))
- {
- Fail("");
- }
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
-
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/fseek/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/fseek/test1/test1.cpp
new file mode 100644
index 0000000000..dd1e87ea8d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/fseek/test1/test1.cpp
@@ -0,0 +1,193 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Call fseek to move a file pointer to the start of a file,
+** a position offset from the start, a position offset from the
+** current position, and a position offset from the end of the
+** file. Check that the file pointer is at the correct position
+** after each seek.
+**
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+
+const char filename[] = "testfile.txt";
+
+static BOOL Cleanup(HANDLE hFile)
+{
+ BOOL result= TRUE;
+
+ if (fclose((PAL_FILE*)hFile))
+ {
+ Trace("fseek: ERROR -> Unable to close file \"%s\".\n",
+ filename);
+ result= FALSE;
+ }
+ if (!DeleteFileA(filename))
+ {
+ result= FALSE;
+ Trace("fseek: ERROR -> Unable to delete file \"%s\". ",
+ "GetLastError returned %u.\n",
+ filename,
+ GetLastError());
+ }
+ return result;
+}
+
+int __cdecl main(int argc, char **argv)
+{
+ char outBuf[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ char inBuf[20];
+ FILE * fp;
+ int size = ( sizeof(outBuf)/sizeof(char) ) - 1;
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+
+ /*create the file*/
+ fp = fopen(filename, "w");
+ if (fp == NULL)
+ {
+ Fail("Unable to open a file for write.\n");
+ }
+ if(fprintf(fp, outBuf) != size)
+ {
+ Trace("Unable to write to %s.\n", filename);
+ Cleanup(fp);
+ Fail("");
+ }
+
+ if (fclose(fp) != 0)
+ {
+ Trace("Unable to close newly written file.\n");
+ if (!DeleteFileA(filename))
+ {
+ Trace("fseek: ERROR -> Unable to delete file \"%s\". ",
+ "GetLastError returned %u.\n",
+ filename,
+ GetLastError());
+ }
+ Fail("");
+ }
+
+ fp = fopen(filename, "r");
+ if (fp == NULL)
+ {
+ if (!DeleteFileA(filename))
+ {
+ Trace("_putw: ERROR -> Unable to delete file \"%s\". ",
+ "GetLastError returned %u.\n",
+ filename,
+ GetLastError());
+ }
+ Fail("Unable to open a file for read.\n");
+ }
+
+ /*seek to the start*/
+ if (fseek(fp, 0, SEEK_SET) != 0)
+ {
+ Cleanup(fp);
+ Fail("fseek failed when seeking the start of a file.\n");
+ }
+ if (fgets(inBuf, 11, fp) != inBuf)
+ {
+ Cleanup(fp);
+ Fail("Unable to read from file after using fseek to move to the start.\n");
+ }
+ if (strncmp(inBuf, outBuf, 10) != 0)
+ {
+ Cleanup(fp);
+ Fail("fseek was asked to seek the start of a file,"
+ "but didn't get there.\n");
+ }
+
+ /*Seek with an offset from the start*/
+
+ if (fseek(fp, 10, SEEK_SET) != 0)
+ {
+ Cleanup(fp);
+ Fail("fseek failed when called with SEEK_SET and a positive offset.\n");
+ }
+
+ if (fgets(inBuf, 6, fp) != inBuf)
+ {
+ Cleanup(fp);
+ Fail("fgets failed after feek was called with SEEK_SET"
+ "and a positive offset.\n");
+ }
+
+
+ if (strncmp(inBuf, "ABCDE", 5) != 0)
+ {
+ Cleanup(fp);
+ Fail("fseek did not move to the correct position when passed SEEK_SET"
+ " and a positive offset.\n");
+ }
+
+ /*now move backwards and read the same string*/
+ if (fseek(fp, -5, SEEK_CUR) != 0)
+ {
+ Cleanup(fp);
+ Fail("fseek failed when passed SEEK_CUR and a negative offset.\n");
+ }
+
+ if (fgets(inBuf, 6, fp) != inBuf)
+ {
+ Cleanup(fp);
+ Fail("fgets failed after fseek was called with SEEK_CUR and a "
+ "negative offset.\n");
+ }
+
+ if (strncmp(inBuf, "ABCDE", 5) != 0)
+ {
+ Cleanup(fp);
+ Fail("fseek did not move to the correct position when called with"
+ " SEEK_CUR and a negative offset.\n");
+ }
+
+ /*Try seeking relative to the end of the file.*/
+ if (fseek(fp, -10, SEEK_END) != 0)
+ {
+ Cleanup(fp);
+ Fail("fseek failed when called with SEEK_END and a negative"
+ " offset.\n");
+ }
+ if (fgets(inBuf, 2, fp) != inBuf)
+ {
+ Cleanup(fp);
+ Fail("fgets failed after fseek was called with SEEK_END and a "
+ "negative offset\n");
+ }
+
+ if (strncmp(inBuf, "Q", 1) != 0)
+ {
+ Cleanup(fp);
+ Fail("fseek did not move to the correct position when called with "
+ "SEEK_END and a negative offset.\n");
+ }
+
+
+ /*close the file*/
+ if(!Cleanup(fp))
+ {
+ Fail("");
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
+
+
+
+
+
+
diff --git a/src/pal/tests/palsuite/c_runtime/ftell/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/ftell/test1/CMakeLists.txt
index 7ea9a51111..a1f350d0c2 100644
--- a/src/pal/tests/palsuite/c_runtime/ftell/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/ftell/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- ftell.c
+ ftell.cpp
)
add_executable(paltest_ftell_test1
diff --git a/src/pal/tests/palsuite/c_runtime/ftell/test1/ftell.c b/src/pal/tests/palsuite/c_runtime/ftell/test1/ftell.cpp
index 66e0854847..66e0854847 100644
--- a/src/pal/tests/palsuite/c_runtime/ftell/test1/ftell.c
+++ b/src/pal/tests/palsuite/c_runtime/ftell/test1/ftell.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/fwprintf.h b/src/pal/tests/palsuite/c_runtime/fwprintf/fwprintf.h
index 36756636cf..eed0e76484 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/fwprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/fwprintf.h
@@ -14,7 +14,7 @@
#ifndef __fwprintf_H__
#define __fwprintf_H__
-void DoStrTest(WCHAR *formatstr, char* param, char *checkstr)
+void DoStrTest(const WCHAR *formatstr, char* param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -45,7 +45,7 @@ void DoStrTest(WCHAR *formatstr, char* param, char *checkstr)
fclose(fp);
}
-void DoWStrTest(WCHAR *formatstr, WCHAR* param, char *checkstr)
+void DoWStrTest(const WCHAR *formatstr, WCHAR* param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -77,8 +77,8 @@ void DoWStrTest(WCHAR *formatstr, WCHAR* param, char *checkstr)
}
-void DoPointerTest(WCHAR *formatstr, void* param, char* paramstr,
- char *checkstr1, char *checkstr2)
+void DoPointerTest(const WCHAR *formatstr, void* param, char* paramstr,
+ const char *checkstr1, const char *checkstr2)
{
FILE *fp;
char buf[256] = { 0 };
@@ -119,7 +119,7 @@ void DoPointerTest(WCHAR *formatstr, void* param, char* paramstr,
-void DoCountTest(WCHAR *formatstr, int param, char *checkstr)
+void DoCountTest(const WCHAR *formatstr, int param, const char *checkstr)
{
FILE *fp;
char buf[512] = { 0 };
@@ -162,7 +162,7 @@ void DoCountTest(WCHAR *formatstr, int param, char *checkstr)
}
}
-void DoShortCountTest(WCHAR *formatstr, int param, char *checkstr)
+void DoShortCountTest(const WCHAR *formatstr, int param, const char *checkstr)
{
FILE *fp;
char buf[512] = { 0 };
@@ -206,7 +206,7 @@ void DoShortCountTest(WCHAR *formatstr, int param, char *checkstr)
}
-void DoCharTest(WCHAR *formatstr, char param, char *checkstr)
+void DoCharTest(const WCHAR *formatstr, char param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -237,7 +237,7 @@ void DoCharTest(WCHAR *formatstr, char param, char *checkstr)
fclose(fp);
}
-void DoWCharTest(WCHAR *formatstr, WCHAR param, char *checkstr)
+void DoWCharTest(const WCHAR *formatstr, WCHAR param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -268,7 +268,7 @@ void DoWCharTest(WCHAR *formatstr, WCHAR param, char *checkstr)
fclose(fp);
}
-void DoNumTest(WCHAR *formatstr, int value, char *checkstr)
+void DoNumTest(const WCHAR *formatstr, int value, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -299,8 +299,8 @@ void DoNumTest(WCHAR *formatstr, int value, char *checkstr)
fclose(fp);
}
-void DoI64Test(WCHAR *formatstr, INT64 value, char *valuestr, char *checkstr1,
- char *checkstr2)
+void DoI64Test(const WCHAR *formatstr, INT64 value, char *valuestr, const char *checkstr1,
+ const char *checkstr2)
{
FILE *fp;
char buf[256] = { 0 };
@@ -332,8 +332,8 @@ void DoI64Test(WCHAR *formatstr, INT64 value, char *valuestr, char *checkstr1,
fclose(fp);
}
-void DoDoubleTest(WCHAR *formatstr, double value, char *checkstr1,
- char *checkstr2)
+void DoDoubleTest(const WCHAR *formatstr, double value, const char *checkstr1,
+ const char *checkstr2)
{
FILE *fp;
char buf[256] = { 0 };
@@ -367,8 +367,8 @@ void DoDoubleTest(WCHAR *formatstr, double value, char *checkstr1,
}
-void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
- char *paramstr, char *checkstr1, char *checkstr2)
+void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param,
+ char *paramstr, const char *checkstr1, const char *checkstr2)
{
FILE *fp;
char buf[256];
@@ -409,8 +409,8 @@ void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
}
-void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param,
- char *checkstr1, char *checkstr2)
+void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double param,
+ const char *checkstr1, const char *checkstr2)
{
FILE *fp;
char buf[256];
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test1/CMakeLists.txt
index ce4271edb2..519860b877 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fwprintf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test1/test1.cpp
index 8a171db52a..8a171db52a 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test10/CMakeLists.txt
index a8323b4fc7..e604e03dff 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_fwprintf_test10
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test10/test10.cpp
index 3aa2c45c7c..3aa2c45c7c 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test10/test10.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test11/CMakeLists.txt
index 1b7987400a..18be522823 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_fwprintf_test11
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test11/test11.cpp
index 5867cd64fb..5867cd64fb 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test11/test11.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test12/CMakeLists.txt
index 1e43a4c906..6ea739b28f 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_fwprintf_test12
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test12/test12.cpp
index 48a6123423..48a6123423 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test12/test12.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test13/CMakeLists.txt
index c84dc3ea41..8505ccbd82 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test13.c
+ test13.cpp
)
add_executable(paltest_fwprintf_test13
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test13/test13.cpp
index 6eabec6c77..6eabec6c77 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test13/test13.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test13/test13.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test14/CMakeLists.txt
index 97824c76b7..548e60fdb8 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test14.c
+ test14.cpp
)
add_executable(paltest_fwprintf_test14
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test14/test14.cpp
index 001cf72689..001cf72689 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test14/test14.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test14/test14.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test15/CMakeLists.txt
index 6786c5b774..c5b53461a7 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test15.c
+ test15.cpp
)
add_executable(paltest_fwprintf_test15
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test15/test15.cpp
index 9dfe82eccc..9dfe82eccc 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test15/test15.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test15/test15.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test16/CMakeLists.txt
index be14870863..51af0a0d60 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test16.c
+ test16.cpp
)
add_executable(paltest_fwprintf_test16
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test16/test16.cpp
index 1969be1824..1969be1824 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test16/test16.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test16/test16.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test17/CMakeLists.txt
index b390d15620..9ed8a390e7 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test17.c
+ test17.cpp
)
add_executable(paltest_fwprintf_test17
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test17/test17.cpp
index 66b12716d0..66b12716d0 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test17/test17.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test17/test17.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test18/CMakeLists.txt
index 6f6d79bce5..3e3ba4efc7 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test18/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test18.c
+ test18.cpp
)
add_executable(paltest_fwprintf_test18
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test18/test18.cpp
index a33dea39b3..a33dea39b3 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test18/test18.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test18/test18.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test19/CMakeLists.txt
index bc10825ce1..fbb7370ba3 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test19/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test19.c
+ test19.cpp
)
add_executable(paltest_fwprintf_test19
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.c
deleted file mode 100644
index 4600de7fa9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.c
+++ /dev/null
@@ -1,81 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test19.c
-**
-** Purpose: Tests the variable length precision argument.
-** This test is modeled after the sprintf series.
-**
-**
-**==========================================================================*/
-
-#include <palsuite.h>
-#include "../fwprintf.h"
-
-/*
- * Depends on memcmp, strlen, fopen, fseek and fgets.
- */
-
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int n = -1;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
- DoArgumentPrecTest(convert("%.*s"), 2, convert("bar"), "bar", "ba", "ba");
- DoArgumentPrecTest(convert("%.*S"), 2, "bar", "bar", "ba", "ba");
- DoArgumentPrecTest(convert("foo %.*n"), 3, &n, "pointer to int", "foo ",
- "foo ");
- if (n != 4)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- 4, n);
- }
-
- DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, "42", "52", "52");
- DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, "42", "052", "052");
- DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, "0x42", "042", "042");
- DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, "0x42", "042", "042");
-
-
- DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, "2.0e+000", "2.0e+00");
- DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, "2.010e+000",
- "2.010e+00");
- DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, "2.0E+000", "2.0E+00");
- DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, "2.010E+000",
- "2.010E+00");
- DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, "2.0", "2.0");
- DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, "2.010", "2.010");
- DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, "3e+002", "3e+02");
- DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, "256.01", "256.01");
- DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, "3E+002", "3E+02");
- DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, "256.01", "256.01");
-
- PAL_Terminate();
-
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.cpp
new file mode 100644
index 0000000000..a407c9f4bd
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test19/test19.cpp
@@ -0,0 +1,81 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test19.c
+**
+** Purpose: Tests the variable length precision argument.
+** This test is modeled after the sprintf series.
+**
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+#include "../fwprintf.h"
+
+/*
+ * Depends on memcmp, strlen, fopen, fseek and fgets.
+ */
+
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n = -1;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+ DoArgumentPrecTest(convert("%.*s"), 2, (void*)convert("bar"), "bar", "ba", "ba");
+ DoArgumentPrecTest(convert("%.*S"), 2, (void*)"bar", "bar", "ba", "ba");
+ DoArgumentPrecTest(convert("foo %.*n"), 3, (void*)&n, "pointer to int", "foo ",
+ "foo ");
+ if (n != 4)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
+ 4, n);
+ }
+
+ DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, "42", "52", "52");
+ DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, "42", "052", "052");
+ DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, "0x42", "042", "042");
+ DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, "0x42", "042", "042");
+
+
+ DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, "2.0e+000", "2.0e+00");
+ DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, "2.010e+000",
+ "2.010e+00");
+ DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, "2.0E+000", "2.0E+00");
+ DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, "2.010E+000",
+ "2.010E+00");
+ DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, "2.0", "2.0");
+ DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, "2.010", "2.010");
+ DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, "3e+002", "3e+02");
+ DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, "256.01", "256.01");
+ DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, "3E+002", "3E+02");
+ DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, "256.01", "256.01");
+
+ PAL_Terminate();
+
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test2/CMakeLists.txt
index 64314651c0..e65a396862 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_fwprintf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test2/test2.cpp
index ecd3c513df..ecd3c513df 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test3/CMakeLists.txt
index 6906722cde..53c46369de 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_fwprintf_test3
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test3/test3.cpp
index d718a19067..d718a19067 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test4/CMakeLists.txt
index b91bc87195..9dbb46283e 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_fwprintf_test4
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test4/test4.cpp
index 96fb472c3e..96fb472c3e 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test5/CMakeLists.txt
index 53bf482b6f..4e72e3ca88 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_fwprintf_test5
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test5/test5.cpp
index 9d95989090..9d95989090 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test6/CMakeLists.txt
index bf7d7cccb8..d57f07fafa 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_fwprintf_test6
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test6/test6.cpp
index 160ff524e0..160ff524e0 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test7/CMakeLists.txt
index 68bcc9ca65..314ca353e5 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_fwprintf_test7
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.cpp
index c5515a8640..c5515a8640 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test8/CMakeLists.txt
index e07cbb9119..e818df2eb2 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_fwprintf_test8
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test8/test8.cpp
index efc81a954a..efc81a954a 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test8/test8.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwprintf/test9/CMakeLists.txt
index 898da1a64f..28b6b86921 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_fwprintf_test9
diff --git a/src/pal/tests/palsuite/c_runtime/fwprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/fwprintf/test9/test9.cpp
index 23db2d8971..23db2d8971 100644
--- a/src/pal/tests/palsuite/c_runtime/fwprintf/test9/test9.c
+++ b/src/pal/tests/palsuite/c_runtime/fwprintf/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/fwrite/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/fwrite/test1/CMakeLists.txt
index 701e56acb5..5c8b7449f2 100644
--- a/src/pal/tests/palsuite/c_runtime/fwrite/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/fwrite/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_fwrite_test1
diff --git a/src/pal/tests/palsuite/c_runtime/fwrite/test1/test1.c b/src/pal/tests/palsuite/c_runtime/fwrite/test1/test1.cpp
index 392522879f..392522879f 100644
--- a/src/pal/tests/palsuite/c_runtime/fwrite/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/fwrite/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/getc/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/getc/test1/CMakeLists.txt
index 2a29e8af0a..68ecaa9abb 100644
--- a/src/pal/tests/palsuite/c_runtime/getc/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/getc/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- getc.c
+ getc.cpp
)
add_executable(paltest_getc_test1
diff --git a/src/pal/tests/palsuite/c_runtime/getc/test1/getc.c b/src/pal/tests/palsuite/c_runtime/getc/test1/getc.cpp
index dfe10d6160..dfe10d6160 100644
--- a/src/pal/tests/palsuite/c_runtime/getc/test1/getc.c
+++ b/src/pal/tests/palsuite/c_runtime/getc/test1/getc.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/getenv/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/getenv/test1/CMakeLists.txt
index 6243c032ab..9c52c2890e 100644
--- a/src/pal/tests/palsuite/c_runtime/getenv/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/getenv/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getenv_test1
diff --git a/src/pal/tests/palsuite/c_runtime/getenv/test1/test1.c b/src/pal/tests/palsuite/c_runtime/getenv/test1/test1.cpp
index 0fb9025c8f..0fb9025c8f 100644
--- a/src/pal/tests/palsuite/c_runtime/getenv/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/getenv/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/getenv/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/getenv/test2/CMakeLists.txt
index 7a301a5ca6..971a836239 100644
--- a/src/pal/tests/palsuite/c_runtime/getenv/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/getenv/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_getenv_test2
diff --git a/src/pal/tests/palsuite/c_runtime/getenv/test2/test2.c b/src/pal/tests/palsuite/c_runtime/getenv/test2/test2.cpp
index 26f245fcce..26f245fcce 100644
--- a/src/pal/tests/palsuite/c_runtime/getenv/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/getenv/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/getenv/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/getenv/test3/CMakeLists.txt
index 2cbe472221..620ccd1003 100644
--- a/src/pal/tests/palsuite/c_runtime/getenv/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/getenv/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_getenv_test3
diff --git a/src/pal/tests/palsuite/c_runtime/getenv/test3/test3.c b/src/pal/tests/palsuite/c_runtime/getenv/test3/test3.cpp
index 1eefd9d40c..1eefd9d40c 100644
--- a/src/pal/tests/palsuite/c_runtime/getenv/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/getenv/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/isalnum/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/isalnum/test1/CMakeLists.txt
index 3879bb7902..af65f32cbf 100644
--- a/src/pal/tests/palsuite/c_runtime/isalnum/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/isalnum/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isalnum_test1
diff --git a/src/pal/tests/palsuite/c_runtime/isalnum/test1/test1.c b/src/pal/tests/palsuite/c_runtime/isalnum/test1/test1.cpp
index d9cdfcadf6..d9cdfcadf6 100644
--- a/src/pal/tests/palsuite/c_runtime/isalnum/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/isalnum/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/isalpha/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/isalpha/test1/CMakeLists.txt
index 44fb72d7fe..82f19ad383 100644
--- a/src/pal/tests/palsuite/c_runtime/isalpha/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/isalpha/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isalpha_test1
diff --git a/src/pal/tests/palsuite/c_runtime/isalpha/test1/test1.c b/src/pal/tests/palsuite/c_runtime/isalpha/test1/test1.cpp
index b494d14a92..b494d14a92 100644
--- a/src/pal/tests/palsuite/c_runtime/isalpha/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/isalpha/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/isdigit/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/isdigit/test1/CMakeLists.txt
index dd03b238e1..b96b7aa706 100644
--- a/src/pal/tests/palsuite/c_runtime/isdigit/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/isdigit/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isdigit_test1
diff --git a/src/pal/tests/palsuite/c_runtime/isdigit/test1/test1.c b/src/pal/tests/palsuite/c_runtime/isdigit/test1/test1.cpp
index ad2344827f..ad2344827f 100644
--- a/src/pal/tests/palsuite/c_runtime/isdigit/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/isdigit/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/islower/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/islower/test1/CMakeLists.txt
index b7f5ad069f..d071d4bb65 100644
--- a/src/pal/tests/palsuite/c_runtime/islower/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/islower/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_islower_test1
diff --git a/src/pal/tests/palsuite/c_runtime/islower/test1/test1.c b/src/pal/tests/palsuite/c_runtime/islower/test1/test1.cpp
index c8e877b705..c8e877b705 100644
--- a/src/pal/tests/palsuite/c_runtime/islower/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/islower/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/isprint/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/isprint/test1/CMakeLists.txt
index 365777ab5a..91410a02ab 100644
--- a/src/pal/tests/palsuite/c_runtime/isprint/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/isprint/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- isprint.c
+ isprint.cpp
)
add_executable(paltest_isprint_test1
diff --git a/src/pal/tests/palsuite/c_runtime/isprint/test1/isprint.c b/src/pal/tests/palsuite/c_runtime/isprint/test1/isprint.cpp
index 54db666bf2..54db666bf2 100644
--- a/src/pal/tests/palsuite/c_runtime/isprint/test1/isprint.c
+++ b/src/pal/tests/palsuite/c_runtime/isprint/test1/isprint.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/isprint/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/isprint/test2/CMakeLists.txt
index a7ad75cc04..53ad94273c 100644
--- a/src/pal/tests/palsuite/c_runtime/isprint/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/isprint/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_isprint_test2
diff --git a/src/pal/tests/palsuite/c_runtime/isprint/test2/test2.c b/src/pal/tests/palsuite/c_runtime/isprint/test2/test2.cpp
index 2170c47a14..2170c47a14 100644
--- a/src/pal/tests/palsuite/c_runtime/isprint/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/isprint/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/isspace/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/isspace/test1/CMakeLists.txt
index 34ad70d328..c3cc525145 100644
--- a/src/pal/tests/palsuite/c_runtime/isspace/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/isspace/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isspace_test1
diff --git a/src/pal/tests/palsuite/c_runtime/isspace/test1/test1.c b/src/pal/tests/palsuite/c_runtime/isspace/test1/test1.cpp
index 6cd1ce878b..6cd1ce878b 100644
--- a/src/pal/tests/palsuite/c_runtime/isspace/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/isspace/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/isupper/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/isupper/test1/CMakeLists.txt
index c7fc71c43b..e1cfa6609d 100644
--- a/src/pal/tests/palsuite/c_runtime/isupper/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/isupper/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isupper_test1
diff --git a/src/pal/tests/palsuite/c_runtime/isupper/test1/test1.c b/src/pal/tests/palsuite/c_runtime/isupper/test1/test1.cpp
index b88bcc4a7e..b88bcc4a7e 100644
--- a/src/pal/tests/palsuite/c_runtime/isupper/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/isupper/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/iswdigit/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/iswdigit/test1/CMakeLists.txt
index b35dd5ed6d..4074abbe76 100644
--- a/src/pal/tests/palsuite/c_runtime/iswdigit/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/iswdigit/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_iswdigit_test1
diff --git a/src/pal/tests/palsuite/c_runtime/iswdigit/test1/test1.c b/src/pal/tests/palsuite/c_runtime/iswdigit/test1/test1.cpp
index 1cf94c5d13..1cf94c5d13 100644
--- a/src/pal/tests/palsuite/c_runtime/iswdigit/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/iswdigit/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/iswprint/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/iswprint/test1/CMakeLists.txt
index 5e436c3ca2..d21c232133 100644
--- a/src/pal/tests/palsuite/c_runtime/iswprint/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/iswprint/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_iswprint_test1
diff --git a/src/pal/tests/palsuite/c_runtime/iswprint/test1/test1.c b/src/pal/tests/palsuite/c_runtime/iswprint/test1/test1.cpp
index 08a985b2d6..08a985b2d6 100644
--- a/src/pal/tests/palsuite/c_runtime/iswprint/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/iswprint/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/iswspace/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/iswspace/test1/CMakeLists.txt
index 1368e55ccc..1f9a54fb17 100644
--- a/src/pal/tests/palsuite/c_runtime/iswspace/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/iswspace/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_iswspace_test1
diff --git a/src/pal/tests/palsuite/c_runtime/iswspace/test1/test1.c b/src/pal/tests/palsuite/c_runtime/iswspace/test1/test1.cpp
index c58997812e..c58997812e 100644
--- a/src/pal/tests/palsuite/c_runtime/iswspace/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/iswspace/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/iswupper/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/iswupper/test1/CMakeLists.txt
index 8b8fae6d72..1da5fbaa75 100644
--- a/src/pal/tests/palsuite/c_runtime/iswupper/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/iswupper/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_iswupper_test1
diff --git a/src/pal/tests/palsuite/c_runtime/iswupper/test1/test1.c b/src/pal/tests/palsuite/c_runtime/iswupper/test1/test1.cpp
index a01686be44..a01686be44 100644
--- a/src/pal/tests/palsuite/c_runtime/iswupper/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/iswupper/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/iswxdigit/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/iswxdigit/test1/CMakeLists.txt
index 3a726eced9..ae55976128 100644
--- a/src/pal/tests/palsuite/c_runtime/iswxdigit/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/iswxdigit/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_iswxdigit_test1
diff --git a/src/pal/tests/palsuite/c_runtime/iswxdigit/test1/test1.c b/src/pal/tests/palsuite/c_runtime/iswxdigit/test1/test1.cpp
index 73ad495856..73ad495856 100644
--- a/src/pal/tests/palsuite/c_runtime/iswxdigit/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/iswxdigit/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/isxdigit/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/isxdigit/test1/CMakeLists.txt
index 8919b36e42..4fd46c93d8 100644
--- a/src/pal/tests/palsuite/c_runtime/isxdigit/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/isxdigit/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isxdigit_test1
diff --git a/src/pal/tests/palsuite/c_runtime/isxdigit/test1/test1.c b/src/pal/tests/palsuite/c_runtime/isxdigit/test1/test1.cpp
index be25af233c..be25af233c 100644
--- a/src/pal/tests/palsuite/c_runtime/isxdigit/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/isxdigit/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/labs/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/labs/test1/CMakeLists.txt
index cf0f0999a9..2ffb3cd641 100644
--- a/src/pal/tests/palsuite/c_runtime/labs/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/labs/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_labs_test1
diff --git a/src/pal/tests/palsuite/c_runtime/labs/test1/test1.c b/src/pal/tests/palsuite/c_runtime/labs/test1/test1.cpp
index 41f85226e1..41f85226e1 100644
--- a/src/pal/tests/palsuite/c_runtime/labs/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/labs/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/llabs/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/llabs/test1/CMakeLists.txt
index 8f5bdbe097..3adc3cc737 100644
--- a/src/pal/tests/palsuite/c_runtime/llabs/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/llabs/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_llabs_test1
diff --git a/src/pal/tests/palsuite/c_runtime/llabs/test1/test1.c b/src/pal/tests/palsuite/c_runtime/llabs/test1/test1.cpp
index 044e22f134..044e22f134 100644
--- a/src/pal/tests/palsuite/c_runtime/llabs/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/llabs/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/localtime/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/localtime/test1/CMakeLists.txt
index 25acf48749..698699f821 100644
--- a/src/pal/tests/palsuite/c_runtime/localtime/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/localtime/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_localtime_test1
diff --git a/src/pal/tests/palsuite/c_runtime/localtime/test1/test1.c b/src/pal/tests/palsuite/c_runtime/localtime/test1/test1.cpp
index a993a17f69..a993a17f69 100644
--- a/src/pal/tests/palsuite/c_runtime/localtime/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/localtime/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/log/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/log/test1/CMakeLists.txt
index dd19002904..c8f991b997 100644
--- a/src/pal/tests/palsuite/c_runtime/log/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/log/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_log_test1
diff --git a/src/pal/tests/palsuite/c_runtime/log/test1/test1.c b/src/pal/tests/palsuite/c_runtime/log/test1/test1.cpp
index eea592dd45..eea592dd45 100644
--- a/src/pal/tests/palsuite/c_runtime/log/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/log/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/log10/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/log10/test1/CMakeLists.txt
index 31e750df3e..31025fbd04 100644
--- a/src/pal/tests/palsuite/c_runtime/log10/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/log10/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_log10_test1
diff --git a/src/pal/tests/palsuite/c_runtime/log10/test1/test1.c b/src/pal/tests/palsuite/c_runtime/log10/test1/test1.cpp
index 13711a752e..13711a752e 100644
--- a/src/pal/tests/palsuite/c_runtime/log10/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/log10/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/log10f/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/log10f/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/log10f/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/log10f/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/log10f/test1/CMakeLists.txt
new file mode 100644
index 0000000000..b2c0835451
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/log10f/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_log10f_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_log10f_test1 coreclrpal)
+
+target_link_libraries(paltest_log10f_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/log10f/test1/test1.c b/src/pal/tests/palsuite/c_runtime/log10f/test1/test1.c
new file mode 100644
index 0000000000..e7c8c2f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/log10f/test1/test1.c
@@ -0,0 +1,144 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test to ensure that log10f returns correct values.
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** fabs
+** _isnanf
+**
+**===========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = log10f(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("log10f(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = log10f(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("log10f(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0, PAL_NEGINF, 0 },
+ { 0.000721784159f, -3.14159265f, PAL_EPSILON * 10 }, // expected: -(pi)
+ { 0.00191301410f, -2.71828183f, PAL_EPSILON * 10 }, // expected: -(e)
+ { 0.00498212830f, -2.30258509f, PAL_EPSILON * 10 }, // expected: -(ln(10))
+ { 0.0268660410f, -1.57079633f, PAL_EPSILON * 10 }, // expected: -(pi / 2)
+ { 0.0360831928f, -1.44269504f, PAL_EPSILON * 10 }, // expected: -(logf2(e))
+ { 0.0385288847f, -1.41421356f, PAL_EPSILON * 10 }, // expected: -(sqrtf(2))
+ { 0.0744082059f, -1.12837917f, PAL_EPSILON * 10 }, // expected: -(2 / sqrtf(pi))
+ { 0.1f, -1, PAL_EPSILON * 10 }, // expected: -(1)
+ { 0.163908636f, -0.785398163f, PAL_EPSILON }, // expected: -(pi / 4)
+ { 0.196287760f, -0.707106781f, PAL_EPSILON }, // expected: -(1 / sqrtf(2))
+ { 0.202699566f, -0.693147181f, PAL_EPSILON }, // expected: -(ln(2))
+ { 0.230876765f, -0.636619772f, PAL_EPSILON }, // expected: -(2 / pi)
+ { 0.367879441f, -0.434294482f, PAL_EPSILON }, // expected: -(log10f(e))
+ { 0.480496373f, -0.318309886f, PAL_EPSILON }, // expected: -(1 / pi)
+ { 1, 0, PAL_EPSILON },
+ { 2.08118116f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi
+ { 2.71828183f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e) value: e
+ { 4.33131503f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi
+ { 4.93340967f, 0.693147181f, PAL_EPSILON }, // expected: ln(2)
+ { 5.09456117f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2)
+ { 6.10095980f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4
+ { 10, 1, PAL_EPSILON * 10 },
+ { 13.4393779f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi)
+ { 25.9545535f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2)
+ { 27.7137338f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e)
+ { 37.2217105f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2
+ { 200.717432f, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10)
+ { 522.735300f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e
+ { 1385.45573f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi
+ { PAL_POSINF, PAL_POSINF, 0 },
+ };
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate(tests[i].value, tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NEGINF);
+ validate_isnan(PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/log10f/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/log10f/test1/testinfo.dat
new file mode 100644
index 0000000000..175ee3ab09
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/log10f/test1/testinfo.dat
@@ -0,0 +1,17 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = log10f
+Name = Positive Test for log10f
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes a series of values to the log10f() function,
+= checking each for the expected result. Also checks
+= for proper handling of out-of-range values.
+
+
+
diff --git a/src/pal/tests/palsuite/c_runtime/logf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/logf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/logf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/logf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/logf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..550f572bc7
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/logf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_logf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_logf_test1 coreclrpal)
+
+target_link_libraries(paltest_logf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/logf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/logf/test1/test1.c
new file mode 100644
index 0000000000..499778e992
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/logf/test1/test1.c
@@ -0,0 +1,139 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test1.c
+**
+** Purpose: Tests logf with a normal set of values.
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = logf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("logf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = logf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("logf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0, PAL_NEGINF, 0 },
+ { 0.0432139183f, -3.14159265f, PAL_EPSILON * 10 }, // expected: -(pi)
+ { 0.0659880358f, -2.71828183f, PAL_EPSILON * 10 }, // expected: -(e)
+ { 0.1f, -2.30258509f, PAL_EPSILON * 10 }, // expected: -(ln(10))
+ { 0.207879576f, -1.57079633f, PAL_EPSILON * 10 }, // expected: -(pi / 2)
+ { 0.236290088f, -1.44269504f, PAL_EPSILON * 10 }, // expected: -(logf2(e))
+ { 0.243116734f, -1.41421356f, PAL_EPSILON * 10 }, // expected: -(sqrtf(2))
+ { 0.323557264f, -1.12837917f, PAL_EPSILON * 10 }, // expected: -(2 / sqrtf(pi))
+ { 0.367879441f, -1, PAL_EPSILON * 10 }, // expected: -(1)
+ { 0.455938128f, -0.785398163f, PAL_EPSILON }, // expected: -(pi / 4)
+ { 0.493068691f, -0.707106781f, PAL_EPSILON }, // expected: -(1 / sqrtf(2))
+ { 0.5f, -0.693147181f, PAL_EPSILON }, // expected: -(ln(2))
+ { 0.529077808f, -0.636619772f, PAL_EPSILON }, // expected: -(2 / pi)
+ { 0.647721485f, -0.434294482f, PAL_EPSILON }, // expected: -(log10f(e))
+ { 0.727377349f, -0.318309886f, PAL_EPSILON }, // expected: -(1 / pi)
+ { 1, 0, PAL_EPSILON },
+ { 1.37480223f, 0.318309886f, PAL_EPSILON }, // expected: 1 / pi
+ { 1.54387344f, 0.434294482f, PAL_EPSILON }, // expected: log10f(e)
+ { 1.89008116f, 0.636619772f, PAL_EPSILON }, // expected: 2 / pi
+ { 2, 0.693147181f, PAL_EPSILON }, // expected: ln(2)
+ { 2.02811498f, 0.707106781f, PAL_EPSILON }, // expected: 1 / sqrtf(2)
+ { 2.19328005f, 0.785398163f, PAL_EPSILON }, // expected: pi / 4
+ { 2.71828183f, 1, PAL_EPSILON * 10 }, // value: e
+ { 3.09064302f, 1.12837917f, PAL_EPSILON * 10 }, // expected: 2 / sqrtf(pi)
+ { 4.11325038f, 1.41421356f, PAL_EPSILON * 10 }, // expected: sqrtf(2)
+ { 4.23208611f, 1.44269504f, PAL_EPSILON * 10 }, // expected: logf2(e)
+ { 4.81047738f, 1.57079633f, PAL_EPSILON * 10 }, // expected: pi / 2
+ { 10, 2.30258509f, PAL_EPSILON * 10 }, // expected: ln(10)
+ { 15.1542622f, 2.71828183f, PAL_EPSILON * 10 }, // expected: e
+ { 23.1406926f, 3.14159265f, PAL_EPSILON * 10 }, // expected: pi
+ { PAL_POSINF, PAL_POSINF, 0 },
+ };
+
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate(tests[i].value, tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NEGINF);
+ validate_isnan(PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/logf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/logf/test1/testinfo.dat
new file mode 100644
index 0000000000..aadfee6c11
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/logf/test1/testinfo.dat
@@ -0,0 +1,14 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = logf
+Name = Positive Test for logf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes a series of values to the logf() function,
+= checking each for the expected result. Also checks
+= for proper handling of out-of-range values.
diff --git a/src/pal/tests/palsuite/c_runtime/malloc/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/malloc/test1/CMakeLists.txt
index 4a388ad3d7..f475730973 100644
--- a/src/pal/tests/palsuite/c_runtime/malloc/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/malloc/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_malloc_test1
diff --git a/src/pal/tests/palsuite/c_runtime/malloc/test1/test1.c b/src/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp
index 7ea4dd068f..7ea4dd068f 100644
--- a/src/pal/tests/palsuite/c_runtime/malloc/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/malloc/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/malloc/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/malloc/test2/CMakeLists.txt
index abbed2aa62..663e104d0e 100644
--- a/src/pal/tests/palsuite/c_runtime/malloc/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/malloc/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_malloc_test2
diff --git a/src/pal/tests/palsuite/c_runtime/malloc/test2/test2.c b/src/pal/tests/palsuite/c_runtime/malloc/test2/test2.cpp
index 5deee0eddb..5deee0eddb 100644
--- a/src/pal/tests/palsuite/c_runtime/malloc/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/malloc/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/memchr/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/memchr/test1/CMakeLists.txt
index 4e33a8fc04..959fd2a3bc 100644
--- a/src/pal/tests/palsuite/c_runtime/memchr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/memchr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_memchr_test1
diff --git a/src/pal/tests/palsuite/c_runtime/memchr/test1/test1.c b/src/pal/tests/palsuite/c_runtime/memchr/test1/test1.cpp
index 043a6789d8..043a6789d8 100644
--- a/src/pal/tests/palsuite/c_runtime/memchr/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/memchr/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/memcmp/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/memcmp/test1/CMakeLists.txt
index b61f208f34..43d8fdd7f7 100644
--- a/src/pal/tests/palsuite/c_runtime/memcmp/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/memcmp/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_memcmp_test1
diff --git a/src/pal/tests/palsuite/c_runtime/memcmp/test1/test1.c b/src/pal/tests/palsuite/c_runtime/memcmp/test1/test1.cpp
index 7b63173e22..7b63173e22 100644
--- a/src/pal/tests/palsuite/c_runtime/memcmp/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/memcmp/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/memcpy/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/memcpy/test1/CMakeLists.txt
index d846bfc62d..14db0df60e 100644
--- a/src/pal/tests/palsuite/c_runtime/memcpy/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/memcpy/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_memcpy_test1
diff --git a/src/pal/tests/palsuite/c_runtime/memcpy/test1/test1.c b/src/pal/tests/palsuite/c_runtime/memcpy/test1/test1.cpp
index 9da98d6573..9da98d6573 100644
--- a/src/pal/tests/palsuite/c_runtime/memcpy/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/memcpy/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/memmove/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/memmove/test1/CMakeLists.txt
index cf50ec01b7..db6f65e48b 100644
--- a/src/pal/tests/palsuite/c_runtime/memmove/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/memmove/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_memmove_test1
diff --git a/src/pal/tests/palsuite/c_runtime/memmove/test1/test1.c b/src/pal/tests/palsuite/c_runtime/memmove/test1/test1.c
deleted file mode 100644
index c1af871f4a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/memmove/test1/test1.c
+++ /dev/null
@@ -1,116 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: Test that memmove correctly copies text from one buffer
-** to another even when the buffers overlap.
-**
-**
-**==========================================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char **argv)
-{
- char testA[11] = "abcdefghij";
- char testB[15] = "aabbccddeeffgg";
- char testC[15] = "aabbccddeeffgg";
- char testD[15] = "aabbccddeeffgg";
- char insString[3] = "zzz";
- char *retVal;
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- /* move a string onto itself */
- retVal = (char *)memmove(testA + 2, testA, 8);
- if (retVal != testA + 2)
- {
- Fail("The return value should have been the value of the destination"
- "pointer, but wasn't\n");
- }
-
- /*Check the most likely error*/
- if (memcmp(testA, "ababababab", 11) == 0)
- {
- Fail("memmove should have saved the characters in the region of"
- " overlap between source and destination, but didn't.\n");
- }
-
- if (memcmp(testA, "ababcdefgh", 11) != 0)
- {
- /* not sure what exactly went wrong. */
- Fail("memmove was called on a region containing the characters"
- " \"abcdefghij\". It was to move the first 8 positions to"
- " the last 8 positions, giving the result \"ababcdefgh\". "
- " Instead, it gave the result \"%s\".\n", testA);
- }
-
- /* move a string to the front of testB */
- retVal = (char *)memmove(testB, insString, 3);
- if(retVal != testB)
- {
- Fail("memmove: The function did not return the correct "
- "string.\n");
- }
-
- if(memcmp(testB, "zzzbccddeeffgg",15) != 0)
- {
- Fail("memmove: The function failed to move the string "
- "correctly.\n");
- }
-
-
- /* move a string to the middle of testC */
- retVal = memmove(testC+5, insString, 3);
- if(retVal != testC+5)
- {
- Fail("memmove: The function did not return the correct "
- "string.\n");
- }
-
- if(memcmp(testC, "aabbczzzeeffgg",15) != 0)
- {
- Fail("memmove: The function failed to move the string "
- "correctly.\n");
- }
-
-
- /* move a string to the end of testD */
- retVal = memmove(testD+11, insString, 3);
- if(retVal != testD+11)
- {
- Fail("memmove: The function did not return the correct "
- "string.\n");
- }
-
- if(memcmp(testD, "aabbccddeefzzz",15) != 0)
- {
- Fail("memmove: The function failed to move the string "
- "correctly.\n");
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/memmove/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/memmove/test1/test1.cpp
new file mode 100644
index 0000000000..8279d67139
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/memmove/test1/test1.cpp
@@ -0,0 +1,116 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test that memmove correctly copies text from one buffer
+** to another even when the buffers overlap.
+**
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char **argv)
+{
+ char testA[11] = "abcdefghij";
+ char testB[15] = "aabbccddeeffgg";
+ char testC[15] = "aabbccddeeffgg";
+ char testD[15] = "aabbccddeeffgg";
+ char insString[4] = "zzz";
+ char *retVal;
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ /* move a string onto itself */
+ retVal = (char *)memmove(testA + 2, testA, 8);
+ if (retVal != testA + 2)
+ {
+ Fail("The return value should have been the value of the destination"
+ "pointer, but wasn't\n");
+ }
+
+ /*Check the most likely error*/
+ if (memcmp(testA, "ababababab", 11) == 0)
+ {
+ Fail("memmove should have saved the characters in the region of"
+ " overlap between source and destination, but didn't.\n");
+ }
+
+ if (memcmp(testA, "ababcdefgh", 11) != 0)
+ {
+ /* not sure what exactly went wrong. */
+ Fail("memmove was called on a region containing the characters"
+ " \"abcdefghij\". It was to move the first 8 positions to"
+ " the last 8 positions, giving the result \"ababcdefgh\". "
+ " Instead, it gave the result \"%s\".\n", testA);
+ }
+
+ /* move a string to the front of testB */
+ retVal = (char *)memmove(testB, insString, 3);
+ if(retVal != testB)
+ {
+ Fail("memmove: The function did not return the correct "
+ "string.\n");
+ }
+
+ if(memcmp(testB, "zzzbccddeeffgg",15) != 0)
+ {
+ Fail("memmove: The function failed to move the string "
+ "correctly.\n");
+ }
+
+
+ /* move a string to the middle of testC */
+ retVal = (char*)memmove(testC+5, insString, 3);
+ if(retVal != testC+5)
+ {
+ Fail("memmove: The function did not return the correct "
+ "string.\n");
+ }
+
+ if(memcmp(testC, "aabbczzzeeffgg",15) != 0)
+ {
+ Fail("memmove: The function failed to move the string "
+ "correctly.\n");
+ }
+
+
+ /* move a string to the end of testD */
+ retVal = (char*)memmove(testD+11, insString, 3);
+ if(retVal != testD+11)
+ {
+ Fail("memmove: The function did not return the correct "
+ "string.\n");
+ }
+
+ if(memcmp(testD, "aabbccddeefzzz",15) != 0)
+ {
+ Fail("memmove: The function failed to move the string "
+ "correctly.\n");
+ }
+
+ PAL_Terminate();
+ return PASS;
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/pal/tests/palsuite/c_runtime/memset/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/memset/test1/CMakeLists.txt
index 78b5a6bc00..bc3d6251cb 100644
--- a/src/pal/tests/palsuite/c_runtime/memset/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/memset/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_memset_test1
diff --git a/src/pal/tests/palsuite/c_runtime/memset/test1/test1.c b/src/pal/tests/palsuite/c_runtime/memset/test1/test1.cpp
index 67cde8756b..67cde8756b 100644
--- a/src/pal/tests/palsuite/c_runtime/memset/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/memset/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/modf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/modf/test1/CMakeLists.txt
index 4b65ba7a6f..3fe7bc7c46 100644
--- a/src/pal/tests/palsuite/c_runtime/modf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/modf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_modf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/modf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/modf/test1/test1.cpp
index 389d079253..389d079253 100644
--- a/src/pal/tests/palsuite/c_runtime/modf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/modf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/modff/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/modff/test1/CMakeLists.txt
index 812cd1c47b..10e5e99267 100644
--- a/src/pal/tests/palsuite/c_runtime/modff/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/modff/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_modff_test1
diff --git a/src/pal/tests/palsuite/c_runtime/modff/test1/test1.c b/src/pal/tests/palsuite/c_runtime/modff/test1/test1.cpp
index 6b7a50be39..6b7a50be39 100644
--- a/src/pal/tests/palsuite/c_runtime/modff/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/modff/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/pow/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/pow/test1/CMakeLists.txt
index 69ba02af17..f94210d5b7 100644
--- a/src/pal/tests/palsuite/c_runtime/pow/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/pow/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_pow_test1
diff --git a/src/pal/tests/palsuite/c_runtime/pow/test1/test1.c b/src/pal/tests/palsuite/c_runtime/pow/test1/test1.cpp
index 0a05cd5a47..0a05cd5a47 100644
--- a/src/pal/tests/palsuite/c_runtime/pow/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/pow/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/powf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/powf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/powf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/powf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/powf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..8ea040f9a4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/powf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_powf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_powf_test1 coreclrpal)
+
+target_link_libraries(paltest_powf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/powf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/powf/test1/test1.c
new file mode 100644
index 0000000000..ca738e8c8d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/powf/test1/test1.c
@@ -0,0 +1,229 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test1.c
+**
+** Purpose: Tests that atan2f returns correct values for a subset of values.
+** Tests with positive and negative values of x and y to ensure
+** atan2f is returning results from the correct quadrant.
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float x; /* first component of the value to test the function with */
+ float y; /* second component of the value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float x, float y, float expected, float variance)
+{
+ float result = powf(x, y);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("powf(%g, %g) returned %10.9g when it should have returned %10.9g",
+ x, y, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float x, float y)
+{
+ float result = powf(x, y);
+
+ if (!_isnanf(result))
+ {
+ Fail("powf(%g, %g) returned %10.9g when it should have returned %10.9g",
+ x, y, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* x y expected variance */
+ { PAL_NEGINF, PAL_NEGINF, 0, PAL_EPSILON },
+ { PAL_NEGINF, PAL_POSINF, PAL_POSINF, 0 },
+
+ { -10, PAL_NEGINF, 0, PAL_EPSILON },
+ { -10, -1, -0.1f, PAL_EPSILON },
+ { -10, 0, 1, PAL_EPSILON * 10 },
+ { -10, 1, -10, PAL_EPSILON * 100 },
+ { -10, PAL_POSINF, PAL_POSINF, 0 },
+
+ { -2.71828183f, PAL_NEGINF, 0, PAL_EPSILON }, // x: -(e)
+ { -2.71828183f, -1, -0.367879441f, PAL_EPSILON }, // x: -(e)
+ { -2.71828183f, 0, 1, PAL_EPSILON * 10 }, // x: -(e)
+ { -2.71828183f, 1, -2.71828183f, PAL_EPSILON * 10 }, // x: -(e) expected: e
+ { -2.71828183f, PAL_POSINF, PAL_POSINF, 0 }, // x: -(e)
+
+ { -0.0, PAL_NEGINF, PAL_POSINF, 0 },
+ { -0.0, -1, PAL_NEGINF, 0 },
+ { -0.0f, -0.0f, 1, PAL_EPSILON * 10 },
+ { -0.0f, 0, 1, PAL_EPSILON * 10 },
+ { -0.0, 1, -0.0, PAL_EPSILON },
+ { -0.0, PAL_POSINF, 0, PAL_EPSILON },
+
+ { 0.0, PAL_NEGINF, PAL_POSINF, 0 },
+ { 0.0, -1, PAL_POSINF, 0 },
+ { 0, -0.0f, 1, PAL_EPSILON * 10 },
+ { 0, 0, 1, PAL_EPSILON * 10 },
+ { 0.0, 1, 0, PAL_EPSILON },
+ { 0.0, PAL_POSINF, 0, PAL_EPSILON },
+
+ { 1, PAL_NEGINF, 1, PAL_EPSILON * 10 },
+ { 1, PAL_POSINF, 1, PAL_EPSILON * 10 },
+
+ { 2.71828183f, PAL_NEGINF, 0, PAL_EPSILON },
+ { 2.71828183f, -3.14159265f, 0.0432139183f, PAL_EPSILON / 10 }, // x: e y: -(pi)
+ { 2.71828183f, -2.71828183f, 0.0659880358f, PAL_EPSILON / 10 }, // x: e y: -(e)
+ { 2.71828183f, -2.30258509f, 0.1f, PAL_EPSILON }, // x: e y: -(ln(10))
+ { 2.71828183f, -1.57079633f, 0.207879576f, PAL_EPSILON }, // x: e y: -(pi / 2)
+ { 2.71828183f, -1.44269504f, 0.236290088f, PAL_EPSILON }, // x: e y: -(logf2(e))
+ { 2.71828183f, -1.41421356f, 0.243116734f, PAL_EPSILON }, // x: e y: -(sqrtf(2))
+ { 2.71828183f, -1.12837917f, 0.323557264f, PAL_EPSILON }, // x: e y: -(2 / sqrtf(pi))
+ { 2.71828183f, -1, 0.367879441f, PAL_EPSILON }, // x: e y: -(1)
+ { 2.71828183f, -0.785398163f, 0.455938128f, PAL_EPSILON }, // x: e y: -(pi / 4)
+ { 2.71828183f, -0.707106781f, 0.493068691f, PAL_EPSILON }, // x: e y: -(1 / sqrtf(2))
+ { 2.71828183f, -0.693147181f, 0.5f, PAL_EPSILON }, // x: e y: -(ln(2))
+ { 2.71828183f, -0.636619772f, 0.529077808f, PAL_EPSILON }, // x: e y: -(2 / pi)
+ { 2.71828183f, -0.434294482f, 0.647721485f, PAL_EPSILON }, // x: e y: -(log10f(e))
+ { 2.71828183f, -0.318309886f, 0.727377349f, PAL_EPSILON }, // x: e y: -(1 / pi)
+ { 2.71828183f, 0, 1, PAL_EPSILON * 10 }, // x: e
+ { 2.71828183f, 0.318309886f, 1.37480223f, PAL_EPSILON * 10 }, // x: e y: 1 / pi
+ { 2.71828183f, 0.434294482f, 1.54387344f, PAL_EPSILON * 10 }, // x: e y: log10f(e)
+ { 2.71828183f, 0.636619772f, 1.89008116f, PAL_EPSILON * 10 }, // x: e y: 2 / pi
+ { 2.71828183f, 0.693147181f, 2, PAL_EPSILON * 10 }, // x: e y: ln(2)
+ { 2.71828183f, 0.707106781f, 2.02811498f, PAL_EPSILON * 10 }, // x: e y: 1 / sqrtf(2)
+ { 2.71828183f, 0.785398163f, 2.19328005f, PAL_EPSILON * 10 }, // x: e y: pi / 4
+ { 2.71828183f, 1, 2.71828183f, PAL_EPSILON * 10 }, // x: e expected: e
+ { 2.71828183f, 1.12837917f, 3.09064302f, PAL_EPSILON * 10 }, // x: e y: 2 / sqrtf(pi)
+ { 2.71828183f, 1.41421356f, 4.11325038f, PAL_EPSILON * 10 }, // x: e y: sqrtf(2)
+ { 2.71828183f, 1.44269504f, 4.23208611f, PAL_EPSILON * 10 }, // x: e y: logf2(e)
+ { 2.71828183f, 1.57079633f, 4.81047738f, PAL_EPSILON * 10 }, // x: e y: pi / 2
+ { 2.71828183f, 2.30258509f, 10, PAL_EPSILON * 100 }, // x: e y: ln(10)
+ { 2.71828183f, 2.71828183f, 15.1542622f, PAL_EPSILON * 100 }, // x: e y: e
+ { 2.71828183f, 3.14159265f, 23.1406926f, PAL_EPSILON * 100 }, // x: e y: pi
+ { 2.71828183f, PAL_POSINF, PAL_POSINF, 0 }, // x: e
+
+ { 10, PAL_NEGINF, 0, 0 },
+ { 10, -3.14159265f, 0.000721784159f, PAL_EPSILON / 1000 }, // y: -(pi)
+ { 10, -2.71828183f, 0.00191301410f, PAL_EPSILON / 100 }, // y: -(e)
+ { 10, -2.30258509f, 0.00498212830f, PAL_EPSILON / 100 }, // y: -(ln(10))
+ { 10, -1.57079633f, 0.0268660410f, PAL_EPSILON / 10 }, // y: -(pi / 2)
+ { 10, -1.44269504f, 0.0360831928f, PAL_EPSILON / 10 }, // y: -(logf2(e))
+ { 10, -1.41421356f, 0.0385288847f, PAL_EPSILON / 10 }, // y: -(sqrtf(2))
+ { 10, -1.12837917f, 0.0744082059f, PAL_EPSILON / 10 }, // y: -(2 / sqrtf(pi))
+ { 10, -1, 0.1f, PAL_EPSILON }, // y: -(1)
+ { 10, -0.785398163f, 0.163908636f, PAL_EPSILON }, // y: -(pi / 4)
+ { 10, -0.707106781f, 0.196287760f, PAL_EPSILON }, // y: -(1 / sqrtf(2))
+ { 10, -0.693147181f, 0.202699566f, PAL_EPSILON }, // y: -(ln(2))
+ { 10, -0.636619772f, 0.230876765f, PAL_EPSILON }, // y: -(2 / pi)
+ { 10, -0.434294482f, 0.367879441f, PAL_EPSILON }, // y: -(log10f(e))
+ { 10, -0.318309886f, 0.480496373f, PAL_EPSILON }, // y: -(1 / pi)
+ { 10, 0, 1, PAL_EPSILON * 10 },
+ { 10, 0.318309886f, 2.08118116f, PAL_EPSILON * 10 }, // y: 1 / pi
+ { 10, 0.434294482f, 2.71828183f, PAL_EPSILON * 10 }, // y: log10f(e) expected: e
+ { 10, 0.636619772f, 4.33131503f, PAL_EPSILON * 10 }, // y: 2 / pi
+ { 10, 0.693147181f, 4.93340967f, PAL_EPSILON * 10 }, // y: ln(2)
+ { 10, 0.707106781f, 5.09456117f, PAL_EPSILON * 10 }, // y: 1 / sqrtf(2)
+ { 10, 0.785398163f, 6.10095980f, PAL_EPSILON * 10 }, // y: pi / 4
+ { 10, 1, 10, PAL_EPSILON * 100 },
+ { 10, 1.12837917f, 13.4393779f, PAL_EPSILON * 100 }, // y: 2 / sqrtf(pi)
+ { 10, 1.41421356f, 25.9545535f, PAL_EPSILON * 100 }, // y: sqrtf(2)
+ { 10, 1.44269504f, 27.7137338f, PAL_EPSILON * 100 }, // y: logf2(e)
+ { 10, 1.57079633f, 37.2217105f, PAL_EPSILON * 100 }, // y: pi / 2
+ { 10, 2.30258509f, 200.717432f, PAL_EPSILON * 1000 }, // y: ln(10)
+ { 10, 2.71828183f, 522.735300f, PAL_EPSILON * 1000 }, // y: e
+ { 10, 3.14159265f, 1385.45573f, PAL_EPSILON * 10000 }, // y: pi
+ { 10, PAL_POSINF, PAL_POSINF, 0 },
+
+ { PAL_POSINF, PAL_NEGINF, 0, PAL_EPSILON },
+ { PAL_POSINF, PAL_POSINF, PAL_POSINF, 0 },
+ };
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate(tests[i].x, tests[i].y, tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(-10, -1.57079633f); // y: -(pi / 2)
+ validate_isnan(-10, -0.785398163f); // y: -(pi / 4)
+ validate_isnan(-10, 0.785398163f); // y: pi / 4
+ validate_isnan(-10, 1.57079633f); // y: pi / 2
+
+ validate_isnan(-2.71828183f, -1.57079633f); // x: -(e) y: -(pi / 2)
+ validate_isnan(-2.71828183f, -0.785398163f); // x: -(e) y: -(pi / 4)
+ validate_isnan(-2.71828183f, 0.785398163f); // x: -(e) y: pi / 4
+ validate_isnan(-2.71828183f, 1.57079633f); // x: -(e) y: pi / 2
+
+ validate_isnan(-1, PAL_NEGINF);
+ validate_isnan(-1, PAL_POSINF);
+
+ validate_isnan(PAL_NAN, -0.0);
+ validate_isnan(PAL_NAN, 0);
+
+ validate_isnan(PAL_NEGINF, PAL_NAN);
+ validate_isnan(PAL_NAN, PAL_NEGINF);
+
+ validate_isnan(PAL_POSINF, PAL_NAN);
+ validate_isnan(PAL_NAN, PAL_POSINF);
+
+ validate_isnan(PAL_NAN, PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/powf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/powf/test1/testinfo.dat
new file mode 100644
index 0000000000..778c042025
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/powf/test1/testinfo.dat
@@ -0,0 +1,17 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = powf
+Name = Call powf with some std input/output.
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Call the powf function with various num/expfonent pairs
+= that should produce std answers.
+
+
+
+
diff --git a/src/pal/tests/palsuite/c_runtime/printf/printf.h b/src/pal/tests/palsuite/c_runtime/printf/printf.h
index 2eaa984bad..8ef725f305 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/printf.h
+++ b/src/pal/tests/palsuite/c_runtime/printf/printf.h
@@ -14,7 +14,7 @@
#ifndef __printf_H__
#define __printf_H__
-void DoStrTest(char *formatstr, char* param, char *checkstr)
+void DoStrTest(const char *formatstr, char* param, const char *checkstr)
{
int ret;
@@ -26,7 +26,7 @@ void DoStrTest(char *formatstr, char* param, char *checkstr)
}
}
-void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
+void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr)
{
int ret;
@@ -38,8 +38,8 @@ void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
}
}
-void DoPointerTest(char *formatstr, void* param, char* paramstr,
- char *checkstr1)
+void DoPointerTest(const char *formatstr, void* param, char* paramstr,
+ const char *checkstr1)
{
int ret;
@@ -51,7 +51,7 @@ void DoPointerTest(char *formatstr, void* param, char* paramstr,
}
}
-void DoCountTest(char *formatstr, int param, char *checkstr)
+void DoCountTest(const char *formatstr, int param, const char *checkstr)
{
int ret;
int n = -1;
@@ -70,7 +70,7 @@ void DoCountTest(char *formatstr, int param, char *checkstr)
}
}
-void DoShortCountTest(char *formatstr, int param, char *checkstr)
+void DoShortCountTest(const char *formatstr, int param, const char *checkstr)
{
int ret;
short int n = -1;
@@ -90,7 +90,7 @@ void DoShortCountTest(char *formatstr, int param, char *checkstr)
}
-void DoCharTest(char *formatstr, char param, char *checkstr)
+void DoCharTest(const char *formatstr, char param, const char *checkstr)
{
int ret;
@@ -102,7 +102,7 @@ void DoCharTest(char *formatstr, char param, char *checkstr)
}
}
-void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
+void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr)
{
int ret;
@@ -114,7 +114,7 @@ void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
}
}
-void DoNumTest(char *formatstr, int param, char *checkstr)
+void DoNumTest(const char *formatstr, int param, const char *checkstr)
{
int ret;
@@ -126,8 +126,8 @@ void DoNumTest(char *formatstr, int param, char *checkstr)
}
}
-void DoI64Test(char *formatstr, INT64 param, char *valuestr,
- char *checkstr1)
+void DoI64Test(const char *formatstr, INT64 param, char *valuestr,
+ const char *checkstr1)
{
int ret;
@@ -139,8 +139,8 @@ void DoI64Test(char *formatstr, INT64 param, char *valuestr,
}
}
-void DoDoubleTest(char *formatstr, double param,
- char *checkstr1, char *checkstr2)
+void DoDoubleTest(const char *formatstr, double param,
+ const char *checkstr1, const char *checkstr2)
{
int ret;
@@ -152,8 +152,8 @@ void DoDoubleTest(char *formatstr, double param,
}
}
-void DoArgumentPrecTest(char *formatstr, int precision, void *param,
- char *paramstr, char *checkstr1, char *checkstr2)
+void DoArgumentPrecTest(const char *formatstr, int precision, void *param,
+ char *paramstr, const char *checkstr1, const char *checkstr2)
{
int ret;
@@ -165,8 +165,8 @@ void DoArgumentPrecTest(char *formatstr, int precision, void *param,
}
}
-void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param,
- char *checkstr1, char *checkstr2)
+void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param,
+ const char *checkstr1, const char *checkstr2)
{
int ret;
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test1/CMakeLists.txt
index bea9151ed7..2dace14f90 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_printf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/printf/test1/test1.cpp
index 31b7014343..31b7014343 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test10/CMakeLists.txt
index 89ff2e0190..75e30c8599 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_printf_test10
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/printf/test10/test10.cpp
index 5e69175b07..5e69175b07 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test10/test10.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test11/CMakeLists.txt
index 349f154a8d..4ee12dc21d 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_printf_test11
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/printf/test11/test11.cpp
index 788be8b2db..788be8b2db 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test11/test11.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test12/CMakeLists.txt
index 0d32ee1690..3b2e39d640 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_printf_test12
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/printf/test12/test12.cpp
index b4006f2405..b4006f2405 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test12/test12.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test13/CMakeLists.txt
index 348d25b22d..b6af021d48 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test13.c
+ test13.cpp
)
add_executable(paltest_printf_test13
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/printf/test13/test13.cpp
index ccd16b50d2..ccd16b50d2 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test13/test13.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test13/test13.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test14/CMakeLists.txt
index 659ea78cc6..5a6cf8a180 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test14.c
+ test14.cpp
)
add_executable(paltest_printf_test14
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/printf/test14/test14.cpp
index 10577db67d..10577db67d 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test14/test14.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test14/test14.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test15/CMakeLists.txt
index 9e4e310304..b1466a387d 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test15.c
+ test15.cpp
)
add_executable(paltest_printf_test15
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/printf/test15/test15.cpp
index 2acfc436a3..2acfc436a3 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test15/test15.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test15/test15.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test16/CMakeLists.txt
index 7e477a3059..c81da10ec9 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test16.c
+ test16.cpp
)
add_executable(paltest_printf_test16
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/printf/test16/test16.cpp
index 50c952f959..50c952f959 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test16/test16.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test16/test16.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test17/CMakeLists.txt
index c18450c2aa..9d40e54ca6 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test17.c
+ test17.cpp
)
add_executable(paltest_printf_test17
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/printf/test17/test17.cpp
index 96ddd5c1e4..96ddd5c1e4 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test17/test17.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test17/test17.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test18/CMakeLists.txt
index b0468314a3..6ab11f4be1 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test18/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test18.c
+ test18.cpp
)
add_executable(paltest_printf_test18
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/printf/test18/test18.cpp
index 6c05e40f42..6c05e40f42 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test18/test18.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test18/test18.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test19/CMakeLists.txt
index efd47563d4..f022938e32 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test19/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test19.c
+ test19.cpp
)
add_executable(paltest_printf_test19
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/printf/test19/test19.c
deleted file mode 100644
index 1e09398f7c..0000000000
--- a/src/pal/tests/palsuite/c_runtime/printf/test19/test19.c
+++ /dev/null
@@ -1,76 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test19.c
-**
-** Purpose: Test #19 for the printf function. Tests the variable length
-** precision argument.
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-#include "../printf.h"
-
-
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int n = -1;
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoArgumentPrecTest("%.*s", 2, "bar", "bar", "ba", "ba");
- DoArgumentPrecTest("%.*S", 2, convert("bar"), "bar", "ba", "ba");
-
- DoArgumentPrecTest("%.*n", 3, &n, "pointer to int", "", "");
- if (n != 0)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- 0, n);
- }
-
- DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
- DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
- DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
- DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
-
-
- DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
- DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
- DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
- DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
- DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
- DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
- DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
- DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
- DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
- DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/printf/test19/test19.cpp
new file mode 100644
index 0000000000..a3ce0e7ad8
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/printf/test19/test19.cpp
@@ -0,0 +1,76 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test19.c
+**
+** Purpose: Test #19 for the printf function. Tests the variable length
+** precision argument.
+**
+**
+**==========================================================================*/
+
+
+#include <palsuite.h>
+#include "../printf.h"
+
+
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n = -1;
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoArgumentPrecTest("%.*s", 2, (void*)"bar", "bar", "ba", "ba");
+ DoArgumentPrecTest("%.*S", 2, (void*)convert("bar"), "bar", "ba", "ba");
+
+ DoArgumentPrecTest("%.*n", 3, (void*)&n, "pointer to int", "", "");
+ if (n != 0)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
+ 0, n);
+ }
+
+ DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
+ DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
+ DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
+ DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
+
+
+ DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
+ DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
+ DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
+ DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
+ DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
+ DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
+ DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
+ DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
+ DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
+ DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test2/CMakeLists.txt
index c303a69134..e92b6b09f3 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_printf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/printf/test2/test2.cpp
index e766ef4a90..e766ef4a90 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test3/CMakeLists.txt
index 8bc7479797..fcfd779a0c 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_printf_test3
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/printf/test3/test3.cpp
index 5cc530948c..5cc530948c 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test4/CMakeLists.txt
index 55e5700fe3..7311bbea69 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_printf_test4
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/printf/test4/test4.cpp
index bcdc201d4f..bcdc201d4f 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test5/CMakeLists.txt
index d091bca2dc..bfe185c44f 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_printf_test5
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/printf/test5/test5.cpp
index 9f8baa74da..9f8baa74da 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test6/CMakeLists.txt
index c004e353e9..842ebfedc6 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_printf_test6
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/printf/test6/test6.cpp
index edc65b6b9b..edc65b6b9b 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test7/CMakeLists.txt
index ff6b647ccd..16e39198ba 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_printf_test7
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/printf/test7/test7.cpp
index 3aeb58f7dc..3aeb58f7dc 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test8/CMakeLists.txt
index 5ee387f5b8..4a40fee6d9 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_printf_test8
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/printf/test8/test8.cpp
index daa4674b92..daa4674b92 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test8/test8.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/printf/test9/CMakeLists.txt
index baf46c1065..df8f75d2fd 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/printf/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_printf_test9
diff --git a/src/pal/tests/palsuite/c_runtime/printf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/printf/test9/test9.cpp
index 22c60d04f2..22c60d04f2 100644
--- a/src/pal/tests/palsuite/c_runtime/printf/test9/test9.c
+++ b/src/pal/tests/palsuite/c_runtime/printf/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/qsort/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/qsort/test1/CMakeLists.txt
index 105a727e91..ff215b8dc6 100644
--- a/src/pal/tests/palsuite/c_runtime/qsort/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/qsort/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_qsort_test1
diff --git a/src/pal/tests/palsuite/c_runtime/qsort/test1/test1.c b/src/pal/tests/palsuite/c_runtime/qsort/test1/test1.cpp
index c65fb18e68..c65fb18e68 100644
--- a/src/pal/tests/palsuite/c_runtime/qsort/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/qsort/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/qsort/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/qsort/test2/CMakeLists.txt
index 09e3f6db1e..cdd9642779 100644
--- a/src/pal/tests/palsuite/c_runtime/qsort/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/qsort/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_qsort_test2
diff --git a/src/pal/tests/palsuite/c_runtime/qsort/test2/test2.c b/src/pal/tests/palsuite/c_runtime/qsort/test2/test2.cpp
index 8110dcd2c2..8110dcd2c2 100644
--- a/src/pal/tests/palsuite/c_runtime/qsort/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/qsort/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/rand_srand/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/rand_srand/test1/CMakeLists.txt
index 939914662a..6728f402ff 100644
--- a/src/pal/tests/palsuite/c_runtime/rand_srand/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/rand_srand/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_rand_srand_test1
diff --git a/src/pal/tests/palsuite/c_runtime/rand_srand/test1/test1.c b/src/pal/tests/palsuite/c_runtime/rand_srand/test1/test1.cpp
index 34154cb6d2..34154cb6d2 100644
--- a/src/pal/tests/palsuite/c_runtime/rand_srand/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/rand_srand/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/realloc/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/realloc/test1/CMakeLists.txt
index 0a9f34fc3b..62830a0fe8 100644
--- a/src/pal/tests/palsuite/c_runtime/realloc/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/realloc/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_realloc_test1
diff --git a/src/pal/tests/palsuite/c_runtime/realloc/test1/test1.c b/src/pal/tests/palsuite/c_runtime/realloc/test1/test1.c
deleted file mode 100644
index d0dd128cc1..0000000000
--- a/src/pal/tests/palsuite/c_runtime/realloc/test1/test1.c
+++ /dev/null
@@ -1,66 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: Uses realloc to allocate and realloate memory, checking
-** that memory contents are copied when the memory is reallocated.
-**
-**
-**==========================================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char **argv)
-{
- char *testA;
- const int len1 = 10;
- const char str1[] = "aaaaaaaaaa";
-
- const int len2 = 20;
- const char str2[] = "bbbbbbbbbbbbbbbbbbbb";
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- /* this should work like malloc */
- testA = (char *)realloc(NULL, len1*sizeof(char));
- memcpy(testA, str1, len1);
- if (testA == NULL)
- {
- Fail("We ran out of memory (unlikely), or realloc is broken.\n");
- }
-
- if (memcmp(testA, str1, len1) != 0)
- {
- Fail("realloc doesn't properly allocate new memory.\n");
- }
-
- testA = (char *)realloc(testA, len2*sizeof(char));
- if (memcmp(testA, str1, len1) != 0)
- {
- Fail("realloc doesn't move the contents of the original memory "
- "block to the newly allocated block.\n");
- }
-
- memcpy(testA, str2, len2);
- if (memcmp(testA, str2, len2) != 0)
- {
- Fail("Couldn't write to memory allocated by realloc.\n");
- }
-
- /* free the buffer */
- testA = realloc(testA, 0);
- if (testA != NULL)
- {
- Fail("Realloc didn't return NULL when called with a length "
- "of zero.\n");
- }
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/realloc/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/realloc/test1/test1.cpp
new file mode 100644
index 0000000000..64a9270eab
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/realloc/test1/test1.cpp
@@ -0,0 +1,66 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Uses realloc to allocate and realloate memory, checking
+** that memory contents are copied when the memory is reallocated.
+**
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char **argv)
+{
+ char *testA;
+ const int len1 = 10;
+ const char str1[] = "aaaaaaaaaa";
+
+ const int len2 = 20;
+ const char str2[] = "bbbbbbbbbbbbbbbbbbbb";
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ /* this should work like malloc */
+ testA = (char *)realloc(NULL, len1*sizeof(char));
+ memcpy(testA, str1, len1);
+ if (testA == NULL)
+ {
+ Fail("We ran out of memory (unlikely), or realloc is broken.\n");
+ }
+
+ if (memcmp(testA, str1, len1) != 0)
+ {
+ Fail("realloc doesn't properly allocate new memory.\n");
+ }
+
+ testA = (char *)realloc(testA, len2*sizeof(char));
+ if (memcmp(testA, str1, len1) != 0)
+ {
+ Fail("realloc doesn't move the contents of the original memory "
+ "block to the newly allocated block.\n");
+ }
+
+ memcpy(testA, str2, len2);
+ if (memcmp(testA, str2, len2) != 0)
+ {
+ Fail("Couldn't write to memory allocated by realloc.\n");
+ }
+
+ /* free the buffer */
+ testA = (char*)realloc(testA, 0);
+ if (testA != NULL)
+ {
+ Fail("Realloc didn't return NULL when called with a length "
+ "of zero.\n");
+ }
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sin/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sin/test1/CMakeLists.txt
index e074337452..74a0e78f52 100644
--- a/src/pal/tests/palsuite/c_runtime/sin/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sin/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_sin_test1
diff --git a/src/pal/tests/palsuite/c_runtime/sin/test1/test1.c b/src/pal/tests/palsuite/c_runtime/sin/test1/test1.cpp
index bec58d4dd9..bec58d4dd9 100644
--- a/src/pal/tests/palsuite/c_runtime/sin/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/sin/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/sinf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sinf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sinf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/sinf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sinf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..0651b43d1d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sinf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_sinf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sinf_test1 coreclrpal)
+
+target_link_libraries(paltest_sinf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sinf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/sinf/test1/test1.c
new file mode 100644
index 0000000000..d5bd248935
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sinf/test1/test1.c
@@ -0,0 +1,130 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test to ensure that sinf return the correct values
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** fabs
+**
+**===========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = sinf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("sinf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = sinf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("sinf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0, 0, PAL_EPSILON },
+ { 0.318309886f, 0.312961796f, PAL_EPSILON }, // value: 1 / pi
+ { 0.434294482f, 0.420770483f, PAL_EPSILON }, // value: log10f(e)
+ { 0.636619772f, 0.594480769f, PAL_EPSILON }, // value: 2 / pi
+ { 0.693147181f, 0.638961276f, PAL_EPSILON }, // value: ln(2)
+ { 0.707106781f, 0.649636939f, PAL_EPSILON }, // value: 1 / sqrtf(2)
+ { 0.785398163f, 0.707106781f, PAL_EPSILON }, // value: pi / 4, expected: 1 / sqrtf(2)
+ { 1, 0.841470985f, PAL_EPSILON },
+ { 1.12837917f, 0.903719457f, PAL_EPSILON }, // value: 2 / sqrtf(pi)
+ { 1.41421356f, 0.987765946f, PAL_EPSILON }, // value: sqrtf(2)
+ { 1.44269504f, 0.991806244f, PAL_EPSILON }, // value: logf2(e)
+ { 1.57079633f, 1, PAL_EPSILON * 10 }, // value: pi / 2
+ { 2.30258509f, 0.743980337f, PAL_EPSILON }, // value: ln(10)
+ { 2.71828183f, 0.410781291f, PAL_EPSILON }, // value: e
+ { 3.14159265f, 0, PAL_EPSILON }, // value: pi
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate( tests[i].value, tests[i].expected, tests[i].variance);
+ validate(-tests[i].value, -tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NEGINF);
+ validate_isnan(PAL_NAN);
+ validate_isnan(PAL_POSINF);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sinf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sinf/test1/testinfo.dat
new file mode 100644
index 0000000000..08ff6026cb
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sinf/test1/testinfo.dat
@@ -0,0 +1,13 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sinf
+Name = Positive Test for sinf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes to sinf() a series of angle value, checking that
+= each one return to correct value.
diff --git a/src/pal/tests/palsuite/c_runtime/sinh/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sinh/test1/CMakeLists.txt
index 66cc691d92..b0101ba808 100644
--- a/src/pal/tests/palsuite/c_runtime/sinh/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sinh/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_sinh_test1
diff --git a/src/pal/tests/palsuite/c_runtime/sinh/test1/test1.c b/src/pal/tests/palsuite/c_runtime/sinh/test1/test1.cpp
index e790b16fb4..e790b16fb4 100644
--- a/src/pal/tests/palsuite/c_runtime/sinh/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/sinh/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/sinhf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sinhf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sinhf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/sinhf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sinhf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..72cce43460
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sinhf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_sinhf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sinhf_test1 coreclrpal)
+
+target_link_libraries(paltest_sinhf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sinhf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/sinhf/test1/test1.c
new file mode 100644
index 0000000000..4e706a2f71
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sinhf/test1/test1.c
@@ -0,0 +1,129 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test to ensure that sinhf return the correct values
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** fabs
+**
+**===========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = sinhf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("sinhf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = sinhf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("sinhf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0, 0, PAL_EPSILON },
+ { 0.318309886f, 0.323712439f, PAL_EPSILON }, // value: 1 / pi
+ { 0.434294482f, 0.448075979f, PAL_EPSILON }, // value: log10f(e)
+ { 0.636619772f, 0.680501678f, PAL_EPSILON }, // value: 2 / pi
+ { 0.693147181f, 0.75, PAL_EPSILON }, // value: ln(2)
+ { 0.707106781f, 0.767523145f, PAL_EPSILON }, // value: 1 / sqrtf(2)
+ { 0.785398163f, 0.868670961f, PAL_EPSILON }, // value: pi / 4
+ { 1, 1.17520119f, PAL_EPSILON * 10 },
+ { 1.12837917f, 1.38354288f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi)
+ { 1.41421356f, 1.93506682f, PAL_EPSILON * 10 }, // value: sqrtf(2)
+ { 1.44269504f, 1.99789801f, PAL_EPSILON * 10 }, // value: logf2(e)
+ { 1.57079633f, 2.30129890f, PAL_EPSILON * 10 }, // value: pi / 2
+ { 2.30258509f, 4.95f, PAL_EPSILON * 10 }, // value: ln(10)
+ { 2.71828183f, 7.54413710f, PAL_EPSILON * 10 }, // value: e
+ { 3.14159265f, 11.5487394f, PAL_EPSILON * 100 }, // value: pi
+ { PAL_POSINF, PAL_POSINF, 0 },
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate( tests[i].value, tests[i].expected, tests[i].variance);
+ validate(-tests[i].value, -tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sinhf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sinhf/test1/testinfo.dat
new file mode 100644
index 0000000000..cfb27f5427
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sinhf/test1/testinfo.dat
@@ -0,0 +1,13 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sinhf
+Name = Positive Test for sinhf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes to sinhf() a series of angle value, checking that
+= each one return to correct value.
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/CMakeLists.txt
deleted file mode 100644
index cafb9536b0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-add_subdirectory(test10)
-add_subdirectory(test11)
-add_subdirectory(test12)
-add_subdirectory(test13)
-add_subdirectory(test14)
-add_subdirectory(test15)
-add_subdirectory(test16)
-add_subdirectory(test17)
-add_subdirectory(test18)
-add_subdirectory(test19)
-add_subdirectory(test2)
-add_subdirectory(test3)
-add_subdirectory(test4)
-add_subdirectory(test5)
-add_subdirectory(test6)
-add_subdirectory(test7)
-add_subdirectory(test8)
-add_subdirectory(test9)
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/sprintf.h b/src/pal/tests/palsuite/c_runtime/sprintf/sprintf.h
deleted file mode 100644
index 411ae66d54..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/sprintf.h
+++ /dev/null
@@ -1,195 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: sprintf.h
-**
-** Purpose: Containts common testing functions for sprintf
-**
-**
-**==========================================================================*/
-
-#ifndef __SPRINTF_H__
-#define __SPRINTF_H__
-
-void DoStrTest(char *formatstr, char* param, char *checkstr)
-{
- char buf[256] = { 0 };
-
- sprintf(buf, formatstr, param);
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: failed to insert string \"%s\" into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- param, formatstr, checkstr, buf);
- }
-}
-
-void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
-{
- char buf[256] = { 0 };
-
- sprintf(buf, formatstr, param);
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: failed to insert wide string \"%s\" into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- convertC(param), formatstr, checkstr, buf);
- }
-}
-
-void DoPointerTest(char *formatstr, void* param, char* paramstr,
- char *checkstr1)
-{
- char buf[256] = { 0 };
-
- sprintf(buf, formatstr, param);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- paramstr, formatstr, checkstr1, buf);
- }
-}
-
-void DoCountTest(char *formatstr, int param, char *checkstr)
-{
- char buf[512] = { 0 };
- int n = -1;
-
- sprintf(buf, formatstr, &n);
-
- if (n != param)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- param, n);
- }
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf);
- }
-}
-
-void DoShortCountTest(char *formatstr, int param, char *checkstr)
-{
- char buf[256] = { 0 };
- short int n = -1;
-
- sprintf(buf, formatstr, &n);
-
- if (n != param)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- param, n);
- }
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf);
- }
-}
-
-
-void DoCharTest(char *formatstr, char param, char *checkstr)
-{
- char buf[256] = { 0 };
-
- sprintf(buf, formatstr, param);
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- param, param, formatstr, checkstr, buf);
- }
-}
-
-void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
-{
- char buf[256] = { 0 };
-
- sprintf(buf, formatstr, param);
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- (char)param, param, formatstr, checkstr, buf);
- }
-}
-
-void DoNumTest(char *formatstr, int value, char *checkstr)
-{
- char buf[256] = { 0 };
-
- sprintf(buf, formatstr, value);
- if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: failed to insert %#x into \"%s\"\n"
- "Expected \"%s\" got \"%s\".\n",
- value, formatstr, checkstr, buf);
- }
-}
-
-void DoI64Test(char *formatstr, INT64 value, char *valuestr, char *checkstr1)
-{
- char buf[256] = { 0 };
-
- sprintf(buf, formatstr, value);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\"\n"
- "Expected \"%s\", got \"%s\".\n",
- valuestr, formatstr, checkstr1, buf);
- }
-}
-
-void DoDoubleTest(char *formatstr, double value, char *checkstr1,
- char *checkstr2)
-{
- char buf[256] = { 0 };
-
- sprintf(buf, formatstr, value);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
- memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\"\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- value, formatstr, checkstr1, checkstr2, buf);
- }
-}
-
-void DoArgumentPrecTest(char *formatstr, int precision, void *param,
- char *paramstr, char *checkstr1, char *checkstr2)
-{
- char buf[256];
-
- sprintf(buf, formatstr, precision, param);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
- memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n", paramstr, formatstr,
- precision, checkstr1, checkstr2, buf);
- }
-
-}
-
-void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param,
- char *checkstr1, char *checkstr2)
-{
- char buf[256];
-
- sprintf(buf, formatstr, precision, param);
- if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
- memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n", param, formatstr,
- precision, checkstr1, checkstr2, buf);
- }
-
-}
-
-#endif
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test1/CMakeLists.txt
deleted file mode 100644
index bdec045af9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_sprintf_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test1 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/sprintf/test1/test1.c
deleted file mode 100644
index 42e27f263b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test1/test1.c
+++ /dev/null
@@ -1,45 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: Test #1 for the sprintf function. A single, basic, test
-** case with no formatting.
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- char checkstr[] = "hello world";
- char buf[256];
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- sprintf(buf, "hello world");
-
- if (memcmp(checkstr, buf, strlen(checkstr)+1) != 0)
- {
- Fail("ERROR: expected %s, got %s\n", checkstr, buf);
- }
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test1/testinfo.dat
deleted file mode 100644
index abe07445cc..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test1/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= General test to see if sprintf works correctly
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test10/CMakeLists.txt
deleted file mode 100644
index 91e9db8ccc..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test10/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test10.c
-)
-
-add_executable(paltest_sprintf_test10
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test10 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test10
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/sprintf/test10/test10.c
deleted file mode 100644
index ae7dbfb177..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test10/test10.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test10.c
-**
-** Purpose: Test #10 for the sprintf function. Tests the octal specifier
-** (%o).
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %o", pos, "foo 52");
- DoNumTest("foo %lo", 0xFFFF, "foo 177777");
- DoNumTest("foo %ho", 0xFFFF, "foo 177777");
- DoNumTest("foo %Lo", pos, "foo 52");
- DoI64Test("foo %I64o", l, "42", "foo 52");
- DoNumTest("foo %3o", pos, "foo 52");
- DoNumTest("foo %-3o", pos, "foo 52 ");
- DoNumTest("foo %.1o", pos, "foo 52");
- DoNumTest("foo %.3o", pos, "foo 052");
- DoNumTest("foo %03o", pos, "foo 052");
- DoNumTest("foo %#o", pos, "foo 052");
- DoNumTest("foo %+o", pos, "foo 52");
- DoNumTest("foo % o", pos, "foo 52");
- DoNumTest("foo %+o", neg, "foo 37777777726");
- DoNumTest("foo % o", neg, "foo 37777777726");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test10/testinfo.dat
deleted file mode 100644
index 70b7f3ab75..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test10/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test10
-Description
-= Tests sprintf with octal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test11/CMakeLists.txt
deleted file mode 100644
index b14c8be04d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test11/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test11.c
-)
-
-add_executable(paltest_sprintf_test11
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test11 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test11
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/sprintf/test11/test11.c
deleted file mode 100644
index 0b5b5ab93d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test11/test11.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test11.c
-**
-** Purpose: Test #11 for the sprintf function. Test the unsigned int
-** specifier (%u).
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %u", pos, "foo 42");
- DoNumTest("foo %lu", 0xFFFF, "foo 65535");
- DoNumTest("foo %hu", 0xFFFF, "foo 65535");
- DoNumTest("foo %Lu", pos, "foo 42");
- DoI64Test("foo %I64u", l, "42", "foo 42");
- DoNumTest("foo %3u", pos, "foo 42");
- DoNumTest("foo %-3u", pos, "foo 42 ");
- DoNumTest("foo %.1u", pos, "foo 42");
- DoNumTest("foo %.3u", pos, "foo 042");
- DoNumTest("foo %03u", pos, "foo 042");
- DoNumTest("foo %#u", pos, "foo 42");
- DoNumTest("foo %+u", pos, "foo 42");
- DoNumTest("foo % u", pos, "foo 42");
- DoNumTest("foo %+u", neg, "foo 4294967254");
- DoNumTest("foo % u", neg, "foo 4294967254");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test11/testinfo.dat
deleted file mode 100644
index 852bd3e7b6..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test11/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test11
-Description
-= Tests sprintf with unsigned numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test12/CMakeLists.txt
deleted file mode 100644
index 1e517495bd..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test12/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test12.c
-)
-
-add_executable(paltest_sprintf_test12
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test12 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test12
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/sprintf/test12/test12.c
deleted file mode 100644
index c2e778e494..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test12/test12.c
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test12.c
-**
-** Purpose: Test #12 for the sprintf function. Tests the (lowercase)
-** hexadecimal specifier (%x)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 0x1234ab;
- INT64 l = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %x", pos, "foo 1234ab");
- DoNumTest("foo %lx", pos, "foo 1234ab");
- DoNumTest("foo %hx", pos, "foo 34ab");
- DoNumTest("foo %Lx", pos, "foo 1234ab");
- DoI64Test("foo %I64x", l, "0x1234567887654321",
- "foo 1234567887654321");
- DoNumTest("foo %7x", pos, "foo 1234ab");
- DoNumTest("foo %-7x", pos, "foo 1234ab ");
- DoNumTest("foo %.1x", pos, "foo 1234ab");
- DoNumTest("foo %.7x", pos, "foo 01234ab");
- DoNumTest("foo %07x", pos, "foo 01234ab");
- DoNumTest("foo %#x", pos, "foo 0x1234ab");
- DoNumTest("foo %+x", pos, "foo 1234ab");
- DoNumTest("foo % x", pos, "foo 1234ab");
- DoNumTest("foo %+x", neg, "foo ffffffd6");
- DoNumTest("foo % x", neg, "foo ffffffd6");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test12/testinfo.dat
deleted file mode 100644
index 5df91d0e6a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test12/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test12
-Description
-= Tests sprintf with hex numbers (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test13/CMakeLists.txt
deleted file mode 100644
index 25b033fe82..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test13/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test13.c
-)
-
-add_executable(paltest_sprintf_test13
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test13 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test13
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/sprintf/test13/test13.c
deleted file mode 100644
index 0b4b7ed9ae..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test13/test13.c
+++ /dev/null
@@ -1,56 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test13.c
-**
-** Purpose: Test #13 for the sprintf function. Tests the (uppercase)
-** hexadecimal specifier (%X)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 0x1234AB;
- INT64 l = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %X", pos, "foo 1234AB");
- DoNumTest("foo %lX", pos, "foo 1234AB");
- DoNumTest("foo %hX", pos, "foo 34AB");
- DoNumTest("foo %LX", pos, "foo 1234AB");
- DoI64Test("foo %I64X", l, "0x1234567887654321",
- "foo 1234567887654321");
- DoNumTest("foo %7X", pos, "foo 1234AB");
- DoNumTest("foo %-7X", pos, "foo 1234AB ");
- DoNumTest("foo %.1X", pos, "foo 1234AB");
- DoNumTest("foo %.7X", pos, "foo 01234AB");
- DoNumTest("foo %07X", pos, "foo 01234AB");
- DoNumTest("foo %#X", pos, "foo 0X1234AB");
- DoNumTest("foo %+X", pos, "foo 1234AB");
- DoNumTest("foo % X", pos, "foo 1234AB");
- DoNumTest("foo %+X", neg, "foo FFFFFFD6");
- DoNumTest("foo % X", neg, "foo FFFFFFD6");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test13/testinfo.dat
deleted file mode 100644
index 634817a791..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test13/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test13
-Description
-= Tests sprintf with hex numbers (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test14/CMakeLists.txt
deleted file mode 100644
index 5eae306e16..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test14/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test14.c
-)
-
-add_executable(paltest_sprintf_test14
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test14 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test14
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/sprintf/test14/test14.c
deleted file mode 100644
index 20e986a9c3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test14/test14.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test14.c
-**
-** Purpose: Test #14 for the sprintf function. Tests the lowercase
-** exponential notation double specifier (%e)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 256.0;
- double neg = -256.0;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest("foo %e", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %le", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %he", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %Le", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %I64e", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %14e", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %-14e", val, "foo 2.560000e+002 ", "foo 2.560000e+02 ");
- DoDoubleTest("foo %.1e", val, "foo 2.6e+002", "foo 2.6e+02");
- DoDoubleTest("foo %.8e", val, "foo 2.56000000e+002", "foo 2.56000000e+02");
- DoDoubleTest("foo %014e", val, "foo 02.560000e+002", "foo 002.560000e+02");
- DoDoubleTest("foo %#e", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %+e", val, "foo +2.560000e+002", "foo +2.560000e+02");
- DoDoubleTest("foo % e", val, "foo 2.560000e+002", "foo 2.560000e+02");
- DoDoubleTest("foo %+e", neg, "foo -2.560000e+002", "foo -2.560000e+02");
- DoDoubleTest("foo % e", neg, "foo -2.560000e+002", "foo -2.560000e+02");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test14/testinfo.dat
deleted file mode 100644
index c7086efdbc..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test14/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test14
-Description
-= Tests sprintf with exponential format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test15/CMakeLists.txt
deleted file mode 100644
index 1fff23fc89..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test15/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test15.c
-)
-
-add_executable(paltest_sprintf_test15
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test15 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test15
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/sprintf/test15/test15.c
deleted file mode 100644
index 34199b2eb3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test15/test15.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test15.c
-**
-** Purpose: Test #15 for the sprintf function. Tests the uppercase
-** exponential notation double specifier (%E)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 256.0;
- double neg = -256.0;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest("foo %E", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %lE", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %hE", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %LE", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %I64E", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %14E", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %-14E", val, "foo 2.560000E+002 ", "foo 2.560000E+02 ");
- DoDoubleTest("foo %.1E", val, "foo 2.6E+002", "foo 2.6E+02");
- DoDoubleTest("foo %.8E", val, "foo 2.56000000E+002", "foo 2.56000000E+02");
- DoDoubleTest("foo %014E", val, "foo 02.560000E+002", "foo 002.560000E+02");
- DoDoubleTest("foo %#E", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %+E", val, "foo +2.560000E+002", "foo +2.560000E+02");
- DoDoubleTest("foo % E", val, "foo 2.560000E+002", "foo 2.560000E+02");
- DoDoubleTest("foo %+E", neg, "foo -2.560000E+002", "foo -2.560000E+02");
- DoDoubleTest("foo % E", neg, "foo -2.560000E+002", "foo -2.560000E+02");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test15/testinfo.dat
deleted file mode 100644
index 0a47c5321a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test15/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test15
-Description
-= Tests sprintf with exponential format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test16/CMakeLists.txt
deleted file mode 100644
index 2065c576d9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test16/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test16.c
-)
-
-add_executable(paltest_sprintf_test16
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test16 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test16
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/sprintf/test16/test16.c
deleted file mode 100644
index c93b68bc2d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test16/test16.c
+++ /dev/null
@@ -1,52 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test16.c
-**
-** Purpose: Test #16 for the sprintf function. Tests the decimal notation
-** double specifier (%f)
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest("foo %f", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %lf", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %hf", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %Lf", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %I64f", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %12f", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %-12f", val, "foo 2560.001000 ", "foo 2560.001000 ");
- DoDoubleTest("foo %.1f", val, "foo 2560.0", "foo 2560.0");
- DoDoubleTest("foo %.8f", val, "foo 2560.00100000", "foo 2560.00100000");
- DoDoubleTest("foo %012f", val, "foo 02560.001000", "foo 02560.001000");
- DoDoubleTest("foo %#f", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %+f", val, "foo +2560.001000", "foo +2560.001000");
- DoDoubleTest("foo % f", val, "foo 2560.001000", "foo 2560.001000");
- DoDoubleTest("foo %+f", neg, "foo -2560.001000", "foo -2560.001000");
- DoDoubleTest("foo % f", neg, "foo -2560.001000", "foo -2560.001000");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test16/testinfo.dat
deleted file mode 100644
index e18fab1ad8..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test16/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test16
-Description
-= Tests sprintf with decimal point format doubles
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test17/CMakeLists.txt
deleted file mode 100644
index ce3a8ad048..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test17/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test17.c
-)
-
-add_executable(paltest_sprintf_test17
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test17 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test17
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/sprintf/test17/test17.c
deleted file mode 100644
index 643215b8f5..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test17/test17.c
+++ /dev/null
@@ -1,54 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test17.c
-**
-** Purpose: Test #17 for the sprintf function. Tests the lowercase
-** shorthand notation double specifier (%g)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest("foo %g", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %lg", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %hg", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %Lg", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %I64g", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %5g", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %-5g", val, "foo 2560 ", "foo 2560 ");
- DoDoubleTest("foo %.1g", val, "foo 3e+003", "foo 3e+03");
- DoDoubleTest("foo %.2g", val, "foo 2.6e+003", "foo 2.6e+03");
- DoDoubleTest("foo %.12g", val, "foo 2560.001", "foo 2560.001");
- DoDoubleTest("foo %06g", val, "foo 002560", "foo 002560");
- DoDoubleTest("foo %#g", val, "foo 2560.00", "foo 2560.00");
- DoDoubleTest("foo %+g", val, "foo +2560", "foo +2560");
- DoDoubleTest("foo % g", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %+g", neg, "foo -2560", "foo -2560");
- DoDoubleTest("foo % g", neg, "foo -2560", "foo -2560");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test17/testinfo.dat
deleted file mode 100644
index a723103e02..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test17/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test17
-Description
-= Tests sprintf with compact format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test18/CMakeLists.txt
deleted file mode 100644
index 6f69e1c7c2..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test18/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test18.c
-)
-
-add_executable(paltest_sprintf_test18
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test18 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test18
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/sprintf/test18/test18.c
deleted file mode 100644
index fa88152479..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test18/test18.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test18.c
-**
-** Purpose: Test #18 for the sprintf function. Tests the uppercase
-** shorthand notation double specifier (%G)
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- double val = 2560.001;
- double neg = -2560.001;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoDoubleTest("foo %G", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %lG", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %hG", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %LG", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %I64G", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %5G", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %-5G", val, "foo 2560 ", "foo 2560 ");
- DoDoubleTest("foo %.1G", val, "foo 3E+003", "foo 3E+03");
- DoDoubleTest("foo %.2G", val, "foo 2.6E+003", "foo 2.6E+03");
- DoDoubleTest("foo %.12G", val, "foo 2560.001", "foo 2560.001");
- DoDoubleTest("foo %06G", val, "foo 002560", "foo 002560");
- DoDoubleTest("foo %#G", val, "foo 2560.00", "foo 2560.00");
- DoDoubleTest("foo %+G", val, "foo +2560", "foo +2560");
- DoDoubleTest("foo % G", val, "foo 2560", "foo 2560");
- DoDoubleTest("foo %+G", neg, "foo -2560", "foo -2560");
- DoDoubleTest("foo % G", neg, "foo -2560", "foo -2560");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test18/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test18/testinfo.dat
deleted file mode 100644
index dfafa4bcf4..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test18/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test18
-Description
-= Tests sprintf with compact format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test19/CMakeLists.txt
deleted file mode 100644
index a2917b27dc..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test19/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test19.c
-)
-
-add_executable(paltest_sprintf_test19
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test19 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test19
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/sprintf/test19/test19.c
deleted file mode 100644
index aee731cb74..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test19/test19.c
+++ /dev/null
@@ -1,78 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test19.c
-**
-** Purpose: Test #19 for the sprintf function. Tests the variable length
-** precision argument.
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int n = -1;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- DoArgumentPrecTest("%.*s", 2, "bar", "bar", "ba", "ba");
- DoArgumentPrecTest("%.*S", 2, convert("bar"), "bar", "ba", "ba");
-
- DoArgumentPrecTest("%.*n", 3, &n, "pointer to int", "", "");
- if (n != 0)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- 0, n);
- }
-
- DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
- DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
- DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
- DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
-
-
- DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
- DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
- DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
- DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
- DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
- DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
- DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
- DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
- DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
- DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test19/testinfo.dat
deleted file mode 100644
index ebd13025f6..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test19/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test19
-Description
-= Tests sprintf with argument specified precision
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test2/CMakeLists.txt
deleted file mode 100644
index 8af1c53a30..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test2/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test2.c
-)
-
-add_executable(paltest_sprintf_test2
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test2 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test2
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/sprintf/test2/test2.c
deleted file mode 100644
index d50679a5a3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test2/test2.c
+++ /dev/null
@@ -1,47 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test2.c
-**
-** Purpose: Test #2 for the sprintf function. Tests the string specifier
-** (%s).
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoStrTest("foo %s", "bar", "foo bar");
- DoStrTest("foo %hs", "bar", "foo bar");
- DoWStrTest("foo %ls", convert("bar"), "foo bar");
- DoWStrTest("foo %ws", convert("bar"), "foo bar");
- DoStrTest("foo %Ls", "bar", "foo bar");
- DoStrTest("foo %I64s", "bar", "foo bar");
- DoStrTest("foo %5s", "bar", "foo bar");
- DoStrTest("foo %.2s", "bar", "foo ba");
- DoStrTest("foo %5.2s", "bar", "foo ba");
- DoStrTest("foo %-5s", "bar", "foo bar ");
- DoStrTest("foo %05s", "bar", "foo 00bar");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test2/testinfo.dat
deleted file mode 100644
index e8d0f53ff3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test2/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test2
-Description
-= Tests sprintf with strings
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test3/CMakeLists.txt
deleted file mode 100644
index b7b7e0a579..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test3/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test3.c
-)
-
-add_executable(paltest_sprintf_test3
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test3 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test3
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/sprintf/test3/test3.c
deleted file mode 100644
index ae52dbed08..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test3/test3.c
+++ /dev/null
@@ -1,47 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test3.c
-**
-** Purpose: Test #3 for the sprintf function. Tests the wide string
-** specifier (%S).
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- DoWStrTest("foo %S", convert("bar"), "foo bar");
- DoStrTest("foo %hS", "bar", "foo bar");
- DoWStrTest("foo %lS", convert("bar"), "foo bar");
- DoWStrTest("foo %wS", convert("bar"), "foo bar");
- DoWStrTest("foo %LS", convert("bar"), "foo bar");
- DoWStrTest("foo %I64S", convert("bar"), "foo bar");
- DoWStrTest("foo %5S", convert("bar"), "foo bar");
- DoWStrTest("foo %.2S", convert("bar"), "foo ba");
- DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
- DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
- DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
-
- PAL_Terminate();
- return PASS;
-}
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test3/testinfo.dat
deleted file mode 100644
index 12e0a9cfb0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test3/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test3
-Description
-= Tests sprintf with wide strings
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test4/CMakeLists.txt
deleted file mode 100644
index 3478867b7c..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test4/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test4.c
-)
-
-add_executable(paltest_sprintf_test4
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test4 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test4
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/sprintf/test4/test4.c
deleted file mode 100644
index 9660ffaa3a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test4/test4.c
+++ /dev/null
@@ -1,69 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test4.c
-**
-** Purpose: Test #4 for the sprintf function. Tests the pointer
-** specifier (%p).
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- void *ptr = (void*) 0x123456;
- INT64 lptr = I64(0x1234567887654321);
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-/*
-** Run only on 64 bit platforms
-*/
-#if defined(BIT64) && defined(PLATFORM_UNIX)
- Trace("Testing for 64 Bit Platforms \n");
- DoPointerTest("%p", NULL, "NULL", "0000000000000000");
- DoPointerTest("%p", ptr, "pointer to 0x123456", "0000000000123456");
- DoPointerTest("%17p", ptr, "pointer to 0x123456", " 0000000000123456");
- DoPointerTest("%17p", ptr, "pointer to 0x123456", " 0000000000123456");
- DoPointerTest("%-17p", ptr, "pointer to 0x123456", "0000000000123456 ");
- DoPointerTest("%+p", ptr, "pointer to 0x123456", "0000000000123456");
- DoPointerTest("%#p", ptr, "pointer to 0x123456", "0X0000000000123456");
- DoPointerTest("%lp", ptr, "pointer to 0x123456", "00123456");
- DoPointerTest("%hp", ptr, "pointer to 0x123456", "00003456");
- DoPointerTest("%Lp", ptr, "pointer to 0x123456", "00123456");
- DoI64Test("%I64p", lptr, "pointer to 0x1234567887654321",
- "1234567887654321");
-#else
- Trace("Testing for Non 64 Bit Platforms \n");
- DoPointerTest("%p", NULL, "NULL", "00000000");
- DoPointerTest("%p", ptr, "pointer to 0x123456", "00123456");
- DoPointerTest("%9p", ptr, "pointer to 0x123456", " 00123456");
- DoPointerTest("%09p", ptr, "pointer to 0x123456", " 00123456");
- DoPointerTest("%-9p", ptr, "pointer to 0x123456", "00123456 ");
- DoPointerTest("%+p", ptr, "pointer to 0x123456", "00123456");
- DoPointerTest("%#p", ptr, "pointer to 0x123456", "0X00123456");
- DoPointerTest("%lp", ptr, "pointer to 0x123456", "00123456");
- DoPointerTest("%hp", ptr, "pointer to 0x123456", "00003456");
- DoPointerTest("%Lp", ptr, "pointer to 0x123456", "00123456");
- DoI64Test("%I64p", lptr, "pointer to 0x1234567887654321",
- "1234567887654321");
-#endif
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test4/testinfo.dat
deleted file mode 100644
index bf7236dc32..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test4/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test4
-Description
-= Tests sprintf with pointers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test5/CMakeLists.txt
deleted file mode 100644
index dfa7583766..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test5/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test5.c
-)
-
-add_executable(paltest_sprintf_test5
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test5 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test5
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/sprintf/test5/test5.c
deleted file mode 100644
index 1b52da77b6..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test5/test5.c
+++ /dev/null
@@ -1,62 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test5.c
-**
-** Purpose: Test #5 for the sprintf function. Tests the count specifier (%n).
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- char *longStr =
- "really-long-string-that-just-keeps-going-on-and-on-and-on.."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "%n bar";
- char *longResult =
- "really-long-string-that-just-keeps-going-on-and-on-and-on.."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- " bar";
-
- if (PAL_Initialize(argc, argv)!= 0)
- {
- return FAIL;
- }
-
- DoCountTest("foo %n bar", 4, "foo bar");
- DoCountTest(longStr, 257, longResult);
- DoCountTest("fo%n bar", 2, "fo bar");
- DoCountTest("%n", 0, "");
- DoCountTest("foo %#n bar", 4, "foo bar");
- DoCountTest("foo % n bar", 4, "foo bar");
- DoCountTest("foo %+n bar", 4, "foo bar");
- DoCountTest("foo %-n bar", 4, "foo bar");
- DoCountTest("foo %0n bar", 4, "foo bar");
- DoShortCountTest("foo %hn bar", 4, "foo bar");
- DoCountTest("foo %ln bar", 4, "foo bar");
- DoCountTest("foo %Ln bar", 4, "foo bar");
- DoCountTest("foo %I64n bar", 4, "foo bar");
- DoCountTest("foo %20.3n bar", 4, "foo bar");
-
- PAL_Terminate();
-
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test5/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test5/testinfo.dat
deleted file mode 100644
index 31e0537bd0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test5/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test5
-Description
-= Tests sprintf with the count specifier
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test6/CMakeLists.txt
deleted file mode 100644
index 7a9a5fc856..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test6/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test6.c
-)
-
-add_executable(paltest_sprintf_test6
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test6 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test6
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/sprintf/test6/test6.c
deleted file mode 100644
index c14e075475..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test6/test6.c
+++ /dev/null
@@ -1,50 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test6.c
-**
-** Purpose: Test #6 for the sprintf function. Tests the char specifier (%c).
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR wc = (WCHAR) 'c';
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
-
- DoCharTest("foo %c", 'b', "foo b");
- DoCharTest("foo %hc", 'b', "foo b");
- DoWCharTest("foo %lc", wc, "foo c");
- DoCharTest("foo %Lc", 'b', "foo b");
- DoCharTest("foo %I64c", 'b', "foo b");
- DoCharTest("foo %5c", 'b', "foo b");
- DoCharTest("foo %.0c", 'b', "foo b");
- DoCharTest("foo %-5c", 'b', "foo b ");
- DoCharTest("foo %05c", 'b', "foo 0000b");
- DoCharTest("foo % c", 'b', "foo b");
- DoCharTest("foo %#c", 'b', "foo b");
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test6/testinfo.dat
deleted file mode 100644
index 037e4106ff..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test6/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test6
-Description
-= Tests sprintf with characters
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test7/CMakeLists.txt
deleted file mode 100644
index a539a59ab9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test7/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test7.c
-)
-
-add_executable(paltest_sprintf_test7
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test7 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test7
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/sprintf/test7/test7.c
deleted file mode 100644
index 082bd20e6d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test7/test7.c
+++ /dev/null
@@ -1,49 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test7.c
-**
-** Purpose: Test #7 for the sprintf function. Tests the wide char
-** specifier (%C).
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR wb = (WCHAR) 'b';
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoWCharTest("foo %C", wb, "foo b");
- DoWCharTest("foo %hC", wb, "foo b");
- DoCharTest("foo %lC", 'c', "foo c");
- DoWCharTest("foo %LC", wb, "foo b");
- DoWCharTest("foo %I64C", wb, "foo b");
- DoWCharTest("foo %5C", wb, "foo b");
- DoWCharTest("foo %.0C", wb, "foo b");
- DoWCharTest("foo %-5C", wb, "foo b ");
- DoWCharTest("foo %05C", wb, "foo 0000b");
- DoWCharTest("foo % C", wb, "foo b");
- DoWCharTest("foo %#C", wb, "foo b");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test7/testinfo.dat
deleted file mode 100644
index a2730bc97c..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test7/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test7
-Description
-= Tests sprintf with wide characters
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test8/CMakeLists.txt
deleted file mode 100644
index 7a92c5072a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test8/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test8.c
-)
-
-add_executable(paltest_sprintf_test8
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test8 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test8
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/sprintf/test8/test8.c
deleted file mode 100644
index 9587c82c94..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test8/test8.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test8.c
-**
-** Purpose: Test #8 for the sprintf function. Tests the decimal
-** specifier (%d).
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %d", pos, "foo 42");
- DoNumTest("foo %ld", 0xFFFF, "foo 65535");
- DoNumTest("foo %hd", 0xFFFF, "foo -1");
- DoNumTest("foo %Ld", pos, "foo 42");
- DoI64Test("foo %I64d", l, "42", "foo 42");
- DoNumTest("foo %3d", pos, "foo 42");
- DoNumTest("foo %-3d", pos, "foo 42 ");
- DoNumTest("foo %.1d", pos, "foo 42");
- DoNumTest("foo %.3d", pos, "foo 042");
- DoNumTest("foo %03d", pos, "foo 042");
- DoNumTest("foo %#d", pos, "foo 42");
- DoNumTest("foo %+d", pos, "foo +42");
- DoNumTest("foo % d", pos, "foo 42");
- DoNumTest("foo %+d", neg, "foo -42");
- DoNumTest("foo % d", neg, "foo -42");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test8/testinfo.dat
deleted file mode 100644
index adc0b66f06..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test8/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test8
-Description
-= Tests sprintf with decimal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test9/CMakeLists.txt
deleted file mode 100644
index 2a91658bd4..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test9/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test9.c
-)
-
-add_executable(paltest_sprintf_test9
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test9 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test9
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/sprintf/test9/test9.c
deleted file mode 100644
index 98f5db6ec1..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test9/test9.c
+++ /dev/null
@@ -1,55 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test9.c
-**
-** Purpose: Test #9 for the sprintf function. Tests the integer
-** specifier (%i).
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- int neg = -42;
- int pos = 42;
- INT64 l = 42;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
-
- DoNumTest("foo %i", pos, "foo 42");
- DoNumTest("foo %li", 0xFFFF, "foo 65535");
- DoNumTest("foo %hi", 0xFFFF, "foo -1");
- DoNumTest("foo %Li", pos, "foo 42");
- DoI64Test("foo %I64i", l, "42", "foo 42");
- DoNumTest("foo %3i", pos, "foo 42");
- DoNumTest("foo %-3i", pos, "foo 42 ");
- DoNumTest("foo %.1i", pos, "foo 42");
- DoNumTest("foo %.3i", pos, "foo 042");
- DoNumTest("foo %03i", pos, "foo 042");
- DoNumTest("foo %#i", pos, "foo 42");
- DoNumTest("foo %+i", pos, "foo +42");
- DoNumTest("foo % i", pos, "foo 42");
- DoNumTest("foo %+i", neg, "foo -42");
- DoNumTest("foo % i", neg, "foo -42");
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test9/testinfo.dat
deleted file mode 100644
index e569e789cd..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test9/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test9
-Description
-= Tests sprintf with integer numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/CMakeLists.txt
new file mode 100644
index 0000000000..8fe1cb60ac
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/CMakeLists.txt
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
+add_subdirectory(test10)
+add_subdirectory(test11)
+add_subdirectory(test12)
+add_subdirectory(test13)
+add_subdirectory(test14)
+add_subdirectory(test15)
+add_subdirectory(test16)
+add_subdirectory(test17)
+add_subdirectory(test18)
+add_subdirectory(test19)
+add_subdirectory(test2)
+add_subdirectory(test3)
+add_subdirectory(test4)
+add_subdirectory(test6)
+add_subdirectory(test7)
+add_subdirectory(test8)
+add_subdirectory(test9)
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h b/src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h
new file mode 100644
index 0000000000..129b9db727
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h
@@ -0,0 +1,195 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: sprintf_s.h
+**
+** Purpose: Containts common testing functions for sprintf_s
+**
+**
+**==========================================================================*/
+
+#ifndef __SPRINTF_S_H__
+#define __SPRINTF_S_H__
+
+void DoStrTest(const char *formatstr, char* param, const char *checkstr)
+{
+ char buf[256] = { 0 };
+
+ sprintf_s(buf, _countof(buf), formatstr, param);
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert string \"%s\" into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ param, formatstr, checkstr, buf);
+ }
+}
+
+void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr)
+{
+ char buf[256] = { 0 };
+
+ sprintf_s(buf, _countof(buf), formatstr, param);
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert wide string \"%s\" into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ convertC(param), formatstr, checkstr, buf);
+ }
+}
+
+void DoPointerTest(const char *formatstr, void* param, char* paramstr,
+ const char *checkstr1)
+{
+ char buf[256] = { 0 };
+
+ sprintf_s(buf, _countof(buf), formatstr, param);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ paramstr, formatstr, checkstr1, buf);
+ }
+}
+
+void DoCountTest(const char *formatstr, int param, const char *checkstr)
+{
+ char buf[512] = { 0 };
+ int n = -1;
+
+ sprintf_s(buf, _countof(buf), formatstr, &n);
+
+ if (n != param)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
+ param, n);
+ }
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf);
+ }
+}
+
+void DoShortCountTest(const char *formatstr, int param, const char *checkstr)
+{
+ char buf[256] = { 0 };
+ short int n = -1;
+
+ sprintf_s(buf, _countof(buf), formatstr, &n);
+
+ if (n != param)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
+ param, n);
+ }
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: Expected \"%s\" got \"%s\".\n", checkstr, buf);
+ }
+}
+
+
+void DoCharTest(const char *formatstr, char param, const char *checkstr)
+{
+ char buf[256] = { 0 };
+
+ sprintf_s(buf, _countof(buf), formatstr, param);
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ param, param, formatstr, checkstr, buf);
+ }
+}
+
+void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr)
+{
+ char buf[256] = { 0 };
+
+ sprintf_s(buf, _countof(buf), formatstr, param);
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ (char)param, param, formatstr, checkstr, buf);
+ }
+}
+
+void DoNumTest(const char *formatstr, int value, const char *checkstr)
+{
+ char buf[256] = { 0 };
+
+ sprintf_s(buf, _countof(buf), formatstr, value);
+ if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %#x into \"%s\"\n"
+ "Expected \"%s\" got \"%s\".\n",
+ value, formatstr, checkstr, buf);
+ }
+}
+
+void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1)
+{
+ char buf[256] = { 0 };
+
+ sprintf_s(buf, _countof(buf), formatstr, value);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\"\n"
+ "Expected \"%s\", got \"%s\".\n",
+ valuestr, formatstr, checkstr1, buf);
+ }
+}
+
+void DoDoubleTest(const char *formatstr, double value, const char *checkstr1,
+ const char *checkstr2)
+{
+ char buf[256] = { 0 };
+
+ sprintf_s(buf, _countof(buf), formatstr, value);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
+ memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %f into \"%s\"\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ value, formatstr, checkstr1, checkstr2, buf);
+ }
+}
+
+void DoArgumentPrecTest(const char *formatstr, int precision, void *param,
+ char *paramstr, const char *checkstr1, const char *checkstr2)
+{
+ char buf[256];
+
+ sprintf_s(buf, _countof(buf), formatstr, precision, param);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
+ memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n", paramstr, formatstr,
+ precision, checkstr1, checkstr2, buf);
+ }
+
+}
+
+void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param,
+ const char *checkstr1, const char *checkstr2)
+{
+ char buf[256];
+
+ sprintf_s(buf, _countof(buf), formatstr, precision, param);
+ if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
+ memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
+ {
+ Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n", param, formatstr,
+ precision, checkstr1, checkstr2, buf);
+ }
+
+}
+
+#endif
+
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/CMakeLists.txt
new file mode 100644
index 0000000000..ee0d90fe7f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.cpp
+)
+
+add_executable(paltest_sprintf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test1 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp
new file mode 100644
index 0000000000..a289c07716
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp
@@ -0,0 +1,45 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test #1 for the sprintf_s function. A single, basic, test
+** case with no formatting.
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ char checkstr[] = "hello world";
+ char buf[256];
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ sprintf_s(buf, _countof(buf), "hello world");
+
+ if (memcmp(checkstr, buf, strlen(checkstr)+1) != 0)
+ {
+ Fail("ERROR: expected %s, got %s\n", checkstr, buf);
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/testinfo.dat
new file mode 100644
index 0000000000..255c534cdf
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= General test to see if sprintf_s works correctly
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/CMakeLists.txt
new file mode 100644
index 0000000000..1efad19dee
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test10.cpp
+)
+
+add_executable(paltest_sprintf_test10
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test10 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test10
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp
new file mode 100644
index 0000000000..bbda15a331
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp
@@ -0,0 +1,55 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test10.c
+**
+** Purpose: Test #10 for the sprintf_s function. Tests the octal specifier
+** (%o).
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %o", pos, "foo 52");
+ DoNumTest("foo %lo", 0xFFFF, "foo 177777");
+ DoNumTest("foo %ho", 0xFFFF, "foo 177777");
+ DoNumTest("foo %Lo", pos, "foo 52");
+ DoI64Test("foo %I64o", l, "42", "foo 52");
+ DoNumTest("foo %3o", pos, "foo 52");
+ DoNumTest("foo %-3o", pos, "foo 52 ");
+ DoNumTest("foo %.1o", pos, "foo 52");
+ DoNumTest("foo %.3o", pos, "foo 052");
+ DoNumTest("foo %03o", pos, "foo 052");
+ DoNumTest("foo %#o", pos, "foo 052");
+ DoNumTest("foo %+o", pos, "foo 52");
+ DoNumTest("foo % o", pos, "foo 52");
+ DoNumTest("foo %+o", neg, "foo 37777777726");
+ DoNumTest("foo % o", neg, "foo 37777777726");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/testinfo.dat
new file mode 100644
index 0000000000..25ed554ea3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test10
+Description
+= Tests sprintf_s with octal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/CMakeLists.txt
new file mode 100644
index 0000000000..f2f4da694c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test11.cpp
+)
+
+add_executable(paltest_sprintf_test11
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test11 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test11
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp
new file mode 100644
index 0000000000..7f4fca9f32
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp
@@ -0,0 +1,55 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test11.c
+**
+** Purpose: Test #11 for the sprintf_s function. Test the unsigned int
+** specifier (%u).
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %u", pos, "foo 42");
+ DoNumTest("foo %lu", 0xFFFF, "foo 65535");
+ DoNumTest("foo %hu", 0xFFFF, "foo 65535");
+ DoNumTest("foo %Lu", pos, "foo 42");
+ DoI64Test("foo %I64u", l, "42", "foo 42");
+ DoNumTest("foo %3u", pos, "foo 42");
+ DoNumTest("foo %-3u", pos, "foo 42 ");
+ DoNumTest("foo %.1u", pos, "foo 42");
+ DoNumTest("foo %.3u", pos, "foo 042");
+ DoNumTest("foo %03u", pos, "foo 042");
+ DoNumTest("foo %#u", pos, "foo 42");
+ DoNumTest("foo %+u", pos, "foo 42");
+ DoNumTest("foo % u", pos, "foo 42");
+ DoNumTest("foo %+u", neg, "foo 4294967254");
+ DoNumTest("foo % u", neg, "foo 4294967254");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/testinfo.dat
new file mode 100644
index 0000000000..3144f1290e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test11
+Description
+= Tests sprintf_s with unsigned numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/CMakeLists.txt
new file mode 100644
index 0000000000..361e91f9ae
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test12.cpp
+)
+
+add_executable(paltest_sprintf_test12
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test12 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test12
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp
new file mode 100644
index 0000000000..759a41105b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp
@@ -0,0 +1,56 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test12.c
+**
+** Purpose: Test #12 for the sprintf_s function. Tests the (lowercase)
+** hexadecimal specifier (%x)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 0x1234ab;
+ INT64 l = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %x", pos, "foo 1234ab");
+ DoNumTest("foo %lx", pos, "foo 1234ab");
+ DoNumTest("foo %hx", pos, "foo 34ab");
+ DoNumTest("foo %Lx", pos, "foo 1234ab");
+ DoI64Test("foo %I64x", l, "0x1234567887654321",
+ "foo 1234567887654321");
+ DoNumTest("foo %7x", pos, "foo 1234ab");
+ DoNumTest("foo %-7x", pos, "foo 1234ab ");
+ DoNumTest("foo %.1x", pos, "foo 1234ab");
+ DoNumTest("foo %.7x", pos, "foo 01234ab");
+ DoNumTest("foo %07x", pos, "foo 01234ab");
+ DoNumTest("foo %#x", pos, "foo 0x1234ab");
+ DoNumTest("foo %+x", pos, "foo 1234ab");
+ DoNumTest("foo % x", pos, "foo 1234ab");
+ DoNumTest("foo %+x", neg, "foo ffffffd6");
+ DoNumTest("foo % x", neg, "foo ffffffd6");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/testinfo.dat
new file mode 100644
index 0000000000..ed91cecc46
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test12
+Description
+= Tests sprintf_s with hex numbers (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/CMakeLists.txt
new file mode 100644
index 0000000000..d08e13b2ba
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test13.cpp
+)
+
+add_executable(paltest_sprintf_test13
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test13 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test13
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp
new file mode 100644
index 0000000000..76250d058c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp
@@ -0,0 +1,56 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test13.c
+**
+** Purpose: Test #13 for the sprintf_s function. Tests the (uppercase)
+** hexadecimal specifier (%X)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 0x1234AB;
+ INT64 l = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %X", pos, "foo 1234AB");
+ DoNumTest("foo %lX", pos, "foo 1234AB");
+ DoNumTest("foo %hX", pos, "foo 34AB");
+ DoNumTest("foo %LX", pos, "foo 1234AB");
+ DoI64Test("foo %I64X", l, "0x1234567887654321",
+ "foo 1234567887654321");
+ DoNumTest("foo %7X", pos, "foo 1234AB");
+ DoNumTest("foo %-7X", pos, "foo 1234AB ");
+ DoNumTest("foo %.1X", pos, "foo 1234AB");
+ DoNumTest("foo %.7X", pos, "foo 01234AB");
+ DoNumTest("foo %07X", pos, "foo 01234AB");
+ DoNumTest("foo %#X", pos, "foo 0X1234AB");
+ DoNumTest("foo %+X", pos, "foo 1234AB");
+ DoNumTest("foo % X", pos, "foo 1234AB");
+ DoNumTest("foo %+X", neg, "foo FFFFFFD6");
+ DoNumTest("foo % X", neg, "foo FFFFFFD6");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/testinfo.dat
new file mode 100644
index 0000000000..fd5f53017c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test13
+Description
+= Tests sprintf_s with hex numbers (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/CMakeLists.txt
new file mode 100644
index 0000000000..60ac2922d7
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test14.cpp
+)
+
+add_executable(paltest_sprintf_test14
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test14 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test14
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp
new file mode 100644
index 0000000000..668edda433
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp
@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test14.c
+**
+** Purpose: Test #14 for the sprintf_s function. Tests the lowercase
+** exponential notation double specifier (%e)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 256.0;
+ double neg = -256.0;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest("foo %e", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %le", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %he", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %Le", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %I64e", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %14e", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %-14e", val, "foo 2.560000e+002 ", "foo 2.560000e+02 ");
+ DoDoubleTest("foo %.1e", val, "foo 2.6e+002", "foo 2.6e+02");
+ DoDoubleTest("foo %.8e", val, "foo 2.56000000e+002", "foo 2.56000000e+02");
+ DoDoubleTest("foo %014e", val, "foo 02.560000e+002", "foo 002.560000e+02");
+ DoDoubleTest("foo %#e", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %+e", val, "foo +2.560000e+002", "foo +2.560000e+02");
+ DoDoubleTest("foo % e", val, "foo 2.560000e+002", "foo 2.560000e+02");
+ DoDoubleTest("foo %+e", neg, "foo -2.560000e+002", "foo -2.560000e+02");
+ DoDoubleTest("foo % e", neg, "foo -2.560000e+002", "foo -2.560000e+02");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/testinfo.dat
new file mode 100644
index 0000000000..23cf423354
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test14
+Description
+= Tests sprintf_s with exponential format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/CMakeLists.txt
new file mode 100644
index 0000000000..57bba40e6c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test15.cpp
+)
+
+add_executable(paltest_sprintf_test15
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test15 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test15
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp
new file mode 100644
index 0000000000..61e0e362a1
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp
@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test15.c
+**
+** Purpose: Test #15 for the sprintf_s function. Tests the uppercase
+** exponential notation double specifier (%E)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 256.0;
+ double neg = -256.0;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest("foo %E", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %lE", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %hE", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %LE", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %I64E", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %14E", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %-14E", val, "foo 2.560000E+002 ", "foo 2.560000E+02 ");
+ DoDoubleTest("foo %.1E", val, "foo 2.6E+002", "foo 2.6E+02");
+ DoDoubleTest("foo %.8E", val, "foo 2.56000000E+002", "foo 2.56000000E+02");
+ DoDoubleTest("foo %014E", val, "foo 02.560000E+002", "foo 002.560000E+02");
+ DoDoubleTest("foo %#E", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %+E", val, "foo +2.560000E+002", "foo +2.560000E+02");
+ DoDoubleTest("foo % E", val, "foo 2.560000E+002", "foo 2.560000E+02");
+ DoDoubleTest("foo %+E", neg, "foo -2.560000E+002", "foo -2.560000E+02");
+ DoDoubleTest("foo % E", neg, "foo -2.560000E+002", "foo -2.560000E+02");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/testinfo.dat
new file mode 100644
index 0000000000..537e6d1db2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test15
+Description
+= Tests sprintf_s with exponential format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/CMakeLists.txt
new file mode 100644
index 0000000000..fc93e1a67d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test16.cpp
+)
+
+add_executable(paltest_sprintf_test16
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test16 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test16
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp
new file mode 100644
index 0000000000..b237c98d5c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp
@@ -0,0 +1,52 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test16.c
+**
+** Purpose: Test #16 for the sprintf_s function. Tests the decimal notation
+** double specifier (%f)
+**
+**
+**==========================================================================*/
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest("foo %f", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %lf", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %hf", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %Lf", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %I64f", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %12f", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %-12f", val, "foo 2560.001000 ", "foo 2560.001000 ");
+ DoDoubleTest("foo %.1f", val, "foo 2560.0", "foo 2560.0");
+ DoDoubleTest("foo %.8f", val, "foo 2560.00100000", "foo 2560.00100000");
+ DoDoubleTest("foo %012f", val, "foo 02560.001000", "foo 02560.001000");
+ DoDoubleTest("foo %#f", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %+f", val, "foo +2560.001000", "foo +2560.001000");
+ DoDoubleTest("foo % f", val, "foo 2560.001000", "foo 2560.001000");
+ DoDoubleTest("foo %+f", neg, "foo -2560.001000", "foo -2560.001000");
+ DoDoubleTest("foo % f", neg, "foo -2560.001000", "foo -2560.001000");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/testinfo.dat
new file mode 100644
index 0000000000..4e98eccac2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test16
+Description
+= Tests sprintf_s with decimal point format doubles
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/CMakeLists.txt
new file mode 100644
index 0000000000..dc5ff2bb30
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test17.cpp
+)
+
+add_executable(paltest_sprintf_test17
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test17 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test17
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp
new file mode 100644
index 0000000000..220555e5d4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp
@@ -0,0 +1,54 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test17.c
+**
+** Purpose: Test #17 for the sprintf_s function. Tests the lowercase
+** shorthand notation double specifier (%g)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest("foo %g", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %lg", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %hg", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %Lg", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %I64g", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %5g", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %-5g", val, "foo 2560 ", "foo 2560 ");
+ DoDoubleTest("foo %.1g", val, "foo 3e+003", "foo 3e+03");
+ DoDoubleTest("foo %.2g", val, "foo 2.6e+003", "foo 2.6e+03");
+ DoDoubleTest("foo %.12g", val, "foo 2560.001", "foo 2560.001");
+ DoDoubleTest("foo %06g", val, "foo 002560", "foo 002560");
+ DoDoubleTest("foo %#g", val, "foo 2560.00", "foo 2560.00");
+ DoDoubleTest("foo %+g", val, "foo +2560", "foo +2560");
+ DoDoubleTest("foo % g", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %+g", neg, "foo -2560", "foo -2560");
+ DoDoubleTest("foo % g", neg, "foo -2560", "foo -2560");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/testinfo.dat
new file mode 100644
index 0000000000..5e41e20d44
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test17
+Description
+= Tests sprintf_s with compact format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/CMakeLists.txt
new file mode 100644
index 0000000000..f6e1b09efa
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test18.cpp
+)
+
+add_executable(paltest_sprintf_test18
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test18 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test18
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp
new file mode 100644
index 0000000000..2135a6f1e7
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp
@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test18.c
+**
+** Purpose: Test #18 for the sprintf_s function. Tests the uppercase
+** shorthand notation double specifier (%G)
+**
+**
+**==========================================================================*/
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ double val = 2560.001;
+ double neg = -2560.001;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoDoubleTest("foo %G", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %lG", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %hG", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %LG", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %I64G", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %5G", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %-5G", val, "foo 2560 ", "foo 2560 ");
+ DoDoubleTest("foo %.1G", val, "foo 3E+003", "foo 3E+03");
+ DoDoubleTest("foo %.2G", val, "foo 2.6E+003", "foo 2.6E+03");
+ DoDoubleTest("foo %.12G", val, "foo 2560.001", "foo 2560.001");
+ DoDoubleTest("foo %06G", val, "foo 002560", "foo 002560");
+ DoDoubleTest("foo %#G", val, "foo 2560.00", "foo 2560.00");
+ DoDoubleTest("foo %+G", val, "foo +2560", "foo +2560");
+ DoDoubleTest("foo % G", val, "foo 2560", "foo 2560");
+ DoDoubleTest("foo %+G", neg, "foo -2560", "foo -2560");
+ DoDoubleTest("foo % G", neg, "foo -2560", "foo -2560");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/testinfo.dat
new file mode 100644
index 0000000000..06ae3a632e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test18
+Description
+= Tests sprintf_s with compact format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/CMakeLists.txt
new file mode 100644
index 0000000000..757288b694
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test19.cpp
+)
+
+add_executable(paltest_sprintf_test19
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test19 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test19
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp
new file mode 100644
index 0000000000..483c7167b1
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp
@@ -0,0 +1,71 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test19.c
+**
+** Purpose: Test #19 for the sprintf_s function. Tests the variable length
+** precision argument.
+**
+**
+**==========================================================================*/
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n = -1;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ DoArgumentPrecTest("%.*s", 2, (void*)"bar", "bar", "ba", "ba");
+ DoArgumentPrecTest("%.*S", 2, (void*)convert("bar"), "bar", "ba", "ba");
+
+ DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
+ DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
+ DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
+ DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
+
+
+ DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
+ DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
+ DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
+ DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
+ DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
+ DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
+ DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
+ DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
+ DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
+ DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/testinfo.dat
new file mode 100644
index 0000000000..7064c01771
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test19
+Description
+= Tests sprintf_s with argument specified precision
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/CMakeLists.txt
new file mode 100644
index 0000000000..d569263da4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test2.cpp
+)
+
+add_executable(paltest_sprintf_test2
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test2 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test2
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp
new file mode 100644
index 0000000000..990f4f04a8
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test2.c
+**
+** Purpose: Test #2 for the sprintf_s function. Tests the string specifier
+** (%s).
+**
+**
+**==========================================================================*/
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoStrTest("foo %s", "bar", "foo bar");
+ DoStrTest("foo %hs", "bar", "foo bar");
+ DoWStrTest("foo %ls", convert("bar"), "foo bar");
+ DoWStrTest("foo %ws", convert("bar"), "foo bar");
+ DoStrTest("foo %Ls", "bar", "foo bar");
+ DoStrTest("foo %I64s", "bar", "foo bar");
+ DoStrTest("foo %5s", "bar", "foo bar");
+ DoStrTest("foo %.2s", "bar", "foo ba");
+ DoStrTest("foo %5.2s", "bar", "foo ba");
+ DoStrTest("foo %-5s", "bar", "foo bar ");
+ DoStrTest("foo %05s", "bar", "foo 00bar");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/testinfo.dat
new file mode 100644
index 0000000000..cce2dc67e7
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test2
+Description
+= Tests sprintf_s with strings
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/CMakeLists.txt
new file mode 100644
index 0000000000..518c3f847a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test3.cpp
+)
+
+add_executable(paltest_sprintf_test3
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test3 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test3
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp
new file mode 100644
index 0000000000..c0dc8e1716
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test3.c
+**
+** Purpose: Test #3 for the sprintf_s function. Tests the wide string
+** specifier (%S).
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ DoWStrTest("foo %S", convert("bar"), "foo bar");
+ DoStrTest("foo %hS", "bar", "foo bar");
+ DoWStrTest("foo %lS", convert("bar"), "foo bar");
+ DoWStrTest("foo %wS", convert("bar"), "foo bar");
+ DoWStrTest("foo %LS", convert("bar"), "foo bar");
+ DoWStrTest("foo %I64S", convert("bar"), "foo bar");
+ DoWStrTest("foo %5S", convert("bar"), "foo bar");
+ DoWStrTest("foo %.2S", convert("bar"), "foo ba");
+ DoWStrTest("foo %5.2S", convert("bar"), "foo ba");
+ DoWStrTest("foo %-5S", convert("bar"), "foo bar ");
+ DoWStrTest("foo %05S", convert("bar"), "foo 00bar");
+
+ PAL_Terminate();
+ return PASS;
+}
+
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/testinfo.dat
new file mode 100644
index 0000000000..cc8de0eae5
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test3
+Description
+= Tests sprintf_s with wide strings
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/CMakeLists.txt
new file mode 100644
index 0000000000..260def44aa
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test4.cpp
+)
+
+add_executable(paltest_sprintf_test4
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test4 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test4
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp
new file mode 100644
index 0000000000..46115ad5ae
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp
@@ -0,0 +1,69 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test4.c
+**
+** Purpose: Test #4 for the sprintf_s function. Tests the pointer
+** specifier (%p).
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ void *ptr = (void*) 0x123456;
+ INT64 lptr = I64(0x1234567887654321);
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+/*
+** Run only on 64 bit platforms
+*/
+#if defined(BIT64) && defined(PLATFORM_UNIX)
+ Trace("Testing for 64 Bit Platforms \n");
+ DoPointerTest("%p", NULL, "NULL", "0000000000000000");
+ DoPointerTest("%p", ptr, "pointer to 0x123456", "0000000000123456");
+ DoPointerTest("%17p", ptr, "pointer to 0x123456", " 0000000000123456");
+ DoPointerTest("%17p", ptr, "pointer to 0x123456", " 0000000000123456");
+ DoPointerTest("%-17p", ptr, "pointer to 0x123456", "0000000000123456 ");
+ DoPointerTest("%+p", ptr, "pointer to 0x123456", "0000000000123456");
+ DoPointerTest("%#p", ptr, "pointer to 0x123456", "0X0000000000123456");
+ DoPointerTest("%lp", ptr, "pointer to 0x123456", "00123456");
+ DoPointerTest("%hp", ptr, "pointer to 0x123456", "00003456");
+ DoPointerTest("%Lp", ptr, "pointer to 0x123456", "00123456");
+ DoI64Test("%I64p", lptr, "pointer to 0x1234567887654321",
+ "1234567887654321");
+#else
+ Trace("Testing for Non 64 Bit Platforms \n");
+ DoPointerTest("%p", NULL, "NULL", "00000000");
+ DoPointerTest("%p", ptr, "pointer to 0x123456", "00123456");
+ DoPointerTest("%9p", ptr, "pointer to 0x123456", " 00123456");
+ DoPointerTest("%09p", ptr, "pointer to 0x123456", " 00123456");
+ DoPointerTest("%-9p", ptr, "pointer to 0x123456", "00123456 ");
+ DoPointerTest("%+p", ptr, "pointer to 0x123456", "00123456");
+ DoPointerTest("%#p", ptr, "pointer to 0x123456", "0X00123456");
+ DoPointerTest("%lp", ptr, "pointer to 0x123456", "00123456");
+ DoPointerTest("%hp", ptr, "pointer to 0x123456", "00003456");
+ DoPointerTest("%Lp", ptr, "pointer to 0x123456", "00123456");
+ DoI64Test("%I64p", lptr, "pointer to 0x1234567887654321",
+ "1234567887654321");
+#endif
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/testinfo.dat
new file mode 100644
index 0000000000..f53f784991
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test4
+Description
+= Tests sprintf_s with pointers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/CMakeLists.txt
new file mode 100644
index 0000000000..fce1f204fd
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test6.cpp
+)
+
+add_executable(paltest_sprintf_test6
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test6 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test6
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp
new file mode 100644
index 0000000000..c5fc804071
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp
@@ -0,0 +1,50 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test6.c
+**
+** Purpose: Test #6 for the sprintf_s function. Tests the char specifier (%c).
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR wc = (WCHAR) 'c';
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+
+ DoCharTest("foo %c", 'b', "foo b");
+ DoCharTest("foo %hc", 'b', "foo b");
+ DoWCharTest("foo %lc", wc, "foo c");
+ DoCharTest("foo %Lc", 'b', "foo b");
+ DoCharTest("foo %I64c", 'b', "foo b");
+ DoCharTest("foo %5c", 'b', "foo b");
+ DoCharTest("foo %.0c", 'b', "foo b");
+ DoCharTest("foo %-5c", 'b', "foo b ");
+ DoCharTest("foo %05c", 'b', "foo 0000b");
+ DoCharTest("foo % c", 'b', "foo b");
+ DoCharTest("foo %#c", 'b', "foo b");
+
+ PAL_Terminate();
+ return PASS;
+}
+
+
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/testinfo.dat
new file mode 100644
index 0000000000..c5b93fc78c
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test6
+Description
+= Tests sprintf_s with characters
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/CMakeLists.txt
new file mode 100644
index 0000000000..72a831ec89
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test7.cpp
+)
+
+add_executable(paltest_sprintf_test7
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test7 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test7
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp
new file mode 100644
index 0000000000..fd46ae9674
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp
@@ -0,0 +1,49 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test7.c
+**
+** Purpose: Test #7 for the sprintf_s function. Tests the wide char
+** specifier (%C).
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR wb = (WCHAR) 'b';
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoWCharTest("foo %C", wb, "foo b");
+ DoWCharTest("foo %hC", wb, "foo b");
+ DoCharTest("foo %lC", 'c', "foo c");
+ DoWCharTest("foo %LC", wb, "foo b");
+ DoWCharTest("foo %I64C", wb, "foo b");
+ DoWCharTest("foo %5C", wb, "foo b");
+ DoWCharTest("foo %.0C", wb, "foo b");
+ DoWCharTest("foo %-5C", wb, "foo b ");
+ DoWCharTest("foo %05C", wb, "foo 0000b");
+ DoWCharTest("foo % C", wb, "foo b");
+ DoWCharTest("foo %#C", wb, "foo b");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/testinfo.dat
new file mode 100644
index 0000000000..647c9d80fd
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test7
+Description
+= Tests sprintf_s with wide characters
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/CMakeLists.txt
new file mode 100644
index 0000000000..c9522c1c9d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test8.cpp
+)
+
+add_executable(paltest_sprintf_test8
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test8 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test8
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp
new file mode 100644
index 0000000000..db02627bb0
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp
@@ -0,0 +1,55 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test8.c
+**
+** Purpose: Test #8 for the sprintf_s function. Tests the decimal
+** specifier (%d).
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %d", pos, "foo 42");
+ DoNumTest("foo %ld", 0xFFFF, "foo 65535");
+ DoNumTest("foo %hd", 0xFFFF, "foo -1");
+ DoNumTest("foo %Ld", pos, "foo 42");
+ DoI64Test("foo %I64d", l, "42", "foo 42");
+ DoNumTest("foo %3d", pos, "foo 42");
+ DoNumTest("foo %-3d", pos, "foo 42 ");
+ DoNumTest("foo %.1d", pos, "foo 42");
+ DoNumTest("foo %.3d", pos, "foo 042");
+ DoNumTest("foo %03d", pos, "foo 042");
+ DoNumTest("foo %#d", pos, "foo 42");
+ DoNumTest("foo %+d", pos, "foo +42");
+ DoNumTest("foo % d", pos, "foo 42");
+ DoNumTest("foo %+d", neg, "foo -42");
+ DoNumTest("foo % d", neg, "foo -42");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/testinfo.dat
new file mode 100644
index 0000000000..524834e53e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test8
+Description
+= Tests sprintf_s with decimal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/CMakeLists.txt
new file mode 100644
index 0000000000..e76fed4784
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test9.cpp
+)
+
+add_executable(paltest_sprintf_test9
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sprintf_test9 coreclrpal)
+
+target_link_libraries(paltest_sprintf_test9
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp
new file mode 100644
index 0000000000..2e1c78ce68
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp
@@ -0,0 +1,55 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test9.c
+**
+** Purpose: Test #9 for the sprintf_s function. Tests the integer
+** specifier (%i).
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sprintf_s.h"
+
+/*
+ * Depends on memcmp and strlen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int neg = -42;
+ int pos = 42;
+ INT64 l = 42;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+
+ DoNumTest("foo %i", pos, "foo 42");
+ DoNumTest("foo %li", 0xFFFF, "foo 65535");
+ DoNumTest("foo %hi", 0xFFFF, "foo -1");
+ DoNumTest("foo %Li", pos, "foo 42");
+ DoI64Test("foo %I64i", l, "42", "foo 42");
+ DoNumTest("foo %3i", pos, "foo 42");
+ DoNumTest("foo %-3i", pos, "foo 42 ");
+ DoNumTest("foo %.1i", pos, "foo 42");
+ DoNumTest("foo %.3i", pos, "foo 042");
+ DoNumTest("foo %03i", pos, "foo 042");
+ DoNumTest("foo %#i", pos, "foo 42");
+ DoNumTest("foo %+i", pos, "foo +42");
+ DoNumTest("foo % i", pos, "foo 42");
+ DoNumTest("foo %+i", neg, "foo -42");
+ DoNumTest("foo % i", neg, "foo -42");
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/testinfo.dat
new file mode 100644
index 0000000000..7c51443a3d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sprintf_s
+Name = Positive Test for sprintf_s
+TYPE = DEFAULT
+EXE1 = test9
+Description
+= Tests sprintf_s with integer numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sqrt/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sqrt/test1/CMakeLists.txt
index 4347c44e46..d4aefe6ca8 100644
--- a/src/pal/tests/palsuite/c_runtime/sqrt/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sqrt/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_sqrt_test1
diff --git a/src/pal/tests/palsuite/c_runtime/sqrt/test1/test1.c b/src/pal/tests/palsuite/c_runtime/sqrt/test1/test1.cpp
index 62d2251d61..62d2251d61 100644
--- a/src/pal/tests/palsuite/c_runtime/sqrt/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/sqrt/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/_makepath/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sqrtf/CMakeLists.txt
index f6aa0cb2d9..f6aa0cb2d9 100644
--- a/src/pal/tests/palsuite/c_runtime/_makepath/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sqrtf/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sqrtf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sqrtf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..96b6ffa998
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sqrtf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_sqrtf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sqrtf_test1 coreclrpal)
+
+target_link_libraries(paltest_sqrtf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sqrtf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/sqrtf/test1/test1.c
new file mode 100644
index 0000000000..cb1ac9e7df
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sqrtf/test1/test1.c
@@ -0,0 +1,122 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test1.c
+**
+** Purpose: Call the sqrtf function on a positive value, a positive value
+** with a decimal and on the maxium possible float value.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = sqrtf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("sqrtf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = sqrtf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("sqrtf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0.318309886f, 0.564189584f, PAL_EPSILON }, // value: 1 / pi
+ { 0.434294482f, 0.659010229f, PAL_EPSILON }, // value: log10f(e)
+ { 0.636619772f, 0.797884561f, PAL_EPSILON }, // value: 2 / pi
+ { 0.693147181f, 0.832554611f, PAL_EPSILON }, // value: ln(2)
+ { 0.707106781f, 0.840896415f, PAL_EPSILON }, // value: 1 / sqrtf(2)
+ { 0.785398163f, 0.886226925f, PAL_EPSILON }, // value: pi / 4
+ { 1, 1, PAL_EPSILON * 10 },
+ { 1.12837917f, 1.06225193f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi)
+ { 1.41421356f, 1.18920712f, PAL_EPSILON * 10 }, // value: sqrtf(2)
+ { 1.44269504f, 1.20112241f, PAL_EPSILON * 10 }, // value: logf2(e)
+ { 1.57079633f, 1.25331414f, PAL_EPSILON * 10 }, // value: pi / 2
+ { 2.30258509f, 1.51742713f, PAL_EPSILON * 10 }, // value: ln(10)
+ { 2.71828183f, 1.64872127f, PAL_EPSILON * 10 }, // value: e
+ { 3.14159265f, 1.77245385F, PAL_EPSILON * 10 }, // value: pi
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ validate(-0.0f, -0.0f, PAL_EPSILON);
+ validate( 0.0f, 0.0f, PAL_EPSILON);
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate(tests[i].value, tests[i].expected, tests[i].variance);
+ validate_isnan(-tests[i].value);
+ }
+
+ validate_isnan(PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sqrtf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sqrtf/test1/testinfo.dat
new file mode 100644
index 0000000000..00d8ab2e43
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sqrtf/test1/testinfo.dat
@@ -0,0 +1,17 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sqrtf
+Name = Call sqrtf on positive values and zero.
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Call the sqrtf function on a positive value, a positive value
+= with a decimal and on the maxium possible float value.
+
+
+
+
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/sscanf.h b/src/pal/tests/palsuite/c_runtime/sscanf/sscanf.h
deleted file mode 100644
index 675a67aed2..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/sscanf.h
+++ /dev/null
@@ -1,246 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: sscanf.h
-**
-** Purpose: Contains common testing functions for sscanf.h
-**
-**
-**==========================================================================*/
-
-#ifndef __SSCANF_H__
-#define __SSCANF_H__
-
-void DoVoidTest(char *inputstr, char *formatstr)
-{
- char buf[256] = { 0 };
- int i;
- int ret;
-
- ret = sscanf(inputstr, formatstr, buf);
- if (ret != 0)
- {
- Fail("ERROR: Expected sscanf to return 0, got %d.\n"
- "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
- }
-
- for (i=0; i<256; i++)
- {
- if (buf[i] != 0)
- {
- Fail("ERROR: Parameter unexpectedly modified scanning \"%s\" "
- "using \"%s\".\n", inputstr, formatstr);
- }
- }
-
-}
-
-void DoStrTest(char *inputstr, char *formatstr, char *checkstr)
-{
- char buf[256] = { 0 };
- int ret;
-
- ret = sscanf(inputstr, formatstr, buf);
- if (ret != 1)
- {
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
- "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
- }
-
- if (memcmp(checkstr, buf, strlen(checkstr) + 1) != 0)
- {
- Fail("ERROR: scanned string incorrectly from \"%s\" using \"%s\".\n"
- "Expected \"%s\", got \"%s\".\n", inputstr, formatstr, checkstr,
- buf);
- }
-
-}
-
-void DoWStrTest(char *inputstr, char *formatstr, WCHAR *checkstr)
-{
- WCHAR buf[256] = { 0 };
- int ret;
-
- ret = sscanf(inputstr, formatstr, buf);
- if (ret != 1)
- {
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
- "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
- }
-
- if (memcmp(checkstr, buf, wcslen(checkstr)*2 + 2) != 0)
- {
- Fail("ERROR: scanned wide string incorrectly from \"%s\" using \"%s\".\n"
- "Expected \"%s\", got \"%s\".\n", inputstr, formatstr,
- convertC(checkstr), convertC(buf));
- }
-
-}
-
-void DoNumTest(char *inputstr, char *formatstr, int checknum)
-{
- int num;
- int ret;
-
- ret = sscanf(inputstr, formatstr, &num);
- if (ret != 1)
- {
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
- "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
- }
-
- if (checknum != num)
- {
- Fail("ERROR: scanned number incorrectly from \"%s\" using \"%s\".\n"
- "Expected %d, got %d.\n", inputstr, formatstr, checknum, num);
- }
-}
-
-void DoShortNumTest(char *inputstr, char *formatstr, short checknum)
-{
- short num;
- int ret;
-
- ret = sscanf(inputstr, formatstr, &num);
- if (ret != 1)
- {
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
- "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
- }
-
- if (checknum != num)
- {
- Fail("ERROR: scanned number incorrectly from \"%s\" using \"%s\".\n"
- "Expected %hd, got %hd.\n", inputstr, formatstr, checknum, num);
- }
-}
-
-void DoI64NumTest(char *inputstr, char *formatstr, INT64 checknum)
-{
- char buf[256];
- char check[256];
- INT64 num;
- int ret;
-
- ret = sscanf(inputstr, formatstr, &num);
- if (ret != 1)
- {
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
- "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
- }
-
- if (checknum != num)
- {
- sprintf(buf, "%I64d", num);
- sprintf(check, "%I64d", checknum);
- Fail("ERROR: scanned I64 number incorrectly from \"%s\" using \"%s\".\n"
- "Expected %s, got %s.\n", inputstr, formatstr, check, buf);
- }
-}
-
-void DoCharTest(char *inputstr, char *formatstr, char* checkchars, int numchars)
-{
- char buf[256];
- int ret;
- int i;
-
- for (i=0; i<256; i++)
- buf[i] = (char)-1;
-
- ret = sscanf(inputstr, formatstr, buf);
- if (ret != 1)
- {
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
- "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
- }
-
- if (memcmp(buf, checkchars, numchars) != 0)
- {
- buf[numchars] = 0;
-
- Fail("ERROR: scanned character(s) incorrectly from \"%s\" using \"%s\".\n"
- "Expected %s, got %s.\n", inputstr, formatstr, checkchars,
- buf);
- }
-
- if (buf[numchars] != (char)-1)
- {
- Fail("ERROR: overflow occurred in scanning character(s) from \"%s\" "
- "using \"%s\".\nExpected %d character(s)\n", inputstr, formatstr,
- numchars);
- }
-}
-
-void DoWCharTest(char *inputstr, char *formatstr, WCHAR* checkchars, int numchars)
-{
- WCHAR buf[256];
- int ret;
- int i;
-
- for (i=0; i<256; i++)
- buf[i] = (WCHAR)-1;
-
- ret = sscanf(inputstr, formatstr, buf);
- if (ret != 1)
- {
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
- "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
- }
-
- if (memcmp(buf, checkchars, numchars) != 0)
- {
- buf[numchars] = 0;
-
- Fail("ERROR: scanned wide character(s) incorrectly from \"%s\" using \"%s\".\n"
- "Expected %s, got %s.\n", inputstr, formatstr, convertC(checkchars),
- convertC(buf));
- }
-
- if (buf[numchars] != (WCHAR)-1)
- {
- Fail("ERROR: overflow occurred in scanning wide character(s) from \"%s\" "
- "using \"%s\".\nExpected %d character(s)\n", inputstr, formatstr,
- numchars);
- }
-}
-
-
-void DoFloatTest(char *inputstr, char *formatstr, float checkval)
-{
- char buf[256] = { 0 };
- float val;
- int ret;
- int i;
-
- for (i=0; i<256; i++)
- buf[i] = (char)-1;
-
- ret = sscanf(inputstr, formatstr, buf);
- val = *(float*)buf;
-
- if (ret != 1)
- {
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
- "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
- }
-
- if (val != checkval)
- {
- Fail("ERROR: scanned float incorrectly from \"%s\" using \"%s\".\n"
- "Expected \"%f\", got \"%f\".\n", inputstr, formatstr, checkval,
- val);
- }
-
- if (buf[4] != (char)-1)
- {
- Fail("ERROR: overflow occurred in scanning float from \"%s\" "
- "using \"%s\".\n", inputstr, formatstr);
-
- }
-}
-
-
-#endif
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test1/CMakeLists.txt
deleted file mode 100644
index dce6d1de87..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test1.c
-)
-
-add_executable(paltest_sscanf_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test1 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/sscanf/test1/test1.c
deleted file mode 100644
index c6f66a1d20..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test1/test1.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: General test of sscanf
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int num;
- int ret;
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
-
- DoVoidTest("foo bar", "foo ");
- DoVoidTest("foo bar", "baz");
- DoVoidTest("foo bar", "foo %*s");
-
- DoStrTest("foo % bar", "foo %% %s", "bar");
- DoStrTest("foo bar baz", "foo %bar %s", "baz");
-
- DoVoidTest("foo bar baz", "foo % bar %s");
- DoVoidTest("foo baz bar", "foo% baz %s");
-
- ret = sscanf("foo bar baz", "foo bar %n", &num);
- if (ret != 0 || num != 8)
- {
- Fail("ERROR: Got incorrect values in scanning \"%s\" using \"%s\".\n"
- "Expected to get a value of %d with return value of %d, "
- "got %d with return %d\n", "foo bar baz", "foo bar %n", 8, 0,
- num, ret);
-
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test1/testinfo.dat
deleted file mode 100644
index ef33ba9e13..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test1/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test1
-Description
-= General test of sscanf
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test10/CMakeLists.txt
deleted file mode 100644
index c27e4ce33a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test10/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test10.c
-)
-
-add_executable(paltest_sscanf_test10
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test10 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test10
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/sscanf/test10/test10.c
deleted file mode 100644
index aac5be43ae..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test10/test10.c
+++ /dev/null
@@ -1,37 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test10.c
-**
-** Purpose: Tests sscanf with wide charactersn
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoWCharTest("1234d", "%C", convert("1"), 1);
- DoWCharTest("1234d", "%C", convert("1"), 1);
- DoWCharTest("abc", "%2C", convert("ab"), 2);
- DoWCharTest(" ab", "%C", convert(" "), 1);
- DoCharTest("ab", "%hC", "a", 1);
- DoWCharTest("ab", "%lC", convert("a"), 1);
- DoWCharTest("ab", "%LC", convert("a"), 1);
- DoWCharTest("ab", "%I64C", convert("a"), 1);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test10/testinfo.dat
deleted file mode 100644
index 7e854ed235..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test10/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test10
-Description
-= Tests sscanf with wide characters
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test11/CMakeLists.txt
deleted file mode 100644
index 7570e990bf..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test11/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test11.c
-)
-
-add_executable(paltest_sscanf_test11
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test11 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test11
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/sscanf/test11/test11.c
deleted file mode 100644
index 0e3db6cca0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test11/test11.c
+++ /dev/null
@@ -1,36 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test11.c
-**
-** Purpose: Tests sscanf with strings
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoStrTest("foo bar", "foo %s", "bar");
- DoStrTest("foo bar", "foo %2s", "ba");
- DoStrTest("foo bar", "foo %hs", "bar");
- DoWStrTest("foo bar", "foo %ls", convert("bar"));
- DoStrTest("foo bar", "foo %Ls", "bar");
- DoStrTest("foo bar", "foo %I64s", "bar");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test11/testinfo.dat
deleted file mode 100644
index 60f5cc46a4..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test11/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test11
-Description
-= Tests sscanf with strings
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test12/CMakeLists.txt
deleted file mode 100644
index b6509e46d4..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test12/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test12.c
-)
-
-add_executable(paltest_sscanf_test12
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test12 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test12
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/sscanf/test12/test12.c
deleted file mode 100644
index f800e452c0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test12/test12.c
+++ /dev/null
@@ -1,35 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test12.c
-**
-** Purpose: Tests sscanf with wide strings
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoWStrTest("foo bar", "foo %S", convert("bar"));
- DoWStrTest("foo bar", "foo %2S", convert("ba"));
- DoStrTest("foo bar", "foo %hS", "bar");
- DoWStrTest("foo bar", "foo %lS", convert("bar"));
- DoWStrTest("foo bar", "foo %LS", convert("bar"));
- DoWStrTest("foo bar", "foo %I64S", convert("bar"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test12/testinfo.dat
deleted file mode 100644
index 3c453bf53a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test12/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test12
-Description
-= Tests sscanf with wide strings
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test13/CMakeLists.txt
deleted file mode 100644
index 6fb4094f00..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test13/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test13.c
-)
-
-add_executable(paltest_sscanf_test13
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test13 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test13
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/sscanf/test13/test13.c
deleted file mode 100644
index 314604e3ac..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test13/test13.c
+++ /dev/null
@@ -1,37 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test13.c
-**
-** Purpose: Tests sscanf with floats (decimal notation)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoFloatTest("123.0", "%f", 123.0f);
- DoFloatTest("123.0", "%2f", 12.0f);
- DoFloatTest("10E1", "%f", 100.0f);
- DoFloatTest("-12.01e-2", "%f", -0.1201f);
- DoFloatTest("+12.01e-2", "%f", 0.1201f);
- DoFloatTest("-12.01e+2", "%f", -1201.0f);
- DoFloatTest("+12.01e+2", "%f", 1201.0f);
- DoFloatTest("1234567890.0123456789f", "%f", 1234567936);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test13/testinfo.dat
deleted file mode 100644
index 1c4c2fc26e..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test13/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test13
-Description
-= Tests sscanf with floats (decimal notation)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test14/CMakeLists.txt
deleted file mode 100644
index 373a75fbda..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test14/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test14.c
-)
-
-add_executable(paltest_sscanf_test14
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test14 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test14
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/sscanf/test14/test14.c
deleted file mode 100644
index d1291a3b65..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test14/test14.c
+++ /dev/null
@@ -1,36 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test14.c
-**
-** Purpose: Tests sscanf with floats (exponential notation, lowercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoFloatTest("123.0", "%e", 123.0f);
- DoFloatTest("123.0", "%2e", 12.0f);
- DoFloatTest("10E1", "%e", 100.0f);
- DoFloatTest("-12.01e-2", "%e", -0.1201f);
- DoFloatTest("+12.01e-2", "%e", 0.1201f);
- DoFloatTest("-12.01e+2", "%e", -1201.0f);
- DoFloatTest("+12.01e+2", "%e", 1201.0f);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test14/testinfo.dat
deleted file mode 100644
index 97db6e4ffd..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test14/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test14
-Description
-= Tests sscanf with floats (exponential notation, lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test15/CMakeLists.txt
deleted file mode 100644
index d500901782..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test15/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test15.c
-)
-
-add_executable(paltest_sscanf_test15
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test15 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test15
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/sscanf/test15/test15.c
deleted file mode 100644
index fa51467d85..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test15/test15.c
+++ /dev/null
@@ -1,36 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test15.c
-**
-** Purpose: Tests sscanf with floats (exponential notation, uppercase
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoFloatTest("123.0", "%E", 123.0f);
- DoFloatTest("123.0", "%2E", 12.0f);
- DoFloatTest("10E1", "%E", 100.0f);
- DoFloatTest("-12.01e-2", "%E", -0.1201f);
- DoFloatTest("+12.01e-2", "%E", 0.1201f);
- DoFloatTest("-12.01e+2", "%E", -1201.0f);
- DoFloatTest("+12.01e+2", "%E", 1201.0f);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test15/testinfo.dat
deleted file mode 100644
index 30c2cf4b30..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test15/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test15
-Description
-= Tests sscanf with floats (exponential notation, uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test16/CMakeLists.txt
deleted file mode 100644
index c5e18ec061..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test16/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test16.c
-)
-
-add_executable(paltest_sscanf_test16
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test16 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test16
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/sscanf/test16/test16.c
deleted file mode 100644
index 787b72ed0a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test16/test16.c
+++ /dev/null
@@ -1,37 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test16.c
-**
-** Purpose:Tests sscanf with floats (compact notation, lowercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoFloatTest("123.0", "%g", 123.0f);
- DoFloatTest("123.0", "%2g", 12.0f);
- DoFloatTest("10E1", "%g", 100.0f);
- DoFloatTest("-12.01e-2", "%g", -0.1201f);
- DoFloatTest("+12.01e-2", "%g", 0.1201f);
- DoFloatTest("-12.01e+2", "%g", -1201.0f);
- DoFloatTest("+12.01e+2", "%g", 1201.0f);
- DoFloatTest("1234567890.0123456789g", "%g", 1234567936);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test16/testinfo.dat
deleted file mode 100644
index 2c1dd42b70..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test16/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test16
-Description
-= Tests sscanf with floats (compact notation, lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test17/CMakeLists.txt
deleted file mode 100644
index 7d908ab832..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test17/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test17.c
-)
-
-add_executable(paltest_sscanf_test17
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test17 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test17
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/sscanf/test17/test17.c
deleted file mode 100644
index c0dfd1699c..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test17/test17.c
+++ /dev/null
@@ -1,37 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test17.c
-**
-** Purpose: Tests sscanf with floats (compact notation, uppercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoFloatTest("123.0", "%G", 123.0f);
- DoFloatTest("123.0", "%2G", 12.0f);
- DoFloatTest("10E1", "%G", 100.0f);
- DoFloatTest("-12.01e-2", "%G", -0.1201f);
- DoFloatTest("+12.01e-2", "%G", 0.1201f);
- DoFloatTest("-12.01e+2", "%G", -1201.0f);
- DoFloatTest("+12.01e+2", "%G", 1201.0f);
- DoFloatTest("1234567890.0123456789G", "%G", 1234567936);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test17/testinfo.dat
deleted file mode 100644
index e23be8541e..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test17/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test17
-Description
-= Tests sscanf with floats (compact notation, uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test2/CMakeLists.txt
deleted file mode 100644
index 571d773a88..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test2/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test2.c
-)
-
-add_executable(paltest_sscanf_test2
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test2 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test2
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/sscanf/test2/test2.c
deleted file mode 100644
index 1221124e3a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test2/test2.c
+++ /dev/null
@@ -1,44 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test2.c
-**
-** Purpose: Test to see if sscanf handles whitespace correctly
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-
-/*
- * Tests out how it handles whitespace. Seems to accept anything that qualifies
- * as isspace (space, tab, vertical tab, line feed, carriage return and form
- * feed), even if it says it only wants spaces tabs and newlines.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoStrTest("foo bar", "foo %s", "bar");
- DoStrTest("foo\tbar", "foo %s", "bar");
- DoStrTest("foo\nbar", "foo %s", "bar");
- DoStrTest("foo\rbar", "foo %s", "bar");
- DoStrTest("foo\vbar", "foo %s", "bar");
- DoStrTest("foo\fbar", "foo %s", "bar");
- DoStrTest("foo \t\n\r\v\fbar", "foo %s", "bar");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test2/testinfo.dat
deleted file mode 100644
index f5ee4b52d4..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test2/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test2
-Description
-= Test to see if sscanf handles whitespace correctly
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test3/CMakeLists.txt
deleted file mode 100644
index ced8d5f8da..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test3/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test3.c
-)
-
-add_executable(paltest_sscanf_test3
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test3 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test3
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/sscanf/test3/test3.c
deleted file mode 100644
index 9d18991070..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test3/test3.c
+++ /dev/null
@@ -1,35 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test3.c
-**
-** Purpose: Tests sscanf with bracketed set strings
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoStrTest("bar1", "%[a-z]", "bar");
- DoStrTest("bar1", "%[z-a]", "bar");
- DoStrTest("bar1", "%[ab]", "ba");
- DoStrTest("bar1", "%[ar1b]", "bar1");
- DoStrTest("bar1", "%[^4]", "bar1");
- DoStrTest("bar1", "%[^4a]", "b");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test3/testinfo.dat
deleted file mode 100644
index c38a498225..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test3/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test3
-Description
-= Tests sscanf with bracketed set strings
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test4/CMakeLists.txt
deleted file mode 100644
index 3e70d6dae2..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test4/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test4.c
-)
-
-add_executable(paltest_sscanf_test4
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test4 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test4
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/sscanf/test4/test4.c
deleted file mode 100644
index dd0538bcfe..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test4/test4.c
+++ /dev/null
@@ -1,44 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test4.c
-**
-** Purpose: Tests sscanf with decimal numbers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int n65535 = 65535; /* Walkaround compiler strictness */
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoNumTest("1234d", "%d", 1234);
- DoNumTest("1234d", "%2d", 12);
- DoNumTest("-1", "%d", -1);
- DoNumTest("0x1234", "%d", 0);
- DoNumTest("012", "%d", 12);
- DoShortNumTest("-1", "%hd", n65535);
- DoShortNumTest("65536", "%hd", 0);
- DoNumTest("-1", "%ld", -1);
- DoNumTest("65536", "%ld", 65536);
- DoNumTest("-1", "%Ld", -1);
- DoNumTest("65536", "%Ld", 65536);
- DoI64NumTest("4294967296", "%I64d", I64(4294967296));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test4/testinfo.dat
deleted file mode 100644
index 868056a6a5..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test4/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test4
-Description
-= Tests sscanf with decimal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test5/CMakeLists.txt
deleted file mode 100644
index 391e51baa2..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test5/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test5.c
-)
-
-add_executable(paltest_sscanf_test5
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test5 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test5
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/sscanf/test5/test5.c
deleted file mode 100644
index 0d45248af3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test5/test5.c
+++ /dev/null
@@ -1,43 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test5.c
-**
-** Purpose: Tests sscanf with integer numbers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- int n65535 = 65535; /* Walkaround compiler strictness */
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoNumTest("1234d", "%i", 1234);
- DoNumTest("1234d", "%2i", 12);
- DoNumTest("-1", "%i", -1);
- DoNumTest("0x1234", "%i", 0x1234);
- DoNumTest("012", "%i", 10);
- DoShortNumTest("-1", "%hi", n65535);
- DoShortNumTest("65536", "%hi", 0);
- DoNumTest("-1", "%li", -1);
- DoNumTest("65536", "%li", 65536);
- DoNumTest("-1", "%Li", -1);
- DoNumTest("65536", "%Li", 65536);
- DoI64NumTest("4294967296", "%I64i", I64(4294967296));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test5/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test5/testinfo.dat
deleted file mode 100644
index 8678dc8f5a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test5/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test5
-Description
-= Tests sscanf with integer numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test6/CMakeLists.txt
deleted file mode 100644
index c0b21bfd0d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test6/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test6.c
-)
-
-add_executable(paltest_sscanf_test6
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test6 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test6
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/sscanf/test6/test6.c
deleted file mode 100644
index c45ea31b04..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test6/test6.c
+++ /dev/null
@@ -1,43 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test6.c
-**
-** Purpose: Tests sscanf with octal numbers
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- int n65535 = 65535; /* Walkaround compiler strictness */
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoNumTest("1234d", "%o", 668);
- DoNumTest("1234d", "%2o", 10);
- DoNumTest("-1", "%o", -1);
- DoNumTest("0x1234", "%o", 0);
- DoNumTest("012", "%o", 10);
- DoShortNumTest("-1", "%ho", n65535);
- DoShortNumTest("200000", "%ho", 0);
- DoNumTest("-1", "%lo", -1);
- DoNumTest("200000", "%lo", 65536);
- DoNumTest("-1", "%Lo", -1);
- DoNumTest("200000", "%Lo", 65536);
- DoI64NumTest("40000000000", "%I64o", I64(4294967296));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test6/testinfo.dat
deleted file mode 100644
index b2547a776a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test6/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test6
-Description
-= Tests sscanf with octal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test7/CMakeLists.txt
deleted file mode 100644
index bcbd268011..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test7/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test7.c
-)
-
-add_executable(paltest_sscanf_test7
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test7 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test7
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/sscanf/test7/test7.c
deleted file mode 100644
index 0899671d64..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test7/test7.c
+++ /dev/null
@@ -1,43 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test7.c
-**
-** Purpose: Tests sscanf with hex numbers (lowercase)
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- int n65535 = 65535; /* Walkaround compiler strictness */
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoNumTest("1234i", "%x", 0x1234);
- DoNumTest("1234i", "%2x", 0x12);
- DoNumTest("-1", "%x", -1);
- DoNumTest("0x1234", "%x", 0x1234);
- DoNumTest("012", "%x", 0x12);
- DoShortNumTest("-1", "%hx", n65535);
- DoShortNumTest("10000", "%hx", 0);
- DoNumTest("-1", "%lx", -1);
- DoNumTest("10000", "%lx", 65536);
- DoNumTest("-1", "%Lx", -1);
- DoNumTest("10000", "%Lx", 65536);
- DoI64NumTest("100000000", "%I64x", I64(4294967296));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test7/testinfo.dat
deleted file mode 100644
index 614333e650..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test7/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test7
-Description
-= Tests sscanf with hex numbers (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test8/CMakeLists.txt
deleted file mode 100644
index 211e9e4df6..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test8/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test8.c
-)
-
-add_executable(paltest_sscanf_test8
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test8 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test8
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/sscanf/test8/test8.c
deleted file mode 100644
index 53252f8929..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test8/test8.c
+++ /dev/null
@@ -1,43 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test8.c
-**
-** Purpose:Tests sscanf with unsigned number
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-int __cdecl main(int argc, char *argv[])
-{
- int n65535 = 65535; /* Walkaround compiler strictness */
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoNumTest("1234d", "%u", 1234);
- DoNumTest("1234d", "%2u", 12);
- DoNumTest("-1", "%u", -1);
- DoNumTest("0x1234", "%u", 0);
- DoNumTest("012", "%u", 12);
- DoShortNumTest("-1", "%hu", n65535);
- DoShortNumTest("65536", "%hu", 0);
- DoNumTest("-1", "%lu", -1);
- DoNumTest("65536", "%lu", 65536);
- DoNumTest("-1", "%Lu", -1);
- DoNumTest("65536", "%Lu", 65536);
- DoI64NumTest("4294967296", "%I64u", I64(4294967296));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test8/testinfo.dat
deleted file mode 100644
index 2cbc31ad2a..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test8/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test8
-Description
-= Tests sscanf with unsigned numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf/test9/CMakeLists.txt
deleted file mode 100644
index 77c269aeaa..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test9/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test9.c
-)
-
-add_executable(paltest_sscanf_test9
- ${SOURCES}
-)
-
-add_dependencies(paltest_sscanf_test9 coreclrpal)
-
-target_link_libraries(paltest_sscanf_test9
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/sscanf/test9/test9.c
deleted file mode 100644
index c5a2e0de5d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test9/test9.c
+++ /dev/null
@@ -1,38 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test9.c
-**
-** Purpose: Tests sscanf with characters
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sscanf.h"
-
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoCharTest("1234d", "%c", "1", 1);
- DoCharTest("1234d", "%c", "1", 1);
- DoCharTest("abc", "%2c", "ab", 2);
- DoCharTest(" ab", "%c", " ", 1);
- DoCharTest("ab", "%hc", "a", 1);
- DoWCharTest("ab", "%lc", convert("a"), 1);
- DoCharTest("ab", "%Lc", "a", 1);
- DoCharTest("ab", "%I64c", "a", 1);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf/test9/testinfo.dat
deleted file mode 100644
index c0ccc8a4c9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test9/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section =C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
-TYPE = DEFAULT
-EXE1 = test9
-Description
-= Tests sscanf with characters
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/CMakeLists.txt
index 59f39a5f58..59f39a5f58 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h b/src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h
new file mode 100644
index 0000000000..8a99d87cb4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h
@@ -0,0 +1,246 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: sscanf_s.h
+**
+** Purpose: Contains common testing functions for sscanf_s
+**
+**
+**==========================================================================*/
+
+#ifndef __SSCANF_S_H__
+#define __SSCANF_S_H__
+
+void DoVoidTest(char *inputstr, const char *formatstr)
+{
+ char buf[256] = { 0 };
+ int i;
+ int ret;
+
+ ret = sscanf_s(inputstr, formatstr, buf);
+ if (ret != 0)
+ {
+ Fail("ERROR: Expected sscanf_s to return 0, got %d.\n"
+ "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
+ }
+
+ for (i=0; i<256; i++)
+ {
+ if (buf[i] != 0)
+ {
+ Fail("ERROR: Parameter unexpectedly modified scanning \"%s\" "
+ "using \"%s\".\n", inputstr, formatstr);
+ }
+ }
+
+}
+
+void DoStrTest(char *inputstr, const char *formatstr, const char *checkstr)
+{
+ char buf[256] = { 0 };
+ int ret;
+
+ ret = sscanf_s(inputstr, formatstr, buf, _countof(buf));
+ if (ret != 1)
+ {
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
+ "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
+ }
+
+ if (memcmp(checkstr, buf, strlen(checkstr) + 1) != 0)
+ {
+ Fail("ERROR: scanned string incorrectly from \"%s\" using \"%s\".\n"
+ "Expected \"%s\", got \"%s\".\n", inputstr, formatstr, checkstr,
+ buf);
+ }
+
+}
+
+void DoWStrTest(char *inputstr, const char *formatstr, const WCHAR *checkstr)
+{
+ WCHAR buf[256] = { 0 };
+ int ret;
+
+ ret = sscanf_s(inputstr, formatstr, buf, _countof(buf));
+ if (ret != 1)
+ {
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
+ "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
+ }
+
+ if (memcmp(checkstr, buf, wcslen(checkstr)*2 + 2) != 0)
+ {
+ Fail("ERROR: scanned wide string incorrectly from \"%s\" using \"%s\".\n"
+ "Expected \"%s\", got \"%s\".\n", inputstr, formatstr,
+ convertC(checkstr), convertC(buf));
+ }
+
+}
+
+void DoNumTest(char *inputstr, const char *formatstr, int checknum)
+{
+ int num;
+ int ret;
+
+ ret = sscanf_s(inputstr, formatstr, &num);
+ if (ret != 1)
+ {
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
+ "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
+ }
+
+ if (checknum != num)
+ {
+ Fail("ERROR: scanned number incorrectly from \"%s\" using \"%s\".\n"
+ "Expected %d, got %d.\n", inputstr, formatstr, checknum, num);
+ }
+}
+
+void DoShortNumTest(char *inputstr, const char *formatstr, short checknum)
+{
+ short num;
+ int ret;
+
+ ret = sscanf_s(inputstr, formatstr, &num);
+ if (ret != 1)
+ {
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
+ "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
+ }
+
+ if (checknum != num)
+ {
+ Fail("ERROR: scanned number incorrectly from \"%s\" using \"%s\".\n"
+ "Expected %hd, got %hd.\n", inputstr, formatstr, checknum, num);
+ }
+}
+
+void DoI64NumTest(char *inputstr, const char *formatstr, INT64 checknum)
+{
+ char buf[256];
+ char check[256];
+ INT64 num;
+ int ret;
+
+ ret = sscanf_s(inputstr, formatstr, &num);
+ if (ret != 1)
+ {
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
+ "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
+ }
+
+ if (checknum != num)
+ {
+ sprintf_s(buf, _countof(buf), "%I64d", num);
+ sprintf_s(check, _countof(check), "%I64d", checknum);
+ Fail("ERROR: scanned I64 number incorrectly from \"%s\" using \"%s\".\n"
+ "Expected %s, got %s.\n", inputstr, formatstr, check, buf);
+ }
+}
+
+void DoCharTest(char *inputstr, const char *formatstr, char* checkchars, int numchars)
+{
+ char buf[256];
+ int ret;
+ int i;
+
+ for (i=0; i<256; i++)
+ buf[i] = (char)-1;
+
+ ret = sscanf_s(inputstr, formatstr, buf, _countof(buf));
+ if (ret != 1)
+ {
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
+ "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
+ }
+
+ if (memcmp(buf, checkchars, numchars) != 0)
+ {
+ buf[numchars] = 0;
+
+ Fail("ERROR: scanned character(s) incorrectly from \"%s\" using \"%s\".\n"
+ "Expected %s, got %s.\n", inputstr, formatstr, checkchars,
+ buf);
+ }
+
+ if (buf[numchars] != (char)-1)
+ {
+ Fail("ERROR: overflow occurred in scanning character(s) from \"%s\" "
+ "using \"%s\".\nExpected %d character(s)\n", inputstr, formatstr,
+ numchars);
+ }
+}
+
+void DoWCharTest(char *inputstr, const char *formatstr, WCHAR* checkchars, int numchars)
+{
+ WCHAR buf[256];
+ int ret;
+ int i;
+
+ for (i=0; i<256; i++)
+ buf[i] = (WCHAR)-1;
+
+ ret = sscanf_s(inputstr, formatstr, buf, _countof(buf));
+ if (ret != 1)
+ {
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
+ "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
+ }
+
+ if (memcmp(buf, checkchars, numchars) != 0)
+ {
+ buf[numchars] = 0;
+
+ Fail("ERROR: scanned wide character(s) incorrectly from \"%s\" using \"%s\".\n"
+ "Expected %s, got %s.\n", inputstr, formatstr, convertC(checkchars),
+ convertC(buf));
+ }
+
+ if (buf[numchars] != (WCHAR)-1)
+ {
+ Fail("ERROR: overflow occurred in scanning wide character(s) from \"%s\" "
+ "using \"%s\".\nExpected %d character(s)\n", inputstr, formatstr,
+ numchars);
+ }
+}
+
+
+void DoFloatTest(char *inputstr, const char *formatstr, float checkval)
+{
+ char buf[256] = { 0 };
+ float val;
+ int ret;
+ int i;
+
+ for (i=0; i<256; i++)
+ buf[i] = (char)-1;
+
+ ret = sscanf_s(inputstr, formatstr, buf);
+ val = *(float*)buf;
+
+ if (ret != 1)
+ {
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
+ "Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
+ }
+
+ if (val != checkval)
+ {
+ Fail("ERROR: scanned float incorrectly from \"%s\" using \"%s\".\n"
+ "Expected \"%f\", got \"%f\".\n", inputstr, formatstr, checkval,
+ val);
+ }
+
+ if (buf[4] != (char)-1)
+ {
+ Fail("ERROR: overflow occurred in scanning float from \"%s\" "
+ "using \"%s\".\n", inputstr, formatstr);
+
+ }
+}
+
+
+#endif
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/CMakeLists.txt
new file mode 100644
index 0000000000..97b8f570e3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.cpp
+)
+
+add_executable(paltest_sscanf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test1 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp
new file mode 100644
index 0000000000..61313146e5
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp
@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: General test of sscanf_s
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int num;
+ int ret;
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+
+ DoVoidTest("foo bar", "foo ");
+ DoVoidTest("foo bar", "baz");
+ DoVoidTest("foo bar", "foo %*s");
+
+ DoStrTest("foo % bar", "foo %% %s", "bar");
+ DoStrTest("foo bar baz", "foo %bar %s", "baz");
+
+ DoVoidTest("foo bar baz", "foo % bar %s");
+ DoVoidTest("foo baz bar", "foo% baz %s");
+
+ ret = sscanf_s("foo bar baz", "foo bar %n", &num);
+ if (ret != 0 || num != 8)
+ {
+ Fail("ERROR: Got incorrect values in scanning \"%s\" using \"%s\".\n"
+ "Expected to get a value of %d with return value of %d, "
+ "got %d with return %d\n", "foo bar baz", "foo bar %n", 8, 0,
+ num, ret);
+
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/testinfo.dat
new file mode 100644
index 0000000000..76f592769f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= General test of sscanf_s
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/CMakeLists.txt
new file mode 100644
index 0000000000..afda216c6b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test10.cpp
+)
+
+add_executable(paltest_sscanf_test10
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test10 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test10
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp
new file mode 100644
index 0000000000..0c63c864ed
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp
@@ -0,0 +1,37 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test10.c
+**
+** Purpose: Tests sscanf_s with wide characters
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoWCharTest("1234d", "%C", convert("1"), 1);
+ DoWCharTest("1234d", "%C", convert("1"), 1);
+ DoWCharTest("abc", "%2C", convert("ab"), 2);
+ DoWCharTest(" ab", "%C", convert(" "), 1);
+ DoCharTest("ab", "%hC", "a", 1);
+ DoWCharTest("ab", "%lC", convert("a"), 1);
+ DoWCharTest("ab", "%LC", convert("a"), 1);
+ DoWCharTest("ab", "%I64C", convert("a"), 1);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/testinfo.dat
new file mode 100644
index 0000000000..e048e700a0
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test10
+Description
+= Tests sscanf_s with wide characters
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/CMakeLists.txt
new file mode 100644
index 0000000000..c8f98aeeef
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test11.cpp
+)
+
+add_executable(paltest_sscanf_test11
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test11 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test11
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp
new file mode 100644
index 0000000000..8279f4b3f4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp
@@ -0,0 +1,36 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test11.c
+**
+** Purpose: Tests sscanf_s with strings
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoStrTest("foo bar", "foo %s", "bar");
+ DoStrTest("foo bar", "foo %2s", "ba");
+ DoStrTest("foo bar", "foo %hs", "bar");
+ DoWStrTest("foo bar", "foo %ls", convert("bar"));
+ DoStrTest("foo bar", "foo %Ls", "bar");
+ DoStrTest("foo bar", "foo %I64s", "bar");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/testinfo.dat
new file mode 100644
index 0000000000..5a906ddf51
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test11
+Description
+= Tests sscanf_s with strings
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/CMakeLists.txt
new file mode 100644
index 0000000000..0ecedc3285
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test12.cpp
+)
+
+add_executable(paltest_sscanf_test12
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test12 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test12
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp
new file mode 100644
index 0000000000..e599534270
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp
@@ -0,0 +1,35 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test12.c
+**
+** Purpose: Tests sscanf_s with wide strings
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoWStrTest("foo bar", "foo %S", convert("bar"));
+ DoWStrTest("foo bar", "foo %2S", convert("ba"));
+ DoStrTest("foo bar", "foo %hS", "bar");
+ DoWStrTest("foo bar", "foo %lS", convert("bar"));
+ DoWStrTest("foo bar", "foo %LS", convert("bar"));
+ DoWStrTest("foo bar", "foo %I64S", convert("bar"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/testinfo.dat
new file mode 100644
index 0000000000..569be983c0
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test12
+Description
+= Tests sscanf_s with wide strings
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/CMakeLists.txt
new file mode 100644
index 0000000000..4566ec3338
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test13.cpp
+)
+
+add_executable(paltest_sscanf_test13
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test13 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test13
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp
new file mode 100644
index 0000000000..4fc12bb751
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp
@@ -0,0 +1,37 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test13.c
+**
+** Purpose: Tests sscanf_s with floats (decimal notation)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoFloatTest("123.0", "%f", 123.0f);
+ DoFloatTest("123.0", "%2f", 12.0f);
+ DoFloatTest("10E1", "%f", 100.0f);
+ DoFloatTest("-12.01e-2", "%f", -0.1201f);
+ DoFloatTest("+12.01e-2", "%f", 0.1201f);
+ DoFloatTest("-12.01e+2", "%f", -1201.0f);
+ DoFloatTest("+12.01e+2", "%f", 1201.0f);
+ DoFloatTest("1234567890.0123456789f", "%f", 1234567936);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/testinfo.dat
new file mode 100644
index 0000000000..651577befd
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test13
+Description
+= Tests sscanf_s with floats (decimal notation)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/CMakeLists.txt
new file mode 100644
index 0000000000..557acf5bf8
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test14.cpp
+)
+
+add_executable(paltest_sscanf_test14
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test14 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test14
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp
new file mode 100644
index 0000000000..fc2fa2ee15
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp
@@ -0,0 +1,36 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test14.c
+**
+** Purpose: Tests sscanf_s with floats (exponential notation, lowercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoFloatTest("123.0", "%e", 123.0f);
+ DoFloatTest("123.0", "%2e", 12.0f);
+ DoFloatTest("10E1", "%e", 100.0f);
+ DoFloatTest("-12.01e-2", "%e", -0.1201f);
+ DoFloatTest("+12.01e-2", "%e", 0.1201f);
+ DoFloatTest("-12.01e+2", "%e", -1201.0f);
+ DoFloatTest("+12.01e+2", "%e", 1201.0f);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/testinfo.dat
new file mode 100644
index 0000000000..8e7338fd46
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test14
+Description
+= Tests sscanf_s with floats (exponential notation, lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/CMakeLists.txt
new file mode 100644
index 0000000000..efde5c4a21
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test15.cpp
+)
+
+add_executable(paltest_sscanf_test15
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test15 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test15
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp
new file mode 100644
index 0000000000..1eff995b86
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp
@@ -0,0 +1,36 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test15.c
+**
+** Purpose: Tests sscanf_s with floats (exponential notation, uppercase
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoFloatTest("123.0", "%E", 123.0f);
+ DoFloatTest("123.0", "%2E", 12.0f);
+ DoFloatTest("10E1", "%E", 100.0f);
+ DoFloatTest("-12.01e-2", "%E", -0.1201f);
+ DoFloatTest("+12.01e-2", "%E", 0.1201f);
+ DoFloatTest("-12.01e+2", "%E", -1201.0f);
+ DoFloatTest("+12.01e+2", "%E", 1201.0f);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/testinfo.dat
new file mode 100644
index 0000000000..d713a73d81
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test15
+Description
+= Tests sscanf_s with floats (exponential notation, uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/CMakeLists.txt
new file mode 100644
index 0000000000..6757b0d78a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test16.cpp
+)
+
+add_executable(paltest_sscanf_test16
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test16 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test16
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp
new file mode 100644
index 0000000000..f202767448
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp
@@ -0,0 +1,37 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test16.c
+**
+** Purpose:Tests sscanf_s with floats (compact notation, lowercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoFloatTest("123.0", "%g", 123.0f);
+ DoFloatTest("123.0", "%2g", 12.0f);
+ DoFloatTest("10E1", "%g", 100.0f);
+ DoFloatTest("-12.01e-2", "%g", -0.1201f);
+ DoFloatTest("+12.01e-2", "%g", 0.1201f);
+ DoFloatTest("-12.01e+2", "%g", -1201.0f);
+ DoFloatTest("+12.01e+2", "%g", 1201.0f);
+ DoFloatTest("1234567890.0123456789g", "%g", 1234567936);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/testinfo.dat
new file mode 100644
index 0000000000..669611945d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test16
+Description
+= Tests sscanf_s with floats (compact notation, lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/CMakeLists.txt
new file mode 100644
index 0000000000..8ea4d5e3f6
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test17.cpp
+)
+
+add_executable(paltest_sscanf_test17
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test17 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test17
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp
new file mode 100644
index 0000000000..a18c3caff1
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp
@@ -0,0 +1,37 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test17.c
+**
+** Purpose: Tests sscanf_s with floats (compact notation, uppercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoFloatTest("123.0", "%G", 123.0f);
+ DoFloatTest("123.0", "%2G", 12.0f);
+ DoFloatTest("10E1", "%G", 100.0f);
+ DoFloatTest("-12.01e-2", "%G", -0.1201f);
+ DoFloatTest("+12.01e-2", "%G", 0.1201f);
+ DoFloatTest("-12.01e+2", "%G", -1201.0f);
+ DoFloatTest("+12.01e+2", "%G", 1201.0f);
+ DoFloatTest("1234567890.0123456789G", "%G", 1234567936);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/testinfo.dat
new file mode 100644
index 0000000000..8ce4e93e1a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test17
+Description
+= Tests sscanf_s with floats (compact notation, uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/CMakeLists.txt
new file mode 100644
index 0000000000..4e36223a1d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test2.cpp
+)
+
+add_executable(paltest_sscanf_test2
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test2 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test2
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp
new file mode 100644
index 0000000000..c9c79f67ea
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test2.c
+**
+** Purpose: Test to see if sscanf_s handles whitespace correctly
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+
+/*
+ * Tests out how it handles whitespace. Seems to accept anything that qualifies
+ * as isspace (space, tab, vertical tab, line feed, carriage return and form
+ * feed), even if it says it only wants spaces tabs and newlines.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoStrTest("foo bar", "foo %s", "bar");
+ DoStrTest("foo\tbar", "foo %s", "bar");
+ DoStrTest("foo\nbar", "foo %s", "bar");
+ DoStrTest("foo\rbar", "foo %s", "bar");
+ DoStrTest("foo\vbar", "foo %s", "bar");
+ DoStrTest("foo\fbar", "foo %s", "bar");
+ DoStrTest("foo \t\n\r\v\fbar", "foo %s", "bar");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/testinfo.dat
new file mode 100644
index 0000000000..85fed244f9
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test2
+Description
+= Test to see if sscanf_s handles whitespace correctly
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/CMakeLists.txt
new file mode 100644
index 0000000000..053a96ca0f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test3.cpp
+)
+
+add_executable(paltest_sscanf_test3
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test3 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test3
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp
new file mode 100644
index 0000000000..e1e45bdd70
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp
@@ -0,0 +1,35 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test3.c
+**
+** Purpose: Tests sscanf_s with bracketed set strings
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoStrTest("bar1", "%[a-z]", "bar");
+ DoStrTest("bar1", "%[z-a]", "bar");
+ DoStrTest("bar1", "%[ab]", "ba");
+ DoStrTest("bar1", "%[ar1b]", "bar1");
+ DoStrTest("bar1", "%[^4]", "bar1");
+ DoStrTest("bar1", "%[^4a]", "b");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/testinfo.dat
new file mode 100644
index 0000000000..523d31e82e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test3
+Description
+= Tests sscanf_s with bracketed set strings
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/CMakeLists.txt
new file mode 100644
index 0000000000..ae04bfef57
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test4.cpp
+)
+
+add_executable(paltest_sscanf_test4
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test4 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test4
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp
new file mode 100644
index 0000000000..f8413ea7fd
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test4.c
+**
+** Purpose: Tests sscanf_s with decimal numbers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n65535 = 65535; /* Walkaround compiler strictness */
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoNumTest("1234d", "%d", 1234);
+ DoNumTest("1234d", "%2d", 12);
+ DoNumTest("-1", "%d", -1);
+ DoNumTest("0x1234", "%d", 0);
+ DoNumTest("012", "%d", 12);
+ DoShortNumTest("-1", "%hd", n65535);
+ DoShortNumTest("65536", "%hd", 0);
+ DoNumTest("-1", "%ld", -1);
+ DoNumTest("65536", "%ld", 65536);
+ DoNumTest("-1", "%Ld", -1);
+ DoNumTest("65536", "%Ld", 65536);
+ DoI64NumTest("4294967296", "%I64d", I64(4294967296));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/testinfo.dat
new file mode 100644
index 0000000000..2065f2bea2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test4
+Description
+= Tests sscanf_s with decimal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/CMakeLists.txt
new file mode 100644
index 0000000000..33dcaffec3
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test5.cpp
+)
+
+add_executable(paltest_sscanf_test5
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test5 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test5
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp
new file mode 100644
index 0000000000..cdfefd860b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp
@@ -0,0 +1,43 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test5.c
+**
+** Purpose: Tests sscanf_s with integer numbers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n65535 = 65535; /* Walkaround compiler strictness */
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoNumTest("1234d", "%i", 1234);
+ DoNumTest("1234d", "%2i", 12);
+ DoNumTest("-1", "%i", -1);
+ DoNumTest("0x1234", "%i", 0x1234);
+ DoNumTest("012", "%i", 10);
+ DoShortNumTest("-1", "%hi", n65535);
+ DoShortNumTest("65536", "%hi", 0);
+ DoNumTest("-1", "%li", -1);
+ DoNumTest("65536", "%li", 65536);
+ DoNumTest("-1", "%Li", -1);
+ DoNumTest("65536", "%Li", 65536);
+ DoI64NumTest("4294967296", "%I64i", I64(4294967296));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/testinfo.dat
new file mode 100644
index 0000000000..cb687c15cd
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test5
+Description
+= Tests sscanf_s with integer numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/CMakeLists.txt
new file mode 100644
index 0000000000..1dd23c3cb1
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test6.cpp
+)
+
+add_executable(paltest_sscanf_test6
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test6 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test6
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp
new file mode 100644
index 0000000000..507b100e15
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp
@@ -0,0 +1,43 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test6.c
+**
+** Purpose: Tests sscanf_s with octal numbers
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n65535 = 65535; /* Walkaround compiler strictness */
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoNumTest("1234d", "%o", 668);
+ DoNumTest("1234d", "%2o", 10);
+ DoNumTest("-1", "%o", -1);
+ DoNumTest("0x1234", "%o", 0);
+ DoNumTest("012", "%o", 10);
+ DoShortNumTest("-1", "%ho", n65535);
+ DoShortNumTest("200000", "%ho", 0);
+ DoNumTest("-1", "%lo", -1);
+ DoNumTest("200000", "%lo", 65536);
+ DoNumTest("-1", "%Lo", -1);
+ DoNumTest("200000", "%Lo", 65536);
+ DoI64NumTest("40000000000", "%I64o", I64(4294967296));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/testinfo.dat
new file mode 100644
index 0000000000..9e518dddf2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test6
+Description
+= Tests sscanf_s with octal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/CMakeLists.txt
new file mode 100644
index 0000000000..015a27b776
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test7.cpp
+)
+
+add_executable(paltest_sscanf_test7
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test7 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test7
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp
new file mode 100644
index 0000000000..4093e009e1
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp
@@ -0,0 +1,43 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test7.c
+**
+** Purpose: Tests sscanf_s with hex numbers (lowercase)
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n65535 = 65535; /* Walkaround compiler strictness */
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoNumTest("1234i", "%x", 0x1234);
+ DoNumTest("1234i", "%2x", 0x12);
+ DoNumTest("-1", "%x", -1);
+ DoNumTest("0x1234", "%x", 0x1234);
+ DoNumTest("012", "%x", 0x12);
+ DoShortNumTest("-1", "%hx", n65535);
+ DoShortNumTest("10000", "%hx", 0);
+ DoNumTest("-1", "%lx", -1);
+ DoNumTest("10000", "%lx", 65536);
+ DoNumTest("-1", "%Lx", -1);
+ DoNumTest("10000", "%Lx", 65536);
+ DoI64NumTest("100000000", "%I64x", I64(4294967296));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/testinfo.dat
new file mode 100644
index 0000000000..8d6c182c90
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test7
+Description
+= Tests sscanf_s with hex numbers (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/CMakeLists.txt
new file mode 100644
index 0000000000..aa41ab42a6
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test8.cpp
+)
+
+add_executable(paltest_sscanf_test8
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test8 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test8
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp
new file mode 100644
index 0000000000..23ef22a56a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp
@@ -0,0 +1,43 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test8.c
+**
+** Purpose:Tests sscanf_s with unsigned number
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n65535 = 65535; /* Walkaround compiler strictness */
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoNumTest("1234d", "%u", 1234);
+ DoNumTest("1234d", "%2u", 12);
+ DoNumTest("-1", "%u", -1);
+ DoNumTest("0x1234", "%u", 0);
+ DoNumTest("012", "%u", 12);
+ DoShortNumTest("-1", "%hu", n65535);
+ DoShortNumTest("65536", "%hu", 0);
+ DoNumTest("-1", "%lu", -1);
+ DoNumTest("65536", "%lu", 65536);
+ DoNumTest("-1", "%Lu", -1);
+ DoNumTest("65536", "%Lu", 65536);
+ DoI64NumTest("4294967296", "%I64u", I64(4294967296));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/testinfo.dat
new file mode 100644
index 0000000000..0287a495d2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test8
+Description
+= Tests sscanf_s with unsigned numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/CMakeLists.txt
new file mode 100644
index 0000000000..b631fd40ea
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test9.cpp
+)
+
+add_executable(paltest_sscanf_test9
+ ${SOURCES}
+)
+
+add_dependencies(paltest_sscanf_test9 coreclrpal)
+
+target_link_libraries(paltest_sscanf_test9
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp
new file mode 100644
index 0000000000..2c99c40e5d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp
@@ -0,0 +1,38 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test9.c
+**
+** Purpose: Tests sscanf_s with characters
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../sscanf_s.h"
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoCharTest("1234d", "%c", "1", 1);
+ DoCharTest("1234d", "%c", "1", 1);
+ DoCharTest("abc", "%2c", "ab", 2);
+ DoCharTest(" ab", "%c", " ", 1);
+ DoCharTest("ab", "%hc", "a", 1);
+ DoWCharTest("ab", "%lc", convert("a"), 1);
+ DoCharTest("ab", "%Lc", "a", 1);
+ DoCharTest("ab", "%I64c", "a", 1);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/testinfo.dat
new file mode 100644
index 0000000000..95f6c74ee2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section =C Runtime
+Function = sscanf_s
+Name = Positive Test for sscanf_s
+TYPE = DEFAULT
+EXE1 = test9
+Description
+= Tests sscanf_s with characters
diff --git a/src/pal/tests/palsuite/c_runtime/strcat/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strcat/test1/CMakeLists.txt
index 4a0f0be32d..fd62627db6 100644
--- a/src/pal/tests/palsuite/c_runtime/strcat/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strcat/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strcat_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strcat/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strcat/test1/test1.cpp
index 532d84621e..532d84621e 100644
--- a/src/pal/tests/palsuite/c_runtime/strcat/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strcat/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strchr/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strchr/test1/CMakeLists.txt
index 1d248f3f56..f3ffe3bc15 100644
--- a/src/pal/tests/palsuite/c_runtime/strchr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strchr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strchr_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strchr/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strchr/test1/test1.cpp
index 9190c4f7ce..9190c4f7ce 100644
--- a/src/pal/tests/palsuite/c_runtime/strchr/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strchr/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strcmp/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strcmp/test1/CMakeLists.txt
index b953dfa034..3b0f89c2a5 100644
--- a/src/pal/tests/palsuite/c_runtime/strcmp/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strcmp/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strcmp_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strcmp/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strcmp/test1/test1.cpp
index 49428fd624..49428fd624 100644
--- a/src/pal/tests/palsuite/c_runtime/strcmp/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strcmp/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strcpy/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strcpy/test1/CMakeLists.txt
index 043ec57d98..4369d37a40 100644
--- a/src/pal/tests/palsuite/c_runtime/strcpy/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strcpy/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strcpy_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strcpy/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strcpy/test1/test1.cpp
index 43069e59a6..43069e59a6 100644
--- a/src/pal/tests/palsuite/c_runtime/strcpy/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strcpy/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strcspn/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strcspn/test1/CMakeLists.txt
index a38761c335..717e18f0e9 100644
--- a/src/pal/tests/palsuite/c_runtime/strcspn/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strcspn/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strcspn_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strcspn/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strcspn/test1/test1.cpp
index ddc5667570..ddc5667570 100644
--- a/src/pal/tests/palsuite/c_runtime/strcspn/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strcspn/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strlen/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strlen/test1/CMakeLists.txt
index c61828a97b..4afeb598aa 100644
--- a/src/pal/tests/palsuite/c_runtime/strlen/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strlen/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strlen_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strlen/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strlen/test1/test1.cpp
index 40f8e151c7..40f8e151c7 100644
--- a/src/pal/tests/palsuite/c_runtime/strlen/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strlen/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strncat/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strncat/test1/CMakeLists.txt
index 7595f66939..f8080ecdc2 100644
--- a/src/pal/tests/palsuite/c_runtime/strncat/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strncat/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strncat_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strncat/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strncat/test1/test1.cpp
index 000d1685b9..000d1685b9 100644
--- a/src/pal/tests/palsuite/c_runtime/strncat/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strncat/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strncmp/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strncmp/test1/CMakeLists.txt
index 4a0337a3dc..34b53e294d 100644
--- a/src/pal/tests/palsuite/c_runtime/strncmp/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strncmp/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strncmp_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strncmp/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strncmp/test1/test1.cpp
index 7326c3b61e..7326c3b61e 100644
--- a/src/pal/tests/palsuite/c_runtime/strncmp/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strncmp/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strncpy/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strncpy/test1/CMakeLists.txt
index 6e0250bce3..fb737c8c59 100644
--- a/src/pal/tests/palsuite/c_runtime/strncpy/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strncpy/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strncpy_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strncpy/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strncpy/test1/test1.cpp
index 62baf61ba2..62baf61ba2 100644
--- a/src/pal/tests/palsuite/c_runtime/strncpy/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strncpy/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strpbrk/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strpbrk/test1/CMakeLists.txt
index eac9ac9169..9e76436e01 100644
--- a/src/pal/tests/palsuite/c_runtime/strpbrk/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strpbrk/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strpbrk_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strpbrk/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strpbrk/test1/test1.cpp
index a42b80f313..a42b80f313 100644
--- a/src/pal/tests/palsuite/c_runtime/strpbrk/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strpbrk/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strrchr/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strrchr/test1/CMakeLists.txt
index 5c099b0cd2..bb6916038d 100644
--- a/src/pal/tests/palsuite/c_runtime/strrchr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strrchr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strrchr_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strrchr/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strrchr/test1/test1.cpp
index a5c147eece..a5c147eece 100644
--- a/src/pal/tests/palsuite/c_runtime/strrchr/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strrchr/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strspn/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strspn/test1/CMakeLists.txt
index 45caaf1bf8..c72fd0fa9a 100644
--- a/src/pal/tests/palsuite/c_runtime/strspn/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strspn/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strspn_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strspn/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strspn/test1/test1.cpp
index 78d2488438..78d2488438 100644
--- a/src/pal/tests/palsuite/c_runtime/strspn/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strspn/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strstr/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strstr/test1/CMakeLists.txt
index 17e6ae8457..004b9a5658 100644
--- a/src/pal/tests/palsuite/c_runtime/strstr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strstr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strstr_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strstr/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strstr/test1/test1.cpp
index db01e8b32a..db01e8b32a 100644
--- a/src/pal/tests/palsuite/c_runtime/strstr/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strstr/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strtod/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strtod/test1/CMakeLists.txt
index d3a9d61a4d..09884f32e6 100644
--- a/src/pal/tests/palsuite/c_runtime/strtod/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strtod/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strtod_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strtod/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strtod/test1/test1.cpp
index e312d98f58..e312d98f58 100644
--- a/src/pal/tests/palsuite/c_runtime/strtod/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strtod/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strtod/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strtod/test2/CMakeLists.txt
index 6f407c5914..8729cc5a1c 100644
--- a/src/pal/tests/palsuite/c_runtime/strtod/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strtod/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_strtod_test2
diff --git a/src/pal/tests/palsuite/c_runtime/strtod/test2/test2.c b/src/pal/tests/palsuite/c_runtime/strtod/test2/test2.cpp
index 0eaf4f53b6..0eaf4f53b6 100644
--- a/src/pal/tests/palsuite/c_runtime/strtod/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/strtod/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strtok/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strtok/test1/CMakeLists.txt
index 1d5fc04cca..422c4e96b5 100644
--- a/src/pal/tests/palsuite/c_runtime/strtok/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strtok/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strtok_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strtok/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strtok/test1/test1.cpp
index f1dec70380..f1dec70380 100644
--- a/src/pal/tests/palsuite/c_runtime/strtok/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strtok/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/strtoul/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/strtoul/test1/CMakeLists.txt
index 61dbd4f9a3..009e85fb11 100644
--- a/src/pal/tests/palsuite/c_runtime/strtoul/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/strtoul/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_strtoul_test1
diff --git a/src/pal/tests/palsuite/c_runtime/strtoul/test1/test1.c b/src/pal/tests/palsuite/c_runtime/strtoul/test1/test1.cpp
index 344671b5cc..344671b5cc 100644
--- a/src/pal/tests/palsuite/c_runtime/strtoul/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/strtoul/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h b/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h
index 5229506064..6f4c914a82 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/swprintf.h
@@ -14,7 +14,7 @@
#ifndef __SWPRINTF_H__
#define __SWPRINTF_H__
-void DoWStrTest(WCHAR *formatstr, WCHAR *param, WCHAR *checkstr)
+void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -29,7 +29,7 @@ void DoWStrTest(WCHAR *formatstr, WCHAR *param, WCHAR *checkstr)
}
}
-void DoStrTest(WCHAR *formatstr, char *param, WCHAR *checkstr)
+void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -44,7 +44,7 @@ void DoStrTest(WCHAR *formatstr, char *param, WCHAR *checkstr)
}
}
-void DoPointerTest(WCHAR *formatstr, void* param, WCHAR *checkstr1)
+void DoPointerTest(const WCHAR *formatstr, void* param, const WCHAR *checkstr1)
{
WCHAR buf[256] = { 0 };
@@ -57,7 +57,7 @@ void DoPointerTest(WCHAR *formatstr, void* param, WCHAR *checkstr1)
}
}
-void DoCountTest(WCHAR *formatstr, int param, WCHAR *checkstr)
+void DoCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr)
{
WCHAR buf[512] = { 0 };
int n = -1;
@@ -77,7 +77,7 @@ void DoCountTest(WCHAR *formatstr, int param, WCHAR *checkstr)
}
}
-void DoShortCountTest(WCHAR *formatstr, int param, WCHAR *checkstr)
+void DoShortCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
short int n = -1;
@@ -97,7 +97,7 @@ void DoShortCountTest(WCHAR *formatstr, int param, WCHAR *checkstr)
}
}
-void DoCharTest(WCHAR *formatstr, char param, WCHAR *checkstr)
+void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -110,7 +110,7 @@ void DoCharTest(WCHAR *formatstr, char param, WCHAR *checkstr)
}
}
-void DoWCharTest(WCHAR *formatstr, WCHAR param, WCHAR *checkstr)
+void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -123,7 +123,7 @@ void DoWCharTest(WCHAR *formatstr, WCHAR param, WCHAR *checkstr)
}
}
-void DoNumTest(WCHAR *formatstr, int value, WCHAR*checkstr)
+void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -136,8 +136,8 @@ void DoNumTest(WCHAR *formatstr, int value, WCHAR*checkstr)
}
}
-void DoI64Test(WCHAR *formatstr, INT64 param, char *paramdesc,
- WCHAR *checkstr1)
+void DoI64Test(const WCHAR *formatstr, INT64 param, char *paramdesc,
+ const WCHAR *checkstr1)
{
WCHAR buf[256] = { 0 };
@@ -150,8 +150,8 @@ void DoI64Test(WCHAR *formatstr, INT64 param, char *paramdesc,
}
}
-void DoDoubleTest(WCHAR *formatstr, double value, WCHAR *checkstr1,
- WCHAR *checkstr2)
+void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1,
+ const WCHAR *checkstr2)
{
WCHAR buf[256] = { 0 };
@@ -166,8 +166,8 @@ void DoDoubleTest(WCHAR *formatstr, double value, WCHAR *checkstr1,
}
}
-void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
- char *paramstr, WCHAR *checkstr1, WCHAR *checkstr2)
+void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param,
+ char *paramstr, const WCHAR *checkstr1, const WCHAR *checkstr2)
{
WCHAR buf[256];
@@ -182,8 +182,8 @@ void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
}
}
-void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param,
- WCHAR *checkstr1, WCHAR *checkstr2)
+void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double param,
+ const WCHAR *checkstr1, const WCHAR *checkstr2)
{
WCHAR buf[256];
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt
index fcf816029e..c9be8c3347 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_swprintf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp
index 626040d9f7..626040d9f7 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt
index 302c5e5923..222108393b 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_swprintf_test10
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/swprintf/test10/test10.cpp
index 61aef593a0..61aef593a0 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test10/test10.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt
index 484d57ef58..96222a5b2a 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_swprintf_test11
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/swprintf/test11/test11.cpp
index 216f9acdbb..216f9acdbb 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test11/test11.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt
index 6d45ee4646..1ffe620fed 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_swprintf_test12
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/swprintf/test12/test12.cpp
index a41b0ddbd3..a41b0ddbd3 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test12/test12.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt
index 20f6f0df7b..8699589ec9 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test13.c
+ test13.cpp
)
add_executable(paltest_swprintf_test13
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/swprintf/test13/test13.cpp
index b99232f7ea..b99232f7ea 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test13/test13.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test13/test13.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt
index a052f60116..2a4b84805c 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test14.c
+ test14.cpp
)
add_executable(paltest_swprintf_test14
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/swprintf/test14/test14.cpp
index bcfd6a7c24..bcfd6a7c24 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test14/test14.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test14/test14.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt
index 7bc2da122f..22382bce5f 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test15.c
+ test15.cpp
)
add_executable(paltest_swprintf_test15
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/swprintf/test15/test15.cpp
index 215afbe093..215afbe093 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test15/test15.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test15/test15.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt
index e6ad3abd3f..462f0806cd 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test16.c
+ test16.cpp
)
add_executable(paltest_swprintf_test16
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/swprintf/test16/test16.cpp
index 859afed8dd..859afed8dd 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test16/test16.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test16/test16.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt
index 401285b740..c5b4d44593 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test17.c
+ test17.cpp
)
add_executable(paltest_swprintf_test17
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/swprintf/test17/test17.cpp
index 480f2b2fe1..480f2b2fe1 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test17/test17.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test17/test17.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt
index 210ab2c7ec..6cdf576966 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test18/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test18.c
+ test18.cpp
)
add_executable(paltest_swprintf_test18
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/swprintf/test18/test18.cpp
index 1ed8cd00d8..1ed8cd00d8 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test18/test18.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test18/test18.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt
index b9d44a3031..334b7b4fa1 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test19/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test19.c
+ test19.cpp
)
add_executable(paltest_swprintf_test19
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.c
deleted file mode 100644
index 5199cc3cd9..0000000000
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.c
+++ /dev/null
@@ -1,109 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test19.c
-**
-** Purpose: Tests swprintf with argument specified precision
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../swprintf.h"
-
-/*
- * Uses memcmp & wcslen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- int n = -1;
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- DoArgumentPrecTest(convert("%.*s"), 2, convert("bar"), "bar",
- convert("ba"), convert("ba"));
- DoArgumentPrecTest(convert("%.*S"), 2, "bar", "bar", convert("ba"),
- convert("ba"));
- DoArgumentPrecTest(convert("%.*n"), 3, &n, "pointer to int", convert(""),
- convert(""));
- if (n != 0)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- 0, n);
- }
-
- DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', "a", convert("a"),
- convert("a"));
- DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', "a", convert("a"),
- convert("a"));
- DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', "a", convert("a"),
- convert("a"));
- DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', "a", convert("a"),
- convert("a"));
- DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, "42", convert("42"),
- convert("42"));
- DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, "42", convert("042"),
- convert("042"));
- DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, "42", convert("42"),
- convert("42"));
- DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, "42", convert("042"),
- convert("042"));
- DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, "42", convert("52"),
- convert("52"));
- DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, "42", convert("052"),
- convert("052"));
- DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, "42", convert("42"),
- convert("42"));
- DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, "42", convert("042"),
- convert("042"));
- DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, "0x42", convert("42"),
- convert("42"));
- DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, "0x42", convert("042"),
- convert("042"));
- DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, "0x42", convert("42"),
- convert("42"));
- DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, "0x42", convert("042"),
- convert("042"));
-
-
- DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, convert("2.0e+000"),
- convert("2.0e+000"));
- DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, convert("2.010e+000"),
- convert("2.010e+000"));
- DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, convert("2.0E+000"),
- convert("2.0E+000"));
- DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, convert("2.010E+000"),
- convert("2.010E+000"));
- DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, convert("2.0"),
- convert("2.0"));
- DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, convert("2.010"),
- convert("2.010"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, convert("3e+002"),
- convert("3e+002"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, convert("256.01"),
- convert("256.01"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, convert("3E+002"),
- convert("3E+002"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, convert("256.01"),
- convert("256.01"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp
new file mode 100644
index 0000000000..c0346036cd
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test19/test19.cpp
@@ -0,0 +1,109 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test19.c
+**
+** Purpose: Tests swprintf with argument specified precision
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+#include "../swprintf.h"
+
+/*
+ * Uses memcmp & wcslen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n = -1;
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ DoArgumentPrecTest(convert("%.*s"), 2, (void*)convert("bar"), "bar",
+ convert("ba"), convert("ba"));
+ DoArgumentPrecTest(convert("%.*S"), 2, (void*)"bar", "bar", convert("ba"),
+ convert("ba"));
+ DoArgumentPrecTest(convert("%.*n"), 3, (void*)&n, "pointer to int", convert(""),
+ convert(""));
+ if (n != 0)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
+ 0, n);
+ }
+
+ DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', "a", convert("a"),
+ convert("a"));
+ DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', "a", convert("a"),
+ convert("a"));
+ DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', "a", convert("a"),
+ convert("a"));
+ DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', "a", convert("a"),
+ convert("a"));
+ DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, "42", convert("42"),
+ convert("42"));
+ DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, "42", convert("042"),
+ convert("042"));
+ DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, "42", convert("42"),
+ convert("42"));
+ DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, "42", convert("042"),
+ convert("042"));
+ DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, "42", convert("52"),
+ convert("52"));
+ DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, "42", convert("052"),
+ convert("052"));
+ DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, "42", convert("42"),
+ convert("42"));
+ DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, "42", convert("042"),
+ convert("042"));
+ DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, "0x42", convert("42"),
+ convert("42"));
+ DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, "0x42", convert("042"),
+ convert("042"));
+ DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, "0x42", convert("42"),
+ convert("42"));
+ DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, "0x42", convert("042"),
+ convert("042"));
+
+
+ DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, convert("2.0e+000"),
+ convert("2.0e+000"));
+ DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, convert("2.010e+000"),
+ convert("2.010e+000"));
+ DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, convert("2.0E+000"),
+ convert("2.0E+000"));
+ DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, convert("2.010E+000"),
+ convert("2.010E+000"));
+ DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, convert("2.0"),
+ convert("2.0"));
+ DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, convert("2.010"),
+ convert("2.010"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, convert("3e+002"),
+ convert("3e+002"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, convert("256.01"),
+ convert("256.01"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, convert("3E+002"),
+ convert("3E+002"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, convert("256.01"),
+ convert("256.01"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt
index 84446d5f6d..af2b13e4c7 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_swprintf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp
index deffd3edd7..deffd3edd7 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt
index 6dbd8a3c36..14b81f4ac8 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_swprintf_test3
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp
index 42875c0640..42875c0640 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt
index a665948c47..e153e6b02f 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_swprintf_test4
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp
index 02cc3f9005..02cc3f9005 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test5/CMakeLists.txt
index 8268ec2963..967ccbb992 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_swprintf_test5
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.cpp
index e85adc120e..e85adc120e 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt
index 6a90c0b88e..806211a992 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_swprintf_test6
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp
index ecd6374264..ecd6374264 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt
index 2b1c30cb56..cf563799d9 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_swprintf_test7
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/swprintf/test7/test7.cpp
index e231ada3d2..e231ada3d2 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt
index 281e6df097..e8fcf66157 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_swprintf_test8
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/swprintf/test8/test8.cpp
index b4be28e78d..b4be28e78d 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test8/test8.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt
index 054b40a998..c616348766 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_swprintf_test9
diff --git a/src/pal/tests/palsuite/c_runtime/swprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/swprintf/test9/test9.cpp
index 2f5429e5fd..2f5429e5fd 100644
--- a/src/pal/tests/palsuite/c_runtime/swprintf/test9/test9.c
+++ b/src/pal/tests/palsuite/c_runtime/swprintf/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h b/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h
index 1cac450cf4..6349b7dcd6 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h
@@ -14,7 +14,7 @@
#ifndef __SWSCANF_H__
#define __SWSCANF_H__
-void DoVoidTest(WCHAR *inputstr, WCHAR *formatstr)
+void DoVoidTest(WCHAR *inputstr, const WCHAR *formatstr)
{
char buf[256] = { 0 };
int i;
@@ -40,7 +40,7 @@ void DoVoidTest(WCHAR *inputstr, WCHAR *formatstr)
}
-void DoStrTest(WCHAR *inputstr, WCHAR *formatstr, char *checkstr)
+void DoStrTest(WCHAR *inputstr, const WCHAR *formatstr, const char *checkstr)
{
char buf[256] = { 0 };
int ret;
@@ -63,7 +63,7 @@ void DoStrTest(WCHAR *inputstr, WCHAR *formatstr, char *checkstr)
}
-void DoWStrTest(WCHAR *inputstr, WCHAR *formatstr, WCHAR *checkstr)
+void DoWStrTest(WCHAR *inputstr, const WCHAR *formatstr, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
int ret;
@@ -86,7 +86,7 @@ void DoWStrTest(WCHAR *inputstr, WCHAR *formatstr, WCHAR *checkstr)
}
-void DoNumTest(WCHAR *inputstr, WCHAR *formatstr, int checknum)
+void DoNumTest(WCHAR *inputstr, const WCHAR *formatstr, int checknum)
{
int num = 0;
int ret;
@@ -107,7 +107,7 @@ void DoNumTest(WCHAR *inputstr, WCHAR *formatstr, int checknum)
}
}
-void DoShortNumTest(WCHAR *inputstr, WCHAR *formatstr, short checknum)
+void DoShortNumTest(WCHAR *inputstr, const WCHAR *formatstr, short checknum)
{
short num = 0;
int ret;
@@ -128,7 +128,7 @@ void DoShortNumTest(WCHAR *inputstr, WCHAR *formatstr, short checknum)
}
}
-void DoI64NumTest(WCHAR *inputstr, WCHAR *formatstr, INT64 checknum)
+void DoI64NumTest(WCHAR *inputstr, const WCHAR *formatstr, INT64 checknum)
{
char buf[256];
char check[256];
@@ -145,15 +145,15 @@ void DoI64NumTest(WCHAR *inputstr, WCHAR *formatstr, INT64 checknum)
if (checknum != num)
{
- sprintf(buf, "%I64d", num);
- sprintf(check, "%I64d", checknum);
+ sprintf_s(buf, _countof(buf), "%I64d", num);
+ sprintf_s(check, _countof(check), "%I64d", checknum);
Fail("ERROR: scanned I64 number incorrectly from \"%s\" using \"%s\".\n"
"Expected %s, got %s.\n", convertC(inputstr),
convertC(formatstr), check, buf);
}
}
-void DoCharTest(WCHAR *inputstr, WCHAR*formatstr, char* checkchars, int numchars)
+void DoCharTest(WCHAR *inputstr, const WCHAR *formatstr, char* checkchars, int numchars)
{
char buf[256];
int ret;
@@ -187,7 +187,7 @@ void DoCharTest(WCHAR *inputstr, WCHAR*formatstr, char* checkchars, int numchars
}
}
-void DoWCharTest(WCHAR *inputstr, WCHAR *formatstr, WCHAR *checkchars, int numchars)
+void DoWCharTest(WCHAR *inputstr, const WCHAR *formatstr, const WCHAR *checkchars, int numchars)
{
WCHAR buf[256];
int ret;
@@ -223,7 +223,7 @@ void DoWCharTest(WCHAR *inputstr, WCHAR *formatstr, WCHAR *checkchars, int numch
}
-void DoFloatTest(WCHAR *inputstr, WCHAR *formatstr, float checkval)
+void DoFloatTest(WCHAR *inputstr, const WCHAR *formatstr, float checkval)
{
char buf[256] = { 0 };
float val;
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test1/CMakeLists.txt
index 030aaaf709..44b8939248 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_swscanf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/swscanf/test1/test1.cpp
index 66136e57c5..66136e57c5 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test10/CMakeLists.txt
index f7c8b284ff..27d42114a9 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_swscanf_test10
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/swscanf/test10/test10.cpp
index a8628e0de1..a8628e0de1 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test10/test10.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test11/CMakeLists.txt
index 17066f31b8..1ca9224ec0 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_swscanf_test11
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/swscanf/test11/test11.cpp
index f7eb4af46f..f7eb4af46f 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test11/test11.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test12/CMakeLists.txt
index 95f5174ecb..44d70f47ae 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_swscanf_test12
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/swscanf/test12/test12.cpp
index f5f8bbdf8a..f5f8bbdf8a 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test12/test12.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test13/CMakeLists.txt
index 47abc50313..add0cbfe18 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test13.c
+ test13.cpp
)
add_executable(paltest_swscanf_test13
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/swscanf/test13/test13.cpp
index 1bb0b7b21c..1bb0b7b21c 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test13/test13.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test13/test13.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test14/CMakeLists.txt
index a470436ce7..126e087b1c 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test14.c
+ test14.cpp
)
add_executable(paltest_swscanf_test14
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/swscanf/test14/test14.cpp
index 80581b726f..80581b726f 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test14/test14.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test14/test14.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test15/CMakeLists.txt
index d89650b12c..7c2da2bdf8 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test15.c
+ test15.cpp
)
add_executable(paltest_swscanf_test15
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/swscanf/test15/test15.cpp
index 9b7d277e17..9b7d277e17 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test15/test15.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test15/test15.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test16/CMakeLists.txt
index a2a00f11b6..ba28c4dc2f 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test16.c
+ test16.cpp
)
add_executable(paltest_swscanf_test16
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/swscanf/test16/test16.cpp
index c83b64468b..c83b64468b 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test16/test16.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test16/test16.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt
index c224f5d9a6..225ce868ed 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test17.c
+ test17.cpp
)
add_executable(paltest_swscanf_test17
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.cpp
index 9023f7020a..9023f7020a 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test17/test17.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test2/CMakeLists.txt
index a5335ddb48..15411ecf21 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_swscanf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/swscanf/test2/test2.cpp
index 8fbd3f86ba..8fbd3f86ba 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test3/CMakeLists.txt
index 5c229c26d3..927026107a 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_swscanf_test3
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/swscanf/test3/test3.cpp
index 8b05df20f2..8b05df20f2 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test4/CMakeLists.txt
index 5e281aaf34..eec701645b 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_swscanf_test4
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/swscanf/test4/test4.cpp
index d63d25b7d0..d63d25b7d0 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test5/CMakeLists.txt
index 8b259aa78d..3f022db16c 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_swscanf_test5
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/swscanf/test5/test5.cpp
index 8ae2d81da6..8ae2d81da6 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test6/CMakeLists.txt
index c3fd8696ab..c55666d95c 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_swscanf_test6
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/swscanf/test6/test6.cpp
index 982f799cfc..982f799cfc 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test7/CMakeLists.txt
index 00541306df..adb0abe80d 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_swscanf_test7
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/swscanf/test7/test7.cpp
index 45e9400549..45e9400549 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test8/CMakeLists.txt
index d6aa631ab9..a69c552337 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_swscanf_test8
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/swscanf/test8/test8.cpp
index a244de748f..a244de748f 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test8/test8.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/swscanf/test9/CMakeLists.txt
index 4f7595a205..70a9fe2064 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_swscanf_test9
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/swscanf/test9/test9.cpp
index e289d26f58..e289d26f58 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/test9/test9.c
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/tan/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/tan/test1/CMakeLists.txt
index 665fc22d5e..cea661f2bb 100644
--- a/src/pal/tests/palsuite/c_runtime/tan/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/tan/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_tan_test1
diff --git a/src/pal/tests/palsuite/c_runtime/tan/test1/test1.c b/src/pal/tests/palsuite/c_runtime/tan/test1/test1.cpp
index 443e5da6d6..443e5da6d6 100644
--- a/src/pal/tests/palsuite/c_runtime/tan/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/tan/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/tanf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/tanf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/tanf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/tanf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/tanf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..cd588ea23e
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/tanf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_tanf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_tanf_test1 coreclrpal)
+
+target_link_libraries(paltest_tanf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/tanf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/tanf/test1/test1.c
new file mode 100644
index 0000000000..18d5c4e59d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/tanf/test1/test1.c
@@ -0,0 +1,136 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test to ensure that tanf return the correct values
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** fabs
+**
+**===========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = tanf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("tanf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = tanf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("tanf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0, 0, PAL_EPSILON },
+ { 0.318309886f, 0.329514733f, PAL_EPSILON }, // value: 1 / pi
+ { 0.434294482f, 0.463829067f, PAL_EPSILON }, // value: log10f(e)
+ { 0.636619772f, 0.739302950f, PAL_EPSILON }, // value: 2 / pi
+ { 0.693147181f, 0.830640878f, PAL_EPSILON }, // value: ln(2)
+ { 0.707106781f, 0.854510432f, PAL_EPSILON }, // value: 1 / sqrtf(2)
+ { 0.785398163f, 1, PAL_EPSILON * 10 }, // value: pi / 4
+ { 1, 1.55740772f, PAL_EPSILON * 10 },
+ { 1.12837917f, 2.11087684f, PAL_EPSILON * 10 }, // value: 2 / sqrtf(pi)
+ { 1.41421356f, 6.33411917f, PAL_EPSILON * 10 }, // value: sqrtf(2)
+ { 1.44269504f, 7.76357567f, PAL_EPSILON * 10 }, // value: logf2(e)
+ // SEE BELOW -- { 1.57079633f, PAL_POSINF, 0 }, // value: pi / 2
+ { 2.30258509f, -1.11340715f, PAL_EPSILON * 10 }, // value: ln(10)
+ { 2.71828183f, -0.450549534f, PAL_EPSILON }, // value: e
+ { 3.14159265f, 0, PAL_EPSILON }, // value: pi
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate( tests[i].value, tests[i].expected, tests[i].variance);
+ validate(-tests[i].value, -tests[i].expected, tests[i].variance);
+ }
+
+ // -- SPECIAL CASE --
+ // Normally, tanf(pi / 2) would return PAL_POSINF (atan2f(PAL_POSINF) does return (pi / 2)).
+ // However, it seems instead (on all supported systems), we get a different number entirely.
+ validate( 1.57079633f, -22877332.0, PAL_EPSILON * 100000000);
+ validate(-1.57079633f, 22877332.0, PAL_EPSILON * 100000000);
+
+ validate_isnan(PAL_NEGINF);
+ validate_isnan(PAL_NAN);
+ validate_isnan(PAL_POSINF);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/tanf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/tanf/test1/testinfo.dat
new file mode 100644
index 0000000000..aa33232adc
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/tanf/test1/testinfo.dat
@@ -0,0 +1,13 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = tanf
+Name = Positive Test for tanf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes to tanf() a series of angle value, checking that
+= each one return to correct value.
diff --git a/src/pal/tests/palsuite/c_runtime/tanh/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/tanh/test1/CMakeLists.txt
index f8e439dd95..9fe926d441 100644
--- a/src/pal/tests/palsuite/c_runtime/tanh/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/tanh/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_tanh_test1
diff --git a/src/pal/tests/palsuite/c_runtime/tanh/test1/test1.c b/src/pal/tests/palsuite/c_runtime/tanh/test1/test1.cpp
index 3b8f87964a..3b8f87964a 100644
--- a/src/pal/tests/palsuite/c_runtime/tanh/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/tanh/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/tanhf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/tanhf/CMakeLists.txt
new file mode 100644
index 0000000000..5e1ef7f28b
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/tanhf/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(test1)
diff --git a/src/pal/tests/palsuite/c_runtime/tanhf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/tanhf/test1/CMakeLists.txt
new file mode 100644
index 0000000000..fd0af2a46f
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/tanhf/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ test1.c
+)
+
+add_executable(paltest_tanhf_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_tanhf_test1 coreclrpal)
+
+target_link_libraries(paltest_tanhf_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/c_runtime/tanhf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/tanhf/test1/test1.c
new file mode 100644
index 0000000000..904729a2c4
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/tanhf/test1/test1.c
@@ -0,0 +1,129 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Test to ensure that tanhf return the correct values
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** fabs
+**
+**===========================================================================*/
+
+#include <palsuite.h>
+
+// binary32 (float) has a machine epsilon of 2^-23 (approx. 1.19e-07). However, this
+// is slightly too accurate when writing tests meant to run against libm implementations
+// for various platforms. 2^-21 (approx. 4.76e-07) seems to be as accurate as we can get.
+//
+// The tests themselves will take PAL_EPSILON and adjust it according to the expected result
+// so that the delta used for comparison will compare the most significant digits and ignore
+// any digits that are outside the double precision range (6-9 digits).
+
+// For example, a test with an expect result in the format of 0.xxxxxxxxx will use PAL_EPSILON
+// for the variance, while an expected result in the format of 0.0xxxxxxxxx will use
+// PAL_EPSILON / 10 and and expected result in the format of x.xxxxxx will use PAL_EPSILON * 10.
+#define PAL_EPSILON 4.76837158e-07
+
+#define PAL_NAN sqrtf(-1.0f)
+#define PAL_POSINF -logf(0.0f)
+#define PAL_NEGINF logf(0.0f)
+
+/**
+ * Helper test structure
+ */
+struct test
+{
+ float value; /* value to test the function with */
+ float expected; /* expected result */
+ float variance; /* maximum delta between the expected and actual result */
+};
+
+/**
+ * validate
+ *
+ * test validation function
+ */
+void __cdecl validate(float value, float expected, float variance)
+{
+ float result = tanhf(value);
+
+ /*
+ * The test is valid when the difference between result
+ * and expected is less than or equal to variance
+ */
+ float delta = fabsf(result - expected);
+
+ if (delta > variance)
+ {
+ Fail("tanhf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, expected);
+ }
+}
+
+/**
+ * validate
+ *
+ * test validation function for values returning NaN
+ */
+void __cdecl validate_isnan(float value)
+{
+ float result = tanhf(value);
+
+ if (!_isnanf(result))
+ {
+ Fail("tanhf(%g) returned %10.9g when it should have returned %10.9g",
+ value, result, PAL_NAN);
+ }
+}
+
+/**
+ * main
+ *
+ * executable entry point
+ */
+int __cdecl main(int argc, char **argv)
+{
+ struct test tests[] =
+ {
+ /* value expected variance */
+ { 0, 0, PAL_EPSILON },
+ { 0.318309886f, 0.307977913f, PAL_EPSILON }, // value: 1 / pi
+ { 0.434294482f, 0.408904012f, PAL_EPSILON }, // value: log10f(e)
+ { 0.636619772f, 0.562593600f, PAL_EPSILON }, // value: 2 / pi
+ { 0.693147181f, 0.6f, PAL_EPSILON }, // value: ln(2)
+ { 0.707106781f, 0.608859365f, PAL_EPSILON }, // value: 1 / sqrtf(2)
+ { 0.785398163f, 0.655794203f, PAL_EPSILON }, // value: pi / 4
+ { 1, 0.761594156f, PAL_EPSILON },
+ { 1.12837917f, 0.810463806f, PAL_EPSILON }, // value: 2 / sqrtf(pi)
+ { 1.41421356f, 0.888385562f, PAL_EPSILON }, // value: sqrtf(2)
+ { 1.44269504f, 0.894238946f, PAL_EPSILON }, // value: logf2(e)
+ { 1.57079633f, 0.917152336f, PAL_EPSILON }, // value: pi / 2
+ { 2.30258509f, 0.980198020f, PAL_EPSILON }, // value: ln(10)
+ { 2.71828183f, 0.991328916f, PAL_EPSILON }, // value: e
+ { 3.14159265f, 0.996272076f, PAL_EPSILON }, // value: pi
+ { PAL_POSINF, 1, PAL_EPSILON * 10 }
+ };
+
+ /* PAL initialization */
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ for (int i = 0; i < (sizeof(tests) / sizeof(struct test)); i++)
+ {
+ validate( tests[i].value, tests[i].expected, tests[i].variance);
+ validate(-tests[i].value, -tests[i].expected, tests[i].variance);
+ }
+
+ validate_isnan(PAL_NAN);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/tanhf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/tanhf/test1/testinfo.dat
new file mode 100644
index 0000000000..6c7594fc5a
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/tanhf/test1/testinfo.dat
@@ -0,0 +1,13 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = C Runtime
+Function = tanhf
+Name = Positive Test for tanhf
+TYPE = DEFAULT
+EXE1 = test1
+Description
+= Passes to tanhf() a series of angle value, checking that
+= each one return to correct value.
diff --git a/src/pal/tests/palsuite/c_runtime/time/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/time/test1/CMakeLists.txt
index d495266cef..64df144557 100644
--- a/src/pal/tests/palsuite/c_runtime/time/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/time/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_time_test1
diff --git a/src/pal/tests/palsuite/c_runtime/time/test1/test1.c b/src/pal/tests/palsuite/c_runtime/time/test1/test1.cpp
index c668bf38e7..c668bf38e7 100644
--- a/src/pal/tests/palsuite/c_runtime/time/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/time/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/tolower/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/tolower/test1/CMakeLists.txt
index 537f239cf8..214a509010 100644
--- a/src/pal/tests/palsuite/c_runtime/tolower/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/tolower/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_tolower_test1
diff --git a/src/pal/tests/palsuite/c_runtime/tolower/test1/test1.c b/src/pal/tests/palsuite/c_runtime/tolower/test1/test1.cpp
index cab623d3f9..cab623d3f9 100644
--- a/src/pal/tests/palsuite/c_runtime/tolower/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/tolower/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/toupper/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/toupper/test1/CMakeLists.txt
index e5aa375a9b..3dd536c590 100644
--- a/src/pal/tests/palsuite/c_runtime/toupper/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/toupper/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_toupper_test1
diff --git a/src/pal/tests/palsuite/c_runtime/toupper/test1/test1.c b/src/pal/tests/palsuite/c_runtime/toupper/test1/test1.cpp
index c580699e3b..c580699e3b 100644
--- a/src/pal/tests/palsuite/c_runtime/toupper/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/toupper/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/towlower/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/towlower/test1/CMakeLists.txt
index 2a3e6a07ef..77a46344d4 100644
--- a/src/pal/tests/palsuite/c_runtime/towlower/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/towlower/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_towlower_test1
diff --git a/src/pal/tests/palsuite/c_runtime/towlower/test1/test1.c b/src/pal/tests/palsuite/c_runtime/towlower/test1/test1.cpp
index 5f2457a5fe..5f2457a5fe 100644
--- a/src/pal/tests/palsuite/c_runtime/towlower/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/towlower/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/towupper/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/towupper/test1/CMakeLists.txt
index 537efbe0fa..6a2f813cc9 100644
--- a/src/pal/tests/palsuite/c_runtime/towupper/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/towupper/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_towupper_test1
diff --git a/src/pal/tests/palsuite/c_runtime/towupper/test1/test1.c b/src/pal/tests/palsuite/c_runtime/towupper/test1/test1.cpp
index 63f051fa66..63f051fa66 100644
--- a/src/pal/tests/palsuite/c_runtime/towupper/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/towupper/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/ungetc/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/ungetc/test1/CMakeLists.txt
index da19397e2c..0286f99b77 100644
--- a/src/pal/tests/palsuite/c_runtime/ungetc/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/ungetc/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- ungetc.c
+ ungetc.cpp
)
add_executable(paltest_ungetc_test1
diff --git a/src/pal/tests/palsuite/c_runtime/ungetc/test1/ungetc.c b/src/pal/tests/palsuite/c_runtime/ungetc/test1/ungetc.cpp
index 397e42ac64..397e42ac64 100644
--- a/src/pal/tests/palsuite/c_runtime/ungetc/test1/ungetc.c
+++ b/src/pal/tests/palsuite/c_runtime/ungetc/test1/ungetc.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/ungetc/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/ungetc/test2/CMakeLists.txt
index 7b63423628..0710074bd0 100644
--- a/src/pal/tests/palsuite/c_runtime/ungetc/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/ungetc/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- ungetc.c
+ ungetc.cpp
)
add_executable(paltest_ungetc_test2
diff --git a/src/pal/tests/palsuite/c_runtime/ungetc/test2/ungetc.c b/src/pal/tests/palsuite/c_runtime/ungetc/test2/ungetc.cpp
index cbc8102eec..cbc8102eec 100644
--- a/src/pal/tests/palsuite/c_runtime/ungetc/test2/ungetc.c
+++ b/src/pal/tests/palsuite/c_runtime/ungetc/test2/ungetc.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test1/CMakeLists.txt
index 4c967fbc5b..fcff4a2074 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_vfprintf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test1/test1.cpp
index 302c914e3a..302c914e3a 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test10/CMakeLists.txt
index e154107e36..97c7b167ab 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_vfprintf_test10
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test10/test10.cpp
index ecb4b0314a..ecb4b0314a 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test10/test10.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test11/CMakeLists.txt
index f51f379bcd..9250eb957d 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_vfprintf_test11
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test11/test11.cpp
index 5f7bc118cc..5f7bc118cc 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test11/test11.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test12/CMakeLists.txt
index 3ef68cff70..53d3488b4a 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_vfprintf_test12
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test12/test12.cpp
index 0bf61d3ecc..0bf61d3ecc 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test12/test12.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test13/CMakeLists.txt
index cd34f6649c..c35813b420 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test13.c
+ test13.cpp
)
add_executable(paltest_vfprintf_test13
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test13/test13.cpp
index 1e42ce9e8d..1e42ce9e8d 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test13/test13.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test13/test13.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test14/CMakeLists.txt
index 396a4631c5..bd91f509b5 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test14.c
+ test14.cpp
)
add_executable(paltest_vfprintf_test14
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test14/test14.cpp
index 82f247430f..82f247430f 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test14/test14.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test14/test14.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test15/CMakeLists.txt
index b9ddbe3b4a..30003b82f8 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test15.c
+ test15.cpp
)
add_executable(paltest_vfprintf_test15
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test15/test15.cpp
index 53cc2ceb87..53cc2ceb87 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test15/test15.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test15/test15.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test16/CMakeLists.txt
index 0fd4177ed8..a287f120a0 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test16.c
+ test16.cpp
)
add_executable(paltest_vfprintf_test16
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test16/test16.cpp
index 2b7674bb94..2b7674bb94 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test16/test16.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test16/test16.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test17/CMakeLists.txt
index afc0b3828d..cf1afd9d2d 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test17.c
+ test17.cpp
)
add_executable(paltest_vfprintf_test17
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test17/test17.cpp
index 956be15f6f..956be15f6f 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test17/test17.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test17/test17.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test18/CMakeLists.txt
index 9e373b999e..143eade9b3 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test18/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test18.c
+ test18.cpp
)
add_executable(paltest_vfprintf_test18
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test18/test18.cpp
index c61c8cbdab..c61c8cbdab 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test18/test18.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test18/test18.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test19/CMakeLists.txt
index 3120c9117f..452d929b7d 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test19/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test19.c
+ test19.cpp
)
add_executable(paltest_vfprintf_test19
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.c
deleted file mode 100644
index e88ce23663..0000000000
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.c
+++ /dev/null
@@ -1,76 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test19.c
-**
-** Purpose: Test #19 for the vfprintf function. Tests the variable length
-** precision argument.
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-#include "../vfprintf.h"
-
-
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int n = -1;
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoArgumentPrecTest("%.*s", 2, "bar", "bar", "ba", "ba");
- DoArgumentPrecTest("%.*S", 2, convert("bar"), "bar", "ba", "ba");
-
- DoArgumentPrecTest("%.*n ", 3, &n, "pointer to int", " ", " ");
- if (n != 0)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- 0, n);
- }
-
- DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
- DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
- DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
- DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
-
-
- DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
- DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
- DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
- DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
- DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
- DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
- DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
- DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
- DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
- DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.cpp
new file mode 100644
index 0000000000..d8e8f9301d
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test19/test19.cpp
@@ -0,0 +1,76 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test19.c
+**
+** Purpose: Test #19 for the vfprintf function. Tests the variable length
+** precision argument.
+**
+**
+**==========================================================================*/
+
+
+#include <palsuite.h>
+#include "../vfprintf.h"
+
+
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n = -1;
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoArgumentPrecTest("%.*s", 2, (void*)"bar", "bar", "ba", "ba");
+ DoArgumentPrecTest("%.*S", 2, (void*)convert("bar"), "bar", "ba", "ba");
+
+ DoArgumentPrecTest("%.*n ", 3, (void*)&n, "pointer to int", " ", " ");
+ if (n != 0)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
+ 0, n);
+ }
+
+ DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
+ DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
+ DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
+ DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
+
+
+ DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
+ DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
+ DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
+ DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
+ DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
+ DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
+ DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
+ DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
+ DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
+ DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test2/CMakeLists.txt
index 6e700090d6..b18fb712c6 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_vfprintf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test2/test2.cpp
index d01117f047..d01117f047 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test3/CMakeLists.txt
index 1a14d85603..a8f7eb1991 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_vfprintf_test3
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test3/test3.cpp
index 0081daa426..0081daa426 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test4/CMakeLists.txt
index c1285942bc..60c31693a5 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_vfprintf_test4
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test4/test4.cpp
index d24f08d6e0..d24f08d6e0 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test5/CMakeLists.txt
index 0cccdfd630..5f516fec6a 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_vfprintf_test5
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test5/test5.cpp
index 44f21b61db..44f21b61db 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test6/CMakeLists.txt
index 2c036a45ae..7f0cc710af 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_vfprintf_test6
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test6/test6.cpp
index 36c6fe51ca..36c6fe51ca 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test7/CMakeLists.txt
index ca483af773..a2cd9a2e8f 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_vfprintf_test7
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test7/test7.cpp
index a9cfe319bd..a9cfe319bd 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test8/CMakeLists.txt
index 89459b4e93..a7b20ee43e 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_vfprintf_test8
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test8/test8.cpp
index 5cef99741a..5cef99741a 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test8/test8.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vfprintf/test9/CMakeLists.txt
index 3e3b5b99ed..242b635f93 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_vfprintf_test9
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/vfprintf/test9/test9.cpp
index 45d0dc7a9e..45d0dc7a9e 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/test9/test9.c
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vfprintf/vfprintf.h b/src/pal/tests/palsuite/c_runtime/vfprintf/vfprintf.h
index f4ae7a53fa..7901b08b0d 100644
--- a/src/pal/tests/palsuite/c_runtime/vfprintf/vfprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/vfprintf/vfprintf.h
@@ -14,7 +14,7 @@
#ifndef __vfprintf_H__
#define __vfprintf_H__
-int DoVfprintf(FILE *fp, char *format, ...)
+int DoVfprintf(FILE *fp, const char *format, ...)
{
int retVal;
va_list arglist;
@@ -26,7 +26,7 @@ int DoVfprintf(FILE *fp, char *format, ...)
return (retVal);
}
-void DoStrTest(char *formatstr, char* param, char *checkstr)
+void DoStrTest(const char *formatstr, char* param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -57,7 +57,7 @@ void DoStrTest(char *formatstr, char* param, char *checkstr)
fclose(fp);
}
-void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
+void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -89,8 +89,8 @@ void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
}
-void DoPointerTest(char *formatstr, void* param, char* paramstr,
- char *checkstr1)
+void DoPointerTest(const char *formatstr, void* param, char* paramstr,
+ const char *checkstr1)
{
FILE *fp;
char buf[256] = { 0 };
@@ -130,7 +130,7 @@ void DoPointerTest(char *formatstr, void* param, char* paramstr,
-void DoCountTest(char *formatstr, int param, char *checkstr)
+void DoCountTest(const char *formatstr, int param, const char *checkstr)
{
FILE *fp;
char buf[512] = { 0 };
@@ -173,7 +173,7 @@ void DoCountTest(char *formatstr, int param, char *checkstr)
}
}
-void DoShortCountTest(char *formatstr, int param, char *checkstr)
+void DoShortCountTest(const char *formatstr, int param, const char *checkstr)
{
FILE *fp;
char buf[512] = { 0 };
@@ -217,7 +217,7 @@ void DoShortCountTest(char *formatstr, int param, char *checkstr)
}
-void DoCharTest(char *formatstr, char param, char *checkstr)
+void DoCharTest(const char *formatstr, char param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -248,7 +248,7 @@ void DoCharTest(char *formatstr, char param, char *checkstr)
fclose(fp);
}
-void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
+void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -279,7 +279,7 @@ void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
fclose(fp);
}
-void DoNumTest(char *formatstr, int value, char *checkstr)
+void DoNumTest(const char *formatstr, int value, const char *checkstr)
{
FILE *fp;
char buf[256] = { 0 };
@@ -310,7 +310,7 @@ void DoNumTest(char *formatstr, int value, char *checkstr)
fclose(fp);
}
-void DoI64Test(char *formatstr, INT64 value, char *valuestr, char *checkstr1)
+void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr1)
{
FILE *fp;
char buf[256] = { 0 };
@@ -341,8 +341,8 @@ void DoI64Test(char *formatstr, INT64 value, char *valuestr, char *checkstr1)
fclose(fp);
}
-void DoDoubleTest(char *formatstr, double value, char *checkstr1,
- char *checkstr2)
+void DoDoubleTest(const char *formatstr, double value, const char *checkstr1,
+ const char *checkstr2)
{
FILE *fp;
char buf[256] = { 0 };
@@ -376,8 +376,8 @@ void DoDoubleTest(char *formatstr, double value, char *checkstr1,
}
-void DoArgumentPrecTest(char *formatstr, int precision, void *param,
- char *paramstr, char *checkstr1, char *checkstr2)
+void DoArgumentPrecTest(const char *formatstr, int precision, void *param,
+ char *paramstr, const char *checkstr1, const char *checkstr2)
{
FILE *fp;
char buf[256];
@@ -418,8 +418,8 @@ void DoArgumentPrecTest(char *formatstr, int precision, void *param,
}
-void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param,
- char *checkstr1, char *checkstr2)
+void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param,
+ const char *checkstr1, const char *checkstr2)
{
FILE *fp;
char buf[256];
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test1/CMakeLists.txt
index eabdf87393..9d866e16a2 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_vprintf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/vprintf/test1/test1.cpp
index 404d7a0dc9..404d7a0dc9 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test10/CMakeLists.txt
index 47a21d909a..4ed04b46c6 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_vprintf_test10
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/vprintf/test10/test10.cpp
index b363d7c02c..b363d7c02c 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test10/test10.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test11/CMakeLists.txt
index 4c750b72ac..5dc3c6dc69 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_vprintf_test11
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/vprintf/test11/test11.cpp
index f5157ac99f..f5157ac99f 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test11/test11.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test12/CMakeLists.txt
index 1feb886fc1..a8104296c4 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_vprintf_test12
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/vprintf/test12/test12.cpp
index 703a8c4fdc..703a8c4fdc 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test12/test12.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test13/CMakeLists.txt
index cd7535a1ad..df98081ed7 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test13.c
+ test13.cpp
)
add_executable(paltest_vprintf_test13
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/vprintf/test13/test13.cpp
index ecb83ba38d..ecb83ba38d 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test13/test13.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test13/test13.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test14/CMakeLists.txt
index 82cfd68ecf..b903d4e241 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test14.c
+ test14.cpp
)
add_executable(paltest_vprintf_test14
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/vprintf/test14/test14.cpp
index 536c1950e3..536c1950e3 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test14/test14.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test14/test14.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test15/CMakeLists.txt
index 29a134d48c..659ed9cb44 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test15.c
+ test15.cpp
)
add_executable(paltest_vprintf_test15
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/vprintf/test15/test15.cpp
index 9aff6e457d..9aff6e457d 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test15/test15.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test15/test15.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test16/CMakeLists.txt
index 7fbf43ac84..b2f7fe8b78 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test16.c
+ test16.cpp
)
add_executable(paltest_vprintf_test16
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/vprintf/test16/test16.cpp
index 66e9afe2d7..66e9afe2d7 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test16/test16.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test16/test16.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test17/CMakeLists.txt
index 25970cba15..76cfc9ad06 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test17.c
+ test17.cpp
)
add_executable(paltest_vprintf_test17
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/vprintf/test17/test17.cpp
index d36a084903..d36a084903 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test17/test17.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test17/test17.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test18/CMakeLists.txt
index 45676b93dd..633fb7ee51 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test18/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test18.c
+ test18.cpp
)
add_executable(paltest_vprintf_test18
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/vprintf/test18/test18.cpp
index 6fde79b5fb..6fde79b5fb 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test18/test18.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test18/test18.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test19/CMakeLists.txt
index 25bc2fccd1..1a6256ad0b 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test19/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test19.c
+ test19.cpp
)
add_executable(paltest_vprintf_test19
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.c
deleted file mode 100644
index d79f2e2591..0000000000
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.c
+++ /dev/null
@@ -1,76 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test19.c
-**
-** Purpose: Test #19 for the vprintf function. Tests the variable length
-** precision argument.
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-#include "../vprintf.h"
-
-
-
-
-int __cdecl main(int argc, char *argv[])
-{
- int n = -1;
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- DoArgumentPrecTest("%.*s", 2, "bar", "bar", "ba", "ba");
- DoArgumentPrecTest("%.*S", 2, convert("bar"), "bar", "ba", "ba");
-
- DoArgumentPrecTest("%.*n", 3, &n, "pointer to int", "", "");
- if (n != 0)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- 0, n);
- }
-
- DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
- DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
- DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
- DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
-
-
- DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
- DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
- DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
- DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
- DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
- DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
- DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
- DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
- DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
- DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.cpp
new file mode 100644
index 0000000000..a3e0877369
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test19/test19.cpp
@@ -0,0 +1,76 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test19.c
+**
+** Purpose: Test #19 for the vprintf function. Tests the variable length
+** precision argument.
+**
+**
+**==========================================================================*/
+
+
+#include <palsuite.h>
+#include "../vprintf.h"
+
+
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ int n = -1;
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ DoArgumentPrecTest("%.*s", 2, (void*)"bar", "bar", "ba", "ba");
+ DoArgumentPrecTest("%.*S", 2, (void*)convert("bar"), "bar", "ba", "ba");
+
+ DoArgumentPrecTest("%.*n", 3, (void*)&n, "pointer to int", "", "");
+ if (n != 0)
+ {
+ Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
+ 0, n);
+ }
+
+ DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
+ DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
+ DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
+ DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
+
+
+ DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
+ DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
+ DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
+ DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
+ DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
+ DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
+ DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
+ DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
+ DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
+ DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test2/CMakeLists.txt
index 6820069cb9..41e2073477 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_vprintf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/vprintf/test2/test2.cpp
index 4d9c9bc6f5..4d9c9bc6f5 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test3/CMakeLists.txt
index 676d19bf7a..8570666b11 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_vprintf_test3
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/vprintf/test3/test3.cpp
index 5376c56b76..5376c56b76 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test4/CMakeLists.txt
index 9ddb087e83..06b582b5ee 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_vprintf_test4
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/vprintf/test4/test4.cpp
index 3b66cde22e..3b66cde22e 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test5/CMakeLists.txt
index f453bb66ee..3a1828a28c 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_vprintf_test5
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/vprintf/test5/test5.cpp
index c9e2901230..c9e2901230 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test6/CMakeLists.txt
index 1ce8d5aa4c..2dac7703e6 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_vprintf_test6
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/vprintf/test6/test6.cpp
index 6a83cccea6..6a83cccea6 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test7/CMakeLists.txt
index 5627fe4c1e..5a520045a9 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_vprintf_test7
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/vprintf/test7/test7.cpp
index 5096ace42c..5096ace42c 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test8/CMakeLists.txt
index 0131e4943e..18e4e3a0c9 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_vprintf_test8
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/vprintf/test8/test8.cpp
index 2683339ece..2683339ece 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test8/test8.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vprintf/test9/CMakeLists.txt
index c70631f9dc..8bcbe81f51 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_vprintf_test9
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/vprintf/test9/test9.cpp
index 8545bc760e..8545bc760e 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/test9/test9.c
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vprintf/vprintf.h b/src/pal/tests/palsuite/c_runtime/vprintf/vprintf.h
index 477db32f4d..fcd8f80370 100644
--- a/src/pal/tests/palsuite/c_runtime/vprintf/vprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/vprintf/vprintf.h
@@ -14,7 +14,7 @@
#ifndef __vprintf_H__
#define __vprintf_H__
-int DoVprintf(char *format, ...)
+int DoVprintf(const char *format, ...)
{
int retVal;
va_list arglist;
@@ -26,7 +26,7 @@ int DoVprintf(char *format, ...)
return (retVal);
}
-void DoStrTest(char *formatstr, char* param, char *checkstr)
+void DoStrTest(const char *formatstr, char* param, const char *checkstr)
{
int ret;
@@ -38,7 +38,7 @@ void DoStrTest(char *formatstr, char* param, char *checkstr)
}
}
-void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
+void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr)
{
int ret;
@@ -50,8 +50,8 @@ void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
}
}
-void DoPointerTest(char *formatstr, void* param, char* paramstr,
- char *checkstr1)
+void DoPointerTest(const char *formatstr, void* param, char* paramstr,
+ const char *checkstr1)
{
int ret;
@@ -63,7 +63,7 @@ void DoPointerTest(char *formatstr, void* param, char* paramstr,
}
}
-void DoCountTest(char *formatstr, int param, char *checkstr)
+void DoCountTest(const char *formatstr, int param, const char *checkstr)
{
int ret;
int n = -1;
@@ -82,7 +82,7 @@ void DoCountTest(char *formatstr, int param, char *checkstr)
}
}
-void DoShortCountTest(char *formatstr, int param, char *checkstr)
+void DoShortCountTest(const char *formatstr, int param, const char *checkstr)
{
int ret;
short int n = -1;
@@ -102,7 +102,7 @@ void DoShortCountTest(char *formatstr, int param, char *checkstr)
}
-void DoCharTest(char *formatstr, char param, char *checkstr)
+void DoCharTest(const char *formatstr, char param, const char *checkstr)
{
int ret;
@@ -114,7 +114,7 @@ void DoCharTest(char *formatstr, char param, char *checkstr)
}
}
-void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
+void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr)
{
int ret;
@@ -126,7 +126,7 @@ void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
}
}
-void DoNumTest(char *formatstr, int param, char *checkstr)
+void DoNumTest(const char *formatstr, int param, const char *checkstr)
{
int ret;
@@ -138,7 +138,7 @@ void DoNumTest(char *formatstr, int param, char *checkstr)
}
}
-void DoI64Test(char *formatstr, INT64 param, char *valuestr, char *checkstr1)
+void DoI64Test(const char *formatstr, INT64 param, char *valuestr, const char *checkstr1)
{
int ret;
@@ -150,8 +150,8 @@ void DoI64Test(char *formatstr, INT64 param, char *valuestr, char *checkstr1)
}
}
-void DoDoubleTest(char *formatstr, double param, char *checkstr1,
- char *checkstr2)
+void DoDoubleTest(const char *formatstr, double param, const char *checkstr1,
+ const char *checkstr2)
{
int ret;
@@ -163,8 +163,8 @@ void DoDoubleTest(char *formatstr, double param, char *checkstr1,
}
}
-void DoArgumentPrecTest(char *formatstr, int precision, void *param,
- char *paramstr, char *checkstr1, char *checkstr2)
+void DoArgumentPrecTest(const char *formatstr, int precision, void *param,
+ char *paramstr, const char *checkstr1, const char *checkstr2)
{
int ret;
@@ -176,8 +176,8 @@ void DoArgumentPrecTest(char *formatstr, int precision, void *param,
}
}
-void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param,
- char *checkstr1, char *checkstr2)
+void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param,
+ const char *checkstr1, const char *checkstr2)
{
int ret;
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test1/CMakeLists.txt
index 4f0872eccc..6861157c1b 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_vsprintf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp
index 2007fefc5b..2007fefc5b 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test10/CMakeLists.txt
index d32de01ba1..6f535a5098 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_vsprintf_test10
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test10/test10.cpp
index 791213fccc..791213fccc 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test10/test10.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test11/CMakeLists.txt
index ce67444c39..3fa628f77d 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_vsprintf_test11
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test11/test11.cpp
index e0af94981b..e0af94981b 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test11/test11.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test12/CMakeLists.txt
index fe6ccb8399..f34f76abc5 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_vsprintf_test12
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test12/test12.cpp
index f86ddcade8..f86ddcade8 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test12/test12.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test13/CMakeLists.txt
index 97fdf8cdd0..df23693f10 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test13.c
+ test13.cpp
)
add_executable(paltest_vsprintf_test13
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test13/test13.cpp
index 36e7825531..36e7825531 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test13/test13.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test13/test13.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test14/CMakeLists.txt
index 2851a8893e..394b5ab97c 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test14.c
+ test14.cpp
)
add_executable(paltest_vsprintf_test14
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test14/test14.cpp
index 360fafc37f..360fafc37f 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test14/test14.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test14/test14.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test15/CMakeLists.txt
index 6fb1d321b8..4793b45663 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test15.c
+ test15.cpp
)
add_executable(paltest_vsprintf_test15
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test15/test15.cpp
index a5b4c94226..a5b4c94226 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test15/test15.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test15/test15.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test16/CMakeLists.txt
index ccc21378fc..6a0a52ddf7 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test16.c
+ test16.cpp
)
add_executable(paltest_vsprintf_test16
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test16/test16.cpp
index a7258db9d6..a7258db9d6 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test16/test16.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test16/test16.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test17/CMakeLists.txt
index 4c9dcd986f..4e220dab77 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test17.c
+ test17.cpp
)
add_executable(paltest_vsprintf_test17
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test17/test17.cpp
index 0ad246a1ae..0ad246a1ae 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test17/test17.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test17/test17.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test18/CMakeLists.txt
index 2e8610d4a5..4dd68c2987 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test18/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test18.c
+ test18.cpp
)
add_executable(paltest_vsprintf_test18
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test18/test18.cpp
index 9a45305562..9a45305562 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test18/test18.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test18/test18.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test19/CMakeLists.txt
index 92e39ab597..3156a59a15 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test19/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test19.c
+ test19.cpp
)
add_executable(paltest_vsprintf_test19
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.c
deleted file mode 100644
index 18590ed51b..0000000000
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.c
+++ /dev/null
@@ -1,67 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test19.c
-**
-** Purpose: Test #19 for the vsprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../vsprintf.h"
-
-/*
- * Notes: memcmp is used, as is strlen.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if (PAL_Initialize(argc, argv) != 0)
- {
- return(FAIL);
- }
-
-
- DoArgumentPrecTest("%.*s", 2, "bar", "bar", "ba", "ba");
- DoArgumentPrecTest("%.*S", 2, convert("bar"), "bar", "ba", "ba");
- DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
- DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
- DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
- DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
- DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
- DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
- DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
- DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
-
-
- DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
- DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
- DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
- DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
- DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
- DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
- DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
- DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
- DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
- DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
- DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.cpp
new file mode 100644
index 0000000000..698ff36e35
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test19/test19.cpp
@@ -0,0 +1,67 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test19.c
+**
+** Purpose: Test #19 for the vsprintf function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../vsprintf.h"
+
+/*
+ * Notes: memcmp is used, as is strlen.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ if (PAL_Initialize(argc, argv) != 0)
+ {
+ return(FAIL);
+ }
+
+
+ DoArgumentPrecTest("%.*s", 2, (void*)"bar", "bar", "ba", "ba");
+ DoArgumentPrecTest("%.*S", 2, (void*)convert("bar"), "bar", "ba", "ba");
+ DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*C", 4, (void*)'a', "a", "a", "a");
+ DoArgumentPrecTest("%.*d", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*d", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*i", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*i", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*o", 1, (void*)42, "42", "52", "52");
+ DoArgumentPrecTest("%.*o", 3, (void*)42, "42", "052", "052");
+ DoArgumentPrecTest("%.*u", 1, (void*)42, "42", "42", "42");
+ DoArgumentPrecTest("%.*u", 3, (void*)42, "42", "042", "042");
+ DoArgumentPrecTest("%.*x", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*x", 3, (void*)0x42, "0x42", "042", "042");
+ DoArgumentPrecTest("%.*X", 1, (void*)0x42, "0x42", "42", "42");
+ DoArgumentPrecTest("%.*X", 3, (void*)0x42, "0x42", "042", "042");
+
+
+ DoArgumentPrecDoubleTest("%.*e", 1, 2.01, "2.0e+000", "2.0e+00");
+ DoArgumentPrecDoubleTest("%.*e", 3, 2.01, "2.010e+000", "2.010e+00");
+ DoArgumentPrecDoubleTest("%.*E", 1, 2.01, "2.0E+000", "2.0E+00");
+ DoArgumentPrecDoubleTest("%.*E", 3, 2.01, "2.010E+000", "2.010E+00");
+ DoArgumentPrecDoubleTest("%.*f", 1, 2.01, "2.0", "2.0");
+ DoArgumentPrecDoubleTest("%.*f", 3, 2.01, "2.010", "2.010");
+ DoArgumentPrecDoubleTest("%.*g", 1, 256.01, "3e+002", "3e+02");
+ DoArgumentPrecDoubleTest("%.*g", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*g", 6, 256.01, "256.01", "256.01");
+ DoArgumentPrecDoubleTest("%.*G", 1, 256.01, "3E+002", "3E+02");
+ DoArgumentPrecDoubleTest("%.*G", 3, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 4, 256.01, "256", "256");
+ DoArgumentPrecDoubleTest("%.*G", 6, 256.01, "256.01", "256.01");
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test2/CMakeLists.txt
index 2308bc2573..210224f0f1 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_vsprintf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test2/test2.cpp
index fbd4b41068..fbd4b41068 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test3/CMakeLists.txt
index aef24171fc..5581051f9f 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_vsprintf_test3
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test3/test3.cpp
index 742370ebe9..742370ebe9 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test4/CMakeLists.txt
index 9570255475..88817fcffb 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_vsprintf_test4
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test4/test4.cpp
index dc43a9e2c7..dc43a9e2c7 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test5/CMakeLists.txt
index 34a3e6243f..6d14bf76bf 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_vsprintf_test5
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test5/test5.cpp
index e630d8863b..e630d8863b 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test6/CMakeLists.txt
index dccca0b2b7..606fe3b965 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_vsprintf_test6
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test6/test6.cpp
index 0d38a3a114..0d38a3a114 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test7/CMakeLists.txt
index 7f18de056e..2dee276968 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_vsprintf_test7
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test7/test7.cpp
index c9f87d4343..c9f87d4343 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test8/CMakeLists.txt
index 34c92e1045..8dac76fc3a 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_vsprintf_test8
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test8/test8.cpp
index e741d1da8b..e741d1da8b 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test8/test8.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vsprintf/test9/CMakeLists.txt
index 1fe177de95..95f0faad87 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_vsprintf_test9
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/vsprintf/test9/test9.cpp
index e1f7c84195..e1f7c84195 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/test9/test9.c
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h b/src/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h
index 10648d896f..7b04a777ca 100644
--- a/src/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/vsprintf/vsprintf.h
@@ -26,7 +26,7 @@ int testvsp(char* buf, const char* format, ...)
return (retVal);
}
-void DoStrTest(char *formatstr, char* param, char *checkstr)
+void DoStrTest(const char *formatstr, char* param, const char *checkstr)
{
char buf[256] = { 0 };
@@ -39,7 +39,7 @@ void DoStrTest(char *formatstr, char* param, char *checkstr)
}
}
-void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
+void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr)
{
char buf[256] = { 0 };
@@ -53,7 +53,7 @@ void DoWStrTest(char *formatstr, WCHAR* param, char *checkstr)
}
-void DoCharTest(char *formatstr, char param, char *checkstr)
+void DoCharTest(const char *formatstr, char param, const char *checkstr)
{
char buf[256] = { 0 };
@@ -66,7 +66,7 @@ void DoCharTest(char *formatstr, char param, char *checkstr)
}
}
-void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
+void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr)
{
char buf[256] = { 0 };
@@ -79,7 +79,7 @@ void DoWCharTest(char *formatstr, WCHAR param, char *checkstr)
}
}
-void DoNumTest(char *formatstr, int value, char *checkstr)
+void DoNumTest(const char *formatstr, int value, const char *checkstr)
{
char buf[256] = { 0 };
@@ -92,7 +92,7 @@ void DoNumTest(char *formatstr, int value, char *checkstr)
}
}
-void DoI64Test(char *formatstr, INT64 value, char *valuestr, char *checkstr)
+void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *checkstr)
{
char buf[256] = { 0 };
@@ -104,7 +104,7 @@ void DoI64Test(char *formatstr, INT64 value, char *valuestr, char *checkstr)
valuestr, formatstr, checkstr, buf);
}
}
-void DoDoubleTest(char *formatstr, double value, char *checkstr1, char
+void DoDoubleTest(const char *formatstr, double value, const char *checkstr1, char
*checkstr2)
{
char buf[256] = { 0 };
@@ -119,8 +119,8 @@ void DoDoubleTest(char *formatstr, double value, char *checkstr1, char
}
}
/*FROM TEST 9*/
-void DoArgumentPrecTest(char *formatstr, int precision, void *param,
- char *paramstr, char *checkstr1, char *checkstr2)
+void DoArgumentPrecTest(const char *formatstr, int precision, void *param,
+ char *paramstr, const char *checkstr1, const char *checkstr2)
{
char buf[256];
@@ -135,8 +135,8 @@ void DoArgumentPrecTest(char *formatstr, int precision, void *param,
}
-void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param,
- char *checkstr1, char *checkstr2)
+void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param,
+ const char *checkstr1, const char *checkstr2)
{
char buf[256];
@@ -150,8 +150,8 @@ void DoArgumentPrecDoubleTest(char *formatstr, int precision, double param,
}
}
/*FROM TEST4*/
-void DoPointerTest(char *formatstr, void* param, char* paramstr,
- char *checkstr1)
+void DoPointerTest(const char *formatstr, void* param, char* paramstr,
+ const char *checkstr1)
{
char buf[256] = { 0 };
@@ -164,8 +164,8 @@ void DoPointerTest(char *formatstr, void* param, char* paramstr,
}
}
-void DoI64DoubleTest(char *formatstr, INT64 value, char *valuestr,
- char *checkstr1)
+void DoI64DoubleTest(const char *formatstr, INT64 value, char *valuestr,
+ const char *checkstr1)
{
char buf[256] = { 0 };
@@ -178,7 +178,7 @@ void DoI64DoubleTest(char *formatstr, INT64 value, char *valuestr,
}
}
-void DoTest(char *formatstr, int param, char *checkstr)
+void DoTest(const char *formatstr, int param, const char *checkstr)
{
char buf[256] = { 0 };
int n = -1;
@@ -196,7 +196,7 @@ void DoTest(char *formatstr, int param, char *checkstr)
}
}
-void DoShortTest(char *formatstr, int param, char *checkstr)
+void DoShortTest(const char *formatstr, int param, const char *checkstr)
{
char buf[256] = { 0 };
short int n = -1;
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test1/CMakeLists.txt
index 97fbeb4e28..1d6233744a 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_vswprintf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp
index d386ce104f..d386ce104f 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test10/CMakeLists.txt
index 06c11f68ca..e5301427eb 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_vswprintf_test10
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test10/test10.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test10/test10.cpp
index 7f316e28f6..7f316e28f6 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test10/test10.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test11/CMakeLists.txt
index 5237ba4e1d..1cfadb9300 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_vswprintf_test11
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test11/test11.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test11/test11.cpp
index 608069f829..608069f829 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test11/test11.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test12/CMakeLists.txt
index 26199c3dcc..f5a582a970 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_vswprintf_test12
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test12/test12.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test12/test12.cpp
index 36b203853a..36b203853a 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test12/test12.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test13/CMakeLists.txt
index d0acd98d64..5571d7336f 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test13.c
+ test13.cpp
)
add_executable(paltest_vswprintf_test13
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test13/test13.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test13/test13.cpp
index 63dc36a960..63dc36a960 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test13/test13.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test13/test13.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test14/CMakeLists.txt
index 06c12674a4..234029ead4 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test14.c
+ test14.cpp
)
add_executable(paltest_vswprintf_test14
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test14/test14.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test14/test14.cpp
index bb4ab16a54..bb4ab16a54 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test14/test14.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test14/test14.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test15/CMakeLists.txt
index 05dc41b0d8..b705268bc7 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test15.c
+ test15.cpp
)
add_executable(paltest_vswprintf_test15
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test15/test15.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test15/test15.cpp
index 6296220c4e..6296220c4e 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test15/test15.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test15/test15.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test16/CMakeLists.txt
index 3c42755043..da296bcf32 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test16.c
+ test16.cpp
)
add_executable(paltest_vswprintf_test16
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test16/test16.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test16/test16.cpp
index 3a2059a491..3a2059a491 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test16/test16.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test16/test16.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test17/CMakeLists.txt
index b94c466d5f..02234c1672 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test17.c
+ test17.cpp
)
add_executable(paltest_vswprintf_test17
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test17/test17.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test17/test17.cpp
index 95e3bd9995..95e3bd9995 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test17/test17.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test17/test17.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test18/CMakeLists.txt
index 57cc8ccb03..0c0e5b566b 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test18/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test18.c
+ test18.cpp
)
add_executable(paltest_vswprintf_test18
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test18/test18.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test18/test18.cpp
index ae7ae4c44b..ae7ae4c44b 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test18/test18.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test18/test18.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test19/CMakeLists.txt
index 2187b58727..066db8ab84 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test19/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test19.c
+ test19.cpp
)
add_executable(paltest_vswprintf_test19
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.c
deleted file mode 100644
index c00185be6d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.c
+++ /dev/null
@@ -1,137 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test18.c
-**
-** Purpose: Test #18 for the vswprintf function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-#include "../vswprintf.h"
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with wcslen */
-
-#define DOTEST(a,b,c,d,e) DoTest(a,b,(void*)c,d,e)
-
-void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
- WCHAR *paramstr, WCHAR *checkstr1, WCHAR *checkstr2)
-{
- WCHAR buf[256];
-
- testvswp(buf, formatstr, precision, param);
- if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
- memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
- {
- Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- paramstr,
- convertC(formatstr),
- precision,
- convertC(checkstr1),
- convertC(checkstr2),
- convertC(buf));
- }
-}
-void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param,
- WCHAR *checkstr1, WCHAR *checkstr2)
-{
- WCHAR buf[256];
-
- testvswp(buf, formatstr, precision, param);
- if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
- memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
- {
- Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
- "Expected \"%s\" or \"%s\", got \"%s\".\n",
- param, convertC(formatstr),
- precision,
- convertC(checkstr1),
- convertC(checkstr2),
- convertC(buf));
- }
-}
-
-/*
- * Uses memcmp & wcslen
- */
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if (PAL_Initialize(argc, argv) != 0)
- return(FAIL);
-
- DoArgumentPrecTest(convert("%.*s"), 2, convert("bar"), convert("bar"),
- convert("ba"), convert("ba"));
- DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', convert("a"),
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', convert("a"),
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', convert("a"),
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', convert("a"),
- convert("a"), convert("a"));
- DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, convert("42"),
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, convert("42"),
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, convert("42"),
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, convert("42"),
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, convert("42"),
- convert("52"), convert("52"));
- DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, convert("42"),
- convert("052"), convert("052"));
- DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, convert("42"),
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, convert("42"),
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, convert("0x42"),
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, convert("0x42"),
- convert("042"), convert("042"));
- DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, convert("0x42"),
- convert("42"), convert("42"));
- DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, convert("0x42"),
- convert("042"), convert("042"));
-
-
- DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, convert("2.0e+000"),
- convert("2.0e+00"));
- DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, convert("2.010e+000"),
- convert("2.010e+00"));
- DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, convert("2.0E+000"),
- convert("2.0E+00"));
- DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, convert("2.010E+000"),
- convert("2.010E+00"));
- DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, convert("2.0"),
- convert("2.0"));
- DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, convert("2.010"),
- convert("2.010"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, convert("3e+002"),
- convert("3e+02"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, convert("256.01"),
- convert("256.01"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, convert("3E+002"),
- convert("3E+02"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, convert("256"),
- convert("256"));
- DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, convert("256.01"),
- convert("256.01"));
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp
new file mode 100644
index 0000000000..1d1c5656b2
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test19/test19.cpp
@@ -0,0 +1,137 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test18.c
+**
+** Purpose: Test #18 for the vswprintf function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+#include "../vswprintf.h"
+
+/* memcmp is used to verify the results, so this test is dependent on it. */
+/* ditto with wcslen */
+
+#define DOTEST(a,b,c,d,e) DoTest(a,b,(void*)c,d,e)
+
+void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
+ WCHAR *paramstr, WCHAR *checkstr1, WCHAR *checkstr2)
+{
+ WCHAR buf[256];
+
+ testvswp(buf, formatstr, precision, param);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
+ memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %s into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ paramstr,
+ convertC(formatstr),
+ precision,
+ convertC(checkstr1),
+ convertC(checkstr2),
+ convertC(buf));
+ }
+}
+void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param,
+ WCHAR *checkstr1, WCHAR *checkstr2)
+{
+ WCHAR buf[256];
+
+ testvswp(buf, formatstr, precision, param);
+ if (memcmp(buf, checkstr1, wcslen(checkstr1) + 2) != 0 &&
+ memcmp(buf, checkstr2, wcslen(checkstr2) + 2) != 0)
+ {
+ Fail("ERROR: failed to insert %f into \"%s\" with precision %d\n"
+ "Expected \"%s\" or \"%s\", got \"%s\".\n",
+ param, convertC(formatstr),
+ precision,
+ convertC(checkstr1),
+ convertC(checkstr2),
+ convertC(buf));
+ }
+}
+
+/*
+ * Uses memcmp & wcslen
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ if (PAL_Initialize(argc, argv) != 0)
+ return(FAIL);
+
+ DoArgumentPrecTest(convert("%.*s"), 2, (void*)convert("bar"), convert("bar"),
+ convert("ba"), convert("ba"));
+ DoArgumentPrecTest(convert("%.*c"), 0, (void*)'a', convert("a"),
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*c"), 4, (void*)'a', convert("a"),
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*C"), 0, (void*)'a', convert("a"),
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*C"), 4, (void*)'a', convert("a"),
+ convert("a"), convert("a"));
+ DoArgumentPrecTest(convert("%.*d"), 1, (void*)42, convert("42"),
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*d"), 3, (void*)42, convert("42"),
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*i"), 1, (void*)42, convert("42"),
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*i"), 3, (void*)42, convert("42"),
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*o"), 1, (void*)42, convert("42"),
+ convert("52"), convert("52"));
+ DoArgumentPrecTest(convert("%.*o"), 3, (void*)42, convert("42"),
+ convert("052"), convert("052"));
+ DoArgumentPrecTest(convert("%.*u"), 1, (void*)42, convert("42"),
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*u"), 3, (void*)42, convert("42"),
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*x"), 1, (void*)0x42, convert("0x42"),
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*x"), 3, (void*)0x42, convert("0x42"),
+ convert("042"), convert("042"));
+ DoArgumentPrecTest(convert("%.*X"), 1, (void*)0x42, convert("0x42"),
+ convert("42"), convert("42"));
+ DoArgumentPrecTest(convert("%.*X"), 3, (void*)0x42, convert("0x42"),
+ convert("042"), convert("042"));
+
+
+ DoArgumentPrecDoubleTest(convert("%.*e"), 1, 2.01, convert("2.0e+000"),
+ convert("2.0e+00"));
+ DoArgumentPrecDoubleTest(convert("%.*e"), 3, 2.01, convert("2.010e+000"),
+ convert("2.010e+00"));
+ DoArgumentPrecDoubleTest(convert("%.*E"), 1, 2.01, convert("2.0E+000"),
+ convert("2.0E+00"));
+ DoArgumentPrecDoubleTest(convert("%.*E"), 3, 2.01, convert("2.010E+000"),
+ convert("2.010E+00"));
+ DoArgumentPrecDoubleTest(convert("%.*f"), 1, 2.01, convert("2.0"),
+ convert("2.0"));
+ DoArgumentPrecDoubleTest(convert("%.*f"), 3, 2.01, convert("2.010"),
+ convert("2.010"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 1, 256.01, convert("3e+002"),
+ convert("3e+02"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 3, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 4, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*g"), 6, 256.01, convert("256.01"),
+ convert("256.01"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 1, 256.01, convert("3E+002"),
+ convert("3E+02"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 3, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 4, 256.01, convert("256"),
+ convert("256"));
+ DoArgumentPrecDoubleTest(convert("%.*G"), 6, 256.01, convert("256.01"),
+ convert("256.01"));
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test2/CMakeLists.txt
index 295448cb0c..abfceca9e2 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_vswprintf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test2/test2.cpp
index 491d99f0cf..491d99f0cf 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test3/CMakeLists.txt
index 1fb6272ae7..7f4798dbc5 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_vswprintf_test3
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test3/test3.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test3/test3.cpp
index 1eb0b65ebe..1eb0b65ebe 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test4/CMakeLists.txt
index cae0806e03..05701ac179 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_vswprintf_test4
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp
index 5c9047b5a7..5c9047b5a7 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test5/CMakeLists.txt
index 7c480455ed..888ce27d22 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_vswprintf_test5
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test5/test5.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test5/test5.cpp
index 42146c8be7..42146c8be7 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test6/CMakeLists.txt
index d7de580853..bfbb17ccef 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_vswprintf_test6
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test6/test6.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test6/test6.cpp
index 51e99267a1..51e99267a1 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test7/CMakeLists.txt
index eb07ee2cae..8b980586bc 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_vswprintf_test7
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test7/test7.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test7/test7.cpp
index 6037cb0fe7..6037cb0fe7 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test7/test7.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test8/CMakeLists.txt
index ed35ea8dd0..07ba473844 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_vswprintf_test8
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test8/test8.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test8/test8.cpp
index baba524650..baba524650 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test8/test8.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/vswprintf/test9/CMakeLists.txt
index 7098da31d0..11c77787e9 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_vswprintf_test9
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/test9/test9.c b/src/pal/tests/palsuite/c_runtime/vswprintf/test9/test9.cpp
index 5de004f5ed..5de004f5ed 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/test9/test9.c
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h b/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h
index a79c9bb7a9..37a379212e 100644
--- a/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/vswprintf/vswprintf.h
@@ -27,7 +27,7 @@ int testvswp(wchar_t* buf, const wchar_t* format, ...)
return( retVal);
}
-void DoWStrTest(WCHAR *formatstr, WCHAR *param, WCHAR *checkstr)
+void DoWStrTest(const WCHAR *formatstr, WCHAR *param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -42,7 +42,7 @@ void DoWStrTest(WCHAR *formatstr, WCHAR *param, WCHAR *checkstr)
}
}
-void DoStrTest(WCHAR *formatstr, char *param, WCHAR *checkstr)
+void DoStrTest(const WCHAR *formatstr, char *param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -57,7 +57,7 @@ void DoStrTest(WCHAR *formatstr, char *param, WCHAR *checkstr)
}
}
-void DoCharTest(WCHAR *formatstr, char param, WCHAR *checkstr)
+void DoCharTest(const WCHAR *formatstr, char param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -71,7 +71,7 @@ void DoCharTest(WCHAR *formatstr, char param, WCHAR *checkstr)
}
}
-void DoWCharTest(WCHAR *formatstr, WCHAR param, WCHAR *checkstr)
+void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -85,7 +85,7 @@ void DoWCharTest(WCHAR *formatstr, WCHAR param, WCHAR *checkstr)
}
}
-void DoNumTest(WCHAR *formatstr, int value, WCHAR*checkstr)
+void DoNumTest(const WCHAR *formatstr, int value, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -98,7 +98,7 @@ void DoNumTest(WCHAR *formatstr, int value, WCHAR*checkstr)
}
}
-void DoI64NumTest(WCHAR *formatstr, INT64 value, char *valuestr, WCHAR*checkstr)
+void DoI64NumTest(const WCHAR *formatstr, INT64 value, char *valuestr, const WCHAR *checkstr)
{
WCHAR buf[256] = { 0 };
@@ -110,7 +110,7 @@ void DoI64NumTest(WCHAR *formatstr, INT64 value, char *valuestr, WCHAR*checkstr)
convertC(checkstr), convertC(buf));
}
}
-void DoDoubleTest(WCHAR *formatstr, double value, WCHAR *checkstr1, WCHAR
+void DoDoubleTest(const WCHAR *formatstr, double value, const WCHAR *checkstr1, WCHAR
*checkstr2)
{
WCHAR buf[256] = { 0 };
diff --git a/src/pal/tests/palsuite/c_runtime/wcscat/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcscat/test1/CMakeLists.txt
index 34dfee01bd..815c585de4 100644
--- a/src/pal/tests/palsuite/c_runtime/wcscat/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcscat/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcscat_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.c
deleted file mode 100644
index 789eebf5a3..0000000000
--- a/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.c
+++ /dev/null
@@ -1,71 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose:
-** Test to that wcscat correctly concatanates wide strings, including placing
-** null pointers.
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-
-/*
- * Notes: uses memcmp and the (pal) sprintf
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR dest[80];
- WCHAR test[] = {'f','o','o',' ','b','a','r',' ','b','a','z',0};
- WCHAR str1[] = {'f','o','o',' ',0};
- WCHAR str2[] = {'b','a','r',' ',0};
- WCHAR str3[] = {'b','a','z',0};
- WCHAR *ptr;
- char buffer[256];
-
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
-
- dest[0] = 0;
-
- ptr = wcscat(dest, str1);
- if (ptr != dest)
- {
- Fail("ERROR: Expected wcscat to return ptr to %p, got %p", dest, ptr);
- }
-
- ptr = wcscat(dest, str2);
- if (ptr != dest)
- {
- Fail("ERROR: Expected wcscat to return ptr to %p, got %p", dest, ptr);
- }
-
- ptr = wcscat(dest, str3);
- if (ptr != dest)
- {
- Fail("ERROR: Expected wcscat to return ptr to %p, got %p", dest, ptr);
- }
-
- if (memcmp(dest, test, sizeof(test)) != 0)
- {
- sprintf(buffer, "%S", dest);
- Fail("ERROR: Expected wcscat to give \"%s\", got \"%s\"\n",
- "foo bar baz", buffer);
- }
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp
new file mode 100644
index 0000000000..e9a79d3880
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp
@@ -0,0 +1,71 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose:
+** Test to that wcscat correctly concatanates wide strings, including placing
+** null pointers.
+**
+**
+**==========================================================================*/
+
+
+
+#include <palsuite.h>
+
+/*
+ * Notes: uses memcmp and the (pal) sprintf_s
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR dest[80];
+ WCHAR test[] = {'f','o','o',' ','b','a','r',' ','b','a','z',0};
+ WCHAR str1[] = {'f','o','o',' ',0};
+ WCHAR str2[] = {'b','a','r',' ',0};
+ WCHAR str3[] = {'b','a','z',0};
+ WCHAR *ptr;
+ char buffer[256];
+
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+
+ dest[0] = 0;
+
+ ptr = wcscat(dest, str1);
+ if (ptr != dest)
+ {
+ Fail("ERROR: Expected wcscat to return ptr to %p, got %p", dest, ptr);
+ }
+
+ ptr = wcscat(dest, str2);
+ if (ptr != dest)
+ {
+ Fail("ERROR: Expected wcscat to return ptr to %p, got %p", dest, ptr);
+ }
+
+ ptr = wcscat(dest, str3);
+ if (ptr != dest)
+ {
+ Fail("ERROR: Expected wcscat to return ptr to %p, got %p", dest, ptr);
+ }
+
+ if (memcmp(dest, test, sizeof(test)) != 0)
+ {
+ sprintf_s(buffer, _countof(buffer), "%S", dest);
+ Fail("ERROR: Expected wcscat to give \"%s\", got \"%s\"\n",
+ "foo bar baz", buffer);
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/c_runtime/wcschr/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcschr/test1/CMakeLists.txt
index 542d70b7e6..9cf0a918a0 100644
--- a/src/pal/tests/palsuite/c_runtime/wcschr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcschr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcschr_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcschr/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcschr/test1/test1.cpp
index a4963672f8..a4963672f8 100644
--- a/src/pal/tests/palsuite/c_runtime/wcschr/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcschr/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcscmp/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcscmp/test1/CMakeLists.txt
index 009e48e1ba..98c05352f3 100644
--- a/src/pal/tests/palsuite/c_runtime/wcscmp/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcscmp/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcscmp_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcscmp/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcscmp/test1/test1.cpp
index 1c38dd6d58..1c38dd6d58 100644
--- a/src/pal/tests/palsuite/c_runtime/wcscmp/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcscmp/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcscpy/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcscpy/test1/CMakeLists.txt
index 5f21b829ee..872b2dec5e 100644
--- a/src/pal/tests/palsuite/c_runtime/wcscpy/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcscpy/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcscpy_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.c
deleted file mode 100644
index 4e45c86516..0000000000
--- a/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.c
+++ /dev/null
@@ -1,47 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test1.c
-**
-** Purpose: Tests that wcscpy correctly copies a null-terminated wide string.
-**
-**
-**==========================================================================*/
-
-
-#include <palsuite.h>
-
-/*
- * Notes: uses memcmp and sprintf.
- */
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR str[] = {'f','o','o',0,'b','a','r',0};
- WCHAR dest[80];
- WCHAR result[] = {'f','o','o',0};
- WCHAR *ret;
- char buffer[256];
-
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
-
- ret = wcscpy(dest, str);
-
- if (ret != dest || memcmp(dest, result, sizeof(result)) != 0)
- {
- sprintf(buffer, "%S", dest);
- Fail("Expected wcscpy to give \"%s\" with a return value of %p, got \"%s\" "
- "with a return value of %p.\n", "foo", dest, buffer, ret);
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp
new file mode 100644
index 0000000000..2ecafa8307
--- /dev/null
+++ b/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test1.c
+**
+** Purpose: Tests that wcscpy correctly copies a null-terminated wide string.
+**
+**
+**==========================================================================*/
+
+
+#include <palsuite.h>
+
+/*
+ * Notes: uses memcmp and sprintf_s.
+ */
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR str[] = {'f','o','o',0,'b','a','r',0};
+ WCHAR dest[80];
+ WCHAR result[] = {'f','o','o',0};
+ WCHAR *ret;
+ char buffer[256];
+
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+
+ ret = wcscpy(dest, str);
+
+ if (ret != dest || memcmp(dest, result, sizeof(result)) != 0)
+ {
+ sprintf_s(buffer, _countof(buffer), "%S", dest);
+ Fail("Expected wcscpy to give \"%s\" with a return value of %p, got \"%s\" "
+ "with a return value of %p.\n", "foo", dest, buffer, ret);
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/c_runtime/wcslen/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcslen/test1/CMakeLists.txt
index de0f1c22d3..b641a830f5 100644
--- a/src/pal/tests/palsuite/c_runtime/wcslen/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcslen/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcslen_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcslen/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcslen/test1/test1.cpp
index 17d0327628..17d0327628 100644
--- a/src/pal/tests/palsuite/c_runtime/wcslen/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcslen/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcsncat/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcsncat/test1/CMakeLists.txt
index 12c286a43a..e90e2b7bc4 100644
--- a/src/pal/tests/palsuite/c_runtime/wcsncat/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcsncat/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcsncat_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcsncat/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcsncat/test1/test1.cpp
index 0cd5c3e15a..0cd5c3e15a 100644
--- a/src/pal/tests/palsuite/c_runtime/wcsncat/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcsncat/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/CMakeLists.txt
index 56c9b25806..f5511a86c6 100644
--- a/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcsncmp_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/test1.cpp
index 4e4488f5a1..4e4488f5a1 100644
--- a/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcsncmp/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/CMakeLists.txt
index 1c1d70ba04..a7254a709c 100644
--- a/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcsncpy_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/test1.cpp
index 50d97b0e9c..50d97b0e9c 100644
--- a/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcsncpy/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/CMakeLists.txt
index c6a3f87d75..14c1fe83a4 100644
--- a/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcspbrk_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/test1.cpp
index b0432f7819..b0432f7819 100644
--- a/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcspbrk/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/CMakeLists.txt
index 80513af1af..abdd6d56d2 100644
--- a/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcsrchr_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/test1.cpp
index ae8765776e..ae8765776e 100644
--- a/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcsrchr/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcsstr/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcsstr/test1/CMakeLists.txt
index e42619344d..0e1e0b47b0 100644
--- a/src/pal/tests/palsuite/c_runtime/wcsstr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcsstr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcsstr_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcsstr/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcsstr/test1/test1.cpp
index 8296a74983..8296a74983 100644
--- a/src/pal/tests/palsuite/c_runtime/wcsstr/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcsstr/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstod/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstod/test1/CMakeLists.txt
index cf585d051a..cca01ca964 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstod/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstod/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcstod_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcstod/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcstod/test1/test1.cpp
index e41e92e961..e41e92e961 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstod/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstod/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstod/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstod/test2/CMakeLists.txt
index 43d5bf8a40..ae7450891e 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstod/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstod/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_wcstod_test2
diff --git a/src/pal/tests/palsuite/c_runtime/wcstod/test2/test2.c b/src/pal/tests/palsuite/c_runtime/wcstod/test2/test2.cpp
index 8f9b5cbf58..8f9b5cbf58 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstod/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstod/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstok/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstok/test1/CMakeLists.txt
index 863f5d8c29..6b5bed9552 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstok/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstok/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcstok_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcstok/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcstok/test1/test1.cpp
index 76d7dc02b3..76d7dc02b3 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstok/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstok/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstol/test1/CMakeLists.txt
index 25e96e7de0..f76018fca3 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcstol_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcstol/test1/test1.cpp
index d84ba66adc..d84ba66adc 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstol/test2/CMakeLists.txt
index ea33ec8c7e..8dc2ab6b65 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_wcstol_test2
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test2/test2.c b/src/pal/tests/palsuite/c_runtime/wcstol/test2/test2.cpp
index 58309be6b4..58309be6b4 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstol/test3/CMakeLists.txt
index 509feca08c..310f97d6dc 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_wcstol_test3
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test3/test3.c b/src/pal/tests/palsuite/c_runtime/wcstol/test3/test3.cpp
index 8b5ce6943d..8b5ce6943d 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstol/test4/CMakeLists.txt
index 043c562102..23928aa704 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_wcstol_test4
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test4/test4.c b/src/pal/tests/palsuite/c_runtime/wcstol/test4/test4.cpp
index a5e65946e9..a5e65946e9 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstol/test5/CMakeLists.txt
index c887369880..16c709ffa0 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_wcstol_test5
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test5/test5.c b/src/pal/tests/palsuite/c_runtime/wcstol/test5/test5.cpp
index 62f0a895a6..62f0a895a6 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstol/test6/CMakeLists.txt
index d328161f39..80ccaf609b 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_wcstol_test6
diff --git a/src/pal/tests/palsuite/c_runtime/wcstol/test6/test6.c b/src/pal/tests/palsuite/c_runtime/wcstol/test6/test6.cpp
index 14f6208231..14f6208231 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstol/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstol/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstoul/test1/CMakeLists.txt
index b24523e93b..58f002ab32 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wcstoul_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wcstoul/test1/test1.cpp
index 5274905e30..5274905e30 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstoul/test2/CMakeLists.txt
index e262078e34..2c8d012310 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_wcstoul_test2
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test2/test2.c b/src/pal/tests/palsuite/c_runtime/wcstoul/test2/test2.cpp
index 2ab2dbf5d1..2ab2dbf5d1 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstoul/test3/CMakeLists.txt
index aae268ac59..353df07f52 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_wcstoul_test3
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test3/test3.c b/src/pal/tests/palsuite/c_runtime/wcstoul/test3/test3.cpp
index eac46615e2..eac46615e2 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test3/test3.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstoul/test4/CMakeLists.txt
index bd8073023f..e1e7d55420 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_wcstoul_test4
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test4/test4.c b/src/pal/tests/palsuite/c_runtime/wcstoul/test4/test4.cpp
index 0261da4275..0261da4275 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test4/test4.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstoul/test5/CMakeLists.txt
index 1451e6ad57..9e83c6074c 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_wcstoul_test5
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test5/test5.c b/src/pal/tests/palsuite/c_runtime/wcstoul/test5/test5.cpp
index 00287cf7f4..00287cf7f4 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test5/test5.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wcstoul/test6/CMakeLists.txt
index 15518bdcf8..8352d0cbbe 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_wcstoul_test6
diff --git a/src/pal/tests/palsuite/c_runtime/wcstoul/test6/test6.c b/src/pal/tests/palsuite/c_runtime/wcstoul/test6/test6.cpp
index 28397ec73f..28397ec73f 100644
--- a/src/pal/tests/palsuite/c_runtime/wcstoul/test6/test6.c
+++ b/src/pal/tests/palsuite/c_runtime/wcstoul/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wprintf/test1/CMakeLists.txt
index 701bbe4160..f95fc12ea1 100644
--- a/src/pal/tests/palsuite/c_runtime/wprintf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wprintf/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_wprintf_test1
diff --git a/src/pal/tests/palsuite/c_runtime/wprintf/test1/test1.c b/src/pal/tests/palsuite/c_runtime/wprintf/test1/test1.cpp
index d99dc8cf93..d99dc8cf93 100644
--- a/src/pal/tests/palsuite/c_runtime/wprintf/test1/test1.c
+++ b/src/pal/tests/palsuite/c_runtime/wprintf/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/wprintf/test2/CMakeLists.txt
index 55c3d11913..325e8046d5 100644
--- a/src/pal/tests/palsuite/c_runtime/wprintf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/wprintf/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_wprintf_test2
diff --git a/src/pal/tests/palsuite/c_runtime/wprintf/test2/test2.c b/src/pal/tests/palsuite/c_runtime/wprintf/test2/test2.cpp
index 254e98a394..254e98a394 100644
--- a/src/pal/tests/palsuite/c_runtime/wprintf/test2/test2.c
+++ b/src/pal/tests/palsuite/c_runtime/wprintf/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/c_runtime/wprintf/wprintf.h b/src/pal/tests/palsuite/c_runtime/wprintf/wprintf.h
index 7d3caf1b02..3a96248c35 100644
--- a/src/pal/tests/palsuite/c_runtime/wprintf/wprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/wprintf/wprintf.h
@@ -14,7 +14,7 @@
#ifndef __wprintf_H__
#define __wprintf_H__
-void DoStrTest(WCHAR *formatstr, WCHAR* param, WCHAR *checkstr)
+void DoStrTest(const WCHAR *formatstr, const WCHAR *param, const WCHAR *checkstr)
{
int ret;
@@ -27,8 +27,8 @@ void DoStrTest(WCHAR *formatstr, WCHAR* param, WCHAR *checkstr)
}
-void DoPointerTest(WCHAR *formatstr, void* param, WCHAR* paramstr,
- WCHAR *checkstr1)
+void DoPointerTest(const WCHAR *formatstr, void* param, WCHAR* paramstr,
+ const WCHAR *checkstr1)
{
int ret;
@@ -40,7 +40,7 @@ void DoPointerTest(WCHAR *formatstr, void* param, WCHAR* paramstr,
}
}
-void DoCountTest(WCHAR *formatstr, int param, WCHAR *checkstr)
+void DoCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr)
{
int ret;
int n = -1;
@@ -59,7 +59,7 @@ void DoCountTest(WCHAR *formatstr, int param, WCHAR *checkstr)
}
}
-void DoShortCountTest(WCHAR *formatstr, int param, WCHAR *checkstr)
+void DoShortCountTest(const WCHAR *formatstr, int param, const WCHAR *checkstr)
{
int ret;
short int n = -1;
@@ -79,7 +79,7 @@ void DoShortCountTest(WCHAR *formatstr, int param, WCHAR *checkstr)
}
-void DoCharTest(WCHAR *formatstr, WCHAR param, WCHAR *checkstr)
+void DoCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr)
{
int ret;
@@ -91,7 +91,7 @@ void DoCharTest(WCHAR *formatstr, WCHAR param, WCHAR *checkstr)
}
}
-void DoWCharTest(WCHAR *formatstr, WCHAR param, WCHAR *checkstr)
+void DoWCharTest(const WCHAR *formatstr, WCHAR param, const WCHAR *checkstr)
{
int ret;
@@ -103,7 +103,7 @@ void DoWCharTest(WCHAR *formatstr, WCHAR param, WCHAR *checkstr)
}
}
-void DoNumTest(WCHAR *formatstr, int param, WCHAR *checkstr)
+void DoNumTest(const WCHAR *formatstr, int param, const WCHAR *checkstr)
{
int ret;
@@ -115,8 +115,8 @@ void DoNumTest(WCHAR *formatstr, int param, WCHAR *checkstr)
}
}
-void DoI64Test(WCHAR *formatstr, INT64 param, WCHAR *valuestr,
- WCHAR *checkstr1)
+void DoI64Test(const WCHAR *formatstr, INT64 param, const WCHAR *valuestr,
+ const WCHAR *checkstr1)
{
int ret;
@@ -128,8 +128,8 @@ void DoI64Test(WCHAR *formatstr, INT64 param, WCHAR *valuestr,
}
}
-void DoDoubleTest(WCHAR *formatstr, double param,
- WCHAR *checkstr1, WCHAR *checkstr2)
+void DoDoubleTest(const WCHAR *formatstr, double param,
+ const WCHAR *checkstr1, const WCHAR *checkstr2)
{
int ret;
@@ -141,8 +141,8 @@ void DoDoubleTest(WCHAR *formatstr, double param,
}
}
-void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
- WCHAR *paramstr, WCHAR *checkstr1, WCHAR *checkstr2)
+void DoArgumentPrecTest(const WCHAR *formatstr, int precision, void *param,
+ WCHAR *paramstr, const WCHAR *checkstr1, const WCHAR *checkstr2)
{
int ret;
@@ -154,8 +154,8 @@ void DoArgumentPrecTest(WCHAR *formatstr, int precision, void *param,
}
}
-void DoArgumentPrecDoubleTest(WCHAR *formatstr, int precision, double param,
- WCHAR *checkstr1, WCHAR *checkstr2)
+void DoArgumentPrecDoubleTest(const WCHAR *formatstr, int precision, double param,
+ const WCHAR *checkstr1, const WCHAR *checkstr2)
{
int ret;
diff --git a/src/pal/tests/palsuite/common/palsuite.h b/src/pal/tests/palsuite/common/palsuite.h
index ef644ad8e5..b77ca2ead5 100644
--- a/src/pal/tests/palsuite/common/palsuite.h
+++ b/src/pal/tests/palsuite/common/palsuite.h
@@ -133,9 +133,9 @@ inline ULONG VAL32(ULONG x)
#define th_htons(w) (((w) >> 8) | ((w) << 8))
#endif // BIGENDIAN
+#define _countof(_array) (sizeof(_array)/sizeof(_array[0]))
-
-WCHAR* convert(char * aString)
+WCHAR* convert(const char * aString)
{
int size;
WCHAR* wideBuffer;
@@ -150,7 +150,7 @@ WCHAR* convert(char * aString)
return wideBuffer;
}
-char* convertC(WCHAR * wString)
+char* convertC(const WCHAR * wString)
{
int size;
char * MultiBuffer = NULL;
diff --git a/src/pal/tests/palsuite/composite/object_management/event/nonshared/CMakeLists.txt b/src/pal/tests/palsuite/composite/object_management/event/nonshared/CMakeLists.txt
index c6c00377e1..b336c03d37 100644
--- a/src/pal/tests/palsuite/composite/object_management/event/nonshared/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/object_management/event/nonshared/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- event.c
- main.c
+ event.cpp
+ main.cpp
)
add_executable(paltest_event_nonshared
diff --git a/src/pal/tests/palsuite/composite/object_management/event/nonshared/event.c b/src/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp
index 69ad9a30e3..69ad9a30e3 100644
--- a/src/pal/tests/palsuite/composite/object_management/event/nonshared/event.c
+++ b/src/pal/tests/palsuite/composite/object_management/event/nonshared/event.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/event/nonshared/main.c b/src/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp
index 7b61e91737..7b61e91737 100644
--- a/src/pal/tests/palsuite/composite/object_management/event/nonshared/main.c
+++ b/src/pal/tests/palsuite/composite/object_management/event/nonshared/main.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/event/shared/CMakeLists.txt b/src/pal/tests/palsuite/composite/object_management/event/shared/CMakeLists.txt
index d326e3a42b..86188796bd 100644
--- a/src/pal/tests/palsuite/composite/object_management/event/shared/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/object_management/event/shared/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- event.c
- main.c
+ event.cpp
+ main.cpp
)
add_executable(paltest_event_shared
diff --git a/src/pal/tests/palsuite/composite/object_management/event/shared/event.c b/src/pal/tests/palsuite/composite/object_management/event/shared/event.cpp
index 83d5fce27e..83d5fce27e 100644
--- a/src/pal/tests/palsuite/composite/object_management/event/shared/event.c
+++ b/src/pal/tests/palsuite/composite/object_management/event/shared/event.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/event/shared/main.c b/src/pal/tests/palsuite/composite/object_management/event/shared/main.cpp
index c4a4067b5d..c4a4067b5d 100644
--- a/src/pal/tests/palsuite/composite/object_management/event/shared/main.c
+++ b/src/pal/tests/palsuite/composite/object_management/event/shared/main.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/CMakeLists.txt b/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/CMakeLists.txt
index 7859cd4653..03d5efac27 100644
--- a/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- main.c
- mutex.c
+ main.cpp
+ mutex.cpp
)
add_executable(paltest_mutex_nonshared
diff --git a/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/main.c b/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/main.cpp
index 80f31aad6e..80f31aad6e 100644
--- a/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/main.c
+++ b/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/main.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/mutex.c b/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/mutex.cpp
index 7f1f659f92..7f1f659f92 100644
--- a/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/mutex.c
+++ b/src/pal/tests/palsuite/composite/object_management/mutex/nonshared/mutex.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/mutex/shared/CMakeLists.txt b/src/pal/tests/palsuite/composite/object_management/mutex/shared/CMakeLists.txt
index cf33d0b464..d4b50cd66e 100644
--- a/src/pal/tests/palsuite/composite/object_management/mutex/shared/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/object_management/mutex/shared/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- main.c
- mutex.c
+ main.cpp
+ mutex.cpp
)
add_executable(paltest_mutex_shared
diff --git a/src/pal/tests/palsuite/composite/object_management/mutex/shared/main.c b/src/pal/tests/palsuite/composite/object_management/mutex/shared/main.cpp
index aa98855565..aa98855565 100644
--- a/src/pal/tests/palsuite/composite/object_management/mutex/shared/main.c
+++ b/src/pal/tests/palsuite/composite/object_management/mutex/shared/main.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/mutex/shared/mutex.c b/src/pal/tests/palsuite/composite/object_management/mutex/shared/mutex.cpp
index ec5d9b37ac..ec5d9b37ac 100644
--- a/src/pal/tests/palsuite/composite/object_management/mutex/shared/mutex.c
+++ b/src/pal/tests/palsuite/composite/object_management/mutex/shared/mutex.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/CMakeLists.txt b/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/CMakeLists.txt
index 6efa228fbb..9ed4535d39 100644
--- a/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- main.c
- semaphore.c
+ main.cpp
+ semaphore.cpp
)
add_executable(paltest_semaphore_nonshared
diff --git a/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.c b/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp
index 854809c8f8..854809c8f8 100644
--- a/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.c
+++ b/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/main.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.c b/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp
index 0e487f2c17..0e487f2c17 100644
--- a/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.c
+++ b/src/pal/tests/palsuite/composite/object_management/semaphore/nonshared/semaphore.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/semaphore/shared/CMakeLists.txt b/src/pal/tests/palsuite/composite/object_management/semaphore/shared/CMakeLists.txt
index 12d3ca867e..5c7f93290f 100644
--- a/src/pal/tests/palsuite/composite/object_management/semaphore/shared/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/object_management/semaphore/shared/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- main.c
- semaphore.c
+ main.cpp
+ semaphore.cpp
)
add_executable(paltest_semaphore_shared
diff --git a/src/pal/tests/palsuite/composite/object_management/semaphore/shared/main.c b/src/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp
index deb8252b70..deb8252b70 100644
--- a/src/pal/tests/palsuite/composite/object_management/semaphore/shared/main.c
+++ b/src/pal/tests/palsuite/composite/object_management/semaphore/shared/main.cpp
diff --git a/src/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.c b/src/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp
index 5143c55143..5143c55143 100644
--- a/src/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.c
+++ b/src/pal/tests/palsuite/composite/object_management/semaphore/shared/semaphore.cpp
diff --git a/src/pal/tests/palsuite/composite/synchronization/criticalsection/CMakeLists.txt b/src/pal/tests/palsuite/composite/synchronization/criticalsection/CMakeLists.txt
index 936c0fe82d..fc357ed258 100644
--- a/src/pal/tests/palsuite/composite/synchronization/criticalsection/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/synchronization/criticalsection/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- criticalsection.c
- mainWrapper.c
+ criticalsection.cpp
+ mainWrapper.cpp
)
add_executable(paltest_synchronization_criticalsection
diff --git a/src/pal/tests/palsuite/composite/synchronization/criticalsection/criticalsection.c b/src/pal/tests/palsuite/composite/synchronization/criticalsection/criticalsection.cpp
index 2fcd363e8a..2fcd363e8a 100644
--- a/src/pal/tests/palsuite/composite/synchronization/criticalsection/criticalsection.c
+++ b/src/pal/tests/palsuite/composite/synchronization/criticalsection/criticalsection.cpp
diff --git a/src/pal/tests/palsuite/composite/synchronization/criticalsection/mainWrapper.c b/src/pal/tests/palsuite/composite/synchronization/criticalsection/mainWrapper.cpp
index 4bc2f3d834..4bc2f3d834 100644
--- a/src/pal/tests/palsuite/composite/synchronization/criticalsection/mainWrapper.c
+++ b/src/pal/tests/palsuite/composite/synchronization/criticalsection/mainWrapper.cpp
diff --git a/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/CMakeLists.txt b/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/CMakeLists.txt
index d01b1064f6..9a02993916 100644
--- a/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/CMakeLists.txt
@@ -4,7 +4,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
mtx_critsect.cpp
- pal_composite_native_cs.c
+ pal_composite_native_cs.cpp
resultbuffer.cpp
)
diff --git a/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.c b/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp
index 40efacd7c9..40efacd7c9 100644
--- a/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.c
+++ b/src/pal/tests/palsuite/composite/synchronization/nativecriticalsection/pal_composite_native_cs.cpp
diff --git a/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/CMakeLists.txt b/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/CMakeLists.txt
index c4567f638c..717bdd6b20 100644
--- a/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/CMakeLists.txt
@@ -5,7 +5,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
interlocked.cpp
mtx_critsect.cpp
- pal_composite_native_cs.c
+ pal_composite_native_cs.cpp
resultbuffer.cpp
)
diff --git a/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.c b/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp
index 4c19d3b0de..4c19d3b0de 100644
--- a/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.c
+++ b/src/pal/tests/palsuite/composite/synchronization/nativecs_interlocked/pal_composite_native_cs.cpp
diff --git a/src/pal/tests/palsuite/composite/threading/threadsuspension/CMakeLists.txt b/src/pal/tests/palsuite/composite/threading/threadsuspension/CMakeLists.txt
index 134cce0809..d396d2fc49 100644
--- a/src/pal/tests/palsuite/composite/threading/threadsuspension/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/threading/threadsuspension/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- mainWrapper.c
- threadsuspension.c
+ mainWrapper.cpp
+ threadsuspension.cpp
)
add_executable(paltest_threading_threadsuspension
diff --git a/src/pal/tests/palsuite/composite/threading/threadsuspension/mainWrapper.c b/src/pal/tests/palsuite/composite/threading/threadsuspension/mainWrapper.cpp
index 05a71191cf..05a71191cf 100644
--- a/src/pal/tests/palsuite/composite/threading/threadsuspension/mainWrapper.c
+++ b/src/pal/tests/palsuite/composite/threading/threadsuspension/mainWrapper.cpp
diff --git a/src/pal/tests/palsuite/composite/threading/threadsuspension/threadsuspension.c b/src/pal/tests/palsuite/composite/threading/threadsuspension/threadsuspension.cpp
index 86ee4e2fc0..86ee4e2fc0 100644
--- a/src/pal/tests/palsuite/composite/threading/threadsuspension/threadsuspension.c
+++ b/src/pal/tests/palsuite/composite/threading/threadsuspension/threadsuspension.cpp
diff --git a/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/CMakeLists.txt b/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/CMakeLists.txt
index 5361a1cf0d..2c880921fe 100644
--- a/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- mainWrapper.c
- threadsuspension.c
+ mainWrapper.cpp
+ threadsuspension.cpp
)
add_executable(paltest_threading_threadsuspension_switchthread
diff --git a/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/mainWrapper.c b/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/mainWrapper.cpp
index 05a71191cf..05a71191cf 100644
--- a/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/mainWrapper.c
+++ b/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/mainWrapper.cpp
diff --git a/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/threadsuspension.c b/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/threadsuspension.cpp
index a117b86174..a117b86174 100644
--- a/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/threadsuspension.c
+++ b/src/pal/tests/palsuite/composite/threading/threadsuspension_switchthread/threadsuspension.cpp
diff --git a/src/pal/tests/palsuite/composite/wfmo/CMakeLists.txt b/src/pal/tests/palsuite/composite/wfmo/CMakeLists.txt
index 7dbddbc989..5e103102af 100644
--- a/src/pal/tests/palsuite/composite/wfmo/CMakeLists.txt
+++ b/src/pal/tests/palsuite/composite/wfmo/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- main.c
- mutex.c
+ main.cpp
+ mutex.cpp
)
add_executable(paltest_composite_wfmo
diff --git a/src/pal/tests/palsuite/composite/wfmo/main.c b/src/pal/tests/palsuite/composite/wfmo/main.cpp
index d186aa7b8b..d186aa7b8b 100644
--- a/src/pal/tests/palsuite/composite/wfmo/main.c
+++ b/src/pal/tests/palsuite/composite/wfmo/main.cpp
diff --git a/src/pal/tests/palsuite/composite/wfmo/mutex.c b/src/pal/tests/palsuite/composite/wfmo/mutex.cpp
index c8ed01426c..c8ed01426c 100644
--- a/src/pal/tests/palsuite/composite/wfmo/mutex.c
+++ b/src/pal/tests/palsuite/composite/wfmo/mutex.cpp
diff --git a/src/pal/tests/palsuite/debug_api/DebugBreak/test1/CMakeLists.txt b/src/pal/tests/palsuite/debug_api/DebugBreak/test1/CMakeLists.txt
index db66cbe1d0..1b2ae538cc 100644
--- a/src/pal/tests/palsuite/debug_api/DebugBreak/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/debug_api/DebugBreak/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_debugbreak_test1
diff --git a/src/pal/tests/palsuite/debug_api/DebugBreak/test1/test1.c b/src/pal/tests/palsuite/debug_api/DebugBreak/test1/test1.cpp
index 2b10b9ad9d..2b10b9ad9d 100644
--- a/src/pal/tests/palsuite/debug_api/DebugBreak/test1/test1.c
+++ b/src/pal/tests/palsuite/debug_api/DebugBreak/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/CMakeLists.txt b/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/CMakeLists.txt
index 5bc7fdb6e9..3000734afe 100644
--- a/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_outputdebugstringa_test1
@@ -20,7 +20,7 @@ target_link_libraries(paltest_outputdebugstringa_test1
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_outputdebugstringa_test1_helper
diff --git a/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/helper.c b/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/helper.cpp
index 90073dfedd..90073dfedd 100644
--- a/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/helper.c
+++ b/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/helper.cpp
diff --git a/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/test1.c b/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/test1.cpp
index 080c6ac53e..080c6ac53e 100644
--- a/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/test1.c
+++ b/src/pal/tests/palsuite/debug_api/OutputDebugStringA/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/CMakeLists.txt b/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/CMakeLists.txt
index 9202baeaef..4a93f0e394 100644
--- a/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_outputdebugstringw_test1
diff --git a/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/test1.c b/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/test1.cpp
index 88b55427bc..88b55427bc 100644
--- a/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/test1.c
+++ b/src/pal/tests/palsuite/debug_api/OutputDebugStringW/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/CMakeLists.txt b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/CMakeLists.txt
index 39130aac1c..afd581fb92 100644
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_writeprocessmemory_test1
@@ -20,7 +20,7 @@ target_link_libraries(paltest_writeprocessmemory_test1
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_writeprocessmemory_test1_helper
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.c b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.c
deleted file mode 100644
index 1a7318969c..0000000000
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.c
+++ /dev/null
@@ -1,243 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: helper.c
-**
-** Purpose: This helper process sets up a several blocks of memory,
-** then uses a file to tell its parent process where that memory is
-** So it can do a WriteProcessMemory on it. When the parent process is done
-** we check here that it was written properly.
-**
-**
-**============================================================*/
-
-#include "commonconsts.h"
-
-#include <palsuite.h>
-
-struct allhandles_t
-{
- HANDLE hEvToHelper;
- HANDLE hEvFromHelper;
- char *valuesFileName;
-};
-
-
-/* function: wpmDoIt
- *
- * This is a general WriteProcessMemory testing function that sets up
- * the RAM pointed to and tells the companion process on the other end
- * of the handles in 'Comms' to attempt to alter 'lenDest' bytes at
- * '*pDest'.
- *
- * '*pBuffer'[0..'lenBuffer'] is expected to be a guard region
- * surrounding the '*pDest'[0..'lenDest'] region so that this function
- * can verify that only the proper bytes were altered.
- */
-
-int wpmDoIt(struct allhandles_t Comms,
- char * pBuffer, unsigned int lenBuffer,
- char * pDest, unsigned int lenDest,
- const char* storageDescription)
-{
- char *pCurr;
- FILE *commsFile;
- DWORD dwRet;
-
- if (pBuffer > pDest || lenDest > lenBuffer)
- {
- Trace("WriteProcessMemory::DoIt() test implementation: "
- "(pBuffer > pDest || lenDest > lenBuffer)\n");
- return FALSE;
- }
-
- /* set up the storage */
- memset(pBuffer, guardValue, lenBuffer);
- memset(pDest, initialValue, lenDest);
-
- /* tell the parent what RAM to adjust */
- if(!(commsFile = fopen(Comms.valuesFileName, "w")))
- {
- Trace("WriteProcessMemory: fopen of '%S' failed (%u). \n",
- Comms.valuesFileName, GetLastError());
- return FALSE;
- }
- if (!fprintf(commsFile, "%u %u '%s'\n",
- pDest, lenDest, storageDescription))
- {
- Trace("WriteProcessMemory: fprintf to '%S' failed (%u). \n",
- Comms.valuesFileName, GetLastError());
- return FALSE;
- }
- PEDANTIC1(fclose, (commsFile));
-
- /* Tell the parent the data is ready for it to adjust */
- PEDANTIC(ResetEvent, (Comms.hEvToHelper));
- PEDANTIC(SetEvent, (Comms.hEvFromHelper));
-
- dwRet = WaitForSingleObject(Comms.hEvToHelper, TIMEOUT); /* parent is done */
- if (dwRet != WAIT_OBJECT_0)
- {
- Trace("helper WaitForSingleObjectTest: WaitForSingleObject "
- "failed (%u)\n", GetLastError());
- return FALSE;
- }
-
- /* check the stuff that SHOULD have changed */
- for (pCurr = pDest; pCurr < (pDest + lenDest); pCurr++)
- {
- if ( *pCurr != nextValue)
- {
- Trace("When testing '%s': alteration test failed "
- "at %u offset %u. Found '%c' instead of '%c'\n.",
- storageDescription, pDest, pCurr - pDest, *pCurr, nextValue);
- Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer);
- return FALSE;
- }
- }
- /* check the stuff that should NOT have changed */
- for (pCurr = pBuffer; pCurr < pDest; pCurr++ )
- {
- if ( *pCurr != guardValue)
- {
- Trace("When testing '%s': leading guard zone test failed "
- "at %u offset %u. Found '%c' instead of '%c'\n.",
- storageDescription, pDest, pCurr - pBuffer, *pCurr, guardValue);
- Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer);
- return FALSE;
- }
- }
- for (pCurr = pDest + lenDest; pCurr < (pBuffer + lenBuffer); pCurr++ )
- {
- if ( *pCurr != guardValue)
- {
- Trace("When testing '%s': trailing guard zone test failed "
- "at %u offset %u. Found '%c' instead of '%c'\n.",
- storageDescription, pDest + lenDest, pCurr - pBuffer, *pCurr, guardValue);
- Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- BOOL success = TRUE; /* assume success */
- struct allhandles_t Comms = {0,0,0} ;
-
- /* variables to track storage to alter */
- char *pTarget = NULL;
- unsigned int sizeTarget;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* hook up with the events created by the parent */
- Comms.hEvToHelper = OpenEventW(EVENT_ALL_ACCESS, 0, szcToHelperEvName);
- if (!Comms.hEvToHelper)
- {
- Fail("WriteProcessMemory: OpenEvent of '%S' failed (%u). "
- "(the event should already exist!)\n",
- szcToHelperEvName, GetLastError());
- }
- Comms.hEvFromHelper = OpenEventW(EVENT_ALL_ACCESS, 0, szcFromHelperEvName);
- if (!Comms.hEvToHelper)
- {
- Trace("WriteProcessMemory: OpenEvent of '%S' failed (%u). "
- "(the event should already exist!)\n",
- szcFromHelperEvName, GetLastError());
- success = FALSE;
- goto EXIT;
- }
- Comms.valuesFileName = argv[1];
-
- {
- char autoAllocatedOnStack[51];
-
- /* Get the parent process to write to the local stack */
- success &= wpmDoIt(Comms, autoAllocatedOnStack,
- sizeof(autoAllocatedOnStack),
- autoAllocatedOnStack + sizeof(int),
- sizeof(autoAllocatedOnStack) - 2 * sizeof(int),
- "const size array on stack with int sized guards");
- }
-
- /* Get the parent process to write to stuff on the heap */
- sizeTarget = 2 * sizeof(int) + 23 ; /* 23 is just a random prime > 16 */
- if (!(pTarget = malloc(sizeTarget)))
- {
- Trace("WriteProcessMemory helper: unable to allocate '%s'->%d bytes of memory"
- "(%u).\n",
- argv[3], sizeTarget, GetLastError());
- success = FALSE;
- goto EXIT;
-
- }
- success &= wpmDoIt(Comms, pTarget, sizeTarget,
- pTarget + sizeof(int),
- sizeTarget - 2 * sizeof(int),
- "array on heap with int sized guards");
-
- /* just to be nice try something 16 - 2 * sizeof(int) bytes long */
- {
- char autoAllocatedOnStack[16];
-
- /* Get the parent process to write to the local stack */
- success &= wpmDoIt(Comms, autoAllocatedOnStack,
- sizeof(autoAllocatedOnStack),
- autoAllocatedOnStack + sizeof(int),
- sizeof(autoAllocatedOnStack) - 2 * sizeof(int),
- "another 16 byte array on stack with int sized guards inside");
- }
-
- /* NOTE: Don't try 0 bytes long. Win32 WriteProcessMemory claims
- * it writes 8 bytes in that case! */
-
- /* and 1 byte long... */
- {
- char autoAllocatedOnStack[1+ 2 * sizeof(int)];
-
- /* Get the parent process to write to the local stack */
- success &= wpmDoIt(Comms, autoAllocatedOnStack,
- sizeof(autoAllocatedOnStack),
- autoAllocatedOnStack + sizeof(int),
- 1,
- "no bytes with int sized guards outside on stack");
- }
-
-
-EXIT:
- /* Tell the parent that we are done */
- if (!DeleteFile(Comms.valuesFileName))
- {
- Trace("helper: DeleteFile failed so parent (test1) is unlikely "
- "to exit cleanly\n");
- }
- PEDANTIC(ResetEvent, (Comms.hEvToHelper));
- if (!SetEvent(Comms.hEvFromHelper))
- {
- Trace("helper: SetEvent failed so parent (test1) is unlikely "
- "to exit cleanly\n");
- }
-
- free(pTarget);
- PEDANTIC(CloseHandle, (Comms.hEvToHelper));
- PEDANTIC(CloseHandle, (Comms.hEvFromHelper));
-
- if (!success)
- {
- Fail("");
- }
-
- PAL_Terminate();
-
- return success ? PASS : FAIL;
-}
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp
new file mode 100644
index 0000000000..d965ca7a51
--- /dev/null
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/helper.cpp
@@ -0,0 +1,243 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: helper.c
+**
+** Purpose: This helper process sets up a several blocks of memory,
+** then uses a file to tell its parent process where that memory is
+** So it can do a WriteProcessMemory on it. When the parent process is done
+** we check here that it was written properly.
+**
+**
+**============================================================*/
+
+#include "commonconsts.h"
+
+#include <palsuite.h>
+
+struct allhandles_t
+{
+ HANDLE hEvToHelper;
+ HANDLE hEvFromHelper;
+ char *valuesFileName;
+};
+
+
+/* function: wpmDoIt
+ *
+ * This is a general WriteProcessMemory testing function that sets up
+ * the RAM pointed to and tells the companion process on the other end
+ * of the handles in 'Comms' to attempt to alter 'lenDest' bytes at
+ * '*pDest'.
+ *
+ * '*pBuffer'[0..'lenBuffer'] is expected to be a guard region
+ * surrounding the '*pDest'[0..'lenDest'] region so that this function
+ * can verify that only the proper bytes were altered.
+ */
+
+int wpmDoIt(struct allhandles_t Comms,
+ char * pBuffer, unsigned int lenBuffer,
+ char * pDest, unsigned int lenDest,
+ const char* storageDescription)
+{
+ char *pCurr;
+ FILE *commsFile;
+ DWORD dwRet;
+
+ if (pBuffer > pDest || lenDest > lenBuffer)
+ {
+ Trace("WriteProcessMemory::DoIt() test implementation: "
+ "(pBuffer > pDest || lenDest > lenBuffer)\n");
+ return FALSE;
+ }
+
+ /* set up the storage */
+ memset(pBuffer, guardValue, lenBuffer);
+ memset(pDest, initialValue, lenDest);
+
+ /* tell the parent what RAM to adjust */
+ if(!(commsFile = fopen(Comms.valuesFileName, "w")))
+ {
+ Trace("WriteProcessMemory: fopen of '%S' failed (%u). \n",
+ Comms.valuesFileName, GetLastError());
+ return FALSE;
+ }
+ if (!fprintf(commsFile, "%u %u '%s'\n",
+ pDest, lenDest, storageDescription))
+ {
+ Trace("WriteProcessMemory: fprintf to '%S' failed (%u). \n",
+ Comms.valuesFileName, GetLastError());
+ return FALSE;
+ }
+ PEDANTIC1(fclose, (commsFile));
+
+ /* Tell the parent the data is ready for it to adjust */
+ PEDANTIC(ResetEvent, (Comms.hEvToHelper));
+ PEDANTIC(SetEvent, (Comms.hEvFromHelper));
+
+ dwRet = WaitForSingleObject(Comms.hEvToHelper, TIMEOUT); /* parent is done */
+ if (dwRet != WAIT_OBJECT_0)
+ {
+ Trace("helper WaitForSingleObjectTest: WaitForSingleObject "
+ "failed (%u)\n", GetLastError());
+ return FALSE;
+ }
+
+ /* check the stuff that SHOULD have changed */
+ for (pCurr = pDest; pCurr < (pDest + lenDest); pCurr++)
+ {
+ if ( *pCurr != nextValue)
+ {
+ Trace("When testing '%s': alteration test failed "
+ "at %u offset %u. Found '%c' instead of '%c'\n.",
+ storageDescription, pDest, pCurr - pDest, *pCurr, nextValue);
+ Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer);
+ return FALSE;
+ }
+ }
+ /* check the stuff that should NOT have changed */
+ for (pCurr = pBuffer; pCurr < pDest; pCurr++ )
+ {
+ if ( *pCurr != guardValue)
+ {
+ Trace("When testing '%s': leading guard zone test failed "
+ "at %u offset %u. Found '%c' instead of '%c'\n.",
+ storageDescription, pDest, pCurr - pBuffer, *pCurr, guardValue);
+ Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer);
+ return FALSE;
+ }
+ }
+ for (pCurr = pDest + lenDest; pCurr < (pBuffer + lenBuffer); pCurr++ )
+ {
+ if ( *pCurr != guardValue)
+ {
+ Trace("When testing '%s': trailing guard zone test failed "
+ "at %u offset %u. Found '%c' instead of '%c'\n.",
+ storageDescription, pDest + lenDest, pCurr - pBuffer, *pCurr, guardValue);
+ Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer);
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ BOOL success = TRUE; /* assume success */
+ struct allhandles_t Comms = {0,0,0} ;
+
+ /* variables to track storage to alter */
+ char *pTarget = NULL;
+ unsigned int sizeTarget;
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* hook up with the events created by the parent */
+ Comms.hEvToHelper = OpenEventW(EVENT_ALL_ACCESS, 0, szcToHelperEvName);
+ if (!Comms.hEvToHelper)
+ {
+ Fail("WriteProcessMemory: OpenEvent of '%S' failed (%u). "
+ "(the event should already exist!)\n",
+ szcToHelperEvName, GetLastError());
+ }
+ Comms.hEvFromHelper = OpenEventW(EVENT_ALL_ACCESS, 0, szcFromHelperEvName);
+ if (!Comms.hEvToHelper)
+ {
+ Trace("WriteProcessMemory: OpenEvent of '%S' failed (%u). "
+ "(the event should already exist!)\n",
+ szcFromHelperEvName, GetLastError());
+ success = FALSE;
+ goto EXIT;
+ }
+ Comms.valuesFileName = argv[1];
+
+ {
+ char autoAllocatedOnStack[51];
+
+ /* Get the parent process to write to the local stack */
+ success &= wpmDoIt(Comms, autoAllocatedOnStack,
+ sizeof(autoAllocatedOnStack),
+ autoAllocatedOnStack + sizeof(int),
+ sizeof(autoAllocatedOnStack) - 2 * sizeof(int),
+ "const size array on stack with int sized guards");
+ }
+
+ /* Get the parent process to write to stuff on the heap */
+ sizeTarget = 2 * sizeof(int) + 23 ; /* 23 is just a random prime > 16 */
+ if (!(pTarget = (char*)malloc(sizeTarget)))
+ {
+ Trace("WriteProcessMemory helper: unable to allocate '%s'->%d bytes of memory"
+ "(%u).\n",
+ argv[3], sizeTarget, GetLastError());
+ success = FALSE;
+ goto EXIT;
+
+ }
+ success &= wpmDoIt(Comms, pTarget, sizeTarget,
+ pTarget + sizeof(int),
+ sizeTarget - 2 * sizeof(int),
+ "array on heap with int sized guards");
+
+ /* just to be nice try something 16 - 2 * sizeof(int) bytes long */
+ {
+ char autoAllocatedOnStack[16];
+
+ /* Get the parent process to write to the local stack */
+ success &= wpmDoIt(Comms, autoAllocatedOnStack,
+ sizeof(autoAllocatedOnStack),
+ autoAllocatedOnStack + sizeof(int),
+ sizeof(autoAllocatedOnStack) - 2 * sizeof(int),
+ "another 16 byte array on stack with int sized guards inside");
+ }
+
+ /* NOTE: Don't try 0 bytes long. Win32 WriteProcessMemory claims
+ * it writes 8 bytes in that case! */
+
+ /* and 1 byte long... */
+ {
+ char autoAllocatedOnStack[1+ 2 * sizeof(int)];
+
+ /* Get the parent process to write to the local stack */
+ success &= wpmDoIt(Comms, autoAllocatedOnStack,
+ sizeof(autoAllocatedOnStack),
+ autoAllocatedOnStack + sizeof(int),
+ 1,
+ "no bytes with int sized guards outside on stack");
+ }
+
+
+EXIT:
+ /* Tell the parent that we are done */
+ if (!DeleteFile(Comms.valuesFileName))
+ {
+ Trace("helper: DeleteFile failed so parent (test1) is unlikely "
+ "to exit cleanly\n");
+ }
+ PEDANTIC(ResetEvent, (Comms.hEvToHelper));
+ if (!SetEvent(Comms.hEvFromHelper))
+ {
+ Trace("helper: SetEvent failed so parent (test1) is unlikely "
+ "to exit cleanly\n");
+ }
+
+ free(pTarget);
+ PEDANTIC(CloseHandle, (Comms.hEvToHelper));
+ PEDANTIC(CloseHandle, (Comms.hEvFromHelper));
+
+ if (!success)
+ {
+ Fail("");
+ }
+
+ PAL_Terminate();
+
+ return success ? PASS : FAIL;
+}
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.c b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.c
deleted file mode 100644
index 8de029d973..0000000000
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.c
+++ /dev/null
@@ -1,189 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test1.c
-**
-** Purpose: Create a child process and some events for communications with it.
-** When the child gets back to us with a memory location and a length,
-** Call WriteProcessMemory on this location and check to see that it
-** writes successfully.
-**
-**
-**============================================================*/
-
-#define UNICODE
-
-#include "commonconsts.h"
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
- PROCESS_INFORMATION pi;
- STARTUPINFO si;
- HANDLE hEvToHelper;
- HANDLE hEvFromHelper;
- DWORD dwExitCode;
-
-
- DWORD dwRet;
- char cmdComposeBuf[MAX_PATH];
- PWCHAR uniString;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Create the signals we need for cross process communication */
- hEvToHelper = CreateEvent(NULL, TRUE, FALSE, szcToHelperEvName);
- if (!hEvToHelper)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "GetLastError() returned %d.\n", szcToHelperEvName,
- GetLastError());
- }
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "(already exists!)\n", szcToHelperEvName);
- }
- hEvFromHelper = CreateEvent(NULL, TRUE, FALSE, szcFromHelperEvName);
- if (!hEvToHelper)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "GetLastError() returned %d.\n", szcFromHelperEvName,
- GetLastError());
- }
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "(already exists!)\n", szcFromHelperEvName);
- }
- ResetEvent(hEvFromHelper);
- ResetEvent(hEvToHelper);
-
- if (!sprintf(cmdComposeBuf, "helper %s", commsFileName))
- {
- Fail("Could not convert command line\n");
- }
- uniString = convert(cmdComposeBuf);
-
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory( &pi, sizeof(pi) );
-
- /* Create a new process. This is the process that will ask for
- * memory munging */
- if(!CreateProcess( NULL, uniString, NULL, NULL,
- FALSE, 0, NULL, NULL, &si, &pi))
- {
- Trace("ERROR: CreateProcess failed to load executable '%S'. "
- "GetLastError() returned %u.\n",
- uniString, GetLastError());
- free(uniString);
- Fail("");
- }
- free(uniString);
-
- while(1)
- {
- FILE *commsFile;
- char* pSrcMemory;
- char* pDestMemory;
- int Count;
- SIZE_T wpmCount;
- char incomingCMDBuffer[MAX_PATH + 1];
-
- /* wait until the helper tells us that it has given us
- * something to do */
- dwRet = WaitForSingleObject(hEvFromHelper, TIMEOUT);
- if (dwRet != WAIT_OBJECT_0)
- {
- Trace("test1 WaitForSingleObjectTest: WaitForSingleObject "
- "failed (%u)\n", GetLastError());
- break; /* no more work incoming */
- }
-
- /* get the parameters to test WriteProcessMemory with */
- if (!(commsFile = fopen(commsFileName, "r")))
- {
- /* no file means there is no more work */
- break;
- }
- if ( NULL == fgets(incomingCMDBuffer, MAX_PATH, commsFile))
- {
- Fail ("unable to read from communication file %s "
- "for reasons %u & %u\n",
- errno, GetLastError());
- }
- PEDANTIC1(fclose,(commsFile));
- sscanf(incomingCMDBuffer, "%u %u", &pDestMemory, &Count);
- if (argc > 1)
- {
- Trace("Preparing to write to %u bytes @ %u ('%s')\n",
- Count, pDestMemory, incomingCMDBuffer);
- }
-
- /* compose some data to write to the client process */
- if (!(pSrcMemory = malloc(Count)))
- {
- Trace("could not dynamically allocate memory to copy from "
- "for reasons %u & %u\n",
- errno, GetLastError());
- goto doneIteration;
- }
- memset(pSrcMemory, nextValue, Count);
-
- /* do the work */
- dwRet = WriteProcessMemory(pi.hProcess,
- pDestMemory,
- pSrcMemory,
- Count,
- &wpmCount);
- if (!dwRet)
- {
- Trace("%s: Problem: on a write to %u bytes @ %u ('%s')\n",
- argv[0], Count, pDestMemory, incomingCMDBuffer);
- Trace("test1 WriteProcessMemory returned a%u(!=0) (GLE=%u)\n",
- GetLastError());
- }
- if(Count != wpmCount)
- {
- Trace("%s: Problem: on a write to %u bytes @ %u ('%s')\n",
- argv[0], Count, pDestMemory, incomingCMDBuffer);
- Trace("The number of bytes written should have been "
- "%u, but was reported as %u.\n", Count, wpmCount);
- }
- free(pSrcMemory);
-
- doneIteration:
- PEDANTIC(ResetEvent, (hEvFromHelper));
- PEDANTIC(SetEvent, (hEvToHelper));
- }
-
- /* wait for the child process to complete */
- WaitForSingleObject ( pi.hProcess, TIMEOUT );
- /* this may return a failure code on a success path */
-
- /* check the exit code from the process */
- if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) )
- {
- Trace( "GetExitCodeProcess call failed with error code %u\n",
- GetLastError() );
- dwExitCode = FAIL;
- }
-
-
- PEDANTIC(CloseHandle, (hEvToHelper));
- PEDANTIC(CloseHandle, (hEvFromHelper));
- PEDANTIC(CloseHandle, (pi.hThread));
- PEDANTIC(CloseHandle, (pi.hProcess));
-
- PAL_TerminateEx(dwExitCode);
- return dwExitCode;
-}
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp
new file mode 100644
index 0000000000..f390c10c72
--- /dev/null
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp
@@ -0,0 +1,189 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: test1.c
+**
+** Purpose: Create a child process and some events for communications with it.
+** When the child gets back to us with a memory location and a length,
+** Call WriteProcessMemory on this location and check to see that it
+** writes successfully.
+**
+**
+**============================================================*/
+
+#define UNICODE
+
+#include "commonconsts.h"
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ PROCESS_INFORMATION pi;
+ STARTUPINFO si;
+ HANDLE hEvToHelper;
+ HANDLE hEvFromHelper;
+ DWORD dwExitCode;
+
+
+ DWORD dwRet;
+ char cmdComposeBuf[MAX_PATH];
+ PWCHAR uniString;
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Create the signals we need for cross process communication */
+ hEvToHelper = CreateEvent(NULL, TRUE, FALSE, szcToHelperEvName);
+ if (!hEvToHelper)
+ {
+ Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
+ "GetLastError() returned %d.\n", szcToHelperEvName,
+ GetLastError());
+ }
+ if (GetLastError() == ERROR_ALREADY_EXISTS)
+ {
+ Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
+ "(already exists!)\n", szcToHelperEvName);
+ }
+ hEvFromHelper = CreateEvent(NULL, TRUE, FALSE, szcFromHelperEvName);
+ if (!hEvToHelper)
+ {
+ Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
+ "GetLastError() returned %d.\n", szcFromHelperEvName,
+ GetLastError());
+ }
+ if (GetLastError() == ERROR_ALREADY_EXISTS)
+ {
+ Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
+ "(already exists!)\n", szcFromHelperEvName);
+ }
+ ResetEvent(hEvFromHelper);
+ ResetEvent(hEvToHelper);
+
+ if (!sprintf_s(cmdComposeBuf, _countof(cmdComposeBuf), "helper %s", commsFileName))
+ {
+ Fail("Could not convert command line\n");
+ }
+ uniString = convert(cmdComposeBuf);
+
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ ZeroMemory( &pi, sizeof(pi) );
+
+ /* Create a new process. This is the process that will ask for
+ * memory munging */
+ if(!CreateProcess( NULL, uniString, NULL, NULL,
+ FALSE, 0, NULL, NULL, &si, &pi))
+ {
+ Trace("ERROR: CreateProcess failed to load executable '%S'. "
+ "GetLastError() returned %u.\n",
+ uniString, GetLastError());
+ free(uniString);
+ Fail("");
+ }
+ free(uniString);
+
+ while(1)
+ {
+ FILE *commsFile;
+ char* pSrcMemory;
+ char* pDestMemory;
+ int Count;
+ SIZE_T wpmCount;
+ char incomingCMDBuffer[MAX_PATH + 1];
+
+ /* wait until the helper tells us that it has given us
+ * something to do */
+ dwRet = WaitForSingleObject(hEvFromHelper, TIMEOUT);
+ if (dwRet != WAIT_OBJECT_0)
+ {
+ Trace("test1 WaitForSingleObjectTest: WaitForSingleObject "
+ "failed (%u)\n", GetLastError());
+ break; /* no more work incoming */
+ }
+
+ /* get the parameters to test WriteProcessMemory with */
+ if (!(commsFile = fopen(commsFileName, "r")))
+ {
+ /* no file means there is no more work */
+ break;
+ }
+ if ( NULL == fgets(incomingCMDBuffer, MAX_PATH, commsFile))
+ {
+ Fail ("unable to read from communication file %s "
+ "for reasons %u & %u\n",
+ errno, GetLastError());
+ }
+ PEDANTIC1(fclose,(commsFile));
+ sscanf(incomingCMDBuffer, "%u %u", &pDestMemory, &Count);
+ if (argc > 1)
+ {
+ Trace("Preparing to write to %u bytes @ %u ('%s')\n",
+ Count, pDestMemory, incomingCMDBuffer);
+ }
+
+ /* compose some data to write to the client process */
+ if (!(pSrcMemory = (char*)malloc(Count)))
+ {
+ Trace("could not dynamically allocate memory to copy from "
+ "for reasons %u & %u\n",
+ errno, GetLastError());
+ goto doneIteration;
+ }
+ memset(pSrcMemory, nextValue, Count);
+
+ /* do the work */
+ dwRet = WriteProcessMemory(pi.hProcess,
+ pDestMemory,
+ pSrcMemory,
+ Count,
+ &wpmCount);
+ if (!dwRet)
+ {
+ Trace("%s: Problem: on a write to %u bytes @ %u ('%s')\n",
+ argv[0], Count, pDestMemory, incomingCMDBuffer);
+ Trace("test1 WriteProcessMemory returned a%u(!=0) (GLE=%u)\n",
+ GetLastError());
+ }
+ if(Count != wpmCount)
+ {
+ Trace("%s: Problem: on a write to %u bytes @ %u ('%s')\n",
+ argv[0], Count, pDestMemory, incomingCMDBuffer);
+ Trace("The number of bytes written should have been "
+ "%u, but was reported as %u.\n", Count, wpmCount);
+ }
+ free(pSrcMemory);
+
+ doneIteration:
+ PEDANTIC(ResetEvent, (hEvFromHelper));
+ PEDANTIC(SetEvent, (hEvToHelper));
+ }
+
+ /* wait for the child process to complete */
+ WaitForSingleObject ( pi.hProcess, TIMEOUT );
+ /* this may return a failure code on a success path */
+
+ /* check the exit code from the process */
+ if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) )
+ {
+ Trace( "GetExitCodeProcess call failed with error code %u\n",
+ GetLastError() );
+ dwExitCode = FAIL;
+ }
+
+
+ PEDANTIC(CloseHandle, (hEvToHelper));
+ PEDANTIC(CloseHandle, (hEvFromHelper));
+ PEDANTIC(CloseHandle, (pi.hThread));
+ PEDANTIC(CloseHandle, (pi.hProcess));
+
+ PAL_TerminateEx(dwExitCode);
+ return dwExitCode;
+}
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/CMakeLists.txt b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/CMakeLists.txt
index ecc0e06dac..3a5067c926 100644
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_writeprocessmemory_test3
@@ -20,7 +20,7 @@ target_link_libraries(paltest_writeprocessmemory_test3
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_writeprocessmemory_test3_helper
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.c b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp
index 170e2064cb..170e2064cb 100644
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.c
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/helper.cpp
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.c b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.c
deleted file mode 100644
index 063cb4cbec..0000000000
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.c
+++ /dev/null
@@ -1,205 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test3.c
-**
-** Purpose: Create a child process and debug it. When the child
-** raises an exception, it sends back a memory location. Call
-** WriteProcessMemory on the memory location, but attempt to write
-** more than the memory allows. This should cause an error and the
-** data should be unchanged.
-**
-**
-==============================================================*/
-
-#define UNICODE
-
-#include "commonconsts.h"
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
- PROCESS_INFORMATION pi;
- STARTUPINFO si;
- HANDLE hEvToHelper;
- HANDLE hEvFromHelper;
- DWORD dwExitCode;
-
-
- DWORD dwRet;
- BOOL success = TRUE; /* assume success */
- char cmdComposeBuf[MAX_PATH];
- PWCHAR uniString;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Create the signals we need for cross process communication */
- hEvToHelper = CreateEvent(NULL, TRUE, FALSE, szcToHelperEvName);
- if (!hEvToHelper)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "GetLastError() returned %u.\n", szcToHelperEvName,
- GetLastError());
- }
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "(already exists!)\n", szcToHelperEvName);
- }
- hEvFromHelper = CreateEvent(NULL, TRUE, FALSE, szcFromHelperEvName);
- if (!hEvToHelper)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "GetLastError() returned %u.\n", szcFromHelperEvName,
- GetLastError());
- }
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "(already exists!)\n", szcFromHelperEvName);
- }
-
- if (!sprintf(cmdComposeBuf, "helper %s", commsFileName))
- {
- Fail("Could not convert command line\n");
- }
- uniString = convert(cmdComposeBuf);
-
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory( &pi, sizeof(pi) );
-
- /* Create a new process. This is the process that will ask for
- * memory munging */
- if(!CreateProcess( NULL, uniString, NULL, NULL,
- FALSE, 0, NULL, NULL, &si, &pi))
- {
- Trace("ERROR: CreateProcess failed to load executable '%S'. "
- "GetLastError() returned %u.\n",
- uniString, GetLastError());
- free(uniString);
- Fail("");
- }
- free(uniString);
-
- while(1)
- {
- FILE *commsFile;
- char* pSrcMemory;
- char* pDestMemory;
- int Count;
- SIZE_T wpmCount;
- DWORD dwExpectedErrorCode;
-
- char incomingCMDBuffer[MAX_PATH + 1];
-
- /* wait until the helper tells us that it has given us
- * something to do */
- dwRet = WaitForSingleObject(hEvFromHelper, TIMEOUT);
- if (dwRet != WAIT_OBJECT_0)
- {
- Trace("test1 WaitForSingleObjectTest: WaitForSingleObject "
- "failed (%u)\n", GetLastError());
- break; /* no more work incoming */
- }
-
- /* get the parameters to test WriteProcessMemory with */
- if (!(commsFile = fopen(commsFileName, "r")))
- {
- /* no file means there is no more work */
- break;
- }
- if ( NULL == fgets(incomingCMDBuffer, MAX_PATH, commsFile))
- {
- Trace ("unable to read from communication file %s "
- "for reasons %u & %u\n",
- errno, GetLastError());
- success = FALSE;
- PEDANTIC1(fclose,(commsFile));
- /* it's not worth continuing this trial */
- goto doneIteration;
- }
- PEDANTIC1(fclose,(commsFile));
- sscanf(incomingCMDBuffer, "%u %u %u",
- &pDestMemory, &Count, &dwExpectedErrorCode);
- if (argc > 1)
- {
- Trace("Preparing to write to %u bytes @ %u ('%s')\n",
- Count, pDestMemory, incomingCMDBuffer);
- }
-
- /* compose some data to write to the client process */
- if (!(pSrcMemory = malloc(Count)))
- {
- Trace("could not dynamically allocate memory to copy from "
- "for reasons %u & %u\n",
- errno, GetLastError());
- success = FALSE;
- goto doneIteration;
- }
- memset(pSrcMemory, nextValue, Count);
-
- /* do the work */
- dwRet = WriteProcessMemory(pi.hProcess,
- pDestMemory,
- pSrcMemory,
- Count,
- &wpmCount);
-
- if(dwRet != 0)
- {
- Trace("ERROR: Situation: '%s', return code: %u, bytes 'written': %u\n",
- incomingCMDBuffer, dwRet, wpmCount);
- Trace("ERROR: WriteProcessMemory did not fail as it should, as "
- "it attempted to write to a range of memory which was "
- "not completely accessible.\n");
- success = FALSE;
- }
-
- if(GetLastError() != dwExpectedErrorCode)
- {
- Trace("ERROR: GetLastError() should have returned "
- "%u , but instead it returned %u.\n",
- dwExpectedErrorCode, GetLastError());
- success = FALSE;
- }
- free(pSrcMemory);
-
- doneIteration:
- PEDANTIC(ResetEvent, (hEvFromHelper));
- PEDANTIC(SetEvent, (hEvToHelper));
- }
-
-
- /* wait for the child process to complete */
- WaitForSingleObject ( pi.hProcess, TIMEOUT );
- /* this may return a failure code on a success path */
-
- /* check the exit code from the process */
- if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) )
- {
- Trace( "GetExitCodeProcess call failed with error code %u\n",
- GetLastError() );
- dwExitCode = FAIL;
- }
- if(!success)
- {
- dwExitCode = FAIL;
- }
-
- PEDANTIC(CloseHandle, (hEvToHelper));
- PEDANTIC(CloseHandle, (hEvFromHelper));
- PEDANTIC(CloseHandle, (pi.hThread));
- PEDANTIC(CloseHandle, (pi.hProcess));
-
- PAL_Terminate(dwExitCode);
- return dwExitCode;
-}
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp
new file mode 100644
index 0000000000..15b4b3f79d
--- /dev/null
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp
@@ -0,0 +1,205 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: test3.c
+**
+** Purpose: Create a child process and debug it. When the child
+** raises an exception, it sends back a memory location. Call
+** WriteProcessMemory on the memory location, but attempt to write
+** more than the memory allows. This should cause an error and the
+** data should be unchanged.
+**
+**
+==============================================================*/
+
+#define UNICODE
+
+#include "commonconsts.h"
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ PROCESS_INFORMATION pi;
+ STARTUPINFO si;
+ HANDLE hEvToHelper;
+ HANDLE hEvFromHelper;
+ DWORD dwExitCode;
+
+
+ DWORD dwRet;
+ BOOL success = TRUE; /* assume success */
+ char cmdComposeBuf[MAX_PATH];
+ PWCHAR uniString;
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Create the signals we need for cross process communication */
+ hEvToHelper = CreateEvent(NULL, TRUE, FALSE, szcToHelperEvName);
+ if (!hEvToHelper)
+ {
+ Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
+ "GetLastError() returned %u.\n", szcToHelperEvName,
+ GetLastError());
+ }
+ if (GetLastError() == ERROR_ALREADY_EXISTS)
+ {
+ Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
+ "(already exists!)\n", szcToHelperEvName);
+ }
+ hEvFromHelper = CreateEvent(NULL, TRUE, FALSE, szcFromHelperEvName);
+ if (!hEvToHelper)
+ {
+ Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
+ "GetLastError() returned %u.\n", szcFromHelperEvName,
+ GetLastError());
+ }
+ if (GetLastError() == ERROR_ALREADY_EXISTS)
+ {
+ Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
+ "(already exists!)\n", szcFromHelperEvName);
+ }
+
+ if (!sprintf_s(cmdComposeBuf, _countof(cmdComposeBuf), "helper %s", commsFileName))
+ {
+ Fail("Could not convert command line\n");
+ }
+ uniString = convert(cmdComposeBuf);
+
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ ZeroMemory( &pi, sizeof(pi) );
+
+ /* Create a new process. This is the process that will ask for
+ * memory munging */
+ if(!CreateProcess( NULL, uniString, NULL, NULL,
+ FALSE, 0, NULL, NULL, &si, &pi))
+ {
+ Trace("ERROR: CreateProcess failed to load executable '%S'. "
+ "GetLastError() returned %u.\n",
+ uniString, GetLastError());
+ free(uniString);
+ Fail("");
+ }
+ free(uniString);
+
+ while(1)
+ {
+ FILE *commsFile;
+ char* pSrcMemory;
+ char* pDestMemory;
+ int Count;
+ SIZE_T wpmCount;
+ DWORD dwExpectedErrorCode;
+
+ char incomingCMDBuffer[MAX_PATH + 1];
+
+ /* wait until the helper tells us that it has given us
+ * something to do */
+ dwRet = WaitForSingleObject(hEvFromHelper, TIMEOUT);
+ if (dwRet != WAIT_OBJECT_0)
+ {
+ Trace("test1 WaitForSingleObjectTest: WaitForSingleObject "
+ "failed (%u)\n", GetLastError());
+ break; /* no more work incoming */
+ }
+
+ /* get the parameters to test WriteProcessMemory with */
+ if (!(commsFile = fopen(commsFileName, "r")))
+ {
+ /* no file means there is no more work */
+ break;
+ }
+ if ( NULL == fgets(incomingCMDBuffer, MAX_PATH, commsFile))
+ {
+ Trace ("unable to read from communication file %s "
+ "for reasons %u & %u\n",
+ errno, GetLastError());
+ success = FALSE;
+ PEDANTIC1(fclose,(commsFile));
+ /* it's not worth continuing this trial */
+ goto doneIteration;
+ }
+ PEDANTIC1(fclose,(commsFile));
+ sscanf(incomingCMDBuffer, "%u %u %u",
+ &pDestMemory, &Count, &dwExpectedErrorCode);
+ if (argc > 1)
+ {
+ Trace("Preparing to write to %u bytes @ %u ('%s')\n",
+ Count, pDestMemory, incomingCMDBuffer);
+ }
+
+ /* compose some data to write to the client process */
+ if (!(pSrcMemory = (char*)malloc(Count)))
+ {
+ Trace("could not dynamically allocate memory to copy from "
+ "for reasons %u & %u\n",
+ errno, GetLastError());
+ success = FALSE;
+ goto doneIteration;
+ }
+ memset(pSrcMemory, nextValue, Count);
+
+ /* do the work */
+ dwRet = WriteProcessMemory(pi.hProcess,
+ pDestMemory,
+ pSrcMemory,
+ Count,
+ &wpmCount);
+
+ if(dwRet != 0)
+ {
+ Trace("ERROR: Situation: '%s', return code: %u, bytes 'written': %u\n",
+ incomingCMDBuffer, dwRet, wpmCount);
+ Trace("ERROR: WriteProcessMemory did not fail as it should, as "
+ "it attempted to write to a range of memory which was "
+ "not completely accessible.\n");
+ success = FALSE;
+ }
+
+ if(GetLastError() != dwExpectedErrorCode)
+ {
+ Trace("ERROR: GetLastError() should have returned "
+ "%u , but instead it returned %u.\n",
+ dwExpectedErrorCode, GetLastError());
+ success = FALSE;
+ }
+ free(pSrcMemory);
+
+ doneIteration:
+ PEDANTIC(ResetEvent, (hEvFromHelper));
+ PEDANTIC(SetEvent, (hEvToHelper));
+ }
+
+
+ /* wait for the child process to complete */
+ WaitForSingleObject ( pi.hProcess, TIMEOUT );
+ /* this may return a failure code on a success path */
+
+ /* check the exit code from the process */
+ if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) )
+ {
+ Trace( "GetExitCodeProcess call failed with error code %u\n",
+ GetLastError() );
+ dwExitCode = FAIL;
+ }
+ if(!success)
+ {
+ dwExitCode = FAIL;
+ }
+
+ PEDANTIC(CloseHandle, (hEvToHelper));
+ PEDANTIC(CloseHandle, (hEvFromHelper));
+ PEDANTIC(CloseHandle, (pi.hThread));
+ PEDANTIC(CloseHandle, (pi.hProcess));
+
+ PAL_Terminate(dwExitCode);
+ return dwExitCode;
+}
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/CMakeLists.txt b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/CMakeLists.txt
index cf1ce13862..7cba09038a 100644
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_writeprocessmemory_test4
@@ -20,7 +20,7 @@ target_link_libraries(paltest_writeprocessmemory_test4
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_writeprocessmemory_test4_helper
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.c b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp
index b653ea5057..b653ea5057 100644
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.c
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/helper.cpp
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.c b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp
index 51db23499b..51db23499b 100644
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.c
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/CMakeLists.txt
index adbc8ae86a..4e30869d85 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_EXCEPT_FILTER.c
+ PAL_EXCEPT_FILTER.cpp
)
add_executable(paltest_pal_except_filter_test1
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.c b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.cpp
index ee65f43d2c..ee65f43d2c 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test1/PAL_EXCEPT_FILTER.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/CMakeLists.txt
index 62cda706d5..3f979c08db 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- pal_except_filter.c
+ pal_except_filter.cpp
)
add_executable(paltest_pal_except_filter_test2
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.c b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.cpp
index ccf53fb0ba..ccf53fb0ba 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test2/pal_except_filter.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/CMakeLists.txt
index cc68fb031c..2bdf44e058 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- pal_except_filter.c
+ pal_except_filter.cpp
)
add_executable(paltest_pal_except_filter_test3
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.c b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.cpp
index 20c36840b1..20c36840b1 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER/test3/pal_except_filter.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/CMakeLists.txt
index 21c3b5d33c..cf0a5e7c6d 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_EXCEPT_FILTER_EX.c
+ PAL_EXCEPT_FILTER_EX.cpp
)
add_executable(paltest_pal_except_filter_ex_test1
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.c b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.cpp
index 91f392d8d7..91f392d8d7 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test1/PAL_EXCEPT_FILTER_EX.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/CMakeLists.txt
index 350acff036..a3f82c26b9 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- pal_except_filter_ex.c
+ pal_except_filter_ex.cpp
)
add_executable(paltest_pal_except_filter_ex_test2
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.c b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.cpp
index ab25c49733..ab25c49733 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test2/pal_except_filter_ex.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/CMakeLists.txt
index 7f485c8ca4..532b29a9a1 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- pal_except_filter.c
+ pal_except_filter.cpp
)
add_executable(paltest_pal_except_filter_ex_test3
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.c b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.cpp
index a17cb4f6b3..a17cb4f6b3 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_EXCEPT_FILTER_EX/test3/pal_except_filter.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/CMakeLists.txt
index 8a1a832361..b478de63e4 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_TRY_EXCEPT.c
+ PAL_TRY_EXCEPT.cpp
)
add_executable(paltest_pal_try_except_test1
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.c b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.cpp
index 4fb09bd276..4fb09bd276 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test1/PAL_TRY_EXCEPT.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/CMakeLists.txt
index cdf371926c..0e344a9320 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_TRY_EXCEPT.c
+ PAL_TRY_EXCEPT.cpp
)
add_executable(paltest_pal_try_except_test2
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.c b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.cpp
index eb7b9d1257..eb7b9d1257 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT/test2/PAL_TRY_EXCEPT.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/CMakeLists.txt
index c30877f65e..cced8a11be 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_TRY_EXCEPT_EX.c
+ PAL_TRY_EXCEPT_EX.cpp
)
add_executable(paltest_pal_try_except_ex_test1
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.c b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.cpp
index 8b4dd7b430..8b4dd7b430 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test1/PAL_TRY_EXCEPT_EX.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/CMakeLists.txt
index 0d4c4db240..c3549b5d87 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_TRY_EXCEPT_EX.c
+ PAL_TRY_EXCEPT_EX.cpp
)
add_executable(paltest_pal_try_except_ex_test2
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.c b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.cpp
index 5ab4a95ce9..5ab4a95ce9 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test2/PAL_TRY_EXCEPT_EX.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/CMakeLists.txt
index dc797f2f09..34790da3d3 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_TRY_EXCEPT_EX.c
+ PAL_TRY_EXCEPT_EX.cpp
)
add_executable(paltest_pal_try_except_ex_test3
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.c b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.cpp
index d6a948926b..d6a948926b 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_EXCEPT_EX/test3/PAL_TRY_EXCEPT_EX.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/CMakeLists.txt
index a5fdd26924..f004db1658 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_TRY_LEAVE_FINALLY.c
+ PAL_TRY_LEAVE_FINALLY.cpp
)
add_executable(paltest_pal_try_leave_finally_test1
diff --git a/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.c b/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.cpp
index 675c2a5947..675c2a5947 100644
--- a/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.c
+++ b/src/pal/tests/palsuite/exception_handling/PAL_TRY_LEAVE_FINALLY/test1/PAL_TRY_LEAVE_FINALLY.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/CMakeLists.txt
index e526029bee..068427303f 100644
--- a/src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_setunhandledexceptionfilter_test1
diff --git a/src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/test1.c b/src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/test1.cpp
index 5a067f9354..5a067f9354 100644
--- a/src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/test1.c
+++ b/src/pal/tests/palsuite/exception_handling/SetUnhandledExceptionFilter/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test1/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/pal_except/test1/CMakeLists.txt
index 635e35d635..b219238ef4 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_pal_except_test1
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test1/test1.c b/src/pal/tests/palsuite/exception_handling/pal_except/test1/test1.cpp
index 0fe48e7fc3..0fe48e7fc3 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test1/test1.c
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test2/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/pal_except/test2/CMakeLists.txt
index 813b0e66a1..27a725353b 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_pal_except_test2
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test2/test2.c b/src/pal/tests/palsuite/exception_handling/pal_except/test2/test2.cpp
index bc0d4e300a..bc0d4e300a 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test2/test2.c
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test3/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/pal_except/test3/CMakeLists.txt
index 5fc3b096af..680341a782 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_pal_except_test3
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test3/test3.c b/src/pal/tests/palsuite/exception_handling/pal_except/test3/test3.cpp
index 0137697774..0137697774 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test3/test3.c
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test4/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/pal_except/test4/CMakeLists.txt
index cc054d15dd..98eb7bfb23 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_pal_except_test4
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test4/test4.c b/src/pal/tests/palsuite/exception_handling/pal_except/test4/test4.cpp
index 87844973b0..87844973b0 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test4/test4.c
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test5/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/pal_except/test5/CMakeLists.txt
index 7b8f1d0361..9a39e32cce 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_pal_except_test5
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test5/test5.c b/src/pal/tests/palsuite/exception_handling/pal_except/test5/test5.cpp
index f9faf4440e..f9faf4440e 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test5/test5.c
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test6/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/pal_except/test6/CMakeLists.txt
index 7f943bf126..d009128871 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_pal_except_test6
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test6/test6.c b/src/pal/tests/palsuite/exception_handling/pal_except/test6/test6.cpp
index 44b0ba1bc9..44b0ba1bc9 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test6/test6.c
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test7/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/pal_except/test7/CMakeLists.txt
index 09399c8f6b..33fee62cc2 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_pal_except_test7
diff --git a/src/pal/tests/palsuite/exception_handling/pal_except/test7/test7.c b/src/pal/tests/palsuite/exception_handling/pal_except/test7/test7.cpp
index a8dc8331c2..a8dc8331c2 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_except/test7/test7.c
+++ b/src/pal/tests/palsuite/exception_handling/pal_except/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/pal_finally/test1/CMakeLists.txt b/src/pal/tests/palsuite/exception_handling/pal_finally/test1/CMakeLists.txt
index 5d947ad7db..67cc6c0b92 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_finally/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/exception_handling/pal_finally/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- pal_finally.c
+ pal_finally.cpp
)
add_executable(paltest_pal_finally_test1
diff --git a/src/pal/tests/palsuite/exception_handling/pal_finally/test1/pal_finally.c b/src/pal/tests/palsuite/exception_handling/pal_finally/test1/pal_finally.cpp
index f278f98956..f278f98956 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_finally/test1/pal_finally.c
+++ b/src/pal/tests/palsuite/exception_handling/pal_finally/test1/pal_finally.cpp
diff --git a/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/dlltest1.cpp b/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/dlltest1.cpp
index 614690897a..000ed6271c 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/dlltest1.cpp
+++ b/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/dlltest1.cpp
@@ -20,6 +20,17 @@ int InitializeDllTest1()
return PAL_InitializeDLL();
}
+__attribute__((noinline,optnone))
+static void FailingFunction(volatile int *p)
+{
+ if (p == NULL)
+ {
+ throw PAL_SEHException();
+ }
+
+ *p = 1; // Causes an access violation exception
+}
+
BOOL bTry = FALSE;
BOOL bExcept = FALSE;
@@ -33,7 +44,8 @@ int DllTest1()
volatile int* p = (volatile int *)0x11; // Invalid pointer
bTry = TRUE; // Indicate we hit the PAL_TRY block
- *p = 1; // Causes an access violation exception
+ FailingFunction(p); // Throw in function to fool C++ runtime into handling
+ // h/w exception
Fail("ERROR: code was executed after the access violation.\n");
}
diff --git a/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/dlltest2.cpp b/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/dlltest2.cpp
index 1e85821422..27fc213e4f 100644
--- a/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/dlltest2.cpp
+++ b/src/pal/tests/palsuite/exception_handling/pal_sxs/test1/dlltest2.cpp
@@ -20,6 +20,17 @@ int InitializeDllTest2()
return PAL_InitializeDLL();
}
+__attribute__((noinline,optnone))
+static void FailingFunction(volatile int *p)
+{
+ if (p == NULL)
+ {
+ throw PAL_SEHException();
+ }
+
+ *p = 1; // Causes an access violation exception
+}
+
BOOL bTry = FALSE;
BOOL bExcept = FALSE;
@@ -33,7 +44,8 @@ int DllTest2()
volatile int* p = (volatile int *)0x22; // Invalid pointer
bTry = TRUE; // Indicate we hit the PAL_TRY block
- *p = 2; // Causes an access violation exception
+ FailingFunction(p); // Throw in function to fool C++ runtime into handling
+ // h/w exception
Fail("ERROR: code was executed after the access violation.\n");
}
diff --git a/src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/AreFileApisANSI.c b/src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/AreFileApisANSI.cpp
index ec61f0cb7d..ec61f0cb7d 100644
--- a/src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/AreFileApisANSI.c
+++ b/src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/AreFileApisANSI.cpp
diff --git a/src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/CMakeLists.txt
index 4f50127cb9..e624bef462 100644
--- a/src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/AreFileApisANSI/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- AreFileApisANSI.c
+ AreFileApisANSI.cpp
)
add_executable(paltest_arefileapisansi_test1
diff --git a/src/pal/tests/palsuite/file_io/CompareFileTime/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CompareFileTime/test1/CMakeLists.txt
index fdcb6559b3..fa96a44cdd 100644
--- a/src/pal/tests/palsuite/file_io/CompareFileTime/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CompareFileTime/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CompareFileTime.c
+ CompareFileTime.cpp
)
add_executable(paltest_comparefiletime_test1
diff --git a/src/pal/tests/palsuite/file_io/CompareFileTime/test1/CompareFileTime.c b/src/pal/tests/palsuite/file_io/CompareFileTime/test1/CompareFileTime.cpp
index 3758f7e4eb..3758f7e4eb 100644
--- a/src/pal/tests/palsuite/file_io/CompareFileTime/test1/CompareFileTime.c
+++ b/src/pal/tests/palsuite/file_io/CompareFileTime/test1/CompareFileTime.cpp
diff --git a/src/pal/tests/palsuite/file_io/CopyFileA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CopyFileA/test1/CMakeLists.txt
index b52e5076fa..13abbc0979 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CopyFileA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CopyFileA.c
+ CopyFileA.cpp
)
add_executable(paltest_copyfilea_test1
diff --git a/src/pal/tests/palsuite/file_io/CopyFileA/test1/CopyFileA.c b/src/pal/tests/palsuite/file_io/CopyFileA/test1/CopyFileA.cpp
index bfea85b7cb..bfea85b7cb 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileA/test1/CopyFileA.c
+++ b/src/pal/tests/palsuite/file_io/CopyFileA/test1/CopyFileA.cpp
diff --git a/src/pal/tests/palsuite/file_io/CopyFileA/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CopyFileA/test2/CMakeLists.txt
index 7454f32f51..cd0d8bc6cf 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CopyFileA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_copyfilea_test2
diff --git a/src/pal/tests/palsuite/file_io/CopyFileA/test2/test2.c b/src/pal/tests/palsuite/file_io/CopyFileA/test2/test2.cpp
index 56618d0a58..56618d0a58 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileA/test2/test2.c
+++ b/src/pal/tests/palsuite/file_io/CopyFileA/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/file_io/CopyFileA/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CopyFileA/test3/CMakeLists.txt
index 986be9fd22..0bb41b8d8f 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CopyFileA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_copyfilea_test3
diff --git a/src/pal/tests/palsuite/file_io/CopyFileA/test3/test3.c b/src/pal/tests/palsuite/file_io/CopyFileA/test3/test3.cpp
index 18c8ce80dc..18c8ce80dc 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileA/test3/test3.c
+++ b/src/pal/tests/palsuite/file_io/CopyFileA/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/file_io/CopyFileA/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CopyFileA/test4/CMakeLists.txt
index fb48c83741..12f85d1747 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileA/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CopyFileA/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_copyfilea_test4
diff --git a/src/pal/tests/palsuite/file_io/CopyFileA/test4/test4.c b/src/pal/tests/palsuite/file_io/CopyFileA/test4/test4.cpp
index 1ae69f5e1f..1ae69f5e1f 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileA/test4/test4.c
+++ b/src/pal/tests/palsuite/file_io/CopyFileA/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/file_io/CopyFileW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CopyFileW/test1/CMakeLists.txt
index 766b120035..20c8141d90 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CopyFileW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CopyFileW.c
+ CopyFileW.cpp
)
add_executable(paltest_copyfilew_test1
diff --git a/src/pal/tests/palsuite/file_io/CopyFileW/test1/CopyFileW.c b/src/pal/tests/palsuite/file_io/CopyFileW/test1/CopyFileW.cpp
index 6127cc21bd..6127cc21bd 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileW/test1/CopyFileW.c
+++ b/src/pal/tests/palsuite/file_io/CopyFileW/test1/CopyFileW.cpp
diff --git a/src/pal/tests/palsuite/file_io/CopyFileW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CopyFileW/test2/CMakeLists.txt
index 5c0030bc8d..4201bdca88 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CopyFileW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_copyfilew_test2
diff --git a/src/pal/tests/palsuite/file_io/CopyFileW/test2/test2.c b/src/pal/tests/palsuite/file_io/CopyFileW/test2/test2.cpp
index 5380a181ca..5380a181ca 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileW/test2/test2.c
+++ b/src/pal/tests/palsuite/file_io/CopyFileW/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/file_io/CopyFileW/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CopyFileW/test3/CMakeLists.txt
index 52d9aad1c0..d0fd94c990 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CopyFileW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_copyfilew_test3
diff --git a/src/pal/tests/palsuite/file_io/CopyFileW/test3/test3.c b/src/pal/tests/palsuite/file_io/CopyFileW/test3/test3.cpp
index a2eb04c443..a2eb04c443 100644
--- a/src/pal/tests/palsuite/file_io/CopyFileW/test3/test3.c
+++ b/src/pal/tests/palsuite/file_io/CopyFileW/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CMakeLists.txt
index f8cdf19933..1dc87fa34b 100644
--- a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateDirectoryA.c
+ CreateDirectoryA.cpp
)
add_executable(paltest_createdirectorya_test1
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.c b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.c
deleted file mode 100644
index 2bb441e732..0000000000
--- a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.c
+++ /dev/null
@@ -1,296 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: CreateDirectoryA.c
-**
-** Purpose: Tests the PAL implementation of the CreateDirectoryA function.
-**
-** Depends on:
-** RemoveDirectoryW (since RemoveDirectoryA is unavailable)
-** GetCurrentDirectoryA
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-
-/* apparently, under WIN32 the max path size is 248 but under
- BSD it is _MAX_PATH */
-#if WIN32
-#define CREATE_MAX_PATH_SIZE 248
-#else
-#define CREATE_MAX_PATH_SIZE _MAX_PATH
-#endif
-
-
-int __cdecl main(int argc, char *argv[])
-{
- const char* szTestDir = {"test_directory"};
- const char* szDotDir = {".dotDirectory"};
- BOOL bRc = FALSE;
- BOOL bSuccess = FALSE;
- const int buf_size = CREATE_MAX_PATH_SIZE + 10;
- char szDirName[CREATE_MAX_PATH_SIZE + 10];
- char buffer[CREATE_MAX_PATH_SIZE + 10];
- WCHAR* pTemp = NULL;
- DWORD curDirLen;
- DWORD curDirectory = 1024;
-
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
-
- /* directory does not exist */
- bRc = CreateDirectoryA(szTestDir, NULL);
- if (bRc == FALSE)
- {
- Fail("CreateDirectoryA: Failed to create \"%s\" with error code %ld\n",
- szTestDir,
- GetLastError());
- }
-
-
- /* directory exists should fail */
- bRc = CreateDirectoryA(szTestDir, NULL);
- if (bRc == TRUE)
- {
- pTemp = convert((LPSTR)szTestDir);
- bRc = RemoveDirectoryW(pTemp);
- free(pTemp);
- if (!bRc)
- {
- Trace("CreateDirectoryA: RemoveDirectoryW failed to remove "
- "\"%s\" with the error code %ld.\n",
- szTestDir,
- GetLastError());
- }
- Fail("CreateDirectoryA: Succeeded creating the directory"
- "\"%s\" when it exists already.\n",
- szTestDir);
- }
- else
- {
- pTemp = convert((LPSTR)szTestDir);
- bRc = RemoveDirectoryW(pTemp);
- free(pTemp);
- if (!bRc)
- {
- Fail("CreateDirectoryA: RemoveDirectoryW failed to remove "
- "\"%s\" with the error code %ld.\n",
- szTestDir,
- GetLastError());
- }
- }
-
-
- /* long directory names (CREATE_MAX_PATH_SIZE - 1, CREATE_MAX_PATH_SIZE
- and CREATE_MAX_PATH_SIZE + 1 characters
- including terminating null char) */
-
- curDirLen = GetCurrentDirectoryA(0, NULL);
-
- memset(szDirName, 0, buf_size);
- memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - 2 - curDirLen);
- bRc = CreateDirectoryA(szDirName, NULL);
- if (bRc == FALSE)
- {
- Fail("CreateDirectoryA: Failed to create a directory"
- " name %d chars long with the error code %ld\n",
- strlen(szDirName),
- GetLastError());
- }
- else
- {
- /* Check to see if it's possible to navigate to directory */
- GetCurrentDirectoryA(curDirectory, buffer);
- bSuccess = SetCurrentDirectoryA(szDirName);
- if(!bSuccess)
- {
- Fail("CreateDirectoryA: SetCurrentDirectoryA failed to "
- "navigate to the newly created directory with error "
- "code %u.\n", GetLastError());
- }
-
- /* Set directory back to initial directory */
- SetCurrentDirectoryA(buffer);
-
- pTemp = convert((LPSTR)szDirName);
- bRc = RemoveDirectoryW(pTemp);
- free(pTemp);
- if (!bRc)
- {
- Fail("CreateDirectoryA: RemoveDirectoryW failed to remove "
- "\"%s\" with the error code %ld.\n",
- szDirName,
- GetLastError());
- }
- }
-
-
- memset(szDirName, 0, buf_size);
- memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - 1 - curDirLen);
- bRc = CreateDirectoryA(szDirName, NULL);
- if (bRc == FALSE)
- {
- Fail("CreateDirectoryA: Failed to create a directory"
- " name %d chars long with error code %ld\n",
- strlen(szDirName),
- GetLastError());
- }
- else
- {
- /* Check to see if it's possible to navigate to directory */
- GetCurrentDirectoryA(curDirectory, buffer);
- bSuccess = SetCurrentDirectoryA(szDirName);
- if(!bSuccess)
- {
- Fail("CreateDirectoryA: SetCurrentDirectoryA failed to "
- "navigate to the newly created directory with error "
- "code %u.\n", GetLastError());
- }
-
- /* Set Directroy back to initial directory */
- SetCurrentDirectoryA(buffer);
-
- pTemp = convert(szDirName);
- bRc = RemoveDirectoryW(pTemp);
- free(pTemp);
- if (!bRc)
- {
- Fail("CreateDirectoryA: RemoveDirectoryW failed to remove "
- "\"%s\" with the error code %ld.\n",
- szDirName,
- GetLastError());
- }
- }
-
- memset(szDirName, 0, buf_size);
- memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - curDirLen);
- bRc = CreateDirectoryA(szDirName, NULL);
- if (bRc != FALSE)
- {
- /* Check to see if it's possible to navigate to directory */
- GetCurrentDirectoryA(curDirectory, buffer);
- bSuccess = SetCurrentDirectoryA(szDirName);
- if(!bSuccess)
- {
- Fail("CreateDirectoryA: SetCurrentDirectoryA failed to "
- "navigate to the newly created directory with error "
- "code %u.\n", GetLastError());
- }
-
- /* set directory back to initial directory */
- SetCurrentDirectoryA(buffer);
-
- pTemp = convert(szDirName);
- bRc = RemoveDirectoryW(pTemp);
- free(pTemp);
- if (!bRc)
- {
- Trace("CreateDirectoryA: RemoveDirectoryW failed to remove "
- "\"%s\" with the error code %ld.\n",
- szDirName,
- GetLastError());
- }
- if (strlen(szDirName) > CREATE_MAX_PATH_SIZE)
- {
- Fail("CreateDirectoryA: Failed because it created a directory"
- " name 1 character longer (%d chars) than the max dir size "
- "allowed\n",
- strlen(szDirName));
- }
- }
-
-
- /* long directory name CREATE_MAX_PATH_SIZE + 3 chars including "..\"
- (real path length <= CREATE_MAX_PATH_SIZE) */
- memset(szDirName, 0, buf_size);
- memset(szDirName, 'a', CREATE_MAX_PATH_SIZE + 3 - 1 - curDirLen);
- szDirName[0] = '.';
- szDirName[1] = '.';
- szDirName[2] = '\\';
- bRc = CreateDirectoryA(szDirName, NULL);
- if (bRc == FALSE)
- {
- Fail("CreateDirectoryA: Failed to create a directory name more "
- "than %d chars long and its real path name is less "
- "than %d chars, error %u\n",
- CREATE_MAX_PATH_SIZE,
- CREATE_MAX_PATH_SIZE, GetLastError());
- }
- else
- {
- /* Check to see if it's possible to navigate to directory */
- GetCurrentDirectoryA(curDirectory, buffer);
- bSuccess = SetCurrentDirectoryA(szDirName);
- if(!bSuccess)
- {
- Fail("CreateDirectoryA: SetCurrentDirectoryA failed to "
- "navigate to the newly created directory with error "
- "code %u.\n", GetLastError());
- }
-
- /* set directory back to initial directory */
- SetCurrentDirectoryA(buffer);
-
- pTemp = convert(szDirName);
- bRc = RemoveDirectoryW(pTemp);
- free(pTemp);
- if (!bRc)
- {
- Fail("CreateDirectoryA: RemoveDirectoryW failed to remove "
- " \"%s\" with the error code %ld.\n",
- szDirName,
- GetLastError());
- }
- }
-
-
- /* directories with dots */
- memset(szDirName, 0, buf_size);
- sprintf(szDirName, szDotDir);
- bRc = CreateDirectoryA(szDirName, NULL);
- if (bRc == FALSE)
- {
- Fail("CreateDirectoryA: Failed to create \"%s\" with error code %ld\n",
- szDotDir,
- GetLastError());
- }
- else
- {
-
- /* Check to see if it's possible to navigate to directory */
- GetCurrentDirectoryA(curDirectory, buffer);
- bSuccess = SetCurrentDirectoryA(szDirName);
- if(!bSuccess)
- {
- Fail("CreateDirectoryA: SetCurrentDirectoryA failed to "
- "navigate to the newly created directory with error "
- "code %u.\n", GetLastError());
- }
-
- /* set directory back to initial directory */
- SetCurrentDirectoryA(buffer);
-
- pTemp = convert((LPSTR)szDotDir);
- bRc = RemoveDirectoryW(pTemp);
- free(pTemp);
- if (!bRc)
- {
- Fail("CreateDirectoryA: RemoveDirectoryW failed to remove "
- " \"%s\" with the error code %ld.\n",
- szDotDir,
- GetLastError());
- }
- }
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.cpp b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.cpp
new file mode 100644
index 0000000000..4082d38b36
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.cpp
@@ -0,0 +1,296 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: CreateDirectoryA.c
+**
+** Purpose: Tests the PAL implementation of the CreateDirectoryA function.
+**
+** Depends on:
+** RemoveDirectoryW (since RemoveDirectoryA is unavailable)
+** GetCurrentDirectoryA
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+
+/* apparently, under WIN32 the max path size is 248 but under
+ BSD it is _MAX_PATH */
+#if WIN32
+#define CREATE_MAX_PATH_SIZE 248
+#else
+#define CREATE_MAX_PATH_SIZE _MAX_PATH
+#endif
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ const char* szTestDir = {"test_directory"};
+ const char* szDotDir = {".dotDirectory"};
+ BOOL bRc = FALSE;
+ BOOL bSuccess = FALSE;
+ const int buf_size = CREATE_MAX_PATH_SIZE + 10;
+ char szDirName[CREATE_MAX_PATH_SIZE + 10];
+ char buffer[CREATE_MAX_PATH_SIZE + 10];
+ WCHAR* pTemp = NULL;
+ DWORD curDirLen;
+ DWORD curDirectory = 1024;
+
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+
+ /* directory does not exist */
+ bRc = CreateDirectoryA(szTestDir, NULL);
+ if (bRc == FALSE)
+ {
+ Fail("CreateDirectoryA: Failed to create \"%s\" with error code %ld\n",
+ szTestDir,
+ GetLastError());
+ }
+
+
+ /* directory exists should fail */
+ bRc = CreateDirectoryA(szTestDir, NULL);
+ if (bRc == TRUE)
+ {
+ pTemp = convert((LPSTR)szTestDir);
+ bRc = RemoveDirectoryW(pTemp);
+ free(pTemp);
+ if (!bRc)
+ {
+ Trace("CreateDirectoryA: RemoveDirectoryW failed to remove "
+ "\"%s\" with the error code %ld.\n",
+ szTestDir,
+ GetLastError());
+ }
+ Fail("CreateDirectoryA: Succeeded creating the directory"
+ "\"%s\" when it exists already.\n",
+ szTestDir);
+ }
+ else
+ {
+ pTemp = convert((LPSTR)szTestDir);
+ bRc = RemoveDirectoryW(pTemp);
+ free(pTemp);
+ if (!bRc)
+ {
+ Fail("CreateDirectoryA: RemoveDirectoryW failed to remove "
+ "\"%s\" with the error code %ld.\n",
+ szTestDir,
+ GetLastError());
+ }
+ }
+
+
+ /* long directory names (CREATE_MAX_PATH_SIZE - 1, CREATE_MAX_PATH_SIZE
+ and CREATE_MAX_PATH_SIZE + 1 characters
+ including terminating null char) */
+
+ curDirLen = GetCurrentDirectoryA(0, NULL);
+
+ memset(szDirName, 0, buf_size);
+ memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - 2 - curDirLen);
+ bRc = CreateDirectoryA(szDirName, NULL);
+ if (bRc == FALSE)
+ {
+ Fail("CreateDirectoryA: Failed to create a directory"
+ " name %d chars long with the error code %ld\n",
+ strlen(szDirName),
+ GetLastError());
+ }
+ else
+ {
+ /* Check to see if it's possible to navigate to directory */
+ GetCurrentDirectoryA(curDirectory, buffer);
+ bSuccess = SetCurrentDirectoryA(szDirName);
+ if(!bSuccess)
+ {
+ Fail("CreateDirectoryA: SetCurrentDirectoryA failed to "
+ "navigate to the newly created directory with error "
+ "code %u.\n", GetLastError());
+ }
+
+ /* Set directory back to initial directory */
+ SetCurrentDirectoryA(buffer);
+
+ pTemp = convert((LPSTR)szDirName);
+ bRc = RemoveDirectoryW(pTemp);
+ free(pTemp);
+ if (!bRc)
+ {
+ Fail("CreateDirectoryA: RemoveDirectoryW failed to remove "
+ "\"%s\" with the error code %ld.\n",
+ szDirName,
+ GetLastError());
+ }
+ }
+
+
+ memset(szDirName, 0, buf_size);
+ memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - 1 - curDirLen);
+ bRc = CreateDirectoryA(szDirName, NULL);
+ if (bRc == FALSE)
+ {
+ Fail("CreateDirectoryA: Failed to create a directory"
+ " name %d chars long with error code %ld\n",
+ strlen(szDirName),
+ GetLastError());
+ }
+ else
+ {
+ /* Check to see if it's possible to navigate to directory */
+ GetCurrentDirectoryA(curDirectory, buffer);
+ bSuccess = SetCurrentDirectoryA(szDirName);
+ if(!bSuccess)
+ {
+ Fail("CreateDirectoryA: SetCurrentDirectoryA failed to "
+ "navigate to the newly created directory with error "
+ "code %u.\n", GetLastError());
+ }
+
+ /* Set Directroy back to initial directory */
+ SetCurrentDirectoryA(buffer);
+
+ pTemp = convert(szDirName);
+ bRc = RemoveDirectoryW(pTemp);
+ free(pTemp);
+ if (!bRc)
+ {
+ Fail("CreateDirectoryA: RemoveDirectoryW failed to remove "
+ "\"%s\" with the error code %ld.\n",
+ szDirName,
+ GetLastError());
+ }
+ }
+
+ memset(szDirName, 0, buf_size);
+ memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - curDirLen);
+ bRc = CreateDirectoryA(szDirName, NULL);
+ if (bRc != FALSE)
+ {
+ /* Check to see if it's possible to navigate to directory */
+ GetCurrentDirectoryA(curDirectory, buffer);
+ bSuccess = SetCurrentDirectoryA(szDirName);
+ if(!bSuccess)
+ {
+ Fail("CreateDirectoryA: SetCurrentDirectoryA failed to "
+ "navigate to the newly created directory with error "
+ "code %u.\n", GetLastError());
+ }
+
+ /* set directory back to initial directory */
+ SetCurrentDirectoryA(buffer);
+
+ pTemp = convert(szDirName);
+ bRc = RemoveDirectoryW(pTemp);
+ free(pTemp);
+ if (!bRc)
+ {
+ Trace("CreateDirectoryA: RemoveDirectoryW failed to remove "
+ "\"%s\" with the error code %ld.\n",
+ szDirName,
+ GetLastError());
+ }
+ if (strlen(szDirName) > CREATE_MAX_PATH_SIZE)
+ {
+ Fail("CreateDirectoryA: Failed because it created a directory"
+ " name 1 character longer (%d chars) than the max dir size "
+ "allowed\n",
+ strlen(szDirName));
+ }
+ }
+
+
+ /* long directory name CREATE_MAX_PATH_SIZE + 3 chars including "..\"
+ (real path length <= CREATE_MAX_PATH_SIZE) */
+ memset(szDirName, 0, buf_size);
+ memset(szDirName, 'a', CREATE_MAX_PATH_SIZE + 3 - 1 - curDirLen);
+ szDirName[0] = '.';
+ szDirName[1] = '.';
+ szDirName[2] = '\\';
+ bRc = CreateDirectoryA(szDirName, NULL);
+ if (bRc == FALSE)
+ {
+ Fail("CreateDirectoryA: Failed to create a directory name more "
+ "than %d chars long and its real path name is less "
+ "than %d chars, error %u\n",
+ CREATE_MAX_PATH_SIZE,
+ CREATE_MAX_PATH_SIZE, GetLastError());
+ }
+ else
+ {
+ /* Check to see if it's possible to navigate to directory */
+ GetCurrentDirectoryA(curDirectory, buffer);
+ bSuccess = SetCurrentDirectoryA(szDirName);
+ if(!bSuccess)
+ {
+ Fail("CreateDirectoryA: SetCurrentDirectoryA failed to "
+ "navigate to the newly created directory with error "
+ "code %u.\n", GetLastError());
+ }
+
+ /* set directory back to initial directory */
+ SetCurrentDirectoryA(buffer);
+
+ pTemp = convert(szDirName);
+ bRc = RemoveDirectoryW(pTemp);
+ free(pTemp);
+ if (!bRc)
+ {
+ Fail("CreateDirectoryA: RemoveDirectoryW failed to remove "
+ " \"%s\" with the error code %ld.\n",
+ szDirName,
+ GetLastError());
+ }
+ }
+
+
+ /* directories with dots */
+ memset(szDirName, 0, buf_size);
+ sprintf_s(szDirName, _countof(szDirName), szDotDir);
+ bRc = CreateDirectoryA(szDirName, NULL);
+ if (bRc == FALSE)
+ {
+ Fail("CreateDirectoryA: Failed to create \"%s\" with error code %ld\n",
+ szDotDir,
+ GetLastError());
+ }
+ else
+ {
+
+ /* Check to see if it's possible to navigate to directory */
+ GetCurrentDirectoryA(curDirectory, buffer);
+ bSuccess = SetCurrentDirectoryA(szDirName);
+ if(!bSuccess)
+ {
+ Fail("CreateDirectoryA: SetCurrentDirectoryA failed to "
+ "navigate to the newly created directory with error "
+ "code %u.\n", GetLastError());
+ }
+
+ /* set directory back to initial directory */
+ SetCurrentDirectoryA(buffer);
+
+ pTemp = convert((LPSTR)szDotDir);
+ bRc = RemoveDirectoryW(pTemp);
+ free(pTemp);
+ if (!bRc)
+ {
+ Fail("CreateDirectoryA: RemoveDirectoryW failed to remove "
+ " \"%s\" with the error code %ld.\n",
+ szDotDir,
+ GetLastError());
+ }
+ }
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/CMakeLists.txt
index a50a986d1a..3ee8abbcc2 100644
--- a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- createdirectorya.c
+ createdirectorya.cpp
)
add_executable(paltest_createdirectorya_test2
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/createdirectorya.c b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/createdirectorya.cpp
index fc1bc967b7..fc1bc967b7 100644
--- a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/createdirectorya.c
+++ b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test2/createdirectorya.cpp
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CMakeLists.txt
index 1981e37082..f8cb584cc6 100644
--- a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateDirectoryW.c
+ CreateDirectoryW.cpp
)
add_executable(paltest_createdirectoryw_test1
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.c b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.c
deleted file mode 100644
index 9b020cc19c..0000000000
--- a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.c
+++ /dev/null
@@ -1,347 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: CreateDirectoryW.c
-**
-** Purpose: Tests the PAL implementation of the CreateDirectoryW function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-
-/* apparently, under WIN32 the max path size is 248 but under
- BSD it is _MAX_PATH */
-#if WIN32
-#define CREATE_MAX_PATH_SIZE 248
-#else
-#define CREATE_MAX_PATH_SIZE _MAX_PATH
-#endif
-
-
-int __cdecl main(int argc, char *argv[])
-{
- BOOL bRc = FALSE;
- BOOL bSuccess = FALSE;
- const int buf_size = CREATE_MAX_PATH_SIZE + 10;
- char szDirName[CREATE_MAX_PATH_SIZE + 10];
- char buffer[CREATE_MAX_PATH_SIZE + 10];
- WCHAR* pTemp = NULL;
- DWORD curDirLen;
- DWORD curDirectory = 1024;
-
-
-
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
- /* directory does not exist */
- pTemp = convert("test_directory");
- bRc = CreateDirectoryW(pTemp, NULL);
- free(pTemp);
- if (bRc == FALSE)
- {
- Fail("CreateDirectoryW: Failed to create \"test_directory\"\n");
- }
-
- /* directory exists */
- pTemp = convert("test_directory");
- bRc = CreateDirectoryW(pTemp, NULL);
- if (bRc == TRUE)
- {
- bRc = RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- free(pTemp);
- Fail("CreateDirectoryW: Succeeded creating the directory"
- " \"test_directory\" when it exists already.\n");
- }
-
- bRc = RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- free(pTemp);
-
- /* long directory names (CREATE_MAX_PATH_SIZE - 1, CREATE_MAX_PATH_SIZE
- and CREATE_MAX_PATH_SIZE + 1 characters
- including terminating null char) */
-
- curDirLen = GetCurrentDirectoryA(0, NULL);
-
- memset(szDirName, 0, buf_size);
- memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - 2 - curDirLen);
- pTemp = convert((LPSTR)szDirName);
- bRc = CreateDirectoryW(pTemp, NULL);
- if (bRc == FALSE)
- {
- free(pTemp);
- Fail("CreateDirectoryW: Failed to create a directory"
- " name (%d) chars long with the error code %ld\n",
- CREATE_MAX_PATH_SIZE - 1,
- GetLastError());
- }
- else
- {
-
- /* Check to see if it's possible to navigate to directory */
- GetCurrentDirectoryA(curDirectory, buffer);
- bSuccess = SetCurrentDirectoryA(szDirName);
- if(!bSuccess)
- {
- Trace("CreateDirectoryW: SetCurrentDirectoryA failed to "
- "navigate to the newly created directory with error "
- "code %u.\n", GetLastError());
- bRc = RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- free(pTemp);
- Fail("");
-
- }
-
- /* Set directory back to initial directory */
- bRc = SetCurrentDirectoryA(buffer);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: SetCurrentDirectoryA failed to "
- "change the directory with error %u.\n",
- GetLastError());
- }
-
- bRc = RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- free(pTemp);
- }
-
-
- memset(szDirName, 0, buf_size);
- memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - 1 - curDirLen);
- pTemp = convert(szDirName);
- bRc = CreateDirectoryW(pTemp, NULL);
- if (bRc == FALSE)
- {
- free(pTemp);
- Fail("CreateDirectoryW: Failed to create a directory"
- " name %d chars long with error code %ld\n",
- strlen(szDirName),
- GetLastError());
- }
- else
- {
- /* Check to see if it's possible to navigate to directory */
- GetCurrentDirectoryA(curDirectory, buffer);
- bSuccess = SetCurrentDirectoryA(szDirName);
- if(!bSuccess)
- {
- Trace("CreateDirectoryW: SetCurrentDirectoryA failed to "
- "navigate to the newly created directory with error "
- "code %u.\n", GetLastError());
-
- bRc = RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- free(pTemp);
- Fail("");
- }
-
- /* Set directory back to initial directory */
- bRc = SetCurrentDirectoryA(buffer);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: SetCurrentDirectoryA failed to "
- "change the directory with error %u.\n",
- GetLastError());
- }
-
-
- bRc = RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- free(pTemp);
- }
-
- memset(szDirName, 0, buf_size);
- memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - curDirLen);
- pTemp = convert(szDirName);
- bRc = CreateDirectoryW(pTemp, NULL);
-
- if (bRc != FALSE)
- {
- RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- if (strlen(szDirName) > CREATE_MAX_PATH_SIZE)
- {
- free(pTemp);
- Fail("CreateDirectoryW: Failed because it created a directory"
- " name 1 character longer (%d chars) than the max dir size"
- " allowed\n",
- strlen(szDirName));
- }
- }
-
- free(pTemp);
-
- /* long directory name CREATE_MAX_PATH_SIZE + 3 chars including "..\"
- (real path length <= CREATE_MAX_PATH_SIZE) */
- memset(szDirName, 0, buf_size);
- memset(szDirName, 'a', CREATE_MAX_PATH_SIZE + 3 - 1 - curDirLen);
- szDirName[0] = '.';
- szDirName[1] = '.';
- szDirName[2] = '\\';
- pTemp = convert(szDirName);
- bRc = CreateDirectoryW(pTemp, NULL);
- if (bRc == FALSE)
- {
- free(pTemp);
- Fail("CreateDirectoryW: Failed to create a directory name more "
- "than %d chars long and its real path name is less "
- "than %d chars\n",
- CREATE_MAX_PATH_SIZE,
- CREATE_MAX_PATH_SIZE);
- }
- else
- {
- /* Check to see if it's possible to navigate to directory */
- GetCurrentDirectoryA(curDirectory, buffer);
- bSuccess = SetCurrentDirectoryA(szDirName);
- if(!bSuccess)
- {
- Trace("CreateDirectoryW: SetCurrentDirectoryA failed to "
- "navigate to the newly created directory with error "
- "code %u.\n", GetLastError());
- bRc = RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- free(pTemp);
- Fail("");
- }
-
- /* Set directory back to initial directory */
- bRc = SetCurrentDirectoryA(buffer);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: SetCurrentDirectoryA failed to "
- "change the directory with error %u.\n",
- GetLastError());
- }
-
- bRc = RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- free(pTemp);
- }
-
- /* directories with dots */
- memset(szDirName, 0, 252);
- sprintf(szDirName, ".dotDirectory");
- pTemp = convert(szDirName);
- bRc = CreateDirectoryW(pTemp, NULL);
- if (bRc == FALSE)
- {
- free(pTemp);
- Fail("CreateDirectoryW: Failed to create a dot directory\n");
- }
- else
- {
- /* Check to see if it's possible to navigate to directory */
- GetCurrentDirectoryA(curDirectory, buffer);
- bSuccess = SetCurrentDirectoryA(szDirName);
- if(!bSuccess)
- {
- Trace("CreateDirectoryW: SetCurrentDirectoryA failed to "
- "navigate to the newly created directory with error "
- "code %u.\n", GetLastError());
-
- bRc = RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- free(pTemp);
- Fail("");
- }
-
- /* Set directory back to initial directory */
- bRc = SetCurrentDirectoryA(buffer);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: SetCurrentDirectoryA failed to "
- "change the directory with error %u.\n",
- GetLastError());
- }
-
- bRc = RemoveDirectoryW(pTemp);
- if(!bRc)
- {
- free(pTemp);
- Fail("CreateDirectoryW: RemoveDirectoryW failed to "
- "delete the directory with error %u.\n",
- GetLastError());
- }
- free(pTemp);
- }
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.cpp b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.cpp
new file mode 100644
index 0000000000..bbaedda745
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.cpp
@@ -0,0 +1,347 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: CreateDirectoryW.c
+**
+** Purpose: Tests the PAL implementation of the CreateDirectoryW function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+
+/* apparently, under WIN32 the max path size is 248 but under
+ BSD it is _MAX_PATH */
+#if WIN32
+#define CREATE_MAX_PATH_SIZE 248
+#else
+#define CREATE_MAX_PATH_SIZE _MAX_PATH
+#endif
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ BOOL bRc = FALSE;
+ BOOL bSuccess = FALSE;
+ const int buf_size = CREATE_MAX_PATH_SIZE + 10;
+ char szDirName[CREATE_MAX_PATH_SIZE + 10];
+ char buffer[CREATE_MAX_PATH_SIZE + 10];
+ WCHAR* pTemp = NULL;
+ DWORD curDirLen;
+ DWORD curDirectory = 1024;
+
+
+
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+ /* directory does not exist */
+ pTemp = convert("test_directory");
+ bRc = CreateDirectoryW(pTemp, NULL);
+ free(pTemp);
+ if (bRc == FALSE)
+ {
+ Fail("CreateDirectoryW: Failed to create \"test_directory\"\n");
+ }
+
+ /* directory exists */
+ pTemp = convert("test_directory");
+ bRc = CreateDirectoryW(pTemp, NULL);
+ if (bRc == TRUE)
+ {
+ bRc = RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ free(pTemp);
+ Fail("CreateDirectoryW: Succeeded creating the directory"
+ " \"test_directory\" when it exists already.\n");
+ }
+
+ bRc = RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ free(pTemp);
+
+ /* long directory names (CREATE_MAX_PATH_SIZE - 1, CREATE_MAX_PATH_SIZE
+ and CREATE_MAX_PATH_SIZE + 1 characters
+ including terminating null char) */
+
+ curDirLen = GetCurrentDirectoryA(0, NULL);
+
+ memset(szDirName, 0, buf_size);
+ memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - 2 - curDirLen);
+ pTemp = convert((LPSTR)szDirName);
+ bRc = CreateDirectoryW(pTemp, NULL);
+ if (bRc == FALSE)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: Failed to create a directory"
+ " name (%d) chars long with the error code %ld\n",
+ CREATE_MAX_PATH_SIZE - 1,
+ GetLastError());
+ }
+ else
+ {
+
+ /* Check to see if it's possible to navigate to directory */
+ GetCurrentDirectoryA(curDirectory, buffer);
+ bSuccess = SetCurrentDirectoryA(szDirName);
+ if(!bSuccess)
+ {
+ Trace("CreateDirectoryW: SetCurrentDirectoryA failed to "
+ "navigate to the newly created directory with error "
+ "code %u.\n", GetLastError());
+ bRc = RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ free(pTemp);
+ Fail("");
+
+ }
+
+ /* Set directory back to initial directory */
+ bRc = SetCurrentDirectoryA(buffer);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: SetCurrentDirectoryA failed to "
+ "change the directory with error %u.\n",
+ GetLastError());
+ }
+
+ bRc = RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ free(pTemp);
+ }
+
+
+ memset(szDirName, 0, buf_size);
+ memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - 1 - curDirLen);
+ pTemp = convert(szDirName);
+ bRc = CreateDirectoryW(pTemp, NULL);
+ if (bRc == FALSE)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: Failed to create a directory"
+ " name %d chars long with error code %ld\n",
+ strlen(szDirName),
+ GetLastError());
+ }
+ else
+ {
+ /* Check to see if it's possible to navigate to directory */
+ GetCurrentDirectoryA(curDirectory, buffer);
+ bSuccess = SetCurrentDirectoryA(szDirName);
+ if(!bSuccess)
+ {
+ Trace("CreateDirectoryW: SetCurrentDirectoryA failed to "
+ "navigate to the newly created directory with error "
+ "code %u.\n", GetLastError());
+
+ bRc = RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ free(pTemp);
+ Fail("");
+ }
+
+ /* Set directory back to initial directory */
+ bRc = SetCurrentDirectoryA(buffer);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: SetCurrentDirectoryA failed to "
+ "change the directory with error %u.\n",
+ GetLastError());
+ }
+
+
+ bRc = RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ free(pTemp);
+ }
+
+ memset(szDirName, 0, buf_size);
+ memset(szDirName, 'a', CREATE_MAX_PATH_SIZE - curDirLen);
+ pTemp = convert(szDirName);
+ bRc = CreateDirectoryW(pTemp, NULL);
+
+ if (bRc != FALSE)
+ {
+ RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ if (strlen(szDirName) > CREATE_MAX_PATH_SIZE)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: Failed because it created a directory"
+ " name 1 character longer (%d chars) than the max dir size"
+ " allowed\n",
+ strlen(szDirName));
+ }
+ }
+
+ free(pTemp);
+
+ /* long directory name CREATE_MAX_PATH_SIZE + 3 chars including "..\"
+ (real path length <= CREATE_MAX_PATH_SIZE) */
+ memset(szDirName, 0, buf_size);
+ memset(szDirName, 'a', CREATE_MAX_PATH_SIZE + 3 - 1 - curDirLen);
+ szDirName[0] = '.';
+ szDirName[1] = '.';
+ szDirName[2] = '\\';
+ pTemp = convert(szDirName);
+ bRc = CreateDirectoryW(pTemp, NULL);
+ if (bRc == FALSE)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: Failed to create a directory name more "
+ "than %d chars long and its real path name is less "
+ "than %d chars\n",
+ CREATE_MAX_PATH_SIZE,
+ CREATE_MAX_PATH_SIZE);
+ }
+ else
+ {
+ /* Check to see if it's possible to navigate to directory */
+ GetCurrentDirectoryA(curDirectory, buffer);
+ bSuccess = SetCurrentDirectoryA(szDirName);
+ if(!bSuccess)
+ {
+ Trace("CreateDirectoryW: SetCurrentDirectoryA failed to "
+ "navigate to the newly created directory with error "
+ "code %u.\n", GetLastError());
+ bRc = RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ free(pTemp);
+ Fail("");
+ }
+
+ /* Set directory back to initial directory */
+ bRc = SetCurrentDirectoryA(buffer);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: SetCurrentDirectoryA failed to "
+ "change the directory with error %u.\n",
+ GetLastError());
+ }
+
+ bRc = RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ free(pTemp);
+ }
+
+ /* directories with dots */
+ memset(szDirName, 0, 252);
+ sprintf_s(szDirName, _countof(szDirName), ".dotDirectory");
+ pTemp = convert(szDirName);
+ bRc = CreateDirectoryW(pTemp, NULL);
+ if (bRc == FALSE)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: Failed to create a dot directory\n");
+ }
+ else
+ {
+ /* Check to see if it's possible to navigate to directory */
+ GetCurrentDirectoryA(curDirectory, buffer);
+ bSuccess = SetCurrentDirectoryA(szDirName);
+ if(!bSuccess)
+ {
+ Trace("CreateDirectoryW: SetCurrentDirectoryA failed to "
+ "navigate to the newly created directory with error "
+ "code %u.\n", GetLastError());
+
+ bRc = RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ free(pTemp);
+ Fail("");
+ }
+
+ /* Set directory back to initial directory */
+ bRc = SetCurrentDirectoryA(buffer);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: SetCurrentDirectoryA failed to "
+ "change the directory with error %u.\n",
+ GetLastError());
+ }
+
+ bRc = RemoveDirectoryW(pTemp);
+ if(!bRc)
+ {
+ free(pTemp);
+ Fail("CreateDirectoryW: RemoveDirectoryW failed to "
+ "delete the directory with error %u.\n",
+ GetLastError());
+ }
+ free(pTemp);
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/CMakeLists.txt
index aae4e7dc54..f8614ca5a6 100644
--- a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- createdirectoryw.c
+ createdirectoryw.cpp
)
add_executable(paltest_createdirectoryw_test2
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/createdirectoryw.c b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/createdirectoryw.cpp
index 20fac5a879..20fac5a879 100644
--- a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/createdirectoryw.c
+++ b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test2/createdirectoryw.cpp
diff --git a/src/pal/tests/palsuite/file_io/CreateFileA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CreateFileA/test1/CMakeLists.txt
index 8814b2281b..edacdbd621 100644
--- a/src/pal/tests/palsuite/file_io/CreateFileA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CreateFileA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileA.c
+ CreateFileA.cpp
)
add_executable(paltest_createfilea_test1
diff --git a/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.c b/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.c
deleted file mode 100644
index a70867a5c8..0000000000
--- a/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.c
+++ /dev/null
@@ -1,145 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: CreateFileA.c
-**
-** Purpose: Test the PAL implementation of the CreateFileA function
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-BOOL Cleanup(void)
-{
- char FileName[20];
- int i;
- BOOL bRet = TRUE; // assume success
-
- // loop through all accesses, modes, dispositions and flags
- for (i=0; i<4*8*4*5; ++i) {
- sprintf(FileName, "test%03d.txt", i);
- if (DeleteFileA(FileName) == FALSE) {
- if (GetLastError() != ERROR_FILE_NOT_FOUND) {
- bRet = FALSE;
- }
- }
- }
- return bRet;
-}
-
-
-int __cdecl main(int argc, char *argv[])
-{
- BOOL bSuccess = TRUE;
- int nCounter = 0;
- HANDLE hFile;
- char lpFileName[20];
- FILE *outFile = NULL;
- char results[1024];
- int i, j, k, l;
- DWORD dwDesiredAccess[4] = {0, // 0
- GENERIC_READ, // 1
- GENERIC_WRITE, // 2
- GENERIC_READ | GENERIC_WRITE}; // 3
- DWORD dwShareMode[8] = {0, // 0
- FILE_SHARE_READ, // 1
- FILE_SHARE_WRITE, // 2
- FILE_SHARE_DELETE, // 3
- FILE_SHARE_READ | FILE_SHARE_WRITE, // 4
- FILE_SHARE_READ | FILE_SHARE_DELETE, // 5
- FILE_SHARE_WRITE | FILE_SHARE_DELETE, // 6
- FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE}; // 7
- LPSECURITY_ATTRIBUTES lpAttr = NULL;
- DWORD dwCreationDisp[4] = {CREATE_NEW, // 0
- CREATE_ALWAYS, // 1
- OPEN_EXISTING, // 2
- OPEN_ALWAYS}; // 3
- DWORD dwFlagsAttrib[5] = {FILE_ATTRIBUTE_NORMAL, // 0
- FILE_FLAG_SEQUENTIAL_SCAN, // 1
- FILE_FLAG_WRITE_THROUGH, // 2
- FILE_FLAG_NO_BUFFERING, // 3
- FILE_FLAG_RANDOM_ACCESS}; // 4
- HANDLE hTemplate = NULL;
-
-
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
- if (!Cleanup()) {
- Trace("Pre-test Cleanup() failed. LastError=%d\n", GetLastError());
- return FAIL;
- }
-
- /* open the file to read the expected results */
- outFile = fopen("winoutput", "r");
- memset (results, 0, 1024);
-
- fgets(results, 1024, outFile);
- nCounter = (int)strlen(results);
- fclose(outFile);
-
- nCounter = 0;
-
- // desired access loop
- for (i = 0; i < 4; i++)
- {
- // share mode loop
- for (j = 0; j < 8; j++)
- {
- // security attributes loop
- for (k = 0; k < 4; k++)
- {
- // creation disp loop
- for (l = 0; l < 5; l++)
- {
- sprintf(lpFileName, "test%03d.txt", nCounter);
- hFile = CreateFile(lpFileName,
- dwDesiredAccess[i],
- dwShareMode[j],
- lpAttr,
- dwCreationDisp[k],
- dwFlagsAttrib[l],
- hTemplate);
- if (hFile == INVALID_HANDLE_VALUE)
- {
- if (results[nCounter] == '1')
- {
- Trace("CreateFile: ERROR: Failed when expected "
- "to pass %s [%d][%d][%d][%d]\n",
- lpFileName, i, j, k, l);
- bSuccess = FALSE;
- }
- }
- else
- {
- CloseHandle(hFile);
- if (results[nCounter] == '0')
- {
- Trace("CreateFile: ERROR: Passed when expected "
- "to fail %s [%d][%d][%d][%d]\n",
- lpFileName, i, j, k, l);
- bSuccess = FALSE;
- }
- }
- nCounter ++;
- }
- }
- }
- }
-
- if (!Cleanup())
- {
- Trace("Post-test Cleanup() failed. LastError=%d\n", GetLastError());
- return FAIL;
- }
-
- int exitCode = bSuccess ? PASS : FAIL;
- PAL_TerminateEx(exitCode);
- return exitCode;
-}
diff --git a/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp b/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp
new file mode 100644
index 0000000000..f98fc5b9c5
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp
@@ -0,0 +1,145 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: CreateFileA.c
+**
+** Purpose: Test the PAL implementation of the CreateFileA function
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+BOOL Cleanup(void)
+{
+ char FileName[20];
+ int i;
+ BOOL bRet = TRUE; // assume success
+
+ // loop through all accesses, modes, dispositions and flags
+ for (i=0; i<4*8*4*5; ++i) {
+ sprintf_s(FileName, _countof(FileName), "test%03d.txt", i);
+ if (DeleteFileA(FileName) == FALSE) {
+ if (GetLastError() != ERROR_FILE_NOT_FOUND) {
+ bRet = FALSE;
+ }
+ }
+ }
+ return bRet;
+}
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ BOOL bSuccess = TRUE;
+ int nCounter = 0;
+ HANDLE hFile;
+ char lpFileName[20];
+ FILE *outFile = NULL;
+ char results[1024];
+ int i, j, k, l;
+ DWORD dwDesiredAccess[4] = {0, // 0
+ GENERIC_READ, // 1
+ GENERIC_WRITE, // 2
+ GENERIC_READ | GENERIC_WRITE}; // 3
+ DWORD dwShareMode[8] = {0, // 0
+ FILE_SHARE_READ, // 1
+ FILE_SHARE_WRITE, // 2
+ FILE_SHARE_DELETE, // 3
+ FILE_SHARE_READ | FILE_SHARE_WRITE, // 4
+ FILE_SHARE_READ | FILE_SHARE_DELETE, // 5
+ FILE_SHARE_WRITE | FILE_SHARE_DELETE, // 6
+ FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE}; // 7
+ LPSECURITY_ATTRIBUTES lpAttr = NULL;
+ DWORD dwCreationDisp[4] = {CREATE_NEW, // 0
+ CREATE_ALWAYS, // 1
+ OPEN_EXISTING, // 2
+ OPEN_ALWAYS}; // 3
+ DWORD dwFlagsAttrib[5] = {FILE_ATTRIBUTE_NORMAL, // 0
+ FILE_FLAG_SEQUENTIAL_SCAN, // 1
+ FILE_FLAG_WRITE_THROUGH, // 2
+ FILE_FLAG_NO_BUFFERING, // 3
+ FILE_FLAG_RANDOM_ACCESS}; // 4
+ HANDLE hTemplate = NULL;
+
+
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+ if (!Cleanup()) {
+ Trace("Pre-test Cleanup() failed. LastError=%d\n", GetLastError());
+ return FAIL;
+ }
+
+ /* open the file to read the expected results */
+ outFile = fopen("winoutput", "r");
+ memset (results, 0, 1024);
+
+ fgets(results, 1024, outFile);
+ nCounter = (int)strlen(results);
+ fclose(outFile);
+
+ nCounter = 0;
+
+ // desired access loop
+ for (i = 0; i < 4; i++)
+ {
+ // share mode loop
+ for (j = 0; j < 8; j++)
+ {
+ // security attributes loop
+ for (k = 0; k < 4; k++)
+ {
+ // creation disp loop
+ for (l = 0; l < 5; l++)
+ {
+ sprintf_s(lpFileName, _countof(lpFileName), "test%03d.txt", nCounter);
+ hFile = CreateFile(lpFileName,
+ dwDesiredAccess[i],
+ dwShareMode[j],
+ lpAttr,
+ dwCreationDisp[k],
+ dwFlagsAttrib[l],
+ hTemplate);
+ if (hFile == INVALID_HANDLE_VALUE)
+ {
+ if (results[nCounter] == '1')
+ {
+ Trace("CreateFile: ERROR: Failed when expected "
+ "to pass %s [%d][%d][%d][%d]\n",
+ lpFileName, i, j, k, l);
+ bSuccess = FALSE;
+ }
+ }
+ else
+ {
+ CloseHandle(hFile);
+ if (results[nCounter] == '0')
+ {
+ Trace("CreateFile: ERROR: Passed when expected "
+ "to fail %s [%d][%d][%d][%d]\n",
+ lpFileName, i, j, k, l);
+ bSuccess = FALSE;
+ }
+ }
+ nCounter ++;
+ }
+ }
+ }
+ }
+
+ if (!Cleanup())
+ {
+ Trace("Post-test Cleanup() failed. LastError=%d\n", GetLastError());
+ return FAIL;
+ }
+
+ int exitCode = bSuccess ? PASS : FAIL;
+ PAL_TerminateEx(exitCode);
+ return exitCode;
+}
diff --git a/src/pal/tests/palsuite/file_io/CreateFileW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/CreateFileW/test1/CMakeLists.txt
index 1ff0b8062f..820e169a37 100644
--- a/src/pal/tests/palsuite/file_io/CreateFileW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/CreateFileW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileW.c
+ CreateFileW.cpp
)
add_executable(paltest_createfilew_test1
diff --git a/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.c b/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.c
deleted file mode 100644
index 4d7d20af29..0000000000
--- a/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.c
+++ /dev/null
@@ -1,152 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: CreateFileW.c
-**
-** Purpose: Test the PAL implementation of the CreateFileW function
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-BOOL Cleanup(void)
-{
- char FileName[20];
- int i;
- BOOL bRet = TRUE; // assume success
-
- // loop through all accesses, modes, dispositions and flags
- for (i=0; i<4*8*4*5; ++i) {
- sprintf(FileName, "test%03d.txt", i);
- if (DeleteFileA(FileName) == FALSE) {
- if (GetLastError() != ERROR_FILE_NOT_FOUND) {
- bRet = FALSE;
- }
- }
- }
- return bRet;
-}
-
-
-int __cdecl main(int argc, char *argv[])
-{
- BOOL bSuccess = TRUE;
- int nCounter = 0;
- HANDLE hFile = NULL;
- WCHAR *lpFileName = NULL;
- char* pTemp = NULL;
- char string[40];
- FILE *outFile = NULL;
- char results[1024];
- int i, j, k, l;
- DWORD dwDesiredAccess[4] = {0, // 0
- GENERIC_READ, // 1
- GENERIC_WRITE, // 2
- GENERIC_READ | GENERIC_WRITE}; // 3
- DWORD dwShareMode[8] = {0, // 0
- FILE_SHARE_READ, // 1
- FILE_SHARE_WRITE, // 2
- FILE_SHARE_DELETE, // 3
- FILE_SHARE_READ | FILE_SHARE_WRITE, // 4
- FILE_SHARE_READ | FILE_SHARE_DELETE, // 5
- FILE_SHARE_WRITE | FILE_SHARE_DELETE, // 6
- FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE}; // 7
- LPSECURITY_ATTRIBUTES lpAttr = NULL;
- DWORD dwCreationDisp[4] = {CREATE_NEW, // 0
- CREATE_ALWAYS, // 1
- OPEN_EXISTING, // 2
- OPEN_ALWAYS}; // 3
- DWORD dwFlagsAttrib[5] = {FILE_ATTRIBUTE_NORMAL, // 0
- FILE_FLAG_SEQUENTIAL_SCAN, // 1
- FILE_FLAG_WRITE_THROUGH, // 2
- FILE_FLAG_NO_BUFFERING, // 3
- FILE_FLAG_RANDOM_ACCESS}; // 4
- HANDLE hTemplate = NULL;
-
-
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
- if (!Cleanup()) {
- Trace("Pre-test Cleanup() failed. LastError=%d\n", GetLastError());
- return FAIL;
- }
-
- /* open the file to read the expected results */
- outFile = fopen("winoutput", "r");
- memset (results, 0, 1024);
-
- fgets(results, 1024, outFile);
- fclose(outFile);
-
- nCounter = 0;
-
- // desired access loop
- for (i = 0; i < 4; i++)
- {
- // share mode loop
- for (j = 0; j < 8; j++)
- {
- // security attributes loop
- for (k = 0; k < 4; k++)
- {
- // creation disp loop
- for (l = 0; l < 5; l++)
- {
- sprintf(string, "test%03d.txt", nCounter);
- lpFileName = convert(string);
- hFile = CreateFileW(lpFileName,
- dwDesiredAccess[i],
- dwShareMode[j],
- lpAttr,
- dwCreationDisp[k],
- dwFlagsAttrib[l],
- hTemplate);
- free(lpFileName);
- if (hFile == INVALID_HANDLE_VALUE)
- {
- if (results[nCounter] == '1')
- {
- pTemp = convertC(lpFileName);
- Trace("CreateFile: ERROR: Failed when expected "
- "to pass %s [%d][%d][%d][%d]\n",
- pTemp, i, j, k, l);
- free(pTemp);
- bSuccess = FALSE;
- }
- }
- else
- {
- CloseHandle(hFile);
- if (results[nCounter] == '0')
- {
- pTemp = convertC(lpFileName);
- Trace("CreateFile: ERROR: Passed when expected "
- "to fail %s [%d][%d][%d][%d]\n",
- pTemp, i, j, k, l);
- free(pTemp);
- bSuccess = FALSE;
- }
- }
- nCounter ++;
- }
- }
- }
- }
-
- if (!Cleanup())
- {
- Trace("Post-test Cleanup() failed. LastError=%d\n", GetLastError());
- return FAIL;
- }
-
- int exitCode = bSuccess ? PASS : FAIL;
- PAL_TerminateEx(exitCode);
- return exitCode;
-}
diff --git a/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp b/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp
new file mode 100644
index 0000000000..0619f5b4aa
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp
@@ -0,0 +1,152 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: CreateFileW.c
+**
+** Purpose: Test the PAL implementation of the CreateFileW function
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+BOOL Cleanup(void)
+{
+ char FileName[20];
+ int i;
+ BOOL bRet = TRUE; // assume success
+
+ // loop through all accesses, modes, dispositions and flags
+ for (i=0; i<4*8*4*5; ++i) {
+ sprintf_s(FileName, _countof(FileName), "test%03d.txt", i);
+ if (DeleteFileA(FileName) == FALSE) {
+ if (GetLastError() != ERROR_FILE_NOT_FOUND) {
+ bRet = FALSE;
+ }
+ }
+ }
+ return bRet;
+}
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ BOOL bSuccess = TRUE;
+ int nCounter = 0;
+ HANDLE hFile = NULL;
+ WCHAR *lpFileName = NULL;
+ char* pTemp = NULL;
+ char string[40];
+ FILE *outFile = NULL;
+ char results[1024];
+ int i, j, k, l;
+ DWORD dwDesiredAccess[4] = {0, // 0
+ GENERIC_READ, // 1
+ GENERIC_WRITE, // 2
+ GENERIC_READ | GENERIC_WRITE}; // 3
+ DWORD dwShareMode[8] = {0, // 0
+ FILE_SHARE_READ, // 1
+ FILE_SHARE_WRITE, // 2
+ FILE_SHARE_DELETE, // 3
+ FILE_SHARE_READ | FILE_SHARE_WRITE, // 4
+ FILE_SHARE_READ | FILE_SHARE_DELETE, // 5
+ FILE_SHARE_WRITE | FILE_SHARE_DELETE, // 6
+ FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE}; // 7
+ LPSECURITY_ATTRIBUTES lpAttr = NULL;
+ DWORD dwCreationDisp[4] = {CREATE_NEW, // 0
+ CREATE_ALWAYS, // 1
+ OPEN_EXISTING, // 2
+ OPEN_ALWAYS}; // 3
+ DWORD dwFlagsAttrib[5] = {FILE_ATTRIBUTE_NORMAL, // 0
+ FILE_FLAG_SEQUENTIAL_SCAN, // 1
+ FILE_FLAG_WRITE_THROUGH, // 2
+ FILE_FLAG_NO_BUFFERING, // 3
+ FILE_FLAG_RANDOM_ACCESS}; // 4
+ HANDLE hTemplate = NULL;
+
+
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+ if (!Cleanup()) {
+ Trace("Pre-test Cleanup() failed. LastError=%d\n", GetLastError());
+ return FAIL;
+ }
+
+ /* open the file to read the expected results */
+ outFile = fopen("winoutput", "r");
+ memset (results, 0, 1024);
+
+ fgets(results, 1024, outFile);
+ fclose(outFile);
+
+ nCounter = 0;
+
+ // desired access loop
+ for (i = 0; i < 4; i++)
+ {
+ // share mode loop
+ for (j = 0; j < 8; j++)
+ {
+ // security attributes loop
+ for (k = 0; k < 4; k++)
+ {
+ // creation disp loop
+ for (l = 0; l < 5; l++)
+ {
+ sprintf_s(string, _countof(string), "test%03d.txt", nCounter);
+ lpFileName = convert(string);
+ hFile = CreateFileW(lpFileName,
+ dwDesiredAccess[i],
+ dwShareMode[j],
+ lpAttr,
+ dwCreationDisp[k],
+ dwFlagsAttrib[l],
+ hTemplate);
+ free(lpFileName);
+ if (hFile == INVALID_HANDLE_VALUE)
+ {
+ if (results[nCounter] == '1')
+ {
+ pTemp = convertC(lpFileName);
+ Trace("CreateFile: ERROR: Failed when expected "
+ "to pass %s [%d][%d][%d][%d]\n",
+ pTemp, i, j, k, l);
+ free(pTemp);
+ bSuccess = FALSE;
+ }
+ }
+ else
+ {
+ CloseHandle(hFile);
+ if (results[nCounter] == '0')
+ {
+ pTemp = convertC(lpFileName);
+ Trace("CreateFile: ERROR: Passed when expected "
+ "to fail %s [%d][%d][%d][%d]\n",
+ pTemp, i, j, k, l);
+ free(pTemp);
+ bSuccess = FALSE;
+ }
+ }
+ nCounter ++;
+ }
+ }
+ }
+ }
+
+ if (!Cleanup())
+ {
+ Trace("Post-test Cleanup() failed. LastError=%d\n", GetLastError());
+ return FAIL;
+ }
+
+ int exitCode = bSuccess ? PASS : FAIL;
+ PAL_TerminateEx(exitCode);
+ return exitCode;
+}
diff --git a/src/pal/tests/palsuite/file_io/DeleteFileW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/DeleteFileW/test1/CMakeLists.txt
index 046fd35148..eada6145b9 100644
--- a/src/pal/tests/palsuite/file_io/DeleteFileW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/DeleteFileW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- DeleteFileW.c
+ DeleteFileW.cpp
)
add_executable(paltest_deletefilew_test1
diff --git a/src/pal/tests/palsuite/file_io/DeleteFileW/test1/DeleteFileW.c b/src/pal/tests/palsuite/file_io/DeleteFileW/test1/DeleteFileW.cpp
index fca96d1e00..fca96d1e00 100644
--- a/src/pal/tests/palsuite/file_io/DeleteFileW/test1/DeleteFileW.c
+++ b/src/pal/tests/palsuite/file_io/DeleteFileW/test1/DeleteFileW.cpp
diff --git a/src/pal/tests/palsuite/file_io/FILECanonicalizePath/CMakeLists.txt b/src/pal/tests/palsuite/file_io/FILECanonicalizePath/CMakeLists.txt
index 0c02c98f15..7045983629 100644
--- a/src/pal/tests/palsuite/file_io/FILECanonicalizePath/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/FILECanonicalizePath/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- FILECanonicalizePath.c
+ FILECanonicalizePath.cpp
)
add_executable(paltest_filecanonicalizepath_test1
diff --git a/src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.c b/src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.c
deleted file mode 100644
index 91bac1f3cb..0000000000
--- a/src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.c
+++ /dev/null
@@ -1,83 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: FILECanonicalizePath.c (test 1)
-**
-** Purpose: Tests the PAL implementation of the FILECanonicalizePath function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-extern void FILECanonicalizePath(LPSTR lpUnixPath);
-
-void TestCase(LPSTR input, LPSTR expectedOutput);
-
-int __cdecl main(int argc, char *argv[])
-{
- if (PAL_Initialize(argc,argv) != 0)
- {
- return FAIL;
- }
-
- // Case 01: /<name> should not change
- TestCase("/Test", "/Test");
-
- // Case 02: /<name>/<name2> should not change
- TestCase("/Test/Foo", "/Test/Foo");
-
- // Case 03: // transforms to /
- TestCase("//", "/");
-
- // Case 04: /./ transforms to /
- TestCase("/./", "/");
-
- // Case 05: /<name>/../ transforms to /
- TestCase("/Test/../", "/");
-
- // Case 06: /Test/Foo/.. transforms to /Test
- TestCase("/Test/Foo/..", "/Test");
-
- // Case 07: /Test/.. transforms to /
- TestCase("/Test/..", "/");
-
- // Case 08: /. transforms to /
- TestCase("/.", "/");
-
- // Case 09: /<name/. transforms to /<name>
- TestCase("/Test/.", "/Test");
-
- // Case 10: /<name>/../. transforms to /
- TestCase("/Test/../.", "/");
-
- // Case 11: /.. transforms to /
- TestCase("/..", "/");
-
- PAL_Terminate();
- return PASS;
-}
-
-void TestCase(LPSTR input, LPSTR expectedOutput)
-{
- // Save the input for debug logging since the input is edited in-place
- char* pOriginalInput = (char*)malloc(strlen(input) * sizeof(char) + 1);
- strcpy(pOriginalInput, input);
-
- char* pInput = (char*)malloc(strlen(input) * sizeof(char) + 1);
- strcpy(pInput, pOriginalInput);
-
- FILECanonicalizePath(pInput);
- if (strcmp(pInput, expectedOutput) != 0)
- {
- free(pOriginalInput);
- free(pInput);
- Fail("FILECanonicalizePath error: input %s did not match expected output %s; got %s instead", pOriginalInput, expectedOutput, pInput);
- }
-
- free(pOriginalInput);
- free(pInput);
-}
diff --git a/src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.cpp b/src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.cpp
new file mode 100644
index 0000000000..3a1758aa3b
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/FILECanonicalizePath/FILECanonicalizePath.cpp
@@ -0,0 +1,83 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: FILECanonicalizePath.c (test 1)
+**
+** Purpose: Tests the PAL implementation of the FILECanonicalizePath function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+extern "C" void FILECanonicalizePath(LPSTR lpUnixPath);
+
+void TestCase(LPSTR input, LPSTR expectedOutput);
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (PAL_Initialize(argc,argv) != 0)
+ {
+ return FAIL;
+ }
+
+ // Case 01: /<name> should not change
+ TestCase("/Test", "/Test");
+
+ // Case 02: /<name>/<name2> should not change
+ TestCase("/Test/Foo", "/Test/Foo");
+
+ // Case 03: // transforms to /
+ TestCase("//", "/");
+
+ // Case 04: /./ transforms to /
+ TestCase("/./", "/");
+
+ // Case 05: /<name>/../ transforms to /
+ TestCase("/Test/../", "/");
+
+ // Case 06: /Test/Foo/.. transforms to /Test
+ TestCase("/Test/Foo/..", "/Test");
+
+ // Case 07: /Test/.. transforms to /
+ TestCase("/Test/..", "/");
+
+ // Case 08: /. transforms to /
+ TestCase("/.", "/");
+
+ // Case 09: /<name/. transforms to /<name>
+ TestCase("/Test/.", "/Test");
+
+ // Case 10: /<name>/../. transforms to /
+ TestCase("/Test/../.", "/");
+
+ // Case 11: /.. transforms to /
+ TestCase("/..", "/");
+
+ PAL_Terminate();
+ return PASS;
+}
+
+void TestCase(LPSTR input, LPSTR expectedOutput)
+{
+ // Save the input for debug logging since the input is edited in-place
+ char* pOriginalInput = (char*)malloc(strlen(input) * sizeof(char) + 1);
+ strcpy(pOriginalInput, input);
+
+ char* pInput = (char*)malloc(strlen(input) * sizeof(char) + 1);
+ strcpy(pInput, pOriginalInput);
+
+ FILECanonicalizePath(pInput);
+ if (strcmp(pInput, expectedOutput) != 0)
+ {
+ free(pOriginalInput);
+ free(pInput);
+ Fail("FILECanonicalizePath error: input %s did not match expected output %s; got %s instead", pOriginalInput, expectedOutput, pInput);
+ }
+
+ free(pOriginalInput);
+ free(pInput);
+}
diff --git a/src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/CMakeLists.txt
index 131054266b..6ec6a98b3f 100644
--- a/src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_filetimetodosdatetime_test1
diff --git a/src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/test1.c b/src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/test1.cpp
index 5f2c81ff98..5f2c81ff98 100644
--- a/src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/test1.c
+++ b/src/pal/tests/palsuite/file_io/FileTimeToDosDateTime/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/file_io/FindClose/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/FindClose/test1/CMakeLists.txt
index 732c9f58d3..d97c69e6ee 100644
--- a/src/pal/tests/palsuite/file_io/FindClose/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/FindClose/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- FindClose.c
+ FindClose.cpp
)
add_executable(paltest_findclose_test1
diff --git a/src/pal/tests/palsuite/file_io/FindClose/test1/FindClose.c b/src/pal/tests/palsuite/file_io/FindClose/test1/FindClose.cpp
index 3d53806e48..3d53806e48 100644
--- a/src/pal/tests/palsuite/file_io/FindClose/test1/FindClose.c
+++ b/src/pal/tests/palsuite/file_io/FindClose/test1/FindClose.cpp
diff --git a/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/CMakeLists.txt
index 6613c4d444..aeac94d42f 100644
--- a/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- FindFirstFileA.c
+ FindFirstFileA.cpp
)
add_executable(paltest_findfirstfilea_test1
diff --git a/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/FindFirstFileA.c b/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/FindFirstFileA.cpp
index 6ceb6a9747..6ceb6a9747 100644
--- a/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/FindFirstFileA.c
+++ b/src/pal/tests/palsuite/file_io/FindFirstFileA/test1/FindFirstFileA.cpp
diff --git a/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/CMakeLists.txt
index 23e95c7dad..2a6ea2b7a4 100644
--- a/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- FindFirstFileW.c
+ FindFirstFileW.cpp
)
add_executable(paltest_findfirstfilew_test1
diff --git a/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/FindFirstFileW.c b/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/FindFirstFileW.cpp
index f69a625976..f69a625976 100644
--- a/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/FindFirstFileW.c
+++ b/src/pal/tests/palsuite/file_io/FindFirstFileW/test1/FindFirstFileW.cpp
diff --git a/src/pal/tests/palsuite/file_io/FindNextFileA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/FindNextFileA/test1/CMakeLists.txt
index efb1655d95..6e97b7aaad 100644
--- a/src/pal/tests/palsuite/file_io/FindNextFileA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/FindNextFileA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- FindNextFileA.c
+ FindNextFileA.cpp
)
add_executable(paltest_findnextfilea_test1
diff --git a/src/pal/tests/palsuite/file_io/FindNextFileA/test1/FindNextFileA.c b/src/pal/tests/palsuite/file_io/FindNextFileA/test1/FindNextFileA.cpp
index 578fa00542..578fa00542 100644
--- a/src/pal/tests/palsuite/file_io/FindNextFileA/test1/FindNextFileA.c
+++ b/src/pal/tests/palsuite/file_io/FindNextFileA/test1/FindNextFileA.cpp
diff --git a/src/pal/tests/palsuite/file_io/FindNextFileA/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/FindNextFileA/test2/CMakeLists.txt
index 96821bdaaa..e037bd3aa0 100644
--- a/src/pal/tests/palsuite/file_io/FindNextFileA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/FindNextFileA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- findnextfilea.c
+ findnextfilea.cpp
)
add_executable(paltest_findnextfilea_test2
diff --git a/src/pal/tests/palsuite/file_io/FindNextFileA/test2/findnextfilea.c b/src/pal/tests/palsuite/file_io/FindNextFileA/test2/findnextfilea.cpp
index c841a4d498..c841a4d498 100644
--- a/src/pal/tests/palsuite/file_io/FindNextFileA/test2/findnextfilea.c
+++ b/src/pal/tests/palsuite/file_io/FindNextFileA/test2/findnextfilea.cpp
diff --git a/src/pal/tests/palsuite/file_io/FindNextFileW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/FindNextFileW/test1/CMakeLists.txt
index 4a283dd3a5..a7c3e7ea02 100644
--- a/src/pal/tests/palsuite/file_io/FindNextFileW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/FindNextFileW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- FindNextFileW.c
+ FindNextFileW.cpp
)
add_executable(paltest_findnextfilew_test1
diff --git a/src/pal/tests/palsuite/file_io/FindNextFileW/test1/FindNextFileW.c b/src/pal/tests/palsuite/file_io/FindNextFileW/test1/FindNextFileW.cpp
index 42e2e55805..42e2e55805 100644
--- a/src/pal/tests/palsuite/file_io/FindNextFileW/test1/FindNextFileW.c
+++ b/src/pal/tests/palsuite/file_io/FindNextFileW/test1/FindNextFileW.cpp
diff --git a/src/pal/tests/palsuite/file_io/FindNextFileW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/FindNextFileW/test2/CMakeLists.txt
index 2938afb888..7b4c3c9597 100644
--- a/src/pal/tests/palsuite/file_io/FindNextFileW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/FindNextFileW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- findnextfilew.c
+ findnextfilew.cpp
)
add_executable(paltest_findnextfilew_test2
diff --git a/src/pal/tests/palsuite/file_io/FindNextFileW/test2/findnextfilew.c b/src/pal/tests/palsuite/file_io/FindNextFileW/test2/findnextfilew.cpp
index 3e806c2576..3e806c2576 100644
--- a/src/pal/tests/palsuite/file_io/FindNextFileW/test2/findnextfilew.c
+++ b/src/pal/tests/palsuite/file_io/FindNextFileW/test2/findnextfilew.cpp
diff --git a/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/CMakeLists.txt
index e3fbccd2ae..6c24ac76d1 100644
--- a/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- FlushFileBuffers.c
+ FlushFileBuffers.cpp
)
add_executable(paltest_flushfilebuffers_test1
diff --git a/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/FlushFileBuffers.c b/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/FlushFileBuffers.cpp
index 246be64847..246be64847 100644
--- a/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/FlushFileBuffers.c
+++ b/src/pal/tests/palsuite/file_io/FlushFileBuffers/test1/FlushFileBuffers.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetConsoleCP/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetConsoleCP/test1/CMakeLists.txt
index 131f4a5fb7..64ab6ea945 100644
--- a/src/pal/tests/palsuite/file_io/GetConsoleCP/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetConsoleCP/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetConsoleCP.c
+ GetConsoleCP.cpp
)
add_executable(paltest_getconsolecp_test1
diff --git a/src/pal/tests/palsuite/file_io/GetConsoleCP/test1/GetConsoleCP.c b/src/pal/tests/palsuite/file_io/GetConsoleCP/test1/GetConsoleCP.cpp
index ba17d6c64d..ba17d6c64d 100644
--- a/src/pal/tests/palsuite/file_io/GetConsoleCP/test1/GetConsoleCP.c
+++ b/src/pal/tests/palsuite/file_io/GetConsoleCP/test1/GetConsoleCP.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/CMakeLists.txt
index d19ab95a37..756f87b382 100644
--- a/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetConsoleOutputCP.c
+ GetConsoleOutputCP.cpp
)
add_executable(paltest_getconsoleoutputcp_test1
diff --git a/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.c b/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.cpp
index 3deaebf68f..3deaebf68f 100644
--- a/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.c
+++ b/src/pal/tests/palsuite/file_io/GetConsoleOutputCP/test1/GetConsoleOutputCP.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/CMakeLists.txt
index f7382b047d..28efc6897f 100644
--- a/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetCurrentDirectoryA.c
+ GetCurrentDirectoryA.cpp
)
add_executable(paltest_getcurrentdirectorya_test1
diff --git a/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.c b/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.cpp
index b09e8a104d..b09e8a104d 100644
--- a/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.c
+++ b/src/pal/tests/palsuite/file_io/GetCurrentDirectoryA/test1/GetCurrentDirectoryA.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/CMakeLists.txt
index ed8419926c..ee07f5e0d1 100644
--- a/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetCurrentDirectoryW.c
+ GetCurrentDirectoryW.cpp
)
add_executable(paltest_getcurrentdirectoryw_test1
diff --git a/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.c b/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.cpp
index 4f4697b0a2..4f4697b0a2 100644
--- a/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.c
+++ b/src/pal/tests/palsuite/file_io/GetCurrentDirectoryW/test1/GetCurrentDirectoryW.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/CMakeLists.txt
index 6b06376233..7de0b275f6 100644
--- a/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetDiskFreeSpaceW.c
+ GetDiskFreeSpaceW.cpp
)
add_executable(paltest_getdiskfreespacew_test1
diff --git a/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/GetDiskFreeSpaceW.c b/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/GetDiskFreeSpaceW.cpp
index c1445f654f..c1445f654f 100644
--- a/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/GetDiskFreeSpaceW.c
+++ b/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test1/GetDiskFreeSpaceW.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/CMakeLists.txt
index 5660b39e1a..7bcbf55c42 100644
--- a/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- getdiskfreespacew.c
+ getdiskfreespacew.cpp
)
add_executable(paltest_getdiskfreespacew_test2
diff --git a/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/getdiskfreespacew.c b/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/getdiskfreespacew.cpp
index 83dcb54b51..83dcb54b51 100644
--- a/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/getdiskfreespacew.c
+++ b/src/pal/tests/palsuite/file_io/GetDiskFreeSpaceW/test2/getdiskfreespacew.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/CMakeLists.txt
index 6bf9818e86..414df7f6b5 100644
--- a/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFileAttributesA.c
+ GetFileAttributesA.cpp
)
add_executable(paltest_getfileattributesa_test1
diff --git a/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/GetFileAttributesA.c b/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/GetFileAttributesA.cpp
index ff6bd0b8e0..ff6bd0b8e0 100644
--- a/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/GetFileAttributesA.c
+++ b/src/pal/tests/palsuite/file_io/GetFileAttributesA/test1/GetFileAttributesA.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/CMakeLists.txt
index 2d299d82e5..6ea24d9d32 100644
--- a/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getfileattributesexw_test1
diff --git a/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/test1.c b/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/test1.cpp
index 7a622b628c..7a622b628c 100644
--- a/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/test1.c
+++ b/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/CMakeLists.txt
index 70caac2c69..0faa3bd11e 100644
--- a/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_getfileattributesexw_test2
diff --git a/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/test2.c b/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/test2.cpp
index f244a3bf6a..f244a3bf6a 100644
--- a/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/test2.c
+++ b/src/pal/tests/palsuite/file_io/GetFileAttributesExW/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/CMakeLists.txt
index 7050484607..bc82f3678e 100644
--- a/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFileAttributesW.c
+ GetFileAttributesW.cpp
)
add_executable(paltest_getfileattributesw_test1
diff --git a/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/GetFileAttributesW.c b/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/GetFileAttributesW.cpp
index 9d00da4bd4..9d00da4bd4 100644
--- a/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/GetFileAttributesW.c
+++ b/src/pal/tests/palsuite/file_io/GetFileAttributesW/test1/GetFileAttributesW.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileSize/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileSize/test1/CMakeLists.txt
index ff20de5905..f192ba7400 100644
--- a/src/pal/tests/palsuite/file_io/GetFileSize/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileSize/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFileSize.c
+ GetFileSize.cpp
)
add_executable(paltest_getfilesize_test1
diff --git a/src/pal/tests/palsuite/file_io/GetFileSize/test1/GetFileSize.c b/src/pal/tests/palsuite/file_io/GetFileSize/test1/GetFileSize.cpp
index fac01c98c9..fac01c98c9 100644
--- a/src/pal/tests/palsuite/file_io/GetFileSize/test1/GetFileSize.c
+++ b/src/pal/tests/palsuite/file_io/GetFileSize/test1/GetFileSize.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/CMakeLists.txt
index 1369a5dc5a..33a7e2f557 100644
--- a/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFileSizeEx.c
+ GetFileSizeEx.cpp
)
add_executable(paltest_getfilesizeex_test1
diff --git a/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/GetFileSizeEx.c b/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/GetFileSizeEx.cpp
index ef5afd0e6b..ef5afd0e6b 100644
--- a/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/GetFileSizeEx.c
+++ b/src/pal/tests/palsuite/file_io/GetFileSizeEx/test1/GetFileSizeEx.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileTime/test1/CMakeLists.txt
index 6a89846d21..b95267ab5b 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFileTime.c
+ GetFileTime.cpp
)
add_executable(paltest_getfiletime_test1
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test1/GetFileTime.c b/src/pal/tests/palsuite/file_io/GetFileTime/test1/GetFileTime.cpp
index fb7bcb8513..fb7bcb8513 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test1/GetFileTime.c
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test1/GetFileTime.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileTime/test2/CMakeLists.txt
index 3d315e44de..fe02e27bbe 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFileTime.c
+ GetFileTime.cpp
)
add_executable(paltest_getfiletime_test2
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test2/GetFileTime.c b/src/pal/tests/palsuite/file_io/GetFileTime/test2/GetFileTime.cpp
index 5b14a1e357..5b14a1e357 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test2/GetFileTime.c
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test2/GetFileTime.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileTime/test3/CMakeLists.txt
index 34f7310464..bb88966e68 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFileTime.c
+ GetFileTime.cpp
)
add_executable(paltest_getfiletime_test3
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test3/GetFileTime.c b/src/pal/tests/palsuite/file_io/GetFileTime/test3/GetFileTime.cpp
index a3f46c2bf8..a3f46c2bf8 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test3/GetFileTime.c
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test3/GetFileTime.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileTime/test4/CMakeLists.txt
index 0c9dcf7802..e43e7f99a8 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFileTime.c
+ GetFileTime.cpp
)
add_executable(paltest_getfiletime_test4
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test4/GetFileTime.c b/src/pal/tests/palsuite/file_io/GetFileTime/test4/GetFileTime.cpp
index ffba516e35..ffba516e35 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test4/GetFileTime.c
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test4/GetFileTime.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test5/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileTime/test5/CMakeLists.txt
index a82717e657..4af995d207 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- getfiletime.c
+ getfiletime.cpp
)
add_executable(paltest_getfiletime_test5
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test5/getfiletime.c b/src/pal/tests/palsuite/file_io/GetFileTime/test5/getfiletime.cpp
index d8196d84bc..d8196d84bc 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test5/getfiletime.c
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test5/getfiletime.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test6/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileTime/test6/CMakeLists.txt
index 24992dfa66..87c448b2a6 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- getfiletime.c
+ getfiletime.cpp
)
add_executable(paltest_getfiletime_test6
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test6/getfiletime.c b/src/pal/tests/palsuite/file_io/GetFileTime/test6/getfiletime.cpp
index 3eedddf82d..3eedddf82d 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test6/getfiletime.c
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test6/getfiletime.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test7/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileTime/test7/CMakeLists.txt
index 6646fd9272..cd5cde4d9e 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- getfiletime.c
+ getfiletime.cpp
)
add_executable(paltest_getfiletime_test7
diff --git a/src/pal/tests/palsuite/file_io/GetFileTime/test7/getfiletime.c b/src/pal/tests/palsuite/file_io/GetFileTime/test7/getfiletime.cpp
index d33175b8ec..d33175b8ec 100644
--- a/src/pal/tests/palsuite/file_io/GetFileTime/test7/getfiletime.c
+++ b/src/pal/tests/palsuite/file_io/GetFileTime/test7/getfiletime.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileType/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileType/test1/CMakeLists.txt
index 66467e99c5..cfaba2e738 100644
--- a/src/pal/tests/palsuite/file_io/GetFileType/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileType/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFileType.c
+ GetFileType.cpp
)
add_executable(paltest_getfiletype_test1
diff --git a/src/pal/tests/palsuite/file_io/GetFileType/test1/GetFileType.c b/src/pal/tests/palsuite/file_io/GetFileType/test1/GetFileType.cpp
index 6558c00bdd..6558c00bdd 100644
--- a/src/pal/tests/palsuite/file_io/GetFileType/test1/GetFileType.c
+++ b/src/pal/tests/palsuite/file_io/GetFileType/test1/GetFileType.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileType/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileType/test2/CMakeLists.txt
index 382b27e788..07dae0b04a 100644
--- a/src/pal/tests/palsuite/file_io/GetFileType/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileType/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- getfiletype.c
+ getfiletype.cpp
)
add_executable(paltest_getfiletype_test2
diff --git a/src/pal/tests/palsuite/file_io/GetFileType/test2/getfiletype.c b/src/pal/tests/palsuite/file_io/GetFileType/test2/getfiletype.cpp
index c9d4eb6572..c9d4eb6572 100644
--- a/src/pal/tests/palsuite/file_io/GetFileType/test2/getfiletype.c
+++ b/src/pal/tests/palsuite/file_io/GetFileType/test2/getfiletype.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFileType/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFileType/test3/CMakeLists.txt
index 52b6077570..9353c85771 100644
--- a/src/pal/tests/palsuite/file_io/GetFileType/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFileType/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- getfiletype.c
+ getfiletype.cpp
)
add_executable(paltest_getfiletype_test3
diff --git a/src/pal/tests/palsuite/file_io/GetFileType/test3/getfiletype.c b/src/pal/tests/palsuite/file_io/GetFileType/test3/getfiletype.cpp
index 6a95585bab..6a95585bab 100644
--- a/src/pal/tests/palsuite/file_io/GetFileType/test3/getfiletype.c
+++ b/src/pal/tests/palsuite/file_io/GetFileType/test3/getfiletype.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/CMakeLists.txt
index 8c10e479fa..6198392000 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFullPathNameA.c
+ GetFullPathNameA.cpp
)
add_executable(paltest_getfullpathnamea_test1
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/GetFullPathNameA.c b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/GetFullPathNameA.cpp
index de9a266f5a..de9a266f5a 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/GetFullPathNameA.c
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test1/GetFullPathNameA.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/CMakeLists.txt
index 382b8fa4bd..3449f2d80b 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_getfullpathnamea_test2
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/test2.c b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/test2.cpp
index 95a1497331..95a1497331 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/test2.c
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/CMakeLists.txt
index f0f8929b4a..9d8d242e26 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_getfullpathnamea_test3
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.c b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.cpp
index 0cc39e7300..0cc39e7300 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.c
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/CMakeLists.txt
index cf0d7ff18c..abf2bacd1c 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_getfullpathnamea_test4
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/test4.c b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/test4.cpp
index fb22c1f07b..fb22c1f07b 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/test4.c
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameA/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/CMakeLists.txt
index a6f354f5a5..d455ca1193 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetFullPathNameW.c
+ GetFullPathNameW.cpp
)
add_executable(paltest_getfullpathnamew_test1
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/GetFullPathNameW.c b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/GetFullPathNameW.cpp
index 592d3ad4c5..592d3ad4c5 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/GetFullPathNameW.c
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test1/GetFullPathNameW.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/CMakeLists.txt
index 199aa1efce..d974e940a7 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_getfullpathnamew_test2
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.c b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.cpp
index fae042d229..fae042d229 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.c
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/CMakeLists.txt
index 6284958b07..09439a6372 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_getfullpathnamew_test3
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.c b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.cpp
index ba80cf222d..ba80cf222d 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.c
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/CMakeLists.txt
index d479b998cc..11ed9583b6 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_getfullpathnamew_test4
diff --git a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/test4.c b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/test4.cpp
index 25eb10d654..25eb10d654 100644
--- a/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/test4.c
+++ b/src/pal/tests/palsuite/file_io/GetFullPathNameW/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/CMakeLists.txt
index cf5dcd0bfc..3b9f0b118a 100644
--- a/src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetLongPathNameW.c
+ GetLongPathNameW.cpp
)
add_executable(paltest_getlongpathnamew_test1
diff --git a/src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/GetLongPathNameW.c b/src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/GetLongPathNameW.cpp
index 22831dda15..22831dda15 100644
--- a/src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/GetLongPathNameW.c
+++ b/src/pal/tests/palsuite/file_io/GetLongPathNameW/test1/GetLongPathNameW.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/CMakeLists.txt
index 5746ef3e04..b92e431095 100644
--- a/src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- getlongpathnamew.c
+ getlongpathnamew.cpp
)
add_executable(paltest_getlongpathnamew_test2
diff --git a/src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/getlongpathnamew.c b/src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/getlongpathnamew.cpp
index 3b033e9a64..3b033e9a64 100644
--- a/src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/getlongpathnamew.c
+++ b/src/pal/tests/palsuite/file_io/GetLongPathNameW/test2/getlongpathnamew.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetStdHandle/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetStdHandle/test1/CMakeLists.txt
index 04bcc5fd67..eaa1721b7e 100644
--- a/src/pal/tests/palsuite/file_io/GetStdHandle/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetStdHandle/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetStdHandle.c
+ GetStdHandle.cpp
)
add_executable(paltest_getstdhandle_test1
diff --git a/src/pal/tests/palsuite/file_io/GetStdHandle/test1/GetStdHandle.c b/src/pal/tests/palsuite/file_io/GetStdHandle/test1/GetStdHandle.cpp
index f4fe03195d..f4fe03195d 100644
--- a/src/pal/tests/palsuite/file_io/GetStdHandle/test1/GetStdHandle.c
+++ b/src/pal/tests/palsuite/file_io/GetStdHandle/test1/GetStdHandle.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetStdHandle/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetStdHandle/test2/CMakeLists.txt
index 97816b4319..ef45aa0dec 100644
--- a/src/pal/tests/palsuite/file_io/GetStdHandle/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetStdHandle/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetStdHandle.c
+ GetStdHandle.cpp
)
add_executable(paltest_getstdhandle_test2
diff --git a/src/pal/tests/palsuite/file_io/GetStdHandle/test2/GetStdHandle.c b/src/pal/tests/palsuite/file_io/GetStdHandle/test2/GetStdHandle.cpp
index 45f5ddd243..45f5ddd243 100644
--- a/src/pal/tests/palsuite/file_io/GetStdHandle/test2/GetStdHandle.c
+++ b/src/pal/tests/palsuite/file_io/GetStdHandle/test2/GetStdHandle.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetSystemTime/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetSystemTime/test1/CMakeLists.txt
index 94d5bcded9..4367e880f7 100644
--- a/src/pal/tests/palsuite/file_io/GetSystemTime/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetSystemTime/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getsystemtime_test1
diff --git a/src/pal/tests/palsuite/file_io/GetSystemTime/test1/test.c b/src/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp
index 361dbef33d..361dbef33d 100644
--- a/src/pal/tests/palsuite/file_io/GetSystemTime/test1/test.c
+++ b/src/pal/tests/palsuite/file_io/GetSystemTime/test1/test.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/CMakeLists.txt
index 977a826e7a..d149383732 100644
--- a/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetSystemTimeAsFileTime.c
+ GetSystemTimeAsFileTime.cpp
)
add_executable(paltest_getsystemtimeasfiletime_test1
diff --git a/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.c b/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp
index bd7e856abd..bd7e856abd 100644
--- a/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.c
+++ b/src/pal/tests/palsuite/file_io/GetSystemTimeAsFileTime/test1/GetSystemTimeAsFileTime.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/CMakeLists.txt
index 1b759af2eb..4ed0ccb537 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetTempFileNameA.c
+ GetTempFileNameA.cpp
)
add_executable(paltest_gettempfilenamea_test1
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.c b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.c
deleted file mode 100644
index 8ede8bab04..0000000000
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.c
+++ /dev/null
@@ -1,125 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: GetTempFileNameA.c (test 1)
-**
-** Purpose: Tests the PAL implementation of the GetTempFileNameA function.
-**
-** Depends on:
-** GetFileAttributesA
-** DeleteFileA
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-
-
-int __cdecl main(int argc, char *argv[])
-{
- UINT uiError = 0;
- const UINT uUnique = 0;
- const char* szDot = {"."};
- const char* szValidPrefix = {"cfr"};
- const char* szLongValidPrefix = {"cfrwxyz"};
- char szReturnedName[256];
- char szTempString[256];
-
- if (0 != PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- /* valid path with null prefix */
- uiError = GetTempFileNameA(szDot, NULL, uUnique, szReturnedName);
- if (uiError == 0)
- {
- Fail("GetTempFileNameA: ERROR -> Call failed with a valid path "
- "with the error code: %ld\n", GetLastError());
- }
- else
- {
- /* verify temp file was created */
- if (GetFileAttributesA(szReturnedName) == -1)
- {
- Fail("GetTempFileNameA: ERROR -> GetFileAttributes failed on the "
- "returned temp file \"%s\" with error code: %ld.\n",
- szReturnedName,
- GetLastError());
- }
- if (DeleteFileA(szReturnedName) != TRUE)
- {
- Fail("GetTempFileNameA: ERROR -> DeleteFileW failed to delete"
- "the created temp file with error code: %ld.\n", GetLastError());
- }
- }
-
-
- /* valid path with valid prefix */
- uiError = GetTempFileNameA(szDot, szValidPrefix, uUnique, szReturnedName);
- if (uiError == 0)
- {
- Fail("GetTempFileNameA: ERROR -> Call failed with a valid path and "
- "prefix with the error code: %ld\n", GetLastError());
- }
- else
- {
- /* verify temp file was created */
- if (GetFileAttributesA(szReturnedName) == -1)
- {
- Fail("GetTempFileNameA: ERROR -> GetFileAttributes failed on the "
- "returned temp file \"%s\" with error code: %ld.\n",
- szReturnedName,
- GetLastError());
- }
- if (DeleteFileA(szReturnedName) != TRUE)
- {
- Fail("GetTempFileNameA: ERROR -> DeleteFileW failed to delete"
- "the created temp \"%s\" file with error code: %ld.\n",
- szReturnedName,
- GetLastError());
- }
- }
-
- /* valid path with long prefix */
- uiError = GetTempFileNameA(szDot, szLongValidPrefix, uUnique, szReturnedName);
- if (uiError == 0)
- {
- Fail("GetTempFileNameA: ERROR -> Call failed with a valid path and "
- "prefix with the error code: %ld\n", GetLastError());
- }
- else
- {
- /* verify temp file was created */
- if (GetFileAttributesA(szReturnedName) == -1)
- {
- Fail("GetTempFileNameA: ERROR -> GetFileAttributes failed on the "
- "returned temp file \"%s\" with error code: %ld.\n",
- szReturnedName,
- GetLastError());
- }
-
- /* now verify that it only used the first 3 characters of the prefix */
- sprintf(szTempString, "%s\\%s", szDot, szLongValidPrefix);
- if (strncmp(szTempString, szReturnedName, 6) == 0)
- {
- Fail("GetTempFileNameA: ERROR -> It appears that an improper prefix "
- "was used.\n");
- }
-
- if (DeleteFileA(szReturnedName) != TRUE)
- {
- Fail("GetTempFileNameA: ERROR -> DeleteFileW failed to delete"
- "the created temp file \"%s\" with error code: %ld.\n",
- szReturnedName,
- GetLastError());
- }
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp
new file mode 100644
index 0000000000..bea8e2776e
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp
@@ -0,0 +1,125 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: GetTempFileNameA.c (test 1)
+**
+** Purpose: Tests the PAL implementation of the GetTempFileNameA function.
+**
+** Depends on:
+** GetFileAttributesA
+** DeleteFileA
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ UINT uiError = 0;
+ const UINT uUnique = 0;
+ const char* szDot = {"."};
+ const char* szValidPrefix = {"cfr"};
+ const char* szLongValidPrefix = {"cfrwxyz"};
+ char szReturnedName[256];
+ char szTempString[256];
+
+ if (0 != PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ /* valid path with null prefix */
+ uiError = GetTempFileNameA(szDot, NULL, uUnique, szReturnedName);
+ if (uiError == 0)
+ {
+ Fail("GetTempFileNameA: ERROR -> Call failed with a valid path "
+ "with the error code: %ld\n", GetLastError());
+ }
+ else
+ {
+ /* verify temp file was created */
+ if (GetFileAttributesA(szReturnedName) == -1)
+ {
+ Fail("GetTempFileNameA: ERROR -> GetFileAttributes failed on the "
+ "returned temp file \"%s\" with error code: %ld.\n",
+ szReturnedName,
+ GetLastError());
+ }
+ if (DeleteFileA(szReturnedName) != TRUE)
+ {
+ Fail("GetTempFileNameA: ERROR -> DeleteFileW failed to delete"
+ "the created temp file with error code: %ld.\n", GetLastError());
+ }
+ }
+
+
+ /* valid path with valid prefix */
+ uiError = GetTempFileNameA(szDot, szValidPrefix, uUnique, szReturnedName);
+ if (uiError == 0)
+ {
+ Fail("GetTempFileNameA: ERROR -> Call failed with a valid path and "
+ "prefix with the error code: %ld\n", GetLastError());
+ }
+ else
+ {
+ /* verify temp file was created */
+ if (GetFileAttributesA(szReturnedName) == -1)
+ {
+ Fail("GetTempFileNameA: ERROR -> GetFileAttributes failed on the "
+ "returned temp file \"%s\" with error code: %ld.\n",
+ szReturnedName,
+ GetLastError());
+ }
+ if (DeleteFileA(szReturnedName) != TRUE)
+ {
+ Fail("GetTempFileNameA: ERROR -> DeleteFileW failed to delete"
+ "the created temp \"%s\" file with error code: %ld.\n",
+ szReturnedName,
+ GetLastError());
+ }
+ }
+
+ /* valid path with long prefix */
+ uiError = GetTempFileNameA(szDot, szLongValidPrefix, uUnique, szReturnedName);
+ if (uiError == 0)
+ {
+ Fail("GetTempFileNameA: ERROR -> Call failed with a valid path and "
+ "prefix with the error code: %ld\n", GetLastError());
+ }
+ else
+ {
+ /* verify temp file was created */
+ if (GetFileAttributesA(szReturnedName) == -1)
+ {
+ Fail("GetTempFileNameA: ERROR -> GetFileAttributes failed on the "
+ "returned temp file \"%s\" with error code: %ld.\n",
+ szReturnedName,
+ GetLastError());
+ }
+
+ /* now verify that it only used the first 3 characters of the prefix */
+ sprintf_s(szTempString, _countof(szTempString), "%s\\%s", szDot, szLongValidPrefix);
+ if (strncmp(szTempString, szReturnedName, 6) == 0)
+ {
+ Fail("GetTempFileNameA: ERROR -> It appears that an improper prefix "
+ "was used.\n");
+ }
+
+ if (DeleteFileA(szReturnedName) != TRUE)
+ {
+ Fail("GetTempFileNameA: ERROR -> DeleteFileW failed to delete"
+ "the created temp file \"%s\" with error code: %ld.\n",
+ szReturnedName,
+ GetLastError());
+ }
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/CMakeLists.txt
index f4bd9b8797..9d9b6461cd 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetTempFileNameA.c
+ GetTempFileNameA.cpp
)
add_executable(paltest_gettempfilenamea_test2
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/GetTempFileNameA.c b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/GetTempFileNameA.cpp
index 861a8b87e8..861a8b87e8 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/GetTempFileNameA.c
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test2/GetTempFileNameA.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/CMakeLists.txt
index 9c02865575..446f3cf837 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- gettempfilenamea.c
+ gettempfilenamea.cpp
)
add_executable(paltest_gettempfilenamea_test3
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/gettempfilenamea.c b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/gettempfilenamea.cpp
index 8eccc3d2e8..8eccc3d2e8 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/gettempfilenamea.c
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test3/gettempfilenamea.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/CMakeLists.txt
index 1b6c599da4..6919cf66cd 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetTempFileNameW.c
+ GetTempFileNameW.cpp
)
add_executable(paltest_gettempfilenamew_test1
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.c b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp
index 43cda8f447..43cda8f447 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.c
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test1/GetTempFileNameW.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/CMakeLists.txt
index 851030d9ae..d077463390 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetTempFileNameW.c
+ GetTempFileNameW.cpp
)
add_executable(paltest_gettempfilenamew_test2
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/GetTempFileNameW.c b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/GetTempFileNameW.cpp
index 2c8b19e081..2c8b19e081 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/GetTempFileNameW.c
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test2/GetTempFileNameW.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/CMakeLists.txt
index 82dd0a9f3f..3aa0f4a044 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- gettempfilenamew.c
+ gettempfilenamew.cpp
)
add_executable(paltest_gettempfilenamew_test3
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/gettempfilenamew.c b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/gettempfilenamew.cpp
index 96d8e66410..96d8e66410 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/gettempfilenamew.c
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameW/test3/gettempfilenamew.cpp
diff --git a/src/pal/tests/palsuite/file_io/GetTempPathW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/GetTempPathW/test1/CMakeLists.txt
index f2979e9536..04b240997a 100644
--- a/src/pal/tests/palsuite/file_io/GetTempPathW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/GetTempPathW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetTempPathW.c
+ GetTempPathW.cpp
)
add_executable(paltest_gettemppathw_test1
diff --git a/src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.c b/src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.c
deleted file mode 100644
index 08c88075ca..0000000000
--- a/src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.c
+++ /dev/null
@@ -1,103 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: GetTempPathW.c (test 1)
-**
-** Purpose: Tests the PAL implementation of the GetTempPathW function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-static void SetTmpDir(WCHAR path[])
-{
- DWORD result = SetEnvironmentVariableW(W("TMPDIR"), path);
- if (!result)
- {
- Fail("ERROR -> SetEnvironmentVariableW failed with result %d and error code %d.\n",
- result, GetLastError());
- }
-}
-
-static void SetAndCompare(WCHAR tmpDirPath[], WCHAR expected[])
-{
- DWORD dwBufferLength = _MAX_DIR;
- WCHAR path[dwBufferLength];
-
- SetTmpDir(tmpDirPath);
-
- DWORD dwResultLen = GetTempPathW(dwBufferLength, path);
- if (dwResultLen <= 0)
- {
- Fail("ERROR: GetTempPathW returned %d with error code %d.\n", dwResultLen, GetLastError());
- }
- if (dwResultLen >= dwBufferLength)
- {
- Fail("ERROR: Buffer of length %d passed to GetTempPathA was too small to hold %d chars..\n", dwBufferLength, dwResultLen);
- }
- if (wcscmp(expected, path) != 0)
- {
- Fail("ERROR: GetTempPathW expected to get '%S' but instead got '%S'.\n", expected, path);
- }
- if (expected[dwResultLen - 1] != '/')
- {
- Fail("ERROR: GetTempPathW returned '%S', which should have ended in '/'.\n", path);
- }
-}
-
-static void SetAndCheckLength(WCHAR tmpDirPath [], int bufferLength, int expectedResultLength)
-{
- WCHAR path[bufferLength];
-
- SetTmpDir(tmpDirPath);
- DWORD dwResultLen = GetTempPathW(bufferLength, path);
-
- if (dwResultLen != expectedResultLength)
- {
- Fail("GetTempPathW(%d, %S) expected to return %d but returned %d.\n",
- bufferLength, tmpDirPath?tmpDirPath:W("NULL"), expectedResultLength, dwResultLen);
- }
-}
-
-int __cdecl main(int argc, char *argv[])
-{
- if (0 != PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- SetAndCompare(W("/tmp"), W("/tmp/"));
- SetAndCompare(W("/tmp/"), W("/tmp/"));
- SetAndCompare(W(""), W("/tmp/"));
- SetAndCompare(NULL, W("/tmp/"));
- SetAndCompare(W("/"), W("/"));
- SetAndCompare(W("/var/tmp"), W("/var/tmp/"));
- SetAndCompare(W("/var/tmp/"), W("/var/tmp/"));
- SetAndCompare(W("~"), W("~/"));
- SetAndCompare(W("~/"), W("~/"));
- SetAndCompare(W(".tmp"), W(".tmp/"));
- SetAndCompare(W("./tmp"), W("./tmp/"));
- SetAndCompare(W("/home/someuser/sometempdir"), W("/home/someuser/sometempdir/"));
- SetAndCompare(NULL, W("/tmp/"));
-
- DWORD dwResultLen = GetTempPathA(0, NULL);
- if (dwResultLen != 0 || GetLastError() != ERROR_INVALID_PARAMETER)
- {
- Fail("GetTempPathW(NULL, ...) returned %d with error code %d but "
- "should have failed with ERROR_INVALID_PARAMETER (%d).\n",
- dwResultLen, GetLastError(), ERROR_INVALID_PARAMETER);
- }
-
- SetAndCheckLength(W("abc/"), 5, 4);
- SetAndCheckLength(W("abcd"), 5, 6);
- SetAndCheckLength(W("abcde"), 5, 7);
- SetAndCheckLength(W("abcdef/"), 5, 9);
- SetAndCheckLength(NULL, 5, 6);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.cpp b/src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.cpp
new file mode 100644
index 0000000000..bf997def76
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/GetTempPathW/test1/GetTempPathW.cpp
@@ -0,0 +1,103 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: GetTempPathW.c (test 1)
+**
+** Purpose: Tests the PAL implementation of the GetTempPathW function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+static void SetTmpDir(const WCHAR path[])
+{
+ DWORD result = SetEnvironmentVariableW(W("TMPDIR"), path);
+ if (!result)
+ {
+ Fail("ERROR -> SetEnvironmentVariableW failed with result %d and error code %d.\n",
+ result, GetLastError());
+ }
+}
+
+static void SetAndCompare(const WCHAR tmpDirPath[], const WCHAR expected[])
+{
+ DWORD dwBufferLength = _MAX_DIR;
+ WCHAR path[dwBufferLength];
+
+ SetTmpDir(tmpDirPath);
+
+ DWORD dwResultLen = GetTempPathW(dwBufferLength, path);
+ if (dwResultLen <= 0)
+ {
+ Fail("ERROR: GetTempPathW returned %d with error code %d.\n", dwResultLen, GetLastError());
+ }
+ if (dwResultLen >= dwBufferLength)
+ {
+ Fail("ERROR: Buffer of length %d passed to GetTempPathA was too small to hold %d chars..\n", dwBufferLength, dwResultLen);
+ }
+ if (wcscmp(expected, path) != 0)
+ {
+ Fail("ERROR: GetTempPathW expected to get '%S' but instead got '%S'.\n", expected, path);
+ }
+ if (expected[dwResultLen - 1] != '/')
+ {
+ Fail("ERROR: GetTempPathW returned '%S', which should have ended in '/'.\n", path);
+ }
+}
+
+static void SetAndCheckLength(const WCHAR tmpDirPath [], int bufferLength, int expectedResultLength)
+{
+ WCHAR path[bufferLength];
+
+ SetTmpDir(tmpDirPath);
+ DWORD dwResultLen = GetTempPathW(bufferLength, path);
+
+ if (dwResultLen != expectedResultLength)
+ {
+ Fail("GetTempPathW(%d, %S) expected to return %d but returned %d.\n",
+ bufferLength, tmpDirPath?tmpDirPath:W("NULL"), expectedResultLength, dwResultLen);
+ }
+}
+
+int __cdecl main(int argc, char *argv[])
+{
+ if (0 != PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ SetAndCompare(W("/tmp"), W("/tmp/"));
+ SetAndCompare(W("/tmp/"), W("/tmp/"));
+ SetAndCompare(W(""), W("/tmp/"));
+ SetAndCompare(NULL, W("/tmp/"));
+ SetAndCompare(W("/"), W("/"));
+ SetAndCompare(W("/var/tmp"), W("/var/tmp/"));
+ SetAndCompare(W("/var/tmp/"), W("/var/tmp/"));
+ SetAndCompare(W("~"), W("~/"));
+ SetAndCompare(W("~/"), W("~/"));
+ SetAndCompare(W(".tmp"), W(".tmp/"));
+ SetAndCompare(W("./tmp"), W("./tmp/"));
+ SetAndCompare(W("/home/someuser/sometempdir"), W("/home/someuser/sometempdir/"));
+ SetAndCompare(NULL, W("/tmp/"));
+
+ DWORD dwResultLen = GetTempPathA(0, NULL);
+ if (dwResultLen != 0 || GetLastError() != ERROR_INVALID_PARAMETER)
+ {
+ Fail("GetTempPathW(NULL, ...) returned %d with error code %d but "
+ "should have failed with ERROR_INVALID_PARAMETER (%d).\n",
+ dwResultLen, GetLastError(), ERROR_INVALID_PARAMETER);
+ }
+
+ SetAndCheckLength(W("abc/"), 5, 4);
+ SetAndCheckLength(W("abcd"), 5, 6);
+ SetAndCheckLength(W("abcde"), 5, 7);
+ SetAndCheckLength(W("abcdef/"), 5, 9);
+ SetAndCheckLength(NULL, 5, 6);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/file_io/MoveFileA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/MoveFileA/test1/CMakeLists.txt
index 9a3d0069db..b096a04653 100644
--- a/src/pal/tests/palsuite/file_io/MoveFileA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/MoveFileA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- MoveFileA.c
+ MoveFileA.cpp
)
add_executable(paltest_movefilea_test1
diff --git a/src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.c b/src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.c
deleted file mode 100644
index 8d1bc0eded..0000000000
--- a/src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.c
+++ /dev/null
@@ -1,469 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: MoveFileA.c
-**
-** Purpose: Tests the PAL implementation of the MoveFileA function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-LPSTR lpSource[4] = {"src_existing.txt",
- "src_non-existant.txt",
- "src_dir_existing",
- "src_dir_non-existant"};
-LPSTR lpDestination[4] = {"dst_existing.txt",
- "dst_non-existant.txt",
- "dst_dir_existing",
- "dst_dir_non-existant"};
-
-
-/* Create all the required test files */
-int createExisting(void)
-{
- FILE* tempFile = NULL;
- DWORD dwError;
- BOOL bRc = FALSE;
- char szBuffer[100];
-
- /* create the src_existing file */
- tempFile = fopen(lpSource[0], "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileA test file: src_existing.txt\n");
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR: couldn't create %s\n", lpSource[0]);
- return FAIL;
- }
-
- /* create the src_dir_existing directory and files */
- bRc = CreateDirectoryA(lpSource[2], NULL);
- if (bRc != TRUE)
- {
- Trace("MoveFileA: ERROR: couldn't create \"%s\" because of "
- "error code %ld\n",
- lpSource[2],
- GetLastError());
- return FAIL;
- }
-
- memset(szBuffer, 0, 100);
- sprintf(szBuffer, "%s/test01.txt", lpSource[2]);
- tempFile = fopen(szBuffer, "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileA test file: %s\n", szBuffer);
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR[%ld]:MoveFileA couldn't create %s\n", GetLastError(), szBuffer);
- return FAIL;
- }
-
- memset(szBuffer, 0, 100);
- sprintf(szBuffer, "%s/test02.txt", lpSource[2]);
- tempFile = fopen(szBuffer, "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileA test file: %s\n", szBuffer);
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR[%ld]: couldn't create %s\n", GetLastError(), szBuffer);
- return FAIL;
- }
-
-
- /* create the dst_existing file */
- tempFile = fopen(lpDestination[0], "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileA test file: dst_existing.txt\n");
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR[%ld]:MoveFileA couldn't create \"%s\"\n", GetLastError(), lpDestination[0]);
- return FAIL;
- }
-
- /* create the dst_dir_existing directory and files */
- bRc = CreateDirectoryA(lpDestination[2], NULL);
- if (bRc != TRUE)
- {
- dwError = GetLastError();
- Trace("Error[%ld]:MoveFileA: couldn't create \"%s\"\n", GetLastError(), lpDestination[2]);
- return FAIL;
- }
-
- tempFile = fopen("dst_dir_existing/test01.txt", "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileA test file: dst_dir_existing/test01.txt\n");
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR: couldn't create dst_dir_existing/test01.txt\n");
- return FAIL;
- }
- tempFile = fopen("dst_dir_existing/test02.txt", "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileA test file: dst_dir_existing/test02.txt\n");
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR[%ul]: couldn't create dst_dir_existing/test02.txt\n", GetLastError());
- return FAIL;
- }
-
- return PASS;
-}
-
-
-
-void removeDirectoryHelper(LPSTR dir, int location)
-{
- DWORD dwAtt = GetFileAttributesA(dir);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- if(!RemoveDirectoryA(dir))
- {
- Fail("ERROR: Failed to remove Directory [%s], Error Code [%d], location [%d]\n", dir, GetLastError(), location);
- }
- }
-}
-
-void removeFileHelper(LPSTR pfile, int location)
-{
- FILE *fp;
- fp = fopen( pfile, "r");
-
- if (fp != NULL)
- {
- if(fclose(fp))
- {
- Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
- }
-
- if(!DeleteFileA(pfile))
- {
- Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
- }
- else
- {
- // Trace("Success: deleted file [%S], Error Code [%d], location [%d]\n", wfile, GetLastError(), location);
- }
- }
-
-}
-
-
-/* remove all created files in preparation for the next test */
-void removeAll(void)
-{
- char szTemp[40];
- DWORD dwAtt;
-
- /* get rid of source dirs and files */
- removeFileHelper(lpSource[0], 1);
- removeFileHelper(lpSource[1], 2);
-
- dwAtt = GetFileAttributesA(lpSource[2]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpSource[2]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpSource[2]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpSource[2], 103);
- }
- else
- {
- removeFileHelper(lpSource[2], 17);
- }
-
-
- dwAtt = GetFileAttributesA(lpSource[3]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpSource[3]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpSource[3]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpSource[3], 103);
- }
- else
- {
- removeFileHelper(lpSource[3], 17);
- }
-
- /* get rid of destination dirs and files */
- dwAtt = GetFileAttributesA(lpDestination[0]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpDestination[0]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpDestination[0]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpDestination[0], 103);
- }
- else
- {
- removeFileHelper(lpDestination[0], 17);
- }
-
- dwAtt = GetFileAttributesA(lpDestination[1]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpDestination[1]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpDestination[1]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpDestination[1], 103);
- }
- else
- {
- removeFileHelper(lpDestination[1], 17);
- }
-
- dwAtt = GetFileAttributesA(lpDestination[2]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpDestination[2]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpDestination[2]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpDestination[2], 103);
- }
- else
- {
- removeFileHelper(lpDestination[2], 17);
- }
-
- dwAtt = GetFileAttributesA(lpDestination[3]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpDestination[3]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpDestination[3]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpDestination[3], 103);
- }
- else
- {
- removeFileHelper(lpDestination[3], 17);
- }
-
-}
-
-
-
-
-
-int __cdecl main(int argc, char *argv[])
-{
- BOOL bRc = TRUE;
- BOOL bSuccess = TRUE;
- char results[40];
- FILE* resultsFile = NULL;
- int nCounter = 0;
- int i, j;
- char tempSource[] = {'t','e','m','p','k','.','t','m','p','\0'};
- char tempDest[] = {'t','e','m','p','2','.','t','m','p','\0'};
- HANDLE hFile;
- DWORD result;
-
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
- /* read in the expected results to compare with actual results */
- memset (results, 0, 20);
- resultsFile = fopen("expectedresults.txt", "r");
- if (resultsFile == NULL)
- {
- Fail("MoveFileA ERROR[%ul]: Unable to open \"expectedresults.txt\"\n", GetLastError());
- }
-
- fgets(results, 20, resultsFile);
- fclose(resultsFile);
-
- /* clean the slate */
- removeAll();
-
- if (createExisting() != 0)
- {
- removeAll();
- }
-
-
- /* lpSource loop */
- for (i = 0; i < 4; i++)
- {
- /* lpDestination loop */
- for (j = 0; j < 4; j++)
- {
- bRc = MoveFileA(lpSource[i], lpDestination[j]);
- if (!(
- ((bRc == TRUE) && (results[nCounter] == '1'))
- ||
- ((bRc == FALSE ) && (results[nCounter] == '0')) )
- )
- {
- Trace("MoveFileA: FAILED: test[%d][%d]: \"%s\" -> \"%s\"\n",
- i, j, lpSource[i], lpDestination[j]);
- bSuccess = FALSE;
- }
-
- /* undo the last move */
- removeAll();
- createExisting();
-
- nCounter++;
- }
- }
-
- removeAll();
- if (bSuccess == FALSE)
- {
- Fail("MoveFileA: Test Failed");
- }
-
- /* create the temp source file */
- hFile = CreateFileA(tempSource, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL, 0);
-
- if( hFile == INVALID_HANDLE_VALUE )
- {
- Fail("Error[%ul]:MoveFileA: CreateFile failed to "
- "create the file correctly.\n", GetLastError());
- }
-
- bRc = CloseHandle(hFile);
- if(!bRc)
- {
- Trace("MoveFileA: CloseHandle failed to close the "
- "handle correctly. ERROR:%u\n",GetLastError());
-
- /* delete the created file */
- bRc = DeleteFileA(tempSource);
- if(!bRc)
- {
- Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
- "file correctly.\n", GetLastError());
- }
- Fail("");
- }
-
- /* set the file attributes to be readonly */
- bRc = SetFileAttributesA(tempSource, FILE_ATTRIBUTE_READONLY);
- if(!bRc)
- {
- Trace("MoveFileA: SetFileAttributes failed to set file "
- "attributes correctly. GetLastError returned %u\n",GetLastError());
- /* delete the created file */
- bRc = DeleteFileA(tempSource);
- if(!bRc)
- {
- Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
- "file correctly.\n", GetLastError());
- }
- Fail("");
- }
-
- /* move the file to the new location */
- bRc = MoveFileA(tempSource, tempDest);
- if(!bRc)
- {
- /* delete the created file */
- bRc = DeleteFileA(tempSource);
- if(!bRc)
- {
- Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
- "file correctly.\n", GetLastError());
- }
-
- Fail("Error[%ul]:MoveFileA(%S, %S): GetFileAttributes "
- "failed to get the file's attributes.\n",
- GetLastError(), tempSource, tempDest);
- }
-
- /* check that the newly moved file has the same file attributes
- as the original */
- result = GetFileAttributesA(tempDest);
- if(result == 0)
- {
- /* delete the created file */
- bRc = DeleteFileA(tempDest);
- if(!bRc)
- {
- Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
- "file correctly.\n", GetLastError());
- }
-
- Fail("Error[%ul]:MoveFileA: GetFileAttributes failed to get "
- "the file's attributes.\n", GetLastError());
- }
-
- if((result & FILE_ATTRIBUTE_READONLY) != FILE_ATTRIBUTE_READONLY)
- {
- /* delete the newly moved file */
- bRc = DeleteFileA(tempDest);
- if(!bRc)
- {
- Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
- "file correctly.\n", GetLastError());
- }
-
- Fail("Error[%ul]MoveFileA: GetFileAttributes failed to get "
- "the correct file attributes.\n", GetLastError());
- }
-
- /* set the file attributes back to normal, to be deleted */
- bRc = SetFileAttributesA(tempDest, FILE_ATTRIBUTE_NORMAL);
- if(!bRc)
- {
- /* delete the newly moved file */
- bRc = DeleteFileA(tempDest);
- if(!bRc)
- {
- Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
- "file correctly.\n", GetLastError());
- }
-
- Fail("Error[%ul]:MoveFileA: SetFileAttributes failed to set "
- "file attributes correctly.\n", GetLastError());
- }
-
- /* delete the newly moved file */
- bRc = DeleteFileA(tempDest);
- if(!bRc)
- {
- Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
- "file correctly.\n", GetLastError());
- }
-
- PAL_Terminate();
-
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.cpp b/src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.cpp
new file mode 100644
index 0000000000..6d1337af03
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.cpp
@@ -0,0 +1,469 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: MoveFileA.c
+**
+** Purpose: Tests the PAL implementation of the MoveFileA function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+LPSTR lpSource[4] = {"src_existing.txt",
+ "src_non-existant.txt",
+ "src_dir_existing",
+ "src_dir_non-existant"};
+LPSTR lpDestination[4] = {"dst_existing.txt",
+ "dst_non-existant.txt",
+ "dst_dir_existing",
+ "dst_dir_non-existant"};
+
+
+/* Create all the required test files */
+int createExisting(void)
+{
+ FILE* tempFile = NULL;
+ DWORD dwError;
+ BOOL bRc = FALSE;
+ char szBuffer[100];
+
+ /* create the src_existing file */
+ tempFile = fopen(lpSource[0], "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileA test file: src_existing.txt\n");
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR: couldn't create %s\n", lpSource[0]);
+ return FAIL;
+ }
+
+ /* create the src_dir_existing directory and files */
+ bRc = CreateDirectoryA(lpSource[2], NULL);
+ if (bRc != TRUE)
+ {
+ Trace("MoveFileA: ERROR: couldn't create \"%s\" because of "
+ "error code %ld\n",
+ lpSource[2],
+ GetLastError());
+ return FAIL;
+ }
+
+ memset(szBuffer, 0, 100);
+ sprintf_s(szBuffer, _countof(szBuffer), "%s/test01.txt", lpSource[2]);
+ tempFile = fopen(szBuffer, "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileA test file: %s\n", szBuffer);
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR[%ld]:MoveFileA couldn't create %s\n", GetLastError(), szBuffer);
+ return FAIL;
+ }
+
+ memset(szBuffer, 0, 100);
+ sprintf_s(szBuffer, _countof(szBuffer), "%s/test02.txt", lpSource[2]);
+ tempFile = fopen(szBuffer, "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileA test file: %s\n", szBuffer);
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR[%ld]: couldn't create %s\n", GetLastError(), szBuffer);
+ return FAIL;
+ }
+
+
+ /* create the dst_existing file */
+ tempFile = fopen(lpDestination[0], "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileA test file: dst_existing.txt\n");
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR[%ld]:MoveFileA couldn't create \"%s\"\n", GetLastError(), lpDestination[0]);
+ return FAIL;
+ }
+
+ /* create the dst_dir_existing directory and files */
+ bRc = CreateDirectoryA(lpDestination[2], NULL);
+ if (bRc != TRUE)
+ {
+ dwError = GetLastError();
+ Trace("Error[%ld]:MoveFileA: couldn't create \"%s\"\n", GetLastError(), lpDestination[2]);
+ return FAIL;
+ }
+
+ tempFile = fopen("dst_dir_existing/test01.txt", "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileA test file: dst_dir_existing/test01.txt\n");
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR: couldn't create dst_dir_existing/test01.txt\n");
+ return FAIL;
+ }
+ tempFile = fopen("dst_dir_existing/test02.txt", "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileA test file: dst_dir_existing/test02.txt\n");
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR[%ul]: couldn't create dst_dir_existing/test02.txt\n", GetLastError());
+ return FAIL;
+ }
+
+ return PASS;
+}
+
+
+
+void removeDirectoryHelper(LPSTR dir, int location)
+{
+ DWORD dwAtt = GetFileAttributesA(dir);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ if(!RemoveDirectoryA(dir))
+ {
+ Fail("ERROR: Failed to remove Directory [%s], Error Code [%d], location [%d]\n", dir, GetLastError(), location);
+ }
+ }
+}
+
+void removeFileHelper(LPSTR pfile, int location)
+{
+ FILE *fp;
+ fp = fopen( pfile, "r");
+
+ if (fp != NULL)
+ {
+ if(fclose(fp))
+ {
+ Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
+ }
+
+ if(!DeleteFileA(pfile))
+ {
+ Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
+ }
+ else
+ {
+ // Trace("Success: deleted file [%S], Error Code [%d], location [%d]\n", wfile, GetLastError(), location);
+ }
+ }
+
+}
+
+
+/* remove all created files in preparation for the next test */
+void removeAll(void)
+{
+ char szTemp[40];
+ DWORD dwAtt;
+
+ /* get rid of source dirs and files */
+ removeFileHelper(lpSource[0], 1);
+ removeFileHelper(lpSource[1], 2);
+
+ dwAtt = GetFileAttributesA(lpSource[2]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpSource[2]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpSource[2]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpSource[2], 103);
+ }
+ else
+ {
+ removeFileHelper(lpSource[2], 17);
+ }
+
+
+ dwAtt = GetFileAttributesA(lpSource[3]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpSource[3]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpSource[3]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpSource[3], 103);
+ }
+ else
+ {
+ removeFileHelper(lpSource[3], 17);
+ }
+
+ /* get rid of destination dirs and files */
+ dwAtt = GetFileAttributesA(lpDestination[0]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[0]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[0]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpDestination[0], 103);
+ }
+ else
+ {
+ removeFileHelper(lpDestination[0], 17);
+ }
+
+ dwAtt = GetFileAttributesA(lpDestination[1]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[1]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[1]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpDestination[1], 103);
+ }
+ else
+ {
+ removeFileHelper(lpDestination[1], 17);
+ }
+
+ dwAtt = GetFileAttributesA(lpDestination[2]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[2]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[2]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpDestination[2], 103);
+ }
+ else
+ {
+ removeFileHelper(lpDestination[2], 17);
+ }
+
+ dwAtt = GetFileAttributesA(lpDestination[3]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[3]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[3]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpDestination[3], 103);
+ }
+ else
+ {
+ removeFileHelper(lpDestination[3], 17);
+ }
+
+}
+
+
+
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ BOOL bRc = TRUE;
+ BOOL bSuccess = TRUE;
+ char results[40];
+ FILE* resultsFile = NULL;
+ int nCounter = 0;
+ int i, j;
+ char tempSource[] = {'t','e','m','p','k','.','t','m','p','\0'};
+ char tempDest[] = {'t','e','m','p','2','.','t','m','p','\0'};
+ HANDLE hFile;
+ DWORD result;
+
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+ /* read in the expected results to compare with actual results */
+ memset (results, 0, 20);
+ resultsFile = fopen("expectedresults.txt", "r");
+ if (resultsFile == NULL)
+ {
+ Fail("MoveFileA ERROR[%ul]: Unable to open \"expectedresults.txt\"\n", GetLastError());
+ }
+
+ fgets(results, 20, resultsFile);
+ fclose(resultsFile);
+
+ /* clean the slate */
+ removeAll();
+
+ if (createExisting() != 0)
+ {
+ removeAll();
+ }
+
+
+ /* lpSource loop */
+ for (i = 0; i < 4; i++)
+ {
+ /* lpDestination loop */
+ for (j = 0; j < 4; j++)
+ {
+ bRc = MoveFileA(lpSource[i], lpDestination[j]);
+ if (!(
+ ((bRc == TRUE) && (results[nCounter] == '1'))
+ ||
+ ((bRc == FALSE ) && (results[nCounter] == '0')) )
+ )
+ {
+ Trace("MoveFileA: FAILED: test[%d][%d]: \"%s\" -> \"%s\"\n",
+ i, j, lpSource[i], lpDestination[j]);
+ bSuccess = FALSE;
+ }
+
+ /* undo the last move */
+ removeAll();
+ createExisting();
+
+ nCounter++;
+ }
+ }
+
+ removeAll();
+ if (bSuccess == FALSE)
+ {
+ Fail("MoveFileA: Test Failed");
+ }
+
+ /* create the temp source file */
+ hFile = CreateFileA(tempSource, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, 0);
+
+ if( hFile == INVALID_HANDLE_VALUE )
+ {
+ Fail("Error[%ul]:MoveFileA: CreateFile failed to "
+ "create the file correctly.\n", GetLastError());
+ }
+
+ bRc = CloseHandle(hFile);
+ if(!bRc)
+ {
+ Trace("MoveFileA: CloseHandle failed to close the "
+ "handle correctly. ERROR:%u\n",GetLastError());
+
+ /* delete the created file */
+ bRc = DeleteFileA(tempSource);
+ if(!bRc)
+ {
+ Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
+ "file correctly.\n", GetLastError());
+ }
+ Fail("");
+ }
+
+ /* set the file attributes to be readonly */
+ bRc = SetFileAttributesA(tempSource, FILE_ATTRIBUTE_READONLY);
+ if(!bRc)
+ {
+ Trace("MoveFileA: SetFileAttributes failed to set file "
+ "attributes correctly. GetLastError returned %u\n",GetLastError());
+ /* delete the created file */
+ bRc = DeleteFileA(tempSource);
+ if(!bRc)
+ {
+ Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
+ "file correctly.\n", GetLastError());
+ }
+ Fail("");
+ }
+
+ /* move the file to the new location */
+ bRc = MoveFileA(tempSource, tempDest);
+ if(!bRc)
+ {
+ /* delete the created file */
+ bRc = DeleteFileA(tempSource);
+ if(!bRc)
+ {
+ Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
+ "file correctly.\n", GetLastError());
+ }
+
+ Fail("Error[%ul]:MoveFileA(%S, %S): GetFileAttributes "
+ "failed to get the file's attributes.\n",
+ GetLastError(), tempSource, tempDest);
+ }
+
+ /* check that the newly moved file has the same file attributes
+ as the original */
+ result = GetFileAttributesA(tempDest);
+ if(result == 0)
+ {
+ /* delete the created file */
+ bRc = DeleteFileA(tempDest);
+ if(!bRc)
+ {
+ Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
+ "file correctly.\n", GetLastError());
+ }
+
+ Fail("Error[%ul]:MoveFileA: GetFileAttributes failed to get "
+ "the file's attributes.\n", GetLastError());
+ }
+
+ if((result & FILE_ATTRIBUTE_READONLY) != FILE_ATTRIBUTE_READONLY)
+ {
+ /* delete the newly moved file */
+ bRc = DeleteFileA(tempDest);
+ if(!bRc)
+ {
+ Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
+ "file correctly.\n", GetLastError());
+ }
+
+ Fail("Error[%ul]MoveFileA: GetFileAttributes failed to get "
+ "the correct file attributes.\n", GetLastError());
+ }
+
+ /* set the file attributes back to normal, to be deleted */
+ bRc = SetFileAttributesA(tempDest, FILE_ATTRIBUTE_NORMAL);
+ if(!bRc)
+ {
+ /* delete the newly moved file */
+ bRc = DeleteFileA(tempDest);
+ if(!bRc)
+ {
+ Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
+ "file correctly.\n", GetLastError());
+ }
+
+ Fail("Error[%ul]:MoveFileA: SetFileAttributes failed to set "
+ "file attributes correctly.\n", GetLastError());
+ }
+
+ /* delete the newly moved file */
+ bRc = DeleteFileA(tempDest);
+ if(!bRc)
+ {
+ Fail("Error[%ul]:MoveFileA: DeleteFileA failed to delete the"
+ "file correctly.\n", GetLastError());
+ }
+
+ PAL_Terminate();
+
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/file_io/MoveFileExA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/MoveFileExA/test1/CMakeLists.txt
index f41dd7fd08..ef2471738c 100644
--- a/src/pal/tests/palsuite/file_io/MoveFileExA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/MoveFileExA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- MoveFileExA.c
+ MoveFileExA.cpp
)
add_executable(paltest_movefileexa_test1
diff --git a/src/pal/tests/palsuite/file_io/MoveFileExA/test1/MoveFileExA.c b/src/pal/tests/palsuite/file_io/MoveFileExA/test1/MoveFileExA.cpp
index 0bce2b08d1..0bce2b08d1 100644
--- a/src/pal/tests/palsuite/file_io/MoveFileExA/test1/MoveFileExA.c
+++ b/src/pal/tests/palsuite/file_io/MoveFileExA/test1/MoveFileExA.cpp
diff --git a/src/pal/tests/palsuite/file_io/MoveFileExW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/MoveFileExW/test1/CMakeLists.txt
index 4c6a70f050..ca6b35e3ac 100644
--- a/src/pal/tests/palsuite/file_io/MoveFileExW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/MoveFileExW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- MoveFileExW.c
+ MoveFileExW.cpp
)
add_executable(paltest_movefileexw_test1
diff --git a/src/pal/tests/palsuite/file_io/MoveFileExW/test1/MoveFileExW.c b/src/pal/tests/palsuite/file_io/MoveFileExW/test1/MoveFileExW.cpp
index 4f5b72dcf7..4f5b72dcf7 100644
--- a/src/pal/tests/palsuite/file_io/MoveFileExW/test1/MoveFileExW.c
+++ b/src/pal/tests/palsuite/file_io/MoveFileExW/test1/MoveFileExW.cpp
diff --git a/src/pal/tests/palsuite/file_io/MoveFileW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/MoveFileW/test1/CMakeLists.txt
index 497f654122..4519746e7b 100644
--- a/src/pal/tests/palsuite/file_io/MoveFileW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/MoveFileW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- MoveFileW.c
+ MoveFileW.cpp
)
add_executable(paltest_movefilew_test1
diff --git a/src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.c b/src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.c
deleted file mode 100644
index 58999302d0..0000000000
--- a/src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.c
+++ /dev/null
@@ -1,478 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: MoveFileW.c
-**
-** Purpose: Tests the PAL implementation of the MoveFileW function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-LPSTR lpSource[4] = {"src_existing.txt",
- "src_non-existant.txt",
- "src_dir_existing",
- "src_dir_non-existant"};
-LPSTR lpDestination[4] = {"dst_existing.txt",
- "dst_non-existant.txt",
- "dst_dir_existing",
- "dst_dir_non-existant"};
-
-
-/* Create all the required test files */
-int createExisting(void)
-{
- FILE* tempFile = NULL;
- DWORD dwError;
- BOOL bRc = FALSE;
- WCHAR* wPtr = NULL;
- char szBuffer[100];
-
- /* create the src_existing file */
- tempFile = fopen(lpSource[0], "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFile test file: src_existing.txt\n");
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR: couldn't create %s\n", lpSource[0]);
- return FAIL;
- }
-
- /* create the src_dir_existing directory and files */
- wPtr = convert(lpSource[2]);
- bRc = CreateDirectoryW(wPtr, NULL);
- free(wPtr);
- if (bRc != TRUE)
- {
- Trace("MoveFileW: ERROR: couldn't create \"%s\" because of "
- "error code %ld\n",
- lpSource[2],
- GetLastError());
- return FAIL;
- }
-
- memset(szBuffer, 0, 100);
- sprintf(szBuffer, "%s/test01.txt", lpSource[2]);
- tempFile = fopen(szBuffer, "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileW test file: %s\n", szBuffer);
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR: couldn't create %s\n", szBuffer);
- return FAIL;
- }
-
- memset(szBuffer, 0, 100);
- sprintf(szBuffer, "%s/test02.txt", lpSource[2]);
- tempFile = fopen(szBuffer, "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileW test file: %s\n", szBuffer);
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR: couldn't create %s\n", szBuffer);
- return FAIL;
- }
-
-
- /* create the dst_existing file */
- tempFile = fopen(lpDestination[0], "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileW test file: dst_existing.txt\n");
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR: couldn't create \"%s\"\n", lpDestination[0]);
- return FAIL;
- }
-
- /* create the dst_dir_existing directory and files */
- wPtr = convert(lpDestination[2]);
- bRc = CreateDirectoryW(wPtr, NULL);
- free(wPtr);
- if (bRc != TRUE)
- {
- dwError = GetLastError();
- Trace("MoveFileW: ERROR: couldn't create \"%s\"\n", lpDestination[2]);
- return FAIL;
- }
-
- tempFile = fopen("dst_dir_existing/test01.txt", "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileW test file: dst_dir_existing/test01.txt\n");
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR: couldn't create dst_dir_existing/test01.txt\n");
- return FAIL;
- }
- tempFile = fopen("dst_dir_existing/test02.txt", "w");
- if (tempFile != NULL)
- {
- fprintf(tempFile, "MoveFileW test file: dst_dir_existing/test02.txt\n");
- fclose(tempFile);
- }
- else
- {
- Trace("ERROR: couldn't create dst_dir_existing/test02.txt\n");
- return FAIL;
- }
-
- return PASS;
-}
-
-void removeDirectoryHelper(LPSTR dir, int location)
-{
- DWORD dwAtt = GetFileAttributesA(dir);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- if(!RemoveDirectoryA(dir))
- {
- Fail("ERROR: Failed to remove Directory [%s], Error Code [%d], location [%d]\n", dir, GetLastError(), location);
- }
- }
-}
-
-void removeFileHelper(LPSTR pfile, int location)
-{
- FILE *fp;
- fp = fopen( pfile, "r");
-
- if (fp != NULL)
- {
- if(fclose(fp))
- {
- Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
- }
-
- if(!DeleteFileA(pfile))
- {
- Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
- }
- else
- {
- // Trace("Success: deleted file [%S], Error Code [%d], location [%d]\n", wfile, GetLastError(), location);
- }
- }
-
-}
-
-/* remove all created files in preparation for the next test */
-void removeAll(void)
-{
- char szTemp[40];
- DWORD dwAtt;
-
- /* get rid of source dirs and files */
- removeFileHelper(lpSource[0], 1);
- removeFileHelper(lpSource[1], 2);
-
- dwAtt = GetFileAttributesA(lpSource[2]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpSource[2]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpSource[2]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpSource[2], 103);
- }
- else
- {
- removeFileHelper(lpSource[2], 17);
- }
-
-
- dwAtt = GetFileAttributesA(lpSource[3]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpSource[3]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpSource[3]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpSource[3], 103);
- }
- else
- {
- removeFileHelper(lpSource[3], 17);
- }
-
- /* get rid of destination dirs and files */
- dwAtt = GetFileAttributesA(lpDestination[0]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpDestination[0]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpDestination[0]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpDestination[0], 103);
- }
- else
- {
- removeFileHelper(lpDestination[0], 17);
- }
-
- dwAtt = GetFileAttributesA(lpDestination[1]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpDestination[1]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpDestination[1]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpDestination[1], 103);
- }
- else
- {
- removeFileHelper(lpDestination[1], 17);
- }
-
- dwAtt = GetFileAttributesA(lpDestination[2]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpDestination[2]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpDestination[2]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpDestination[2], 103);
- }
- else
- {
- removeFileHelper(lpDestination[2], 17);
- }
-
- dwAtt = GetFileAttributesA(lpDestination[3]);
- if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
- {
- sprintf(szTemp, "%s/test01.txt", lpDestination[3]);
- removeFileHelper(szTemp, 18);
-
- sprintf(szTemp, "%s/test02.txt", lpDestination[3]);
- removeFileHelper(szTemp, 19);
- removeDirectoryHelper(lpDestination[3], 103);
- }
- else
- {
- removeFileHelper(lpDestination[3], 17);
- }
-
-}
-
-
-
-
-
-int __cdecl main(int argc, char *argv[])
-{
- BOOL bRc = TRUE;
- BOOL bSuccess = TRUE;
- char results[40];
- FILE* resultsFile = NULL;
- int nCounter = 0;
- int i, j;
- WCHAR* wSource = NULL;
- WCHAR* wDest = NULL;
- WCHAR tempSource[] = {'t','e','m','p','k','.','t','m','p','\0'};
- WCHAR tempDest[] = {'t','e','m','p','2','.','t','m','p','\0'};
- HANDLE hFile;
- DWORD result;
-
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
- /* read in the expected results to compare with actual results */
- memset (results, 0, 20);
- resultsFile = fopen("expectedresults.txt", "r");
- if (resultsFile == NULL)
- {
- Fail("MoveFileW ERROR: Unable to open \"expectedresults.txt\"\n");
- }
-
- fgets(results, 20, resultsFile);
- fclose(resultsFile);
-
- /* clean the slate */
- removeAll();
-
- if (createExisting() != 0)
- {
- removeAll();
- }
-
-
- /* lpSource loop */
- for (i = 0; i < 4; i++)
- {
- /* lpDestination loop */
- for (j = 0; j < 4; j++)
- {
-
- wSource = convert(lpSource[i]);
- wDest = convert(lpDestination[j]);
- bRc = MoveFileW(wSource, wDest);
- free(wSource);
- free(wDest);
- if (!(
- ((bRc == TRUE) && (results[nCounter] == '1'))
- ||
- ((bRc == FALSE ) && (results[nCounter] == '0')) )
- )
- {
- Trace("MoveFileW: FAILED: test[%d][%d]: \"%s\" -> \"%s\"\n",
- i, j, lpSource[i], lpDestination[j]);
- bSuccess = FALSE;
- }
-
- /* undo the last move */
- removeAll();
- createExisting();
-
- nCounter++;
- }
- }
-
- removeAll();
- if (bSuccess == FALSE)
- {
- Fail("MoveFileW: Test Failed");
- }
-
- /* create the temp source file */
- hFile = CreateFileW(tempSource, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL, 0);
-
- if( hFile == INVALID_HANDLE_VALUE )
- {
- Fail("MoveFileW: CreateFile failed to "
- "create the file correctly.\n");
- }
-
- bRc = CloseHandle(hFile);
- if(!bRc)
- {
- Trace("MoveFileW: CloseHandle failed to close the "
- "handle correctly. ERROR:%u\n",GetLastError());
-
- /* delete the created file */
- bRc = DeleteFileW(tempSource);
- if(!bRc)
- {
- Fail("MoveFileW: DeleteFileW failed to delete the"
- "file correctly.\n");
- }
- Fail("");
- }
-
- /* set the file attributes to be readonly */
- bRc = SetFileAttributesW(tempSource, FILE_ATTRIBUTE_READONLY);
- if(!bRc)
- {
- Trace("MoveFileW: SetFileAttributes failed to set file "
- "attributes correctly. GetLastError returned %u\n",GetLastError());
- /* delete the created file */
- bRc = DeleteFileW(tempSource);
- if(!bRc)
- {
- Fail("MoveFileW: DeleteFileW failed to delete the"
- "file correctly.\n");
- }
- Fail("");
- }
-
- /* move the file to the new location */
- bRc = MoveFileW(tempSource, tempDest);
- if(!bRc)
- {
- /* delete the created file */
- bRc = DeleteFileW(tempSource);
- if(!bRc)
- {
- Fail("MoveFileW: DeleteFileW failed to delete the"
- "file correctly.\n");
- }
-
- Fail("MoveFileW(%S, %S): GetFileAttributes "
- "failed to get the file's attributes.\n",
- tempSource, tempDest);
- }
-
- /* check that the newly moved file has the same file attributes
- as the original */
- result = GetFileAttributesW(tempDest);
- if(result == 0)
- {
- /* delete the created file */
- bRc = DeleteFileW(tempDest);
- if(!bRc)
- {
- Fail("MoveFileW: DeleteFileW failed to delete the"
- "file correctly.\n");
- }
-
- Fail("MoveFileW: GetFileAttributes failed to get "
- "the file's attributes.\n");
- }
-
- if((result & FILE_ATTRIBUTE_READONLY) != FILE_ATTRIBUTE_READONLY)
- {
- /* delete the newly moved file */
- bRc = DeleteFileW(tempDest);
- if(!bRc)
- {
- Fail("MoveFileW: DeleteFileW failed to delete the"
- "file correctly.\n");
- }
-
- Fail("MoveFileW: GetFileAttributes failed to get "
- "the correct file attributes.\n");
- }
-
- /* set the file attributes back to normal, to be deleted */
- bRc = SetFileAttributesW(tempDest, FILE_ATTRIBUTE_NORMAL);
- if(!bRc)
- {
- /* delete the newly moved file */
- bRc = DeleteFileW(tempDest);
- if(!bRc)
- {
- Fail("MoveFileW: DeleteFileW failed to delete the"
- "file correctly.\n");
- }
-
- Fail("MoveFileW: SetFileAttributes failed to set "
- "file attributes correctly.\n");
- }
-
- /* delete the newly moved file */
- bRc = DeleteFileW(tempDest);
- if(!bRc)
- {
- Fail("MoveFileW: DeleteFileW failed to delete the"
- "file correctly.\n");
- }
-
- PAL_Terminate();
-
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.cpp b/src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.cpp
new file mode 100644
index 0000000000..8a7fae5983
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.cpp
@@ -0,0 +1,478 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: MoveFileW.c
+**
+** Purpose: Tests the PAL implementation of the MoveFileW function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+LPSTR lpSource[4] = {"src_existing.txt",
+ "src_non-existant.txt",
+ "src_dir_existing",
+ "src_dir_non-existant"};
+LPSTR lpDestination[4] = {"dst_existing.txt",
+ "dst_non-existant.txt",
+ "dst_dir_existing",
+ "dst_dir_non-existant"};
+
+
+/* Create all the required test files */
+int createExisting(void)
+{
+ FILE* tempFile = NULL;
+ DWORD dwError;
+ BOOL bRc = FALSE;
+ WCHAR* wPtr = NULL;
+ char szBuffer[100];
+
+ /* create the src_existing file */
+ tempFile = fopen(lpSource[0], "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFile test file: src_existing.txt\n");
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR: couldn't create %s\n", lpSource[0]);
+ return FAIL;
+ }
+
+ /* create the src_dir_existing directory and files */
+ wPtr = convert(lpSource[2]);
+ bRc = CreateDirectoryW(wPtr, NULL);
+ free(wPtr);
+ if (bRc != TRUE)
+ {
+ Trace("MoveFileW: ERROR: couldn't create \"%s\" because of "
+ "error code %ld\n",
+ lpSource[2],
+ GetLastError());
+ return FAIL;
+ }
+
+ memset(szBuffer, 0, 100);
+ sprintf_s(szBuffer, _countof(szBuffer), "%s/test01.txt", lpSource[2]);
+ tempFile = fopen(szBuffer, "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileW test file: %s\n", szBuffer);
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR: couldn't create %s\n", szBuffer);
+ return FAIL;
+ }
+
+ memset(szBuffer, 0, 100);
+ sprintf_s(szBuffer, _countof(szBuffer), "%s/test02.txt", lpSource[2]);
+ tempFile = fopen(szBuffer, "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileW test file: %s\n", szBuffer);
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR: couldn't create %s\n", szBuffer);
+ return FAIL;
+ }
+
+
+ /* create the dst_existing file */
+ tempFile = fopen(lpDestination[0], "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileW test file: dst_existing.txt\n");
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR: couldn't create \"%s\"\n", lpDestination[0]);
+ return FAIL;
+ }
+
+ /* create the dst_dir_existing directory and files */
+ wPtr = convert(lpDestination[2]);
+ bRc = CreateDirectoryW(wPtr, NULL);
+ free(wPtr);
+ if (bRc != TRUE)
+ {
+ dwError = GetLastError();
+ Trace("MoveFileW: ERROR: couldn't create \"%s\"\n", lpDestination[2]);
+ return FAIL;
+ }
+
+ tempFile = fopen("dst_dir_existing/test01.txt", "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileW test file: dst_dir_existing/test01.txt\n");
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR: couldn't create dst_dir_existing/test01.txt\n");
+ return FAIL;
+ }
+ tempFile = fopen("dst_dir_existing/test02.txt", "w");
+ if (tempFile != NULL)
+ {
+ fprintf(tempFile, "MoveFileW test file: dst_dir_existing/test02.txt\n");
+ fclose(tempFile);
+ }
+ else
+ {
+ Trace("ERROR: couldn't create dst_dir_existing/test02.txt\n");
+ return FAIL;
+ }
+
+ return PASS;
+}
+
+void removeDirectoryHelper(LPSTR dir, int location)
+{
+ DWORD dwAtt = GetFileAttributesA(dir);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ if(!RemoveDirectoryA(dir))
+ {
+ Fail("ERROR: Failed to remove Directory [%s], Error Code [%d], location [%d]\n", dir, GetLastError(), location);
+ }
+ }
+}
+
+void removeFileHelper(LPSTR pfile, int location)
+{
+ FILE *fp;
+ fp = fopen( pfile, "r");
+
+ if (fp != NULL)
+ {
+ if(fclose(fp))
+ {
+ Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
+ }
+
+ if(!DeleteFileA(pfile))
+ {
+ Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
+ }
+ else
+ {
+ // Trace("Success: deleted file [%S], Error Code [%d], location [%d]\n", wfile, GetLastError(), location);
+ }
+ }
+
+}
+
+/* remove all created files in preparation for the next test */
+void removeAll(void)
+{
+ char szTemp[40];
+ DWORD dwAtt;
+
+ /* get rid of source dirs and files */
+ removeFileHelper(lpSource[0], 1);
+ removeFileHelper(lpSource[1], 2);
+
+ dwAtt = GetFileAttributesA(lpSource[2]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpSource[2]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpSource[2]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpSource[2], 103);
+ }
+ else
+ {
+ removeFileHelper(lpSource[2], 17);
+ }
+
+
+ dwAtt = GetFileAttributesA(lpSource[3]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpSource[3]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpSource[3]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpSource[3], 103);
+ }
+ else
+ {
+ removeFileHelper(lpSource[3], 17);
+ }
+
+ /* get rid of destination dirs and files */
+ dwAtt = GetFileAttributesA(lpDestination[0]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[0]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[0]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpDestination[0], 103);
+ }
+ else
+ {
+ removeFileHelper(lpDestination[0], 17);
+ }
+
+ dwAtt = GetFileAttributesA(lpDestination[1]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[1]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[1]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpDestination[1], 103);
+ }
+ else
+ {
+ removeFileHelper(lpDestination[1], 17);
+ }
+
+ dwAtt = GetFileAttributesA(lpDestination[2]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[2]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[2]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpDestination[2], 103);
+ }
+ else
+ {
+ removeFileHelper(lpDestination[2], 17);
+ }
+
+ dwAtt = GetFileAttributesA(lpDestination[3]);
+ if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
+ {
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[3]);
+ removeFileHelper(szTemp, 18);
+
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[3]);
+ removeFileHelper(szTemp, 19);
+ removeDirectoryHelper(lpDestination[3], 103);
+ }
+ else
+ {
+ removeFileHelper(lpDestination[3], 17);
+ }
+
+}
+
+
+
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ BOOL bRc = TRUE;
+ BOOL bSuccess = TRUE;
+ char results[40];
+ FILE* resultsFile = NULL;
+ int nCounter = 0;
+ int i, j;
+ WCHAR* wSource = NULL;
+ WCHAR* wDest = NULL;
+ WCHAR tempSource[] = {'t','e','m','p','k','.','t','m','p','\0'};
+ WCHAR tempDest[] = {'t','e','m','p','2','.','t','m','p','\0'};
+ HANDLE hFile;
+ DWORD result;
+
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+ /* read in the expected results to compare with actual results */
+ memset (results, 0, 20);
+ resultsFile = fopen("expectedresults.txt", "r");
+ if (resultsFile == NULL)
+ {
+ Fail("MoveFileW ERROR: Unable to open \"expectedresults.txt\"\n");
+ }
+
+ fgets(results, 20, resultsFile);
+ fclose(resultsFile);
+
+ /* clean the slate */
+ removeAll();
+
+ if (createExisting() != 0)
+ {
+ removeAll();
+ }
+
+
+ /* lpSource loop */
+ for (i = 0; i < 4; i++)
+ {
+ /* lpDestination loop */
+ for (j = 0; j < 4; j++)
+ {
+
+ wSource = convert(lpSource[i]);
+ wDest = convert(lpDestination[j]);
+ bRc = MoveFileW(wSource, wDest);
+ free(wSource);
+ free(wDest);
+ if (!(
+ ((bRc == TRUE) && (results[nCounter] == '1'))
+ ||
+ ((bRc == FALSE ) && (results[nCounter] == '0')) )
+ )
+ {
+ Trace("MoveFileW: FAILED: test[%d][%d]: \"%s\" -> \"%s\"\n",
+ i, j, lpSource[i], lpDestination[j]);
+ bSuccess = FALSE;
+ }
+
+ /* undo the last move */
+ removeAll();
+ createExisting();
+
+ nCounter++;
+ }
+ }
+
+ removeAll();
+ if (bSuccess == FALSE)
+ {
+ Fail("MoveFileW: Test Failed");
+ }
+
+ /* create the temp source file */
+ hFile = CreateFileW(tempSource, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, 0);
+
+ if( hFile == INVALID_HANDLE_VALUE )
+ {
+ Fail("MoveFileW: CreateFile failed to "
+ "create the file correctly.\n");
+ }
+
+ bRc = CloseHandle(hFile);
+ if(!bRc)
+ {
+ Trace("MoveFileW: CloseHandle failed to close the "
+ "handle correctly. ERROR:%u\n",GetLastError());
+
+ /* delete the created file */
+ bRc = DeleteFileW(tempSource);
+ if(!bRc)
+ {
+ Fail("MoveFileW: DeleteFileW failed to delete the"
+ "file correctly.\n");
+ }
+ Fail("");
+ }
+
+ /* set the file attributes to be readonly */
+ bRc = SetFileAttributesW(tempSource, FILE_ATTRIBUTE_READONLY);
+ if(!bRc)
+ {
+ Trace("MoveFileW: SetFileAttributes failed to set file "
+ "attributes correctly. GetLastError returned %u\n",GetLastError());
+ /* delete the created file */
+ bRc = DeleteFileW(tempSource);
+ if(!bRc)
+ {
+ Fail("MoveFileW: DeleteFileW failed to delete the"
+ "file correctly.\n");
+ }
+ Fail("");
+ }
+
+ /* move the file to the new location */
+ bRc = MoveFileW(tempSource, tempDest);
+ if(!bRc)
+ {
+ /* delete the created file */
+ bRc = DeleteFileW(tempSource);
+ if(!bRc)
+ {
+ Fail("MoveFileW: DeleteFileW failed to delete the"
+ "file correctly.\n");
+ }
+
+ Fail("MoveFileW(%S, %S): GetFileAttributes "
+ "failed to get the file's attributes.\n",
+ tempSource, tempDest);
+ }
+
+ /* check that the newly moved file has the same file attributes
+ as the original */
+ result = GetFileAttributesW(tempDest);
+ if(result == 0)
+ {
+ /* delete the created file */
+ bRc = DeleteFileW(tempDest);
+ if(!bRc)
+ {
+ Fail("MoveFileW: DeleteFileW failed to delete the"
+ "file correctly.\n");
+ }
+
+ Fail("MoveFileW: GetFileAttributes failed to get "
+ "the file's attributes.\n");
+ }
+
+ if((result & FILE_ATTRIBUTE_READONLY) != FILE_ATTRIBUTE_READONLY)
+ {
+ /* delete the newly moved file */
+ bRc = DeleteFileW(tempDest);
+ if(!bRc)
+ {
+ Fail("MoveFileW: DeleteFileW failed to delete the"
+ "file correctly.\n");
+ }
+
+ Fail("MoveFileW: GetFileAttributes failed to get "
+ "the correct file attributes.\n");
+ }
+
+ /* set the file attributes back to normal, to be deleted */
+ bRc = SetFileAttributesW(tempDest, FILE_ATTRIBUTE_NORMAL);
+ if(!bRc)
+ {
+ /* delete the newly moved file */
+ bRc = DeleteFileW(tempDest);
+ if(!bRc)
+ {
+ Fail("MoveFileW: DeleteFileW failed to delete the"
+ "file correctly.\n");
+ }
+
+ Fail("MoveFileW: SetFileAttributes failed to set "
+ "file attributes correctly.\n");
+ }
+
+ /* delete the newly moved file */
+ bRc = DeleteFileW(tempDest);
+ if(!bRc)
+ {
+ Fail("MoveFileW: DeleteFileW failed to delete the"
+ "file correctly.\n");
+ }
+
+ PAL_Terminate();
+
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/file_io/ReadFile/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/ReadFile/test1/CMakeLists.txt
index 7b166e17b0..0aceb3708e 100644
--- a/src/pal/tests/palsuite/file_io/ReadFile/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/ReadFile/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- ReadFile.c
+ ReadFile.cpp
)
add_executable(paltest_readfile_test1
diff --git a/src/pal/tests/palsuite/file_io/ReadFile/test1/ReadFile.c b/src/pal/tests/palsuite/file_io/ReadFile/test1/ReadFile.cpp
index a59e29212e..a59e29212e 100644
--- a/src/pal/tests/palsuite/file_io/ReadFile/test1/ReadFile.c
+++ b/src/pal/tests/palsuite/file_io/ReadFile/test1/ReadFile.cpp
diff --git a/src/pal/tests/palsuite/file_io/ReadFile/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/ReadFile/test2/CMakeLists.txt
index fc4870e73d..f28ac117a2 100644
--- a/src/pal/tests/palsuite/file_io/ReadFile/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/ReadFile/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- ReadFile.c
+ ReadFile.cpp
)
add_executable(paltest_readfile_test2
diff --git a/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.c b/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp
index f16858e573..f16858e573 100644
--- a/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.c
+++ b/src/pal/tests/palsuite/file_io/ReadFile/test2/ReadFile.cpp
diff --git a/src/pal/tests/palsuite/file_io/ReadFile/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/ReadFile/test3/CMakeLists.txt
index 77397743d4..26cb675c40 100644
--- a/src/pal/tests/palsuite/file_io/ReadFile/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/ReadFile/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- ReadFile.c
+ ReadFile.cpp
)
add_executable(paltest_readfile_test3
diff --git a/src/pal/tests/palsuite/file_io/ReadFile/test3/ReadFile.c b/src/pal/tests/palsuite/file_io/ReadFile/test3/ReadFile.cpp
index c5d6b1d155..c5d6b1d155 100644
--- a/src/pal/tests/palsuite/file_io/ReadFile/test3/ReadFile.c
+++ b/src/pal/tests/palsuite/file_io/ReadFile/test3/ReadFile.cpp
diff --git a/src/pal/tests/palsuite/file_io/ReadFile/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/ReadFile/test4/CMakeLists.txt
index 37f227aced..bbf12777b6 100644
--- a/src/pal/tests/palsuite/file_io/ReadFile/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/ReadFile/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- readfile.c
+ readfile.cpp
)
add_executable(paltest_readfile_test4
diff --git a/src/pal/tests/palsuite/file_io/ReadFile/test4/readfile.c b/src/pal/tests/palsuite/file_io/ReadFile/test4/readfile.cpp
index 3ec939f63a..3ec939f63a 100644
--- a/src/pal/tests/palsuite/file_io/ReadFile/test4/readfile.c
+++ b/src/pal/tests/palsuite/file_io/ReadFile/test4/readfile.cpp
diff --git a/src/pal/tests/palsuite/file_io/RemoveDirectoryA/test1/RemoveDirectoryA.cpp b/src/pal/tests/palsuite/file_io/RemoveDirectoryA/test1/RemoveDirectoryA.cpp
index 167af58163..4eb53d0d0a 100644
--- a/src/pal/tests/palsuite/file_io/RemoveDirectoryA/test1/RemoveDirectoryA.cpp
+++ b/src/pal/tests/palsuite/file_io/RemoveDirectoryA/test1/RemoveDirectoryA.cpp
@@ -48,7 +48,7 @@ int __cdecl main(int argc, char *argv[])
* remove a directory that does not exist
*/
szTemp = (char *) malloc (sizeof("test_directory"));
- sprintf(szTemp, "test_directory");
+ sprintf_s(szTemp, sizeof("test_directory"), "test_directory");
bRc = RemoveDirectoryA(szTemp);
if (bRc != FALSE)
{
@@ -69,7 +69,7 @@ int __cdecl main(int argc, char *argv[])
}
char *szSymlinkName = (char *) malloc (sizeof("test_directory_symlink"));
- sprintf(szSymlinkName, "test_directory_symlink");
+ sprintf_s(szSymlinkName, sizeof("test_directory_symlink"), "test_directory_symlink");
if (symlink(szTemp, szSymlinkName) != 0)
{
Fail("Error:RemoveDirectoryA: Failed to create a symlink to the directory \"test_directory\".\n");
@@ -140,7 +140,7 @@ int __cdecl main(int argc, char *argv[])
* directories with dots
*/
memset(szDirName, 0, 252);
- sprintf(szDirName, ".dotDirectory");
+ sprintf_s(szDirName, _countof(szDirName), ".dotDirectory");
szTemp = (char *) malloc (sizeof(szDirName));
szTemp = strncpy(szTemp, szDirName, strlen(szDirName) + 1);
@@ -170,7 +170,7 @@ int __cdecl main(int argc, char *argv[])
* Try calling RemoveDirectory with a file name
*/
memset(szDirName, 0, 252);
- sprintf(szDirName, "removedirectoryw.c");
+ sprintf_s(szDirName, _countof(szDirName), "removedirectoryw.c");
szTemp = (char *) malloc (sizeof(szDirName));
szTemp = strncpy(szTemp, szDirName, strlen(szDirName) + 1);
@@ -201,7 +201,7 @@ int __cdecl main(int argc, char *argv[])
}
/* Create non_empty_dir */
- sprintf( szDirName, "non_empty_dir");
+ sprintf_s(szDirName, _countof(szDirName), "non_empty_dir");
szTemp = (char *) malloc (sizeof(szDirName));
szTemp = strncpy(szTemp, szDirName, strlen(szDirName) + 1);
bRc = CreateDirectoryA(szTemp, NULL);
@@ -229,7 +229,7 @@ int __cdecl main(int argc, char *argv[])
}
/* Create sub_dir */
- sprintf (szDirName, "sub_dir");
+ sprintf_s(szDirName, _countof(szDirName), "sub_dir");
szTemp2 = (char *) malloc (sizeof(szDirName));
szTemp2 = strncpy(szTemp2, szDirName, strlen(szDirName) + 1);
bRc = CreateDirectoryA(szTemp2, NULL);
diff --git a/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/CMakeLists.txt
index 45b51cec30..6223bc6197 100644
--- a/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- RemoveDirectoryW.c
+ RemoveDirectoryW.cpp
)
add_executable(paltest_removedirectoryw_test1
diff --git a/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.c b/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.c
deleted file mode 100644
index ae1dd0fb97..0000000000
--- a/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.c
+++ /dev/null
@@ -1,282 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: RemoveDirectoryW.c
-**
-** Purpose: Tests the PAL implementation of the RemoveDirectoryW function.
-**
-**
-**===================================================================*/
-
-
-#include <palsuite.h>
-
-
-int __cdecl main(int argc, char *argv[])
-{
- BOOL bRc = FALSE;
- char szDirName[252];
- DWORD curDirLen;
- WCHAR *szwTemp = NULL;
- WCHAR *szwTemp2 = NULL;
- WCHAR szwCurrentDir[MAX_PATH];
- WCHAR szwSubDir[MAX_PATH];
-
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
- /*
- * remove a NULL directory
- */
- bRc = RemoveDirectoryW(NULL);
- if (bRc != FALSE)
- {
- Fail("RemoveDirectoryW: Failed since it was able to remove a"
- " NULL directory name\n");
- }
-
- /*
- * remove a directory that does not exist
- */
- szwTemp = convert("test_directory");
- bRc = RemoveDirectoryW(szwTemp);
- if (bRc != FALSE)
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed since it was able to remove"
- " the non-existant directory \"test_directory\"\n");
- }
-
- /*
- * remove a directory that exists
- */
- bRc = CreateDirectoryW(szwTemp, NULL);
- if (bRc != TRUE)
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed to create the directory "
- "\"test_directory\" when it exists already.\n");
- }
- bRc = RemoveDirectoryW(szwTemp);
- if (bRc == FALSE)
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed to remove the directory "
- "\"test_directory\" (error code %d)\n",
- GetLastError());
- }
- /* Make sure the directory was removed */
- if( -1 != GetFileAttributesW(szwTemp) )
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Able to get the attributes of "
- "the removed directory\n");
- }
- free(szwTemp);
-
- /*
- * remove long directory names (245 characters)
- */
- curDirLen = GetCurrentDirectoryA(0, NULL) + 1;
- memset(szDirName, 0, 252);
- memset(szDirName, 'a', 245 - curDirLen);
- szwTemp = convert(szDirName);
- bRc = CreateDirectoryW(szwTemp, NULL);
- if (bRc == FALSE)
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed to create a directory name "
- "245 chars long\n");
- }
- bRc = RemoveDirectoryW(szwTemp);
- if (bRc == FALSE)
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed to remove a 245 char "
- "long directory\n");
- }
-
- /* Make sure the directory was removed */
- if( -1 != GetFileAttributesW(szwTemp) )
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Able to get the attributes of "
- "the removed directory\n");
- }
- free(szwTemp);
-
- /*
- * directories with dots
- */
- memset(szDirName, 0, 252);
- sprintf(szDirName, ".dotDirectory");
- szwTemp = convert(szDirName);
- bRc = CreateDirectoryW(szwTemp, NULL);
- if (bRc == FALSE)
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed to create \"%s\"\n", szDirName);
- }
- bRc = RemoveDirectoryW(szwTemp);
- if (bRc == FALSE)
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed to remove \"%s\"\n", szDirName);
- }
-
- /* Make sure the directory was removed */
- if( -1 != GetFileAttributesW(szwTemp) )
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Able to get the attributes of "
- "the removed directory\n");
- }
- free(szwTemp);
-
- /*
- * Try calling RemoveDirectory with a file name
- */
- memset(szDirName, 0, 252);
- sprintf(szDirName, "removedirectoryw.c");
- szwTemp = convert(szDirName);
-
- bRc = RemoveDirectoryW(szwTemp);
- free(szwTemp);
- if (bRc != FALSE)
- {
- Fail("RemoveDirectoryW: should have failed when "
- "called with a valid file name" );
- }
-
- /*
- * remove a non empty directory
- *
- * To test that, we'll first create non_empty_dir, we'll
- * set the current dir to non_empty_dir in which we'll
- * create sub_dir. We'll go back to the root of non_empty_dir
- * and we'll try to delete it (it shouldn't work).
- * After that we'll cleanup sub_dir and non_empty_dir
- */
-
- /* Get the current directory so it is easy to get back
- to it later */
- if( 0 == GetCurrentDirectoryW(MAX_PATH, szwCurrentDir) )
- {
- Fail("RemoveDirectoryW: Failed to get current directory "
- "with GetCurrentDirectoryW.\n");
- }
-
- /* Create non_empty_dir */
- szwTemp = convert("non_empty_dir");
- bRc = CreateDirectoryW(szwTemp, NULL);
- if (bRc != TRUE)
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed to create the directory "
- "\"non_empty_dir\" when it exists already.\n");
- }
-
- if( 0 == SetCurrentDirectoryW(szwTemp) )
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed to set current directory to "
- "\"non_empty_dir\" with SetCurrentDirectoryW.\n");
- }
-
- /* Get the directory full path so it is easy to get back
- to it later */
- if( 0 == GetCurrentDirectoryW(MAX_PATH, szwSubDir) )
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed to get current directory "
- "with GetCurrentDirectoryW.\n");
- }
-
- /* Create sub_dir */
- szwTemp2 = convert("sub_dir");
- bRc = CreateDirectoryW(szwTemp2, NULL);
- if (bRc != TRUE)
- {
- free(szwTemp);
- free(szwTemp2);
- Fail("RemoveDirectoryW: Failed to create the directory "
- "\"sub_dir\" when it exists already.\n");
- }
-
- /* Set the current dir to the parent of non_empty_dir/sub_dir */
- if( 0 == SetCurrentDirectoryW(szwCurrentDir) )
- {
- free(szwTemp);
- free(szwTemp2);
- Fail("RemoveDirectoryW: Failed to set current directory to "
- "\"non_empty_dir\" with SetCurrentDirectoryW.\n");
- }
-
- /* Try to remove non_empty_dir (shouldn't work) */
- bRc = RemoveDirectoryW(szwTemp);
- if (bRc == TRUE)
- {
- free(szwTemp);
- free(szwTemp2);
- Fail("RemoveDirectoryW: shouldn't have been able to remove "
- "the non empty directory \"non_empty_dir\"\n");
- }
-
- /* Go back to non_empty_dir and remove sub_dir */
- if( 0 == SetCurrentDirectoryW(szwSubDir) )
- {
- free(szwTemp);
- free(szwTemp2);
- Fail("RemoveDirectoryW: Failed to set current directory to "
- "\"non_empty_dir\" with SetCurrentDirectoryW.\n");
- }
-
- bRc = RemoveDirectoryW(szwTemp2);
- if (bRc == FALSE)
- {
- free(szwTemp);
- free(szwTemp2);
- Fail("RemoveDirectoryW: unable to remove "
- "directory \"sub_dir\"(error code %d)\n",
- GetLastError());
- }
- /* Make sure the directory was removed */
- if( -1 != GetFileAttributesW(szwTemp2) )
- {
- Fail("RemoveDirectoryW: Able to get the attributes of "
- "the removed directory\n");
- }
- free(szwTemp2);
-
- /* Go back to parent of non_empty_dir and remove non_empty_dir */
- if( 0 == SetCurrentDirectoryW(szwCurrentDir) )
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: Failed to set current directory to "
- "\"..\non_empty_dir\" with SetCurrentDirectoryW.\n");
- }
- bRc = RemoveDirectoryW(szwTemp);
- if (bRc == FALSE)
- {
- free(szwTemp);
- Fail("RemoveDirectoryW: unable to remove "
- "the directory \"non_empty_dir\"(error code %d)\n",
- GetLastError());
- }
- /* Make sure the directory was removed */
- if( -1 != GetFileAttributesW(szwTemp) )
- {
- Fail("RemoveDirectoryW: Able to get the attributes of "
- "the removed directory\n");
- }
- free(szwTemp);
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.cpp b/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.cpp
new file mode 100644
index 0000000000..ec90528069
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.cpp
@@ -0,0 +1,282 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: RemoveDirectoryW.c
+**
+** Purpose: Tests the PAL implementation of the RemoveDirectoryW function.
+**
+**
+**===================================================================*/
+
+
+#include <palsuite.h>
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ BOOL bRc = FALSE;
+ char szDirName[252];
+ DWORD curDirLen;
+ WCHAR *szwTemp = NULL;
+ WCHAR *szwTemp2 = NULL;
+ WCHAR szwCurrentDir[MAX_PATH];
+ WCHAR szwSubDir[MAX_PATH];
+
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+ /*
+ * remove a NULL directory
+ */
+ bRc = RemoveDirectoryW(NULL);
+ if (bRc != FALSE)
+ {
+ Fail("RemoveDirectoryW: Failed since it was able to remove a"
+ " NULL directory name\n");
+ }
+
+ /*
+ * remove a directory that does not exist
+ */
+ szwTemp = convert("test_directory");
+ bRc = RemoveDirectoryW(szwTemp);
+ if (bRc != FALSE)
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed since it was able to remove"
+ " the non-existant directory \"test_directory\"\n");
+ }
+
+ /*
+ * remove a directory that exists
+ */
+ bRc = CreateDirectoryW(szwTemp, NULL);
+ if (bRc != TRUE)
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed to create the directory "
+ "\"test_directory\" when it exists already.\n");
+ }
+ bRc = RemoveDirectoryW(szwTemp);
+ if (bRc == FALSE)
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed to remove the directory "
+ "\"test_directory\" (error code %d)\n",
+ GetLastError());
+ }
+ /* Make sure the directory was removed */
+ if( -1 != GetFileAttributesW(szwTemp) )
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Able to get the attributes of "
+ "the removed directory\n");
+ }
+ free(szwTemp);
+
+ /*
+ * remove long directory names (245 characters)
+ */
+ curDirLen = GetCurrentDirectoryA(0, NULL) + 1;
+ memset(szDirName, 0, 252);
+ memset(szDirName, 'a', 245 - curDirLen);
+ szwTemp = convert(szDirName);
+ bRc = CreateDirectoryW(szwTemp, NULL);
+ if (bRc == FALSE)
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed to create a directory name "
+ "245 chars long\n");
+ }
+ bRc = RemoveDirectoryW(szwTemp);
+ if (bRc == FALSE)
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed to remove a 245 char "
+ "long directory\n");
+ }
+
+ /* Make sure the directory was removed */
+ if( -1 != GetFileAttributesW(szwTemp) )
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Able to get the attributes of "
+ "the removed directory\n");
+ }
+ free(szwTemp);
+
+ /*
+ * directories with dots
+ */
+ memset(szDirName, 0, 252);
+ sprintf_s(szDirName, _countof(szDirName), ".dotDirectory");
+ szwTemp = convert(szDirName);
+ bRc = CreateDirectoryW(szwTemp, NULL);
+ if (bRc == FALSE)
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed to create \"%s\"\n", szDirName);
+ }
+ bRc = RemoveDirectoryW(szwTemp);
+ if (bRc == FALSE)
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed to remove \"%s\"\n", szDirName);
+ }
+
+ /* Make sure the directory was removed */
+ if( -1 != GetFileAttributesW(szwTemp) )
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Able to get the attributes of "
+ "the removed directory\n");
+ }
+ free(szwTemp);
+
+ /*
+ * Try calling RemoveDirectory with a file name
+ */
+ memset(szDirName, 0, 252);
+ sprintf_s(szDirName, _countof(szDirName), "removedirectoryw.c");
+ szwTemp = convert(szDirName);
+
+ bRc = RemoveDirectoryW(szwTemp);
+ free(szwTemp);
+ if (bRc != FALSE)
+ {
+ Fail("RemoveDirectoryW: should have failed when "
+ "called with a valid file name" );
+ }
+
+ /*
+ * remove a non empty directory
+ *
+ * To test that, we'll first create non_empty_dir, we'll
+ * set the current dir to non_empty_dir in which we'll
+ * create sub_dir. We'll go back to the root of non_empty_dir
+ * and we'll try to delete it (it shouldn't work).
+ * After that we'll cleanup sub_dir and non_empty_dir
+ */
+
+ /* Get the current directory so it is easy to get back
+ to it later */
+ if( 0 == GetCurrentDirectoryW(MAX_PATH, szwCurrentDir) )
+ {
+ Fail("RemoveDirectoryW: Failed to get current directory "
+ "with GetCurrentDirectoryW.\n");
+ }
+
+ /* Create non_empty_dir */
+ szwTemp = convert("non_empty_dir");
+ bRc = CreateDirectoryW(szwTemp, NULL);
+ if (bRc != TRUE)
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed to create the directory "
+ "\"non_empty_dir\" when it exists already.\n");
+ }
+
+ if( 0 == SetCurrentDirectoryW(szwTemp) )
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed to set current directory to "
+ "\"non_empty_dir\" with SetCurrentDirectoryW.\n");
+ }
+
+ /* Get the directory full path so it is easy to get back
+ to it later */
+ if( 0 == GetCurrentDirectoryW(MAX_PATH, szwSubDir) )
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed to get current directory "
+ "with GetCurrentDirectoryW.\n");
+ }
+
+ /* Create sub_dir */
+ szwTemp2 = convert("sub_dir");
+ bRc = CreateDirectoryW(szwTemp2, NULL);
+ if (bRc != TRUE)
+ {
+ free(szwTemp);
+ free(szwTemp2);
+ Fail("RemoveDirectoryW: Failed to create the directory "
+ "\"sub_dir\" when it exists already.\n");
+ }
+
+ /* Set the current dir to the parent of non_empty_dir/sub_dir */
+ if( 0 == SetCurrentDirectoryW(szwCurrentDir) )
+ {
+ free(szwTemp);
+ free(szwTemp2);
+ Fail("RemoveDirectoryW: Failed to set current directory to "
+ "\"non_empty_dir\" with SetCurrentDirectoryW.\n");
+ }
+
+ /* Try to remove non_empty_dir (shouldn't work) */
+ bRc = RemoveDirectoryW(szwTemp);
+ if (bRc == TRUE)
+ {
+ free(szwTemp);
+ free(szwTemp2);
+ Fail("RemoveDirectoryW: shouldn't have been able to remove "
+ "the non empty directory \"non_empty_dir\"\n");
+ }
+
+ /* Go back to non_empty_dir and remove sub_dir */
+ if( 0 == SetCurrentDirectoryW(szwSubDir) )
+ {
+ free(szwTemp);
+ free(szwTemp2);
+ Fail("RemoveDirectoryW: Failed to set current directory to "
+ "\"non_empty_dir\" with SetCurrentDirectoryW.\n");
+ }
+
+ bRc = RemoveDirectoryW(szwTemp2);
+ if (bRc == FALSE)
+ {
+ free(szwTemp);
+ free(szwTemp2);
+ Fail("RemoveDirectoryW: unable to remove "
+ "directory \"sub_dir\"(error code %d)\n",
+ GetLastError());
+ }
+ /* Make sure the directory was removed */
+ if( -1 != GetFileAttributesW(szwTemp2) )
+ {
+ Fail("RemoveDirectoryW: Able to get the attributes of "
+ "the removed directory\n");
+ }
+ free(szwTemp2);
+
+ /* Go back to parent of non_empty_dir and remove non_empty_dir */
+ if( 0 == SetCurrentDirectoryW(szwCurrentDir) )
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: Failed to set current directory to "
+ "\"..\non_empty_dir\" with SetCurrentDirectoryW.\n");
+ }
+ bRc = RemoveDirectoryW(szwTemp);
+ if (bRc == FALSE)
+ {
+ free(szwTemp);
+ Fail("RemoveDirectoryW: unable to remove "
+ "the directory \"non_empty_dir\"(error code %d)\n",
+ GetLastError());
+ }
+ /* Make sure the directory was removed */
+ if( -1 != GetFileAttributesW(szwTemp) )
+ {
+ Fail("RemoveDirectoryW: Able to get the attributes of "
+ "the removed directory\n");
+ }
+ free(szwTemp);
+
+
+ PAL_Terminate();
+ return PASS;
+}
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.c
deleted file mode 100644
index ab9eecdebc..0000000000
--- a/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.c
+++ /dev/null
@@ -1,144 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: SearchPathA.c
-**
-** Purpose: Tests the PAL implementation of the SearchFileA function.
-**
-**
-** TODO: Write a test where complete path is passed (say c:\?)
-**===================================================================*/
-//SearchPath
-//
-//The SearchPath function searches for the specified file in the specified path.
-//
-
-
-#include <palsuite.h>
-char* szDir = ".";
-
-char* szNoFileName = "333asdf";
-char* szNoFileNameExt = ".x77t";
-
-char* szFileNameExists = "searchfile";
-char* szFileNameExtExists = ".txt";
-
-char* szFileNameExistsWithExt = "searchfile.txt";
-char fileloc[_MAX_PATH];
-
-void removeFileHelper(LPSTR pfile, int location)
-{
- FILE *fp;
- fp = fopen( pfile, "r");
-
- if (fp != NULL)
- {
- if(fclose(fp))
- {
- Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
- }
-
- if(!DeleteFileA(pfile))
- {
- Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
- }
- }
-
-}
-
-
-void RemoveAll()
-{
- removeFileHelper(fileloc, 1);
-}
-
-int __cdecl main(int argc, char *argv[]) {
-
- char* lpPath = NULL;
- char* lpFileName = NULL;
- char* lpExtension = NULL;
- DWORD nBufferLength = 0;
- char lpBuffer[_MAX_PATH];
- char** lpFilePart = NULL;
- DWORD error = 0;
- DWORD result = 0;
-
- HANDLE hsearchfile;
- char fname[_MAX_FNAME];
- char ext[_MAX_EXT];
- char fullPath[_MAX_DIR];
- char drive[_MAX_DRIVE];
- char dir[_MAX_DIR];
-
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
-
- /* Initalize the buffer.
- */
- 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]);
- }
-
- memset(fileloc, 0, _MAX_PATH);
- sprintf(fileloc, "%s%s", fullPath, szFileNameExistsWithExt);
-
- RemoveAll();
-
- hsearchfile = CreateFileA(fileloc, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL, 0);
-
- if (hsearchfile == INVALID_HANDLE_VALUE)
- {
- Trace("ERROR[%ul]: couldn't create %s\n", GetLastError(), fileloc);
- return FAIL;
- }
-
- CloseHandle(hsearchfile);
-
- //
- // find a file that doesn't exist
- //
- ZeroMemory( lpBuffer, sizeof(lpBuffer));
- lpPath = fullPath;
- lpFileName = szNoFileName;
- lpExtension = NULL;
-
- if( SearchPathA( lpPath, lpFileName, lpExtension, nBufferLength, lpBuffer, lpFilePart) != 0 ){
- error = GetLastError();
- Fail ("SearchPathA: ERROR1 -> Found invalid file[%s][%s][%s][%d]\n", lpPath, szNoFileName, szNoFileNameExt, error);
- }
-
- //
- // find a file that exists, when path is mentioned explicitly
- //
- ZeroMemory( lpBuffer, sizeof(lpBuffer));
- lpPath = fullPath;
- lpFileName = szFileNameExistsWithExt;
- lpExtension = NULL;
-
- result = SearchPathA( lpPath, lpFileName, lpExtension, nBufferLength, lpBuffer, lpFilePart);
-
- if( result == 0 ){
- error = GetLastError();
- Fail ("SearchPathA: ERROR2 -> Did not Find valid file[%s][%s][%d]\n", lpPath, szFileNameExistsWithExt, error);
- }
-
- RemoveAll();
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp b/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp
new file mode 100644
index 0000000000..57afdefc7b
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp
@@ -0,0 +1,139 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: SearchPathA.c
+**
+** Purpose: Tests the PAL implementation of the SearchFileA function.
+**
+**
+** TODO: Write a test where complete path is passed (say c:\?)
+**===================================================================*/
+//SearchPath
+//
+//The SearchPath function searches for the specified file in the specified path.
+//
+
+
+#include <palsuite.h>
+char* szDir = ".";
+
+char* szNoFileName = "333asdf";
+char* szNoFileNameExt = ".x77t";
+
+char* szFileNameExists = "searchfile";
+char* szFileNameExtExists = ".txt";
+
+char* szFileNameExistsWithExt = "searchfile.txt";
+char fileloc[_MAX_PATH];
+
+void removeFileHelper(LPSTR pfile, int location)
+{
+ FILE *fp;
+ fp = fopen( pfile, "r");
+
+ if (fp != NULL)
+ {
+ if(fclose(fp))
+ {
+ Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
+ }
+
+ if(!DeleteFileA(pfile))
+ {
+ Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
+ }
+ }
+
+}
+
+
+void RemoveAll()
+{
+ removeFileHelper(fileloc, 1);
+}
+
+int __cdecl main(int argc, char *argv[]) {
+
+ char* lpPath = NULL;
+ char* lpFileName = NULL;
+ char* lpExtension = NULL;
+ DWORD nBufferLength = 0;
+ char lpBuffer[_MAX_PATH];
+ char** lpFilePart = NULL;
+ DWORD error = 0;
+ DWORD result = 0;
+
+ HANDLE hsearchfile;
+ char fname[_MAX_FNAME];
+ char ext[_MAX_EXT];
+ char fullPath[_MAX_DIR];
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+
+ /* Initalize the buffer.
+ */
+ memset(fullPath, 0, _MAX_DIR);
+
+ if (GetTempPathA(_MAX_DIR, fullPath) == 0)
+ {
+ Fail("ERROR: GetTempPathA failed to get a path\n");
+ }
+
+ memset(fileloc, 0, _MAX_PATH);
+ sprintf_s(fileloc, _countof(fileloc), "%s%s", fullPath, szFileNameExistsWithExt);
+
+ RemoveAll();
+
+ hsearchfile = CreateFileA(fileloc, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, 0);
+
+ if (hsearchfile == INVALID_HANDLE_VALUE)
+ {
+ Trace("ERROR[%ul]: couldn't create %s\n", GetLastError(), fileloc);
+ return FAIL;
+ }
+
+ CloseHandle(hsearchfile);
+
+ //
+ // find a file that doesn't exist
+ //
+ ZeroMemory( lpBuffer, sizeof(lpBuffer));
+ lpPath = fullPath;
+ lpFileName = szNoFileName;
+ lpExtension = NULL;
+
+ if( SearchPathA( lpPath, lpFileName, lpExtension, nBufferLength, lpBuffer, lpFilePart) != 0 ){
+ error = GetLastError();
+ Fail ("SearchPathA: ERROR1 -> Found invalid file[%s][%s][%s][%d]\n", lpPath, szNoFileName, szNoFileNameExt, error);
+ }
+
+ //
+ // find a file that exists, when path is mentioned explicitly
+ //
+ ZeroMemory( lpBuffer, sizeof(lpBuffer));
+ lpPath = fullPath;
+ lpFileName = szFileNameExistsWithExt;
+ lpExtension = NULL;
+
+ result = SearchPathA( lpPath, lpFileName, lpExtension, nBufferLength, lpBuffer, lpFilePart);
+
+ if( result == 0 ){
+ error = GetLastError();
+ Fail ("SearchPathA: ERROR2 -> Did not Find valid file[%s][%s][%d]\n", lpPath, szFileNameExistsWithExt, error);
+ }
+
+ RemoveAll();
+ PAL_Terminate();
+ return PASS;
+}
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.c
deleted file mode 100644
index 2bc7694dc0..0000000000
--- a/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.c
+++ /dev/null
@@ -1,198 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: SearchPathW.c
-**
-** Purpose: Tests the PAL implementation of the SearchFileW function.
-**
-**
-** TODO: Write a test where complete path is passed (say c:\?)
-**===================================================================*/
-//SearchPath
-//
-//The SearchPath function searches for the specified file in the specified path.
-//
-//
-//DWORD SearchPath(
-// LPCTSTR lpPath,
-// LPCTSTR lpFileName,
-// LPCTSTR lpExtension,
-// DWORD nBufferLength,
-// LPTSTR lpBuffer,
-// LPTSTR* lpFilePart
-//);
-//
-//Parameters
-//lpPath
-//[in] Pointer to a null-terminated string that specifies the path to be searched for the file. If this parameter is NULL, the function searches for a matching file in the following directories in the following sequence:
-//The directory from which the application loaded.
-//The current directory.
-//The system directory. Use the GetSystemDirectory function to get the path of this directory.
-//The 16-bit system directory. There is no function that retrieves the path of this directory, but it is searched.
-//The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
-//The directories that are listed in the PATH environment variable.
-
-//lpFileName
-//[in] Pointer to a null-terminated string that specifies the name of the file to search for.
-
-//lpExtension
-//[in] Pointer to a null-terminated string that specifies an extension to be added to the file name when searching for the file. The first character of the file name extension must be a period (.). The extension is added only if the specified file name does not end with an extension.
-//If a file name extension is not required or if the file name contains an extension, this parameter can be NULL.
-//
-//nBufferLength
-//[in] Size of the buffer that receives the valid path and file name, in TCHARs.
-
-//lpBuffer
-//[out] Pointer to the buffer that receives the path and file name of the file found.
-
-//lpFilePart
-//[out] Pointer to the variable that receives the address (within lpBuffer) of the last component of the valid path and file name, which is the address of the character immediately following the final backslash (\) in the path.
-
-//Return Values
-//If the function succeeds, the value returned is the length, in TCHARs, of the string copied to the buffer, not including the terminating null character. If the return value is greater than nBufferLength, the value returned is the size of the buffer required to hold the path.
-//
-//If the function fails, the return value is zero. To get extended error information, call GetLastError.
-
-
-#include <palsuite.h>
-const char* szDir = ".";
-
-const char* szNoFileName = "333asdf";
-const char* szNoFileNameExt = ".x77t";
-
-const char* szFileNameExists = "searchpathw";
-const char* szFileNameExtExists = ".c";
-
-const char* szFileNameExistsWithExt = "searchpathw.c";
-
-char fileloc[_MAX_PATH];
-
-void removeFileHelper(LPSTR pfile, int location)
-{
- FILE *fp;
- fp = fopen( pfile, "r");
-
- if (fp != NULL)
- {
- if(fclose(fp))
- {
- Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
- }
-
- if(!DeleteFileA(pfile))
- {
- Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
- }
- else
- {
- // Trace("Success: deleted file [%S], Error Code [%d], location [%d]\n", wfile, GetLastError(), location);
- }
- }
-
-}
-
-void RemoveAll()
-{
- removeFileHelper(fileloc, 1);
-}
-
-int __cdecl main(int argc, char *argv[]) {
-
- WCHAR* lpPath = NULL;
- WCHAR* lpFileName = NULL;
- WCHAR* lpExtension = NULL;
- DWORD nBufferLength = 0;
- WCHAR lpBuffer[_MAX_PATH];
- WCHAR** lpFilePart = NULL;
- DWORD error = 0;
- DWORD result = 0;
-
- HANDLE hsearchfile;
- char fname[_MAX_FNAME];
- char ext[_MAX_EXT];
- char fullPath[_MAX_DIR];
- char drive[_MAX_DRIVE];
- char dir[_MAX_DIR];
-
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Initalize the buffer.
- */
- 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]);
- }
-
- memset(fileloc, 0, _MAX_PATH);
- sprintf(fileloc, "%s%s", fullPath, szFileNameExistsWithExt);
-
- RemoveAll();
-
- hsearchfile = CreateFileA(fileloc, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL, 0);
-
- if (hsearchfile == NULL)
- {
- Trace("ERROR[%ul]: couldn't create %s\n", GetLastError(), fileloc);
- return FAIL;
- }
-
- CloseHandle(hsearchfile);
-
- //
- // find a file that doesn't exist
- //
- ZeroMemory( lpBuffer, sizeof(lpBuffer));
- lpPath = convert((LPSTR)fullPath);
- lpFileName = convert((LPSTR)szNoFileName);
- lpExtension = NULL;
-
- if( SearchPathW( lpPath, lpFileName, lpExtension, nBufferLength, lpBuffer, lpFilePart) != 0 ){
- error = GetLastError();
- free(lpPath);
- free(lpFileName);
- Fail ("SearchPathW: ERROR1 -> Found invalid file[%s][%s][%s][%d]\n", lpPath, szNoFileName, szNoFileNameExt, error);
- }
-
- free(lpPath);
- free(lpFileName);
-
- //
- // find a file that exists, when path is mentioned explicitly
- //
- ZeroMemory( lpBuffer, sizeof(lpBuffer));
- lpPath = convert((LPSTR)fullPath);
- lpFileName = convert((LPSTR)szFileNameExistsWithExt);
- lpExtension = NULL;
-
- result = SearchPathW( lpPath, lpFileName, lpExtension, nBufferLength, lpBuffer, lpFilePart);
-
- if( result == 0 ){
- error = GetLastError();
- free(lpPath);
- free(lpFileName);
- Fail ("SearchPathA: ERROR2 -> Did not Find valid file[%s][%s][%d]\n", lpPath, szFileNameExistsWithExt, error);
- }
-
- free(lpPath);
- free(lpFileName);
-
- RemoveAll();
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp b/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp
new file mode 100644
index 0000000000..6880a864cb
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp
@@ -0,0 +1,193 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: SearchPathW.c
+**
+** Purpose: Tests the PAL implementation of the SearchFileW function.
+**
+**
+** TODO: Write a test where complete path is passed (say c:\?)
+**===================================================================*/
+//SearchPath
+//
+//The SearchPath function searches for the specified file in the specified path.
+//
+//
+//DWORD SearchPath(
+// LPCTSTR lpPath,
+// LPCTSTR lpFileName,
+// LPCTSTR lpExtension,
+// DWORD nBufferLength,
+// LPTSTR lpBuffer,
+// LPTSTR* lpFilePart
+//);
+//
+//Parameters
+//lpPath
+//[in] Pointer to a null-terminated string that specifies the path to be searched for the file. If this parameter is NULL, the function searches for a matching file in the following directories in the following sequence:
+//The directory from which the application loaded.
+//The current directory.
+//The system directory. Use the GetSystemDirectory function to get the path of this directory.
+//The 16-bit system directory. There is no function that retrieves the path of this directory, but it is searched.
+//The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
+//The directories that are listed in the PATH environment variable.
+
+//lpFileName
+//[in] Pointer to a null-terminated string that specifies the name of the file to search for.
+
+//lpExtension
+//[in] Pointer to a null-terminated string that specifies an extension to be added to the file name when searching for the file. The first character of the file name extension must be a period (.). The extension is added only if the specified file name does not end with an extension.
+//If a file name extension is not required or if the file name contains an extension, this parameter can be NULL.
+//
+//nBufferLength
+//[in] Size of the buffer that receives the valid path and file name, in TCHARs.
+
+//lpBuffer
+//[out] Pointer to the buffer that receives the path and file name of the file found.
+
+//lpFilePart
+//[out] Pointer to the variable that receives the address (within lpBuffer) of the last component of the valid path and file name, which is the address of the character immediately following the final backslash (\) in the path.
+
+//Return Values
+//If the function succeeds, the value returned is the length, in TCHARs, of the string copied to the buffer, not including the terminating null character. If the return value is greater than nBufferLength, the value returned is the size of the buffer required to hold the path.
+//
+//If the function fails, the return value is zero. To get extended error information, call GetLastError.
+
+
+#include <palsuite.h>
+const char* szDir = ".";
+
+const char* szNoFileName = "333asdf";
+const char* szNoFileNameExt = ".x77t";
+
+const char* szFileNameExists = "searchpathw";
+const char* szFileNameExtExists = ".c";
+
+const char* szFileNameExistsWithExt = "searchpathw.c";
+
+char fileloc[_MAX_PATH];
+
+void removeFileHelper(LPSTR pfile, int location)
+{
+ FILE *fp;
+ fp = fopen( pfile, "r");
+
+ if (fp != NULL)
+ {
+ if(fclose(fp))
+ {
+ Fail("ERROR: Failed to close the file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
+ }
+
+ if(!DeleteFileA(pfile))
+ {
+ Fail("ERROR: Failed to delete file [%s], Error Code [%d], location [%d]\n", pfile, GetLastError(), location);
+ }
+ else
+ {
+ // Trace("Success: deleted file [%S], Error Code [%d], location [%d]\n", wfile, GetLastError(), location);
+ }
+ }
+
+}
+
+void RemoveAll()
+{
+ removeFileHelper(fileloc, 1);
+}
+
+int __cdecl main(int argc, char *argv[]) {
+
+ WCHAR* lpPath = NULL;
+ WCHAR* lpFileName = NULL;
+ WCHAR* lpExtension = NULL;
+ DWORD nBufferLength = 0;
+ WCHAR lpBuffer[_MAX_PATH];
+ WCHAR** lpFilePart = NULL;
+ DWORD error = 0;
+ DWORD result = 0;
+
+ HANDLE hsearchfile;
+ char fname[_MAX_FNAME];
+ char ext[_MAX_EXT];
+ char fullPath[_MAX_DIR];
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Initalize the buffer.
+ */
+ memset(fullPath, 0, _MAX_DIR);
+
+ if (GetTempPathA(_MAX_DIR, fullPath) == 0)
+ {
+ Fail("ERROR: GetTempPathA failed to get a path\n");
+ }
+
+ memset(fileloc, 0, _MAX_PATH);
+ sprintf_s(fileloc, _countof(fileloc), "%s%s", fullPath, szFileNameExistsWithExt);
+
+ RemoveAll();
+
+ hsearchfile = CreateFileA(fileloc, GENERIC_WRITE, 0, 0, CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL, 0);
+
+ if (hsearchfile == NULL)
+ {
+ Trace("ERROR[%ul]: couldn't create %s\n", GetLastError(), fileloc);
+ return FAIL;
+ }
+
+ CloseHandle(hsearchfile);
+
+ //
+ // find a file that doesn't exist
+ //
+ ZeroMemory( lpBuffer, sizeof(lpBuffer));
+ lpPath = convert((LPSTR)fullPath);
+ lpFileName = convert((LPSTR)szNoFileName);
+ lpExtension = NULL;
+
+ if( SearchPathW( lpPath, lpFileName, lpExtension, nBufferLength, lpBuffer, lpFilePart) != 0 ){
+ error = GetLastError();
+ free(lpPath);
+ free(lpFileName);
+ Fail ("SearchPathW: ERROR1 -> Found invalid file[%s][%s][%s][%d]\n", lpPath, szNoFileName, szNoFileNameExt, error);
+ }
+
+ free(lpPath);
+ free(lpFileName);
+
+ //
+ // find a file that exists, when path is mentioned explicitly
+ //
+ ZeroMemory( lpBuffer, sizeof(lpBuffer));
+ lpPath = convert((LPSTR)fullPath);
+ lpFileName = convert((LPSTR)szFileNameExistsWithExt);
+ lpExtension = NULL;
+
+ result = SearchPathW( lpPath, lpFileName, lpExtension, nBufferLength, lpBuffer, lpFilePart);
+
+ if( result == 0 ){
+ error = GetLastError();
+ free(lpPath);
+ free(lpFileName);
+ Fail ("SearchPathA: ERROR2 -> Did not Find valid file[%s][%s][%d]\n", lpPath, szFileNameExistsWithExt, error);
+ }
+
+ free(lpPath);
+ free(lpFileName);
+
+ RemoveAll();
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/CMakeLists.txt
index 7376b22226..5d0da64ba7 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetCurrentDirectoryA.c
+ SetCurrentDirectoryA.cpp
)
add_executable(paltest_setcurrentdirectorya_test1
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.c b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.c
deleted file mode 100644
index c07a62412b..0000000000
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.c
+++ /dev/null
@@ -1,215 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: SetCurrentDirectoryA.c (test 1)
-**
-** Purpose: Tests the PAL implementation of the SetCurrentDirectoryA function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-
-
-/* In order to avoid the "chicken and egg" scenario, this is another
- method of getting the current directory. GetFullPathNameA is called with
- a dummy file name and then the file name is stripped off leaving the
- current working directory
-*/
-
-BOOL GetCurrentDir(char* szCurrentDir)
-{
- const char* szFileName = "blah";
- DWORD dwRc = 0;
- char szReturnedPath[_MAX_DIR+1];
- LPSTR pPathPtr;
- size_t nCount = 0;
-
- /* use GetFullPathNameA to to get the current path by stripping
- the file name off the end */
- memset(szReturnedPath, 0, (_MAX_DIR+1));
- dwRc = GetFullPathNameA(szFileName,
- _MAX_DIR,
- szReturnedPath,
- &pPathPtr);
-
- if (dwRc == 0)
- {
- /* GetFullPathNameA failed */
- Trace("SetCurrentDirectoryA: ERROR -> GetFullPathNameA failed "
- "with error code: %ld.\n", GetLastError());
- return(FALSE);
- }
-
- /* now strip the file name from the full path to get the current path */
- nCount = strlen(szReturnedPath) - strlen(szFileName);
- memset(szCurrentDir, 0, (_MAX_DIR+1));
- strncpy(szCurrentDir, szReturnedPath, nCount);
-
- return(TRUE);
-}
-
-
-
-int __cdecl main(int argc, char *argv[])
-{
- const char* szDirName = "testing";
- /* directory name longer than MAX_PATH characters */
- char szLongDirName[MAX_LONGPATH+1];
- char szNewDir[_MAX_DIR+1];
- char szBuiltDir[_MAX_DIR+1];
- char szHomeDir[_MAX_DIR+1];
- WCHAR* szwPtr = NULL;
-
- memset(szLongDirName, 'a', MAX_LONGPATH+1);
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
- /* remove the directory just in case a previous run of the test didn't */
- szwPtr = convert((LPSTR)szDirName);
-
- /* clean up. Remove the directory
- * if it exists */
- RemoveDirectoryW(szwPtr);
-
- /* create a temp directory off the current directory */
- if (CreateDirectoryA(szDirName, NULL) != TRUE)
- {
- free(szwPtr);
- Fail("SetCurrentDirectoryA: ERROR -> CreateDirectoryW failed "
- "with error code: %ld.\n", GetLastError());
- }
-
- /* find out what the current "home" directory is */
- memset(szHomeDir, 0, (_MAX_DIR+1));
- if(GetCurrentDir(szHomeDir) != TRUE)
- {
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
- "with error code: %ld.\n", GetLastError());
- }
- free(szwPtr);
- PAL_TerminateEx(FAIL);
- return FAIL;
- }
-
- /* set the current directory to the temp directory */
-
- if (SetCurrentDirectoryA(szDirName) != TRUE)
- {
- Trace("SetCurrentDirectoryA: ERROR -> Unable to set current "
- "directory. Failed with error code: %ld.\n", GetLastError());
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
- "with error code: %ld.\n", GetLastError());
- }
- free(szwPtr);
- Fail("");
- }
-
- /* append the temp name to the "home" directory */
- memset(szBuiltDir, 0, (_MAX_DIR+1));
-#if WIN32
- sprintf(szBuiltDir,"%s%s\\", szHomeDir, szDirName);
-#else
- sprintf(szBuiltDir,"%s%s/", szHomeDir, szDirName);
-#endif
-
- /* get the new current directory */
- memset(szNewDir, 0, (_MAX_DIR+1));
- if(GetCurrentDir(szNewDir) != TRUE)
- {
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
- "with error code: %ld.\n", GetLastError());
- }
- free(szwPtr);
- PAL_TerminateEx(FAIL);
- return FAIL;
- }
-
- /*compare the new current dir to the compiled current dir */
- if (strncmp(szNewDir, szBuiltDir, strlen(szNewDir)) != 0)
- {
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
- "with error code: %ld.\n", GetLastError());
- }
- free(szwPtr);
- Fail("SetCurrentDirectoryA: ERROR -> The set directory \"%s\" does not"
- " compare to the built directory \"%s\".\n",
- szNewDir,
- szBuiltDir);
- }
-
-
-
- /* set the current dir back to the original */
- if (SetCurrentDirectoryA(szHomeDir) != TRUE)
- {
- Trace("SetCurrentDirectoryA: ERROR -> Unable to set current "
- "directory. Failed with error code: %ld.\n", GetLastError());
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
- "with error code: %ld.\n", GetLastError());
- }
- free(szwPtr);
- Fail("");
- }
-
-
- /* get the new current directory */
- memset(szNewDir, 0, sizeof(char)*(_MAX_DIR+1));
- if(GetCurrentDir(szNewDir) != TRUE)
- {
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
- "with error code: %ld.\n", GetLastError());
- }
- free(szwPtr);
- PAL_TerminateEx(FAIL);
- return FAIL;
- }
-
- /* ensure it compares to the "home" directory which is where
- we should be now */
- if (strncmp(szNewDir, szHomeDir, strlen(szNewDir)) != 0)
- {
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
- "with error code: %ld.\n", GetLastError());
- }
- free(szwPtr);
- Fail("SetCurrentDirectoryA: ERROR -> The set directory does not "
- "compare to the built directory.\n");
- }
-
-
- /* clean up */
- if (!RemoveDirectoryW(szwPtr))
- {
- free(szwPtr);
- Fail("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
- "with error code: %ld.\n", GetLastError());
- }
-
- free(szwPtr);
- PAL_Terminate();
-
- return PASS;
-}
-
-
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.cpp b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.cpp
new file mode 100644
index 0000000000..f227aa3268
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.cpp
@@ -0,0 +1,215 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: SetCurrentDirectoryA.c (test 1)
+**
+** Purpose: Tests the PAL implementation of the SetCurrentDirectoryA function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+
+
+/* In order to avoid the "chicken and egg" scenario, this is another
+ method of getting the current directory. GetFullPathNameA is called with
+ a dummy file name and then the file name is stripped off leaving the
+ current working directory
+*/
+
+BOOL GetCurrentDir(char* szCurrentDir)
+{
+ const char* szFileName = "blah";
+ DWORD dwRc = 0;
+ char szReturnedPath[_MAX_DIR+1];
+ LPSTR pPathPtr;
+ size_t nCount = 0;
+
+ /* use GetFullPathNameA to to get the current path by stripping
+ the file name off the end */
+ memset(szReturnedPath, 0, (_MAX_DIR+1));
+ dwRc = GetFullPathNameA(szFileName,
+ _MAX_DIR,
+ szReturnedPath,
+ &pPathPtr);
+
+ if (dwRc == 0)
+ {
+ /* GetFullPathNameA failed */
+ Trace("SetCurrentDirectoryA: ERROR -> GetFullPathNameA failed "
+ "with error code: %ld.\n", GetLastError());
+ return(FALSE);
+ }
+
+ /* now strip the file name from the full path to get the current path */
+ nCount = strlen(szReturnedPath) - strlen(szFileName);
+ memset(szCurrentDir, 0, (_MAX_DIR+1));
+ strncpy(szCurrentDir, szReturnedPath, nCount);
+
+ return(TRUE);
+}
+
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ const char* szDirName = "testing";
+ /* directory name longer than MAX_PATH characters */
+ char szLongDirName[MAX_LONGPATH+1];
+ char szNewDir[_MAX_DIR+1];
+ char szBuiltDir[_MAX_DIR+1];
+ char szHomeDir[_MAX_DIR+1];
+ WCHAR* szwPtr = NULL;
+
+ memset(szLongDirName, 'a', MAX_LONGPATH+1);
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+ /* remove the directory just in case a previous run of the test didn't */
+ szwPtr = convert((LPSTR)szDirName);
+
+ /* clean up. Remove the directory
+ * if it exists */
+ RemoveDirectoryW(szwPtr);
+
+ /* create a temp directory off the current directory */
+ if (CreateDirectoryA(szDirName, NULL) != TRUE)
+ {
+ free(szwPtr);
+ Fail("SetCurrentDirectoryA: ERROR -> CreateDirectoryW failed "
+ "with error code: %ld.\n", GetLastError());
+ }
+
+ /* find out what the current "home" directory is */
+ memset(szHomeDir, 0, (_MAX_DIR+1));
+ if(GetCurrentDir(szHomeDir) != TRUE)
+ {
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
+ "with error code: %ld.\n", GetLastError());
+ }
+ free(szwPtr);
+ PAL_TerminateEx(FAIL);
+ return FAIL;
+ }
+
+ /* set the current directory to the temp directory */
+
+ if (SetCurrentDirectoryA(szDirName) != TRUE)
+ {
+ Trace("SetCurrentDirectoryA: ERROR -> Unable to set current "
+ "directory. Failed with error code: %ld.\n", GetLastError());
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
+ "with error code: %ld.\n", GetLastError());
+ }
+ free(szwPtr);
+ Fail("");
+ }
+
+ /* append the temp name to the "home" directory */
+ memset(szBuiltDir, 0, (_MAX_DIR+1));
+#if WIN32
+ sprintf_s(szBuiltDir, _countof(szBuiltDir),"%s%s\\", szHomeDir, szDirName);
+#else
+ sprintf_s(szBuiltDir, _countof(szBuiltDir),"%s%s/", szHomeDir, szDirName);
+#endif
+
+ /* get the new current directory */
+ memset(szNewDir, 0, (_MAX_DIR+1));
+ if(GetCurrentDir(szNewDir) != TRUE)
+ {
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
+ "with error code: %ld.\n", GetLastError());
+ }
+ free(szwPtr);
+ PAL_TerminateEx(FAIL);
+ return FAIL;
+ }
+
+ /*compare the new current dir to the compiled current dir */
+ if (strncmp(szNewDir, szBuiltDir, strlen(szNewDir)) != 0)
+ {
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
+ "with error code: %ld.\n", GetLastError());
+ }
+ free(szwPtr);
+ Fail("SetCurrentDirectoryA: ERROR -> The set directory \"%s\" does not"
+ " compare to the built directory \"%s\".\n",
+ szNewDir,
+ szBuiltDir);
+ }
+
+
+
+ /* set the current dir back to the original */
+ if (SetCurrentDirectoryA(szHomeDir) != TRUE)
+ {
+ Trace("SetCurrentDirectoryA: ERROR -> Unable to set current "
+ "directory. Failed with error code: %ld.\n", GetLastError());
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
+ "with error code: %ld.\n", GetLastError());
+ }
+ free(szwPtr);
+ Fail("");
+ }
+
+
+ /* get the new current directory */
+ memset(szNewDir, 0, sizeof(char)*(_MAX_DIR+1));
+ if(GetCurrentDir(szNewDir) != TRUE)
+ {
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
+ "with error code: %ld.\n", GetLastError());
+ }
+ free(szwPtr);
+ PAL_TerminateEx(FAIL);
+ return FAIL;
+ }
+
+ /* ensure it compares to the "home" directory which is where
+ we should be now */
+ if (strncmp(szNewDir, szHomeDir, strlen(szNewDir)) != 0)
+ {
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
+ "with error code: %ld.\n", GetLastError());
+ }
+ free(szwPtr);
+ Fail("SetCurrentDirectoryA: ERROR -> The set directory does not "
+ "compare to the built directory.\n");
+ }
+
+
+ /* clean up */
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ free(szwPtr);
+ Fail("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
+ "with error code: %ld.\n", GetLastError());
+ }
+
+ free(szwPtr);
+ PAL_Terminate();
+
+ return PASS;
+}
+
+
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/CMakeLists.txt
index 7c9caf8081..243e80b9a4 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- setcurrentdirectorya.c
+ setcurrentdirectorya.cpp
)
add_executable(paltest_setcurrentdirectorya_test2
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.c b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.c
deleted file mode 100644
index 415dbbf045..0000000000
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.c
+++ /dev/null
@@ -1,142 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: SetCurrentDirectoryA.c (test 2)
-**
-** Purpose: Tests the PAL implementation of the SetCurrentDirectoryA function
-** by setting the current directory with ../
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- const char szDirName[MAX_PATH] = "testing";
- char szBuiltDir[_MAX_DIR+1];
- char szHomeDirBefore[_MAX_DIR+1];
- char szHomeDirAfter[_MAX_DIR+1];
- WCHAR* szwPtr = NULL;
-
-
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
- /* create a temp directory off the current directory */
- szwPtr = convert((LPSTR)szDirName);
-
- if (CreateDirectoryA(szDirName, NULL) != TRUE)
- {
- free(szwPtr);
- Fail("Unexpected error: CreateDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
-
- /* find out what the current "home" directory is */
- memset(szHomeDirBefore, 0, (_MAX_DIR+1));
-
- if( 0 == GetCurrentDirectoryA((_MAX_DIR+1), szHomeDirBefore) )
- {
- Trace("Unexpected error: Unable to get current directory "
- "with GetCurrentDirectoryA that returned %ld\n",
- GetLastError());
-
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("Unexpected error: RemoveDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
- free(szwPtr);
-
- Fail("");
- }
-
- /* append the temp name to the "home" directory */
- memset(szBuiltDir, 0, (_MAX_DIR+1));
-#if WIN32
- sprintf(szBuiltDir,"%s\\..\\", szDirName);
-#else
- sprintf(szBuiltDir,"%s/../", szDirName);
-#endif
-
-
- /* set the current directory to the temp directory */
- if (SetCurrentDirectoryA(szBuiltDir) != TRUE)
- {
- Trace("ERROR: Unable to set current "
- "directory to %s. Failed with error code: %ld.\n",
- szBuiltDir,
- GetLastError());
-
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
- free(szwPtr);
- Fail("");
- }
-
- /* find out what the current "home" directory is */
- memset(szHomeDirAfter, 0, (_MAX_DIR+1));
-
- if( 0 == GetCurrentDirectoryA((_MAX_DIR+1), szHomeDirAfter) )
- {
- Trace("Unexpected error: Unable to get current directory "
- "with GetCurrentDirectoryA that returned %ld\n",
- GetLastError());
-
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("Unexpected error: RemoveDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
- free(szwPtr);
-
- Fail("");
- }
-
- /*compare the new current dir to the compiled current dir */
- if (strncmp(szHomeDirBefore, szHomeDirAfter, strlen(szHomeDirBefore)) != 0)
- {
- Trace("ERROR: The set directory \"%s\" does not "
- "compare to the built directory \"%s\".\n",
- szHomeDirAfter,
- szHomeDirBefore);
-
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("Unexpected error: RemoveDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
- free(szwPtr);
- Fail("");
- }
-
- /* clean up */
- if (!RemoveDirectoryW(szwPtr))
- {
- free(szwPtr);
- Fail("Unexpected error: RemoveDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
-
- free(szwPtr);
- PAL_Terminate();
-
- return PASS;
-}
-
-
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.cpp b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.cpp
new file mode 100644
index 0000000000..4b1c1c8790
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.cpp
@@ -0,0 +1,142 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: SetCurrentDirectoryA.c (test 2)
+**
+** Purpose: Tests the PAL implementation of the SetCurrentDirectoryA function
+** by setting the current directory with ../
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ const char szDirName[MAX_PATH] = "testing";
+ char szBuiltDir[_MAX_DIR+1];
+ char szHomeDirBefore[_MAX_DIR+1];
+ char szHomeDirAfter[_MAX_DIR+1];
+ WCHAR* szwPtr = NULL;
+
+
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+ /* create a temp directory off the current directory */
+ szwPtr = convert((LPSTR)szDirName);
+
+ if (CreateDirectoryA(szDirName, NULL) != TRUE)
+ {
+ free(szwPtr);
+ Fail("Unexpected error: CreateDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+
+ /* find out what the current "home" directory is */
+ memset(szHomeDirBefore, 0, (_MAX_DIR+1));
+
+ if( 0 == GetCurrentDirectoryA((_MAX_DIR+1), szHomeDirBefore) )
+ {
+ Trace("Unexpected error: Unable to get current directory "
+ "with GetCurrentDirectoryA that returned %ld\n",
+ GetLastError());
+
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("Unexpected error: RemoveDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+ free(szwPtr);
+
+ Fail("");
+ }
+
+ /* append the temp name to the "home" directory */
+ memset(szBuiltDir, 0, (_MAX_DIR+1));
+#if WIN32
+ sprintf_s(szBuiltDir, _countof(szBuiltDir),"%s\\..\\", szDirName);
+#else
+ sprintf_s(szBuiltDir, _countof(szBuiltDir),"%s/../", szDirName);
+#endif
+
+
+ /* set the current directory to the temp directory */
+ if (SetCurrentDirectoryA(szBuiltDir) != TRUE)
+ {
+ Trace("ERROR: Unable to set current "
+ "directory to %s. Failed with error code: %ld.\n",
+ szBuiltDir,
+ GetLastError());
+
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("SetCurrentDirectoryA: ERROR -> RemoveDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+ free(szwPtr);
+ Fail("");
+ }
+
+ /* find out what the current "home" directory is */
+ memset(szHomeDirAfter, 0, (_MAX_DIR+1));
+
+ if( 0 == GetCurrentDirectoryA((_MAX_DIR+1), szHomeDirAfter) )
+ {
+ Trace("Unexpected error: Unable to get current directory "
+ "with GetCurrentDirectoryA that returned %ld\n",
+ GetLastError());
+
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("Unexpected error: RemoveDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+ free(szwPtr);
+
+ Fail("");
+ }
+
+ /*compare the new current dir to the compiled current dir */
+ if (strncmp(szHomeDirBefore, szHomeDirAfter, strlen(szHomeDirBefore)) != 0)
+ {
+ Trace("ERROR: The set directory \"%s\" does not "
+ "compare to the built directory \"%s\".\n",
+ szHomeDirAfter,
+ szHomeDirBefore);
+
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("Unexpected error: RemoveDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+ free(szwPtr);
+ Fail("");
+ }
+
+ /* clean up */
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ free(szwPtr);
+ Fail("Unexpected error: RemoveDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+
+ free(szwPtr);
+ PAL_Terminate();
+
+ return PASS;
+}
+
+
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/CMakeLists.txt
index 57d3577d8f..8560ff0187 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- setcurrentdirectorya.c
+ setcurrentdirectorya.cpp
)
add_executable(paltest_setcurrentdirectorya_test3
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/setcurrentdirectorya.c b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/setcurrentdirectorya.cpp
index a23a7a6314..a23a7a6314 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/setcurrentdirectorya.c
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test3/setcurrentdirectorya.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/CMakeLists.txt
index a0c1dff62a..9149221008 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetCurrentDirectoryW.c
+ SetCurrentDirectoryW.cpp
)
add_executable(paltest_setcurrentdirectoryw_test1
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.c b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.c
deleted file mode 100644
index 257d016ffb..0000000000
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.c
+++ /dev/null
@@ -1,178 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: SetCurrentDirectoryW.c (test 1)
-**
-** Purpose: Tests the PAL implementation of the SetCurrentDirectoryW function.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-const char* szFileName = "blah";
-const char* szDirName = "testing";
-
-
-// In order to avoid the "chicken and egg" scenario, this is another
-// method of getting the current directory. GetFullPathNameW is called with
-// a dummy file name and then the file name is stripped off leaving the
-// current working directory
-BOOL GetCurrentDir(WCHAR* szwCurrentDir)
-{
- DWORD dwRc = 0;
- WCHAR szwReturnedPath[_MAX_DIR+1];
- LPWSTR pPathPtr;
- WCHAR* szwFileName = NULL;
- WCHAR* szwDirName = NULL;
- int nCount = 0;
-
- // use GetFullPathName to to get the current path by stripping
- // the file name off the end
- memset(szwReturnedPath, 0, sizeof(WCHAR)*(_MAX_DIR+1));
- szwFileName = convert((char*)szFileName);
- dwRc = GetFullPathNameW(szwFileName,
- _MAX_DIR,
- szwReturnedPath,
- &pPathPtr);
-
- if (dwRc == 0)
- {
- // GetFullPathName failed
- Trace("SetCurrentDirectoryW: ERROR -> GetFullPathNameW failed "
- "with error code: %ld.\n", GetLastError());
- RemoveDirectoryW(szwDirName);
- free(szwFileName);
- return(FALSE);
- }
-
- // now strip the file name from the full path to get the current path
- nCount = lstrlenW(szwReturnedPath) - lstrlenW(szwFileName);
- memset(szwCurrentDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
- lstrcpynW(szwCurrentDir, szwReturnedPath, nCount);
-
- free(szwFileName);
- return(TRUE);
-}
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR* szwDirName = NULL;
- WCHAR szwNewDir[_MAX_DIR+1];
- WCHAR szwBuiltDir[_MAX_DIR+1];
- WCHAR szwHomeDir[_MAX_DIR+1];
-#if WIN32
- WCHAR szwSlash[] = {'\\','\0'};
-#else
- WCHAR szwSlash[] = {'/','\0'};
-#endif
-
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
- // remove the directory just in case a previous run of the test didn't
- szwDirName = convert((char*)szDirName);
- RemoveDirectoryW(szwDirName);
-
- // create a temp directory off the current directory
- if (CreateDirectoryW(szwDirName, NULL) != TRUE)
- {
- Trace("SetCurrentDirectoryW: ERROR -> CreateDirectoryW failed "
- "with error code: %ld.\n", GetLastError());
- RemoveDirectoryW(szwDirName);
- free(szwDirName);
- Fail("");
- }
-
- // find out what the current "home" directory is
- memset(szwHomeDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
- if(GetCurrentDir(szwHomeDir) != TRUE)
- {
- RemoveDirectoryW(szwDirName);
- free(szwDirName);
- PAL_TerminateEx(FAIL);
- return FAIL;
- }
-
- // set the current directory to the temp directory
- if (SetCurrentDirectoryW(szwDirName) != TRUE)
- {
- Trace("SetCurrentDirectoryW: ERROR -> Unable to set current "
- "directory. Failed with error code: %ld.\n", GetLastError());
- RemoveDirectoryW(szwDirName);
- free(szwDirName);
- Fail("");
- }
-
- // append the temp name to the "home" directory
- memset(szwBuiltDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
- wcscpy(szwBuiltDir, szwHomeDir);
- wcscat(szwBuiltDir, szwSlash);
- wcscat(szwBuiltDir, szwDirName);
-
- // get the new current directory
- memset(szwNewDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
- if(GetCurrentDir(szwNewDir) != TRUE)
- {
- RemoveDirectoryW(szwDirName);
- free(szwDirName);
- PAL_TerminateEx(FAIL);
- return FAIL;
- }
-
- // compare the new current dir to the compiled current dir
- if (wcsncmp(szwNewDir, szwBuiltDir, wcslen(szwNewDir)) != 0)
- {
- RemoveDirectoryW(szwDirName);
- free(szwDirName);
- Fail("SetCurrentDirectoryW: ERROR -> The set directory does not "
- "compare to the built directory.\n");
- }
-
-
-
- // set the current dir back to the original
- if (SetCurrentDirectoryW(szwHomeDir) != TRUE)
- {
- Trace("SetCurrentDirectoryW: ERROR -> Unable to set current "
- "directory. Failed with error code: %ld.\n", GetLastError());
- RemoveDirectoryW(szwDirName);
- free(szwDirName);
- Fail("");
- }
-
-
- // get the new current directory
- memset(szwNewDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
- if(GetCurrentDir(szwNewDir) != TRUE)
- {
- RemoveDirectoryW(szwDirName);
- free(szwDirName);
- PAL_TerminateEx(FAIL);
- return FAIL;
- }
-
- // ensure it compares to the "home" directory which is where
- // we should be now
- if (wcsncmp(szwNewDir, szwHomeDir, wcslen(szwNewDir)) != 0)
- {
- RemoveDirectoryW(szwDirName);
- free(szwDirName);
- Fail("SetCurrentDirectoryW: ERROR -> The set directory does not "
- "compare to the built directory.\n");
- }
-
-
- RemoveDirectoryW(szwDirName);
- free(szwDirName);
- PAL_Terminate();
-
- return PASS;
-}
-
-
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp
new file mode 100644
index 0000000000..e10f2ea8a1
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp
@@ -0,0 +1,178 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: SetCurrentDirectoryW.c (test 1)
+**
+** Purpose: Tests the PAL implementation of the SetCurrentDirectoryW function.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+const char* szFileName = "blah";
+const char* szDirName = "testing";
+
+
+// In order to avoid the "chicken and egg" scenario, this is another
+// method of getting the current directory. GetFullPathNameW is called with
+// a dummy file name and then the file name is stripped off leaving the
+// current working directory
+BOOL GetCurrentDir(WCHAR* szwCurrentDir)
+{
+ DWORD dwRc = 0;
+ WCHAR szwReturnedPath[_MAX_DIR+1];
+ LPWSTR pPathPtr;
+ WCHAR* szwFileName = NULL;
+ WCHAR* szwDirName = NULL;
+ int nCount = 0;
+
+ // use GetFullPathName to to get the current path by stripping
+ // the file name off the end
+ memset(szwReturnedPath, 0, sizeof(WCHAR)*(_MAX_DIR+1));
+ szwFileName = convert((char*)szFileName);
+ dwRc = GetFullPathNameW(szwFileName,
+ _MAX_DIR,
+ szwReturnedPath,
+ &pPathPtr);
+
+ if (dwRc == 0)
+ {
+ // GetFullPathName failed
+ Trace("SetCurrentDirectoryW: ERROR -> GetFullPathNameW failed "
+ "with error code: %ld.\n", GetLastError());
+ RemoveDirectoryW(szwDirName);
+ free(szwFileName);
+ return(FALSE);
+ }
+
+ // now strip the file name from the full path to get the current path
+ nCount = lstrlenW(szwReturnedPath) - lstrlenW(szwFileName);
+ memset(szwCurrentDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
+ wcsncpy(szwCurrentDir, szwReturnedPath, nCount - 1);
+
+ free(szwFileName);
+ return(TRUE);
+}
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR* szwDirName = NULL;
+ WCHAR szwNewDir[_MAX_DIR+1];
+ WCHAR szwBuiltDir[_MAX_DIR+1];
+ WCHAR szwHomeDir[_MAX_DIR+1];
+#if WIN32
+ WCHAR szwSlash[] = {'\\','\0'};
+#else
+ WCHAR szwSlash[] = {'/','\0'};
+#endif
+
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+ // remove the directory just in case a previous run of the test didn't
+ szwDirName = convert((char*)szDirName);
+ RemoveDirectoryW(szwDirName);
+
+ // create a temp directory off the current directory
+ if (CreateDirectoryW(szwDirName, NULL) != TRUE)
+ {
+ Trace("SetCurrentDirectoryW: ERROR -> CreateDirectoryW failed "
+ "with error code: %ld.\n", GetLastError());
+ RemoveDirectoryW(szwDirName);
+ free(szwDirName);
+ Fail("");
+ }
+
+ // find out what the current "home" directory is
+ memset(szwHomeDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
+ if(GetCurrentDir(szwHomeDir) != TRUE)
+ {
+ RemoveDirectoryW(szwDirName);
+ free(szwDirName);
+ PAL_TerminateEx(FAIL);
+ return FAIL;
+ }
+
+ // set the current directory to the temp directory
+ if (SetCurrentDirectoryW(szwDirName) != TRUE)
+ {
+ Trace("SetCurrentDirectoryW: ERROR -> Unable to set current "
+ "directory. Failed with error code: %ld.\n", GetLastError());
+ RemoveDirectoryW(szwDirName);
+ free(szwDirName);
+ Fail("");
+ }
+
+ // append the temp name to the "home" directory
+ memset(szwBuiltDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
+ wcscpy(szwBuiltDir, szwHomeDir);
+ wcscat(szwBuiltDir, szwSlash);
+ wcscat(szwBuiltDir, szwDirName);
+
+ // get the new current directory
+ memset(szwNewDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
+ if(GetCurrentDir(szwNewDir) != TRUE)
+ {
+ RemoveDirectoryW(szwDirName);
+ free(szwDirName);
+ PAL_TerminateEx(FAIL);
+ return FAIL;
+ }
+
+ // compare the new current dir to the compiled current dir
+ if (wcsncmp(szwNewDir, szwBuiltDir, wcslen(szwNewDir)) != 0)
+ {
+ RemoveDirectoryW(szwDirName);
+ free(szwDirName);
+ Fail("SetCurrentDirectoryW: ERROR -> The set directory does not "
+ "compare to the built directory.\n");
+ }
+
+
+
+ // set the current dir back to the original
+ if (SetCurrentDirectoryW(szwHomeDir) != TRUE)
+ {
+ Trace("SetCurrentDirectoryW: ERROR -> Unable to set current "
+ "directory. Failed with error code: %ld.\n", GetLastError());
+ RemoveDirectoryW(szwDirName);
+ free(szwDirName);
+ Fail("");
+ }
+
+
+ // get the new current directory
+ memset(szwNewDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
+ if(GetCurrentDir(szwNewDir) != TRUE)
+ {
+ RemoveDirectoryW(szwDirName);
+ free(szwDirName);
+ PAL_TerminateEx(FAIL);
+ return FAIL;
+ }
+
+ // ensure it compares to the "home" directory which is where
+ // we should be now
+ if (wcsncmp(szwNewDir, szwHomeDir, wcslen(szwNewDir)) != 0)
+ {
+ RemoveDirectoryW(szwDirName);
+ free(szwDirName);
+ Fail("SetCurrentDirectoryW: ERROR -> The set directory does not "
+ "compare to the built directory.\n");
+ }
+
+
+ RemoveDirectoryW(szwDirName);
+ free(szwDirName);
+ PAL_Terminate();
+
+ return PASS;
+}
+
+
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/CMakeLists.txt
index a032462d19..455ddc828d 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- setcurrentdirectoryw.c
+ setcurrentdirectoryw.cpp
)
add_executable(paltest_setcurrentdirectoryw_test2
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.c b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.c
deleted file mode 100644
index 7e3d7b785f..0000000000
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.c
+++ /dev/null
@@ -1,147 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: SetCurrentDirectoryW.c (test 2)
-**
-** Purpose: Tests the PAL implementation of the SetCurrentDirectoryW function
-** by setting the current directory with ../
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- const char szDirName[MAX_PATH] = "testing";
- char szBuiltDir[MAX_PATH];
- WCHAR* szwBuiltDir = NULL;
- WCHAR szwHomeDirBefore[MAX_PATH];
- WCHAR szwHomeDirAfter[MAX_PATH];
- WCHAR* szwPtr = NULL;
-
-
- if (0 != PAL_Initialize(argc,argv))
- {
- return FAIL;
- }
-
- /* create a temp directory off the current directory */
- szwPtr = convert((LPSTR)szDirName);
-
- if (CreateDirectoryW(szwPtr, NULL) != TRUE)
- {
- free(szwPtr);
- Fail("Unexpected error: CreateDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
-
- /* find out what the current "home" directory is */
- memset(szwHomeDirBefore, 0, MAX_PATH * sizeof(WCHAR));
-
- if( 0 == GetCurrentDirectoryW(MAX_PATH, szwHomeDirBefore) )
- {
- Trace("Unexpected error: Unable to get current directory "
- "with GetCurrentDirectoryW that returned %ld\n",
- GetLastError());
-
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("Unexpected error: RemoveDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
- free(szwPtr);
-
- Fail("");
- }
-
- /* append the temp name to the "home" directory */
- memset(szBuiltDir, 0, MAX_PATH);
-#if WIN32
- sprintf(szBuiltDir,"%s\\..\\", szDirName);
-#else
- sprintf(szBuiltDir,"%s/../", szDirName);
-#endif
-
- szwBuiltDir = convert(szBuiltDir);
-
- /* set the current directory to the temp directory */
- if (SetCurrentDirectoryW(szwBuiltDir) != TRUE)
- {
- Trace("ERROR: Unable to set current "
- "directory to %S. Failed with error code: %ld.\n",
- szwBuiltDir,
- GetLastError());
-
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("Unexpected error: RemoveDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
- free(szwPtr);
- free(szwBuiltDir);
- Fail("");
- }
-
- free(szwBuiltDir);
-
- /* find out what the current "home" directory is */
- memset(szwHomeDirAfter, 0, MAX_PATH * sizeof(WCHAR));
-
- if( 0 == GetCurrentDirectoryW(MAX_PATH, szwHomeDirAfter) )
- {
- Trace("Unexpected error: Unable to get current directory "
- "with GetCurrentDirectoryW that returned %ld\n",
- GetLastError());
-
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("ERROR: RemoveDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
- free(szwPtr);
-
- Fail("");
- }
-
- /*compare the new current dir to the compiled current dir */
- if (wcsncmp(szwHomeDirBefore, szwHomeDirAfter, wcslen(szwHomeDirBefore)) != 0)
- {
- Trace("ERROR:The set directory \"%S\" does not "
- "compare to the built directory \"%S\".\n",
- szwHomeDirAfter,
- szwHomeDirBefore);
-
- if (!RemoveDirectoryW(szwPtr))
- {
- Trace("Unexpected error: RemoveDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
- free(szwPtr);
- Fail("");
- }
-
- /* clean up */
- if (!RemoveDirectoryW(szwPtr))
- {
- free(szwPtr);
- Fail("Unexpected error: RemoveDirectoryW failed "
- "with error code: %ld.\n",
- GetLastError());
- }
-
- free(szwPtr);
- PAL_Terminate();
-
- return PASS;
-}
-
-
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp
new file mode 100644
index 0000000000..7f833baabc
--- /dev/null
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp
@@ -0,0 +1,147 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: SetCurrentDirectoryW.c (test 2)
+**
+** Purpose: Tests the PAL implementation of the SetCurrentDirectoryW function
+** by setting the current directory with ../
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ const char szDirName[MAX_PATH] = "testing";
+ char szBuiltDir[MAX_PATH];
+ WCHAR* szwBuiltDir = NULL;
+ WCHAR szwHomeDirBefore[MAX_PATH];
+ WCHAR szwHomeDirAfter[MAX_PATH];
+ WCHAR* szwPtr = NULL;
+
+
+ if (0 != PAL_Initialize(argc,argv))
+ {
+ return FAIL;
+ }
+
+ /* create a temp directory off the current directory */
+ szwPtr = convert((LPSTR)szDirName);
+
+ if (CreateDirectoryW(szwPtr, NULL) != TRUE)
+ {
+ free(szwPtr);
+ Fail("Unexpected error: CreateDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+
+ /* find out what the current "home" directory is */
+ memset(szwHomeDirBefore, 0, MAX_PATH * sizeof(WCHAR));
+
+ if( 0 == GetCurrentDirectoryW(MAX_PATH, szwHomeDirBefore) )
+ {
+ Trace("Unexpected error: Unable to get current directory "
+ "with GetCurrentDirectoryW that returned %ld\n",
+ GetLastError());
+
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("Unexpected error: RemoveDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+ free(szwPtr);
+
+ Fail("");
+ }
+
+ /* append the temp name to the "home" directory */
+ memset(szBuiltDir, 0, MAX_PATH);
+#if WIN32
+ sprintf_s(szBuiltDir, _countof(szBuiltDir),"%s\\..\\", szDirName);
+#else
+ sprintf_s(szBuiltDir, _countof(szBuiltDir),"%s/../", szDirName);
+#endif
+
+ szwBuiltDir = convert(szBuiltDir);
+
+ /* set the current directory to the temp directory */
+ if (SetCurrentDirectoryW(szwBuiltDir) != TRUE)
+ {
+ Trace("ERROR: Unable to set current "
+ "directory to %S. Failed with error code: %ld.\n",
+ szwBuiltDir,
+ GetLastError());
+
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("Unexpected error: RemoveDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+ free(szwPtr);
+ free(szwBuiltDir);
+ Fail("");
+ }
+
+ free(szwBuiltDir);
+
+ /* find out what the current "home" directory is */
+ memset(szwHomeDirAfter, 0, MAX_PATH * sizeof(WCHAR));
+
+ if( 0 == GetCurrentDirectoryW(MAX_PATH, szwHomeDirAfter) )
+ {
+ Trace("Unexpected error: Unable to get current directory "
+ "with GetCurrentDirectoryW that returned %ld\n",
+ GetLastError());
+
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("ERROR: RemoveDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+ free(szwPtr);
+
+ Fail("");
+ }
+
+ /*compare the new current dir to the compiled current dir */
+ if (wcsncmp(szwHomeDirBefore, szwHomeDirAfter, wcslen(szwHomeDirBefore)) != 0)
+ {
+ Trace("ERROR:The set directory \"%S\" does not "
+ "compare to the built directory \"%S\".\n",
+ szwHomeDirAfter,
+ szwHomeDirBefore);
+
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ Trace("Unexpected error: RemoveDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+ free(szwPtr);
+ Fail("");
+ }
+
+ /* clean up */
+ if (!RemoveDirectoryW(szwPtr))
+ {
+ free(szwPtr);
+ Fail("Unexpected error: RemoveDirectoryW failed "
+ "with error code: %ld.\n",
+ GetLastError());
+ }
+
+ free(szwPtr);
+ PAL_Terminate();
+
+ return PASS;
+}
+
+
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/CMakeLists.txt
index 3b981f9564..1cb1150a61 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- setcurrentdirectoryw.c
+ setcurrentdirectoryw.cpp
)
add_executable(paltest_setcurrentdirectoryw_test3
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.c b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.cpp
index e8c4be2ad4..e8c4be2ad4 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.c
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/CMakeLists.txt
index e77ab30b86..3c0fdeec22 100644
--- a/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetEndOfFile.c
+ SetEndOfFile.cpp
)
add_executable(paltest_setendoffile_test1
diff --git a/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/SetEndOfFile.c b/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/SetEndOfFile.cpp
index 9078ddc65b..9078ddc65b 100644
--- a/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/SetEndOfFile.c
+++ b/src/pal/tests/palsuite/file_io/SetEndOfFile/test1/SetEndOfFile.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/CMakeLists.txt
index b04dea04a6..57afdad2fd 100644
--- a/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetEndOfFile.c
+ SetEndOfFile.cpp
)
add_executable(paltest_setendoffile_test2
diff --git a/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/SetEndOfFile.c b/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/SetEndOfFile.cpp
index 6b3c05088e..6b3c05088e 100644
--- a/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/SetEndOfFile.c
+++ b/src/pal/tests/palsuite/file_io/SetEndOfFile/test2/SetEndOfFile.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/CMakeLists.txt
index 1ab177d00a..01575ce09b 100644
--- a/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetEndOfFile.c
+ SetEndOfFile.cpp
)
add_executable(paltest_setendoffile_test3
diff --git a/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/SetEndOfFile.c b/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/SetEndOfFile.cpp
index dfd9194465..dfd9194465 100644
--- a/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/SetEndOfFile.c
+++ b/src/pal/tests/palsuite/file_io/SetEndOfFile/test3/SetEndOfFile.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/CMakeLists.txt
index ff0b6f999c..1dc4f68aef 100644
--- a/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- setendoffile.c
+ setendoffile.cpp
)
add_executable(paltest_setendoffile_test4
diff --git a/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/setendoffile.c b/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/setendoffile.cpp
index 98a6ec63da..98a6ec63da 100644
--- a/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/setendoffile.c
+++ b/src/pal/tests/palsuite/file_io/SetEndOfFile/test4/setendoffile.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/CMakeLists.txt
index cca7167762..19f87a28af 100644
--- a/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_setendoffile_test5
diff --git a/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/test5.c b/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/test5.cpp
index 7000d1af15..7000d1af15 100644
--- a/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/test5.c
+++ b/src/pal/tests/palsuite/file_io/SetEndOfFile/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/CMakeLists.txt
index 81e2dfdea2..638dd5c425 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileAttributesA.c
+ SetFileAttributesA.cpp
)
add_executable(paltest_setfileattributesa_test1
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/SetFileAttributesA.c b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/SetFileAttributesA.cpp
index bacab2a0ad..bacab2a0ad 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/SetFileAttributesA.c
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test1/SetFileAttributesA.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/CMakeLists.txt
index 03445c1df0..51bee5af39 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileAttributesA.c
+ SetFileAttributesA.cpp
)
add_executable(paltest_setfileattributesa_test2
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/SetFileAttributesA.c b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/SetFileAttributesA.cpp
index 5c04a6b181..5c04a6b181 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/SetFileAttributesA.c
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test2/SetFileAttributesA.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/CMakeLists.txt
index 3c35172d7c..4597e1d22c 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileAttributesA.c
+ SetFileAttributesA.cpp
)
add_executable(paltest_setfileattributesa_test3
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/SetFileAttributesA.c b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/SetFileAttributesA.cpp
index 445b515c7f..445b515c7f 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/SetFileAttributesA.c
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test3/SetFileAttributesA.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/CMakeLists.txt
index f30969ad04..1807027123 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileAttributesA.c
+ SetFileAttributesA.cpp
)
add_executable(paltest_setfileattributesa_test4
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/SetFileAttributesA.c b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/SetFileAttributesA.cpp
index 240e89ff6f..240e89ff6f 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/SetFileAttributesA.c
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesA/test4/SetFileAttributesA.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/CMakeLists.txt
index 35927b4b1d..825554da74 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileAttributesW.c
+ SetFileAttributesW.cpp
)
add_executable(paltest_setfileattributesw_test1
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/SetFileAttributesW.c b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/SetFileAttributesW.cpp
index 753c396d1f..753c396d1f 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/SetFileAttributesW.c
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test1/SetFileAttributesW.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/CMakeLists.txt
index 81fa02c1dd..fda1cec1d7 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileAttributesW.c
+ SetFileAttributesW.cpp
)
add_executable(paltest_setfileattributesw_test2
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/SetFileAttributesW.c b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/SetFileAttributesW.cpp
index f657436845..f657436845 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/SetFileAttributesW.c
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test2/SetFileAttributesW.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/CMakeLists.txt
index c2cdacb0d0..1757f88bfe 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileAttributesW.c
+ SetFileAttributesW.cpp
)
add_executable(paltest_setfileattributesw_test3
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/SetFileAttributesW.c b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/SetFileAttributesW.cpp
index 8a8bafac68..8a8bafac68 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/SetFileAttributesW.c
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test3/SetFileAttributesW.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/CMakeLists.txt
index 6a4aa8adc3..d1cfcdd07d 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileAttributesW.c
+ SetFileAttributesW.cpp
)
add_executable(paltest_setfileattributesw_test4
diff --git a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/SetFileAttributesW.c b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/SetFileAttributesW.cpp
index bebadfa264..bebadfa264 100644
--- a/src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/SetFileAttributesW.c
+++ b/src/pal/tests/palsuite/file_io/SetFileAttributesW/test4/SetFileAttributesW.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFilePointer/test1/CMakeLists.txt
index e352449981..bb09a981e9 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFilePointer.c
+ SetFilePointer.cpp
)
add_executable(paltest_setfilepointer_test1
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test1/SetFilePointer.c b/src/pal/tests/palsuite/file_io/SetFilePointer/test1/SetFilePointer.cpp
index 14b5f85e69..14b5f85e69 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test1/SetFilePointer.c
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test1/SetFilePointer.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFilePointer/test2/CMakeLists.txt
index 290a01107f..2e76f00c99 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFilePointer.c
+ SetFilePointer.cpp
)
add_executable(paltest_setfilepointer_test2
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test2/SetFilePointer.c b/src/pal/tests/palsuite/file_io/SetFilePointer/test2/SetFilePointer.cpp
index 19e99a74b3..19e99a74b3 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test2/SetFilePointer.c
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test2/SetFilePointer.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFilePointer/test3/CMakeLists.txt
index daa7553a1a..bcc3faca09 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFilePointer.c
+ SetFilePointer.cpp
)
add_executable(paltest_setfilepointer_test3
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test3/SetFilePointer.c b/src/pal/tests/palsuite/file_io/SetFilePointer/test3/SetFilePointer.cpp
index dd53829629..dd53829629 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test3/SetFilePointer.c
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test3/SetFilePointer.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFilePointer/test4/CMakeLists.txt
index 1117893350..3fcc4066f2 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFilePointer.c
+ SetFilePointer.cpp
)
add_executable(paltest_setfilepointer_test4
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test4/SetFilePointer.c b/src/pal/tests/palsuite/file_io/SetFilePointer/test4/SetFilePointer.cpp
index 2993cfd354..2993cfd354 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test4/SetFilePointer.c
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test4/SetFilePointer.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test5/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFilePointer/test5/CMakeLists.txt
index b37bf42ffc..3012009e4f 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFilePointer.c
+ SetFilePointer.cpp
)
add_executable(paltest_setfilepointer_test5
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test5/SetFilePointer.c b/src/pal/tests/palsuite/file_io/SetFilePointer/test5/SetFilePointer.cpp
index f1d392da38..f1d392da38 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test5/SetFilePointer.c
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test5/SetFilePointer.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test6/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFilePointer/test6/CMakeLists.txt
index 8f99ed2d76..a376acbe28 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFilePointer.c
+ SetFilePointer.cpp
)
add_executable(paltest_setfilepointer_test6
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test6/SetFilePointer.c b/src/pal/tests/palsuite/file_io/SetFilePointer/test6/SetFilePointer.cpp
index b35247ec24..b35247ec24 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test6/SetFilePointer.c
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test6/SetFilePointer.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test7/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFilePointer/test7/CMakeLists.txt
index c5a46a531a..2b5c0bbb45 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFilePointer.c
+ SetFilePointer.cpp
)
add_executable(paltest_setfilepointer_test7
diff --git a/src/pal/tests/palsuite/file_io/SetFilePointer/test7/SetFilePointer.c b/src/pal/tests/palsuite/file_io/SetFilePointer/test7/SetFilePointer.cpp
index 33dfd5e711..33dfd5e711 100644
--- a/src/pal/tests/palsuite/file_io/SetFilePointer/test7/SetFilePointer.c
+++ b/src/pal/tests/palsuite/file_io/SetFilePointer/test7/SetFilePointer.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileTime/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileTime/test1/CMakeLists.txt
index 4c4b5d7611..b94bd05d76 100644
--- a/src/pal/tests/palsuite/file_io/SetFileTime/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileTime/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileTime.c
+ SetFileTime.cpp
)
add_executable(paltest_setfiletime_test1
diff --git a/src/pal/tests/palsuite/file_io/SetFileTime/test1/SetFileTime.c b/src/pal/tests/palsuite/file_io/SetFileTime/test1/SetFileTime.cpp
index 4711aeba89..4711aeba89 100644
--- a/src/pal/tests/palsuite/file_io/SetFileTime/test1/SetFileTime.c
+++ b/src/pal/tests/palsuite/file_io/SetFileTime/test1/SetFileTime.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileTime/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileTime/test2/CMakeLists.txt
index 35c18c8d8d..5478aa3703 100644
--- a/src/pal/tests/palsuite/file_io/SetFileTime/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileTime/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileTime.c
+ SetFileTime.cpp
)
add_executable(paltest_setfiletime_test2
diff --git a/src/pal/tests/palsuite/file_io/SetFileTime/test2/SetFileTime.c b/src/pal/tests/palsuite/file_io/SetFileTime/test2/SetFileTime.cpp
index e950153bb0..e950153bb0 100644
--- a/src/pal/tests/palsuite/file_io/SetFileTime/test2/SetFileTime.c
+++ b/src/pal/tests/palsuite/file_io/SetFileTime/test2/SetFileTime.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileTime/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileTime/test3/CMakeLists.txt
index 0a85d30c51..26e178a328 100644
--- a/src/pal/tests/palsuite/file_io/SetFileTime/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileTime/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileTime.c
+ SetFileTime.cpp
)
add_executable(paltest_setfiletime_test3
diff --git a/src/pal/tests/palsuite/file_io/SetFileTime/test3/SetFileTime.c b/src/pal/tests/palsuite/file_io/SetFileTime/test3/SetFileTime.cpp
index 97f49495d7..97f49495d7 100644
--- a/src/pal/tests/palsuite/file_io/SetFileTime/test3/SetFileTime.c
+++ b/src/pal/tests/palsuite/file_io/SetFileTime/test3/SetFileTime.cpp
diff --git a/src/pal/tests/palsuite/file_io/SetFileTime/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetFileTime/test4/CMakeLists.txt
index 086e35e535..b85a92bf63 100644
--- a/src/pal/tests/palsuite/file_io/SetFileTime/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetFileTime/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetFileTime.c
+ SetFileTime.cpp
)
add_executable(paltest_setfiletime_test4
diff --git a/src/pal/tests/palsuite/file_io/SetFileTime/test4/SetFileTime.c b/src/pal/tests/palsuite/file_io/SetFileTime/test4/SetFileTime.cpp
index 3edd2403c4..3edd2403c4 100644
--- a/src/pal/tests/palsuite/file_io/SetFileTime/test4/SetFileTime.c
+++ b/src/pal/tests/palsuite/file_io/SetFileTime/test4/SetFileTime.cpp
diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/WriteFile/test1/CMakeLists.txt
index 0c6760a2ce..3d5a735a83 100644
--- a/src/pal/tests/palsuite/file_io/WriteFile/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/WriteFile/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- WriteFile.c
+ WriteFile.cpp
)
add_executable(paltest_writefile_test1
diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test1/WriteFile.c b/src/pal/tests/palsuite/file_io/WriteFile/test1/WriteFile.cpp
index 1ac38ddaf0..1ac38ddaf0 100644
--- a/src/pal/tests/palsuite/file_io/WriteFile/test1/WriteFile.c
+++ b/src/pal/tests/palsuite/file_io/WriteFile/test1/WriteFile.cpp
diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/WriteFile/test2/CMakeLists.txt
index a9b51efa3d..3d7d18826a 100644
--- a/src/pal/tests/palsuite/file_io/WriteFile/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/WriteFile/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- WriteFile.c
+ WriteFile.cpp
)
add_executable(paltest_writefile_test2
diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.c b/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp
index 24c148afb8..24c148afb8 100644
--- a/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.c
+++ b/src/pal/tests/palsuite/file_io/WriteFile/test2/WriteFile.cpp
diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/WriteFile/test3/CMakeLists.txt
index e16e8a48f6..bffcf35482 100644
--- a/src/pal/tests/palsuite/file_io/WriteFile/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/WriteFile/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- WriteFile.c
+ WriteFile.cpp
)
add_executable(paltest_writefile_test3
diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test3/WriteFile.c b/src/pal/tests/palsuite/file_io/WriteFile/test3/WriteFile.cpp
index 751f89ff2c..751f89ff2c 100644
--- a/src/pal/tests/palsuite/file_io/WriteFile/test3/WriteFile.c
+++ b/src/pal/tests/palsuite/file_io/WriteFile/test3/WriteFile.cpp
diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/WriteFile/test4/CMakeLists.txt
index fff886b430..402a61ac2c 100644
--- a/src/pal/tests/palsuite/file_io/WriteFile/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/WriteFile/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- writefile.c
+ writefile.cpp
)
add_executable(paltest_writefile_test4
diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test4/writefile.c b/src/pal/tests/palsuite/file_io/WriteFile/test4/writefile.cpp
index 47a0066ec9..47a0066ec9 100644
--- a/src/pal/tests/palsuite/file_io/WriteFile/test4/writefile.c
+++ b/src/pal/tests/palsuite/file_io/WriteFile/test4/writefile.cpp
diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test5/CMakeLists.txt b/src/pal/tests/palsuite/file_io/WriteFile/test5/CMakeLists.txt
index 978eb7f1e7..f1f5037f98 100644
--- a/src/pal/tests/palsuite/file_io/WriteFile/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/WriteFile/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- writefile.c
+ writefile.cpp
)
add_executable(paltest_writefile_test5
diff --git a/src/pal/tests/palsuite/file_io/WriteFile/test5/writefile.c b/src/pal/tests/palsuite/file_io/WriteFile/test5/writefile.cpp
index 46920b3335..46920b3335 100644
--- a/src/pal/tests/palsuite/file_io/WriteFile/test5/writefile.c
+++ b/src/pal/tests/palsuite/file_io/WriteFile/test5/writefile.cpp
diff --git a/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/CMakeLists.txt
index 91b7db1f03..4c4f6416ce 100644
--- a/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_errorpathnotfound_test1
diff --git a/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/test1.c b/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/test1.cpp
index eaf3db3a30..eaf3db3a30 100644
--- a/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/test1.c
+++ b/src/pal/tests/palsuite/file_io/errorpathnotfound/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/CMakeLists.txt
index 7d525c21d5..284933f950 100644
--- a/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_errorpathnotfound_test2
diff --git a/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/test2.c b/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/test2.cpp
index 5c2ab86b99..5c2ab86b99 100644
--- a/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/test2.c
+++ b/src/pal/tests/palsuite/file_io/errorpathnotfound/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/file_io/errorpathnotfound/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/errorpathnotfound/test3/CMakeLists.txt
index c7434f3dba..b418c9dbdb 100644
--- a/src/pal/tests/palsuite/file_io/errorpathnotfound/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/errorpathnotfound/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_errorpathnotfound_test3
diff --git a/src/pal/tests/palsuite/file_io/errorpathnotfound/test3/test3.c b/src/pal/tests/palsuite/file_io/errorpathnotfound/test3/test3.cpp
index 414cbab176..414cbab176 100644
--- a/src/pal/tests/palsuite/file_io/errorpathnotfound/test3/test3.c
+++ b/src/pal/tests/palsuite/file_io/errorpathnotfound/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/file_io/errorpathnotfound/test4/CMakeLists.txt b/src/pal/tests/palsuite/file_io/errorpathnotfound/test4/CMakeLists.txt
index f8062fd127..e0322dd8e4 100644
--- a/src/pal/tests/palsuite/file_io/errorpathnotfound/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/errorpathnotfound/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_errorpathnotfound_test4
diff --git a/src/pal/tests/palsuite/file_io/errorpathnotfound/test4/test4.c b/src/pal/tests/palsuite/file_io/errorpathnotfound/test4/test4.cpp
index e1b68995b0..e1b68995b0 100644
--- a/src/pal/tests/palsuite/file_io/errorpathnotfound/test4/test4.c
+++ b/src/pal/tests/palsuite/file_io/errorpathnotfound/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/file_io/gettemppatha/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/gettemppatha/test1/CMakeLists.txt
index 2aff599e74..9869c9c70f 100644
--- a/src/pal/tests/palsuite/file_io/gettemppatha/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/gettemppatha/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- gettemppatha.c
+ gettemppatha.cpp
)
add_executable(paltest_gettemppatha_test1
diff --git a/src/pal/tests/palsuite/file_io/gettemppatha/test1/gettemppatha.c b/src/pal/tests/palsuite/file_io/gettemppatha/test1/gettemppatha.cpp
index b0da528af8..b0da528af8 100644
--- a/src/pal/tests/palsuite/file_io/gettemppatha/test1/gettemppatha.c
+++ b/src/pal/tests/palsuite/file_io/gettemppatha/test1/gettemppatha.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CMakeLists.txt
index 3fc399fe59..a573dae8cd 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CMakeLists.txt
@@ -17,7 +17,7 @@ add_subdirectory(LockFile)
add_subdirectory(MapViewOfFile)
add_subdirectory(OpenFileMappingA)
add_subdirectory(OpenFileMappingW)
-add_subdirectory(ReadProcessMemory)
+add_subdirectory(ProbeMemory)
add_subdirectory(RtlMoveMemory)
add_subdirectory(UnlockFile)
add_subdirectory(UnmapViewOfFile)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CMakeLists.txt
index 36084bf446..c38015ea21 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMapping.c
+ CreateFileMapping.cpp
)
add_executable(paltest_createfilemappinga_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CreateFileMapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CreateFileMapping.cpp
index 91640bfd04..91640bfd04 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CreateFileMapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test1/CreateFileMapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CMakeLists.txt
index 374f8f0946..fc152c8161 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMapping.c
+ CreateFileMapping.cpp
)
add_executable(paltest_createfilemappinga_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CreateFileMapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CreateFileMapping.cpp
index 2a849d86b8..2a849d86b8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CreateFileMapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test3/CreateFileMapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CMakeLists.txt
index 665b10a3f0..bbb4deaa8b 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMapping.c
+ CreateFileMapping.cpp
)
add_executable(paltest_createfilemappinga_test4
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CreateFileMapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CreateFileMapping.cpp
index 64caa88ca0..64caa88ca0 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CreateFileMapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test4/CreateFileMapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CMakeLists.txt
index 6f7f3c3635..b80aa21a42 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMapping.c
+ CreateFileMapping.cpp
)
add_executable(paltest_createfilemappinga_test5
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CreateFileMapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CreateFileMapping.cpp
index c7f9918b08..c7f9918b08 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CreateFileMapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test5/CreateFileMapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CMakeLists.txt
index 2f5d98b5e6..414127aa35 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMapping.c
+ CreateFileMapping.cpp
)
add_executable(paltest_createfilemappinga_test6
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CreateFileMapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CreateFileMapping.cpp
index 6445295de8..6445295de8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CreateFileMapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test6/CreateFileMapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/CMakeLists.txt
index 4fd24a63a1..e40a5ad486 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- createfilemapping.c
+ createfilemapping.cpp
)
add_executable(paltest_createfilemappinga_test7
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/createfilemapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/createfilemapping.cpp
index 7cef9ddcdc..7cef9ddcdc 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/createfilemapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test7/createfilemapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/CMakeLists.txt
index ae3ee8ddf6..d2e2007545 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- createfilemapping.c
+ createfilemapping.cpp
)
add_executable(paltest_createfilemappinga_test8
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/createfilemapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/createfilemapping.cpp
index 02b2fb5e61..02b2fb5e61 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/createfilemapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test8/createfilemapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/CMakeLists.txt
index a377632bed..3017dc4aa4 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- createfilemapping.c
+ createfilemapping.cpp
)
add_executable(paltest_createfilemappinga_test9
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/createfilemapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/createfilemapping.cpp
index 9224c22b4b..9224c22b4b 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/createfilemapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingA/test9/createfilemapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CMakeLists.txt
index a4ad343ea0..2d24eca8c8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMapping_neg.c
+ CreateFileMapping_neg.cpp
)
add_executable(paltest_createfilemappingw_createfilemapping_neg1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.cpp
index 8cf79b3c57..8cf79b3c57 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/CreateFileMapping_neg1/CreateFileMapping_neg.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CMakeLists.txt
index 0c569ec9b6..a2fbfa39af 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMappingW.c
+ CreateFileMappingW.cpp
)
add_executable(paltest_createfilemappingw_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.cpp
index 4263a3ad29..4263a3ad29 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test1/CreateFileMappingW.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CMakeLists.txt
index 992645f48c..8552cc910f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMappingW.c
+ CreateFileMappingW.cpp
)
add_executable(paltest_createfilemappingw_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.c
deleted file mode 100644
index 11ff967dfd..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.c
+++ /dev/null
@@ -1,124 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: createfilemappingw.c
-**
-** Purpose: Positive test the CreateFileMapping API.
-** Call CreateFileMapping to create a unnamed
-** file-mapping object with PAGE_READONLY
-** protection and SEC_IMAGE attribute in UNICODE
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
- HANDLE FileHandle;
- HANDLE FileMappingHandle;
- int err;
- WCHAR *wpFileName = NULL;
- char executableFileName[256]="";
-
-
- //Initialize the PAL environment
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- ExitProcess(FAIL);
- }
-
-#if WIN32
- sprintf(executableFileName,"%s","executable.exe");
-#else
- sprintf(executableFileName,"%s","executable");
-#endif
-
- //conver string to a unicode one
- wpFileName = convert(executableFileName);
-
-
- //create a file and return the file handle
- FileHandle = CreateFile(wpFileName,
- GENERIC_READ,
- FILE_SHARE_READ,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_ARCHIVE,
- NULL);
-
- //free this memory
- free(wpFileName);
-
- if(INVALID_HANDLE_VALUE == FileHandle)
- {
- Fail("Failed to call CreateFile to create a file\n");
- }
-
- //create a unnamed file-mapping object with file handle FileHandle
- //and with PAGE_READONLY protection
- FileMappingHandle = CreateFileMapping(
- FileHandle, //File Handle
- NULL, //not inherited
- PAGE_READONLY|SEC_IMAGE, //access protection and section attribute
- 0, //high-order of object size
- 0, //low-orger of object size
- NULL); //unnamed object
-
-
- if(NULL == FileMappingHandle)
- {
- Trace("\nFailed to call CreateFileMapping to create a mapping object!\n");
- err = CloseHandle(FileHandle);
- if(0 == err)
- {
- Fail("\nFailed to call CloseHandle API\n");
- }
- Fail("");
- }
- if(GetLastError() == ERROR_ALREADY_EXISTS)
- {
- Trace("\nFile mapping object already exists!\n");
- err = CloseHandle(FileHandle);
- if(0 == err)
- {
- Trace("\nFailed to call CloseHandle API to close a file handle\n");
- err = CloseHandle(FileMappingHandle);
- if(0 == err)
- {
- Fail("\nFailed to call CloseHandle API to close a mapping object handle\n");
- }
- Fail("");
- }
- err = CloseHandle(FileMappingHandle);
- if(0 == err)
- {
- Fail("\nFailed to call CloseHandle API to close a mapping object handle\n");
- }
- Fail("");
- }
- err = CloseHandle(FileMappingHandle);
- if(0 == err)
- {
- Trace("\nFailed to call CloseHandle API to close a mapping object handle\n");
- err = CloseHandle(FileHandle);
- if(0 == err)
- {
- Fail("\nFailed to call CloseHandle API to close a file handle\n");
- }
- Fail("");
- }
- err = CloseHandle(FileHandle);
- if(0 == err)
- {
- Fail("\nFailed to call CloseHandle API to close a file handle\n");
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp
new file mode 100644
index 0000000000..5cc6d77709
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp
@@ -0,0 +1,124 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: createfilemappingw.c
+**
+** Purpose: Positive test the CreateFileMapping API.
+** Call CreateFileMapping to create a unnamed
+** file-mapping object with PAGE_READONLY
+** protection and SEC_IMAGE attribute in UNICODE
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ HANDLE FileHandle;
+ HANDLE FileMappingHandle;
+ int err;
+ WCHAR *wpFileName = NULL;
+ char executableFileName[256]="";
+
+
+ //Initialize the PAL environment
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ ExitProcess(FAIL);
+ }
+
+#if WIN32
+ sprintf_s(executableFileName, _countof(executableFileName),"%s","executable.exe");
+#else
+ sprintf_s(executableFileName, _countof(executableFileName),"%s","executable");
+#endif
+
+ //conver string to a unicode one
+ wpFileName = convert(executableFileName);
+
+
+ //create a file and return the file handle
+ FileHandle = CreateFile(wpFileName,
+ GENERIC_READ,
+ FILE_SHARE_READ,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_ARCHIVE,
+ NULL);
+
+ //free this memory
+ free(wpFileName);
+
+ if(INVALID_HANDLE_VALUE == FileHandle)
+ {
+ Fail("Failed to call CreateFile to create a file\n");
+ }
+
+ //create a unnamed file-mapping object with file handle FileHandle
+ //and with PAGE_READONLY protection
+ FileMappingHandle = CreateFileMapping(
+ FileHandle, //File Handle
+ NULL, //not inherited
+ PAGE_READONLY|SEC_IMAGE, //access protection and section attribute
+ 0, //high-order of object size
+ 0, //low-orger of object size
+ NULL); //unnamed object
+
+
+ if(NULL == FileMappingHandle)
+ {
+ Trace("\nFailed to call CreateFileMapping to create a mapping object!\n");
+ err = CloseHandle(FileHandle);
+ if(0 == err)
+ {
+ Fail("\nFailed to call CloseHandle API\n");
+ }
+ Fail("");
+ }
+ if(GetLastError() == ERROR_ALREADY_EXISTS)
+ {
+ Trace("\nFile mapping object already exists!\n");
+ err = CloseHandle(FileHandle);
+ if(0 == err)
+ {
+ Trace("\nFailed to call CloseHandle API to close a file handle\n");
+ err = CloseHandle(FileMappingHandle);
+ if(0 == err)
+ {
+ Fail("\nFailed to call CloseHandle API to close a mapping object handle\n");
+ }
+ Fail("");
+ }
+ err = CloseHandle(FileMappingHandle);
+ if(0 == err)
+ {
+ Fail("\nFailed to call CloseHandle API to close a mapping object handle\n");
+ }
+ Fail("");
+ }
+ err = CloseHandle(FileMappingHandle);
+ if(0 == err)
+ {
+ Trace("\nFailed to call CloseHandle API to close a mapping object handle\n");
+ err = CloseHandle(FileHandle);
+ if(0 == err)
+ {
+ Fail("\nFailed to call CloseHandle API to close a file handle\n");
+ }
+ Fail("");
+ }
+ err = CloseHandle(FileHandle);
+ if(0 == err)
+ {
+ Fail("\nFailed to call CloseHandle API to close a file handle\n");
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CMakeLists.txt
index 87832ffd9b..97fd712350 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMappingW.c
+ CreateFileMappingW.cpp
)
add_executable(paltest_createfilemappingw_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.cpp
index 1cbeff94a7..1cbeff94a7 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test3/CreateFileMappingW.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CMakeLists.txt
index f8a5c9041f..81f248e335 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMappingW.c
+ CreateFileMappingW.cpp
)
add_executable(paltest_createfilemappingw_test4
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.cpp
index 265a317b2f..265a317b2f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test4/CreateFileMappingW.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CMakeLists.txt
index 8391fbd721..df25e29a4f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMappingW.c
+ CreateFileMappingW.cpp
)
add_executable(paltest_createfilemappingw_test5
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.cpp
index 21bf7c6d76..21bf7c6d76 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test5/CreateFileMappingW.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CMakeLists.txt
index abb62ad950..852c508020 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateFileMappingW.c
+ CreateFileMappingW.cpp
)
add_executable(paltest_createfilemappingw_test6
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.cpp
index acf3ac6dff..acf3ac6dff 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test6/CreateFileMappingW.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/CMakeLists.txt
index b40cfeae96..68be449aec 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- createfilemapping.c
+ createfilemapping.cpp
)
add_executable(paltest_createfilemappingw_test7
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.cpp
index e49b9f688d..e49b9f688d 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test7/createfilemapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/CMakeLists.txt
index 96658c163a..406331072c 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- createfilemapping.c
+ createfilemapping.cpp
)
add_executable(paltest_createfilemappingw_test8
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.cpp
index 1ff137d8d3..1ff137d8d3 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test8/createfilemapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/CMakeLists.txt
index 5a55e27b33..6d15fea1e6 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- createfilemapping.c
+ createfilemapping.cpp
)
add_executable(paltest_createfilemappingw_test9
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.c b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.cpp
index 16ae74c126..16ae74c126 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test9/createfilemapping.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/CMakeLists.txt
index 3807621e3f..beaee835c8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- dlltest.c
- FreeLibrary.c
+ dlltest.cpp
+ FreeLibrary.cpp
)
add_executable(paltest_freelibrary_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/FreeLibrary.c b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/FreeLibrary.cpp
index a06a231586..a06a231586 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/FreeLibrary.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/FreeLibrary.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/dlltest.c b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/dlltest.cpp
index 44f1b5a903..44f1b5a903 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/dlltest.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test1/dlltest.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/CMakeLists.txt
index 00b1eca8e3..0a5e700ba4 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_freelibrary_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/test2.c b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/test2.cpp
index b43f74d6bc..b43f74d6bc 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/test2.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibrary/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/CMakeLists.txt
index cec083583a..03bfe06eb3 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- dlltest.c
- test1.c
+ dlltest.cpp
+ test1.cpp
)
add_executable(paltest_freelibraryandexitthread_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/dlltest.c b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/dlltest.cpp
index 954c624d19..954c624d19 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/dlltest.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/dlltest.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.c b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.c
deleted file mode 100644
index 6aacfc83b4..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.c
+++ /dev/null
@@ -1,183 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=====================================================================
-**
-** Source: test1.c (FreeLibraryAndExitThread)
-**
-** Purpose: Tests the PAL implementation of the FreeLibraryAndExitThread
-** function. FreeLibraryAndExitThread when run will exit the
-** process that it is called within, therefore we create a
-** thread to run the API. Then test for the existance of the
-** thread and access to the library.
-**
-**
-**===================================================================*/
-
-#include <palsuite.h>
-
-/*Define platform specific information*/
-
-/* SHLEXT is defined only for Unix variants */
-#if defined(SHLEXT)
-#define LibraryName "dlltest"SHLEXT
-#else
-#define LibraryName "dlltest"
-#endif
-
-#define TIMEOUT 60000
-
-BOOL PALAPI StartThreadTest();
-DWORD PALAPI CreateTestThread(LPVOID);
-BOOL PALAPI TestDll(HMODULE, int);
-
-int __cdecl main(int argc, char* argv[])
-{
- /*Initialize the PAL*/
- if ((PAL_Initialize(argc, argv)) != 0)
- {
- return (FAIL);
- }
-
- if (!StartThreadTest())
- {
- Fail("ERROR: FreeLibraryAndExitThread test failed.\n");
- }
-
- /*Terminate the PAL*/
- PAL_Terminate();
- return PASS;
-
-}
-
-
-BOOL PALAPI StartThreadTest()
-{
- HMODULE hLib;
- HANDLE hThread;
- DWORD dwThreadId;
- LPTHREAD_START_ROUTINE lpStartAddress = &CreateTestThread;
- LPVOID lpParameter = lpStartAddress;
- DWORD rc = -1;
- /*Load library (DLL).*/
- hLib = LoadLibrary(LibraryName);
- if(hLib == NULL)
- {
- Trace("ERROR: Unable to load library %s\n", LibraryName);
-
- return (FALSE);
- }
-
- /*Start the test thread*/
- hThread = CreateThread(NULL,
- (DWORD)0,
- lpParameter,
- hLib,
- (DWORD)NULL,
- &dwThreadId);
- if(hThread == NULL)
- {
- Trace("ERROR:%u: Unable to create thread.\n",
- GetLastError());
-
- FreeLibrary(hLib);
- return (FALSE);
- }
-
- /*Wait on thread.*/
- rc = WaitForSingleObject(hThread, TIMEOUT);
- if( rc != WAIT_OBJECT_0 )
- {
- Trace("ERROR:%u: hThread=0x%4.4lx not exited by "
- "FreeLibraryAndExitThread, RC[%d]\n",
- GetLastError(),
- hThread, rc);
-
-// There is a possibility that the other thread might
-// still be using the library VSW:337893
-// FreeLibrary(hLib);
- CloseHandle(hThread);
- return (FALSE);
- }
-
- /*Test access to DLL.*/
- if(!TestDll(hLib, 0))
- {
- Trace("ERROR: TestDll function returned FALSE "
- "expected TRUE\n.");
-
- CloseHandle(hThread);
- return (FALSE);
- }
-
- FreeLibrary(hLib);
- /*Clean-up thread.*/
- CloseHandle(hThread);
-
- return (TRUE);
-}
-
-BOOL PALAPI TestDll(HMODULE hLib, int testResult)
-{
- int RetVal;
- char FunctName[] = "DllTest";
- FARPROC DllAddr;
-
- /* Attempt to grab the proc address of the dll function.
- * This one should succeed.*/
- if(testResult == 1)
- {
- DllAddr = GetProcAddress(hLib, FunctName);
- if(DllAddr == NULL)
- {
- Trace("ERROR: Unable to load function \"%s\" library \"%s\"\n",
- FunctName,
- LibraryName);
- return (FALSE);
- }
- /* Run the function in the DLL,
- * to ensure that the DLL was loaded properly.*/
- RetVal = DllAddr();
- if (RetVal != 1)
- {
- Trace("ERROR: Unable to receive correct information from DLL! "
- ":expected \"1\", returned \"%d\"\n",
- RetVal);
- return (FALSE);
- }
- }
-
- /* Attempt to grab the proc address of the dll function.
- * This one should fail.*/
- if(testResult == 0)
- {
- DllAddr = GetProcAddress(hLib, FunctName);
- if(DllAddr != NULL)
- {
- Trace("ERROR: Able to load function \"%s\" from free'd"
- " library \"%s\"\n",
- FunctName,
- LibraryName);
- return (FALSE);
- }
- }
- return (TRUE);
-}
-
-DWORD PALAPI CreateTestThread(LPVOID lpParam)
-{
- /* Test access to DLL.*/
- TestDll(lpParam, 1);
-
- /*Free library and exit thread.*/
- FreeLibraryAndExitThread(lpParam, (DWORD)0);
-
- /* NOT REACHED */
-
- /*Infinite loop, we should not get here.*/
- while(1);
-
- return (DWORD)0;
-}
-
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.cpp b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.cpp
new file mode 100644
index 0000000000..58f6643722
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/FreeLibraryAndExitThread/test1/test1.cpp
@@ -0,0 +1,183 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=====================================================================
+**
+** Source: test1.c (FreeLibraryAndExitThread)
+**
+** Purpose: Tests the PAL implementation of the FreeLibraryAndExitThread
+** function. FreeLibraryAndExitThread when run will exit the
+** process that it is called within, therefore we create a
+** thread to run the API. Then test for the existance of the
+** thread and access to the library.
+**
+**
+**===================================================================*/
+
+#include <palsuite.h>
+
+/*Define platform specific information*/
+
+/* SHLEXT is defined only for Unix variants */
+#if defined(SHLEXT)
+#define LibraryName "dlltest"SHLEXT
+#else
+#define LibraryName "dlltest"
+#endif
+
+#define TIMEOUT 60000
+
+BOOL PALAPI StartThreadTest();
+DWORD PALAPI CreateTestThread(LPVOID);
+BOOL PALAPI TestDll(HMODULE, int);
+
+int __cdecl main(int argc, char* argv[])
+{
+ /*Initialize the PAL*/
+ if ((PAL_Initialize(argc, argv)) != 0)
+ {
+ return (FAIL);
+ }
+
+ if (!StartThreadTest())
+ {
+ Fail("ERROR: FreeLibraryAndExitThread test failed.\n");
+ }
+
+ /*Terminate the PAL*/
+ PAL_Terminate();
+ return PASS;
+
+}
+
+
+BOOL PALAPI StartThreadTest()
+{
+ HMODULE hLib;
+ HANDLE hThread;
+ DWORD dwThreadId;
+ LPTHREAD_START_ROUTINE lpStartAddress = &CreateTestThread;
+ LPVOID lpParameter = (LPVOID)lpStartAddress;
+ DWORD rc = -1;
+ /*Load library (DLL).*/
+ hLib = LoadLibrary(LibraryName);
+ if(hLib == NULL)
+ {
+ Trace("ERROR: Unable to load library %s\n", LibraryName);
+
+ return (FALSE);
+ }
+
+ /*Start the test thread*/
+ hThread = CreateThread(NULL,
+ (DWORD)0,
+ lpStartAddress,
+ hLib,
+ (DWORD)NULL,
+ &dwThreadId);
+ if(hThread == NULL)
+ {
+ Trace("ERROR:%u: Unable to create thread.\n",
+ GetLastError());
+
+ FreeLibrary(hLib);
+ return (FALSE);
+ }
+
+ /*Wait on thread.*/
+ rc = WaitForSingleObject(hThread, TIMEOUT);
+ if( rc != WAIT_OBJECT_0 )
+ {
+ Trace("ERROR:%u: hThread=0x%4.4lx not exited by "
+ "FreeLibraryAndExitThread, RC[%d]\n",
+ GetLastError(),
+ hThread, rc);
+
+// There is a possibility that the other thread might
+// still be using the library VSW:337893
+// FreeLibrary(hLib);
+ CloseHandle(hThread);
+ return (FALSE);
+ }
+
+ /*Test access to DLL.*/
+ if(!TestDll(hLib, 0))
+ {
+ Trace("ERROR: TestDll function returned FALSE "
+ "expected TRUE\n.");
+
+ CloseHandle(hThread);
+ return (FALSE);
+ }
+
+ FreeLibrary(hLib);
+ /*Clean-up thread.*/
+ CloseHandle(hThread);
+
+ return (TRUE);
+}
+
+BOOL PALAPI TestDll(HMODULE hLib, int testResult)
+{
+ int RetVal;
+ char FunctName[] = "DllTest";
+ FARPROC DllAddr;
+
+ /* Attempt to grab the proc address of the dll function.
+ * This one should succeed.*/
+ if(testResult == 1)
+ {
+ DllAddr = GetProcAddress(hLib, FunctName);
+ if(DllAddr == NULL)
+ {
+ Trace("ERROR: Unable to load function \"%s\" library \"%s\"\n",
+ FunctName,
+ LibraryName);
+ return (FALSE);
+ }
+ /* Run the function in the DLL,
+ * to ensure that the DLL was loaded properly.*/
+ RetVal = DllAddr();
+ if (RetVal != 1)
+ {
+ Trace("ERROR: Unable to receive correct information from DLL! "
+ ":expected \"1\", returned \"%d\"\n",
+ RetVal);
+ return (FALSE);
+ }
+ }
+
+ /* Attempt to grab the proc address of the dll function.
+ * This one should fail.*/
+ if(testResult == 0)
+ {
+ DllAddr = GetProcAddress(hLib, FunctName);
+ if(DllAddr != NULL)
+ {
+ Trace("ERROR: Able to load function \"%s\" from free'd"
+ " library \"%s\"\n",
+ FunctName,
+ LibraryName);
+ return (FALSE);
+ }
+ }
+ return (TRUE);
+}
+
+DWORD PALAPI CreateTestThread(LPVOID lpParam)
+{
+ /* Test access to DLL.*/
+ TestDll(lpParam, 1);
+
+ /*Free library and exit thread.*/
+ FreeLibraryAndExitThread(lpParam, (DWORD)0);
+
+ /* NOT REACHED */
+
+ /*Infinite loop, we should not get here.*/
+ while(1);
+
+ return (DWORD)0;
+}
+
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/CMakeLists.txt
index a1128c62b8..9b7a610f0c 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetModuleFileNameA.c
+ GetModuleFileNameA.cpp
)
add_executable(paltest_getmodulefilenamea_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.c b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.cpp
index d05f0ac6a9..d05f0ac6a9 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test1/GetModuleFileNameA.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/CMakeLists.txt
index c35e9acc5e..1909be4b42 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetModuleFileNameA.c
+ GetModuleFileNameA.cpp
)
add_executable(paltest_getmodulefilenamea_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.c b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.cpp
index e8aed6d30e..e8aed6d30e 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameA/test2/GetModuleFileNameA.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/CMakeLists.txt
index c702d07908..f3d92b15c9 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetModuleFileNameW.c
+ GetModuleFileNameW.cpp
)
add_executable(paltest_getmodulefilenamew_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.c b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.c
deleted file mode 100644
index 4c1c3b00ab..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.c
+++ /dev/null
@@ -1,112 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: getmodulefilenamew.c
-**
-** Purpose: Test the GetModuleFileNameW to retrieve the specified module
-** full path and file name in UNICODE.
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-#define MODULENAMEBUFFERSIZE 1024
-
-/* SHLEXT is defined only for Unix variants */
-
-#if defined(SHLEXT)
-#define ModuleName "librotor_pal"SHLEXT
-#define Delimiter "/"
-#else
-#define ModuleName "rotor_pal.dll"
-#define Delimiter "\\"
-#endif
-
-int __cdecl main(int argc, char *argv[])
-{
- HMODULE ModuleHandle;
- int err;
- WCHAR *lpModuleName;
- DWORD ModuleNameLength;
- WCHAR *ModuleFileNameBuf;
- char* TempBuf = NULL;
- char* LastBuf = NULL;
- char NewModuleFileNameBuf[MODULENAMEBUFFERSIZE+200] = "";
-
-
- //Initialize the PAL environment
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- ExitProcess(FAIL);
- }
-
- ModuleFileNameBuf = malloc(MODULENAMEBUFFERSIZE*sizeof(WCHAR));
-
- //convert a normal string to a wide one
- lpModuleName = convert(ModuleName);
-
- //load a module
- ModuleHandle = LoadLibrary(lpModuleName);
-
- //free the memory
- free(lpModuleName);
-
- if(!ModuleHandle)
- {
- Fail("Failed to call LoadLibrary API!\n");
- }
-
-
- //retrieve the specified module full path and file name
- ModuleNameLength = GetModuleFileName(
- ModuleHandle,//specified module handle
- ModuleFileNameBuf,//buffer for module file name
- MODULENAMEBUFFERSIZE);
-
-
-
- //convert a wide full path name to a normal one
- strcpy(NewModuleFileNameBuf,convertC(ModuleFileNameBuf));
-
- //strip out all full path
- TempBuf = strtok(NewModuleFileNameBuf,Delimiter);
- LastBuf = TempBuf;
- while(NULL != TempBuf)
- {
- LastBuf = TempBuf;
- TempBuf = strtok(NULL,Delimiter);
- }
-
-
- //free the memory
- free(ModuleFileNameBuf);
-
- if(0 == ModuleNameLength || strcmp(ModuleName,LastBuf))
- {
- Trace("\nFailed to all GetModuleFileName API!\n");
- err = FreeLibrary(ModuleHandle);
- if(0 == err)
- {
- Fail("\nFailed to all FreeLibrary API!\n");
- }
- Fail("");
- }
-
-
-
- //decrement the reference count of the loaded dll
- err = FreeLibrary(ModuleHandle);
- if(0 == err)
- {
- Fail("\nFailed to all FreeLibrary API!\n");
- }
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.cpp b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.cpp
new file mode 100644
index 0000000000..c122312d89
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test1/GetModuleFileNameW.cpp
@@ -0,0 +1,112 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: getmodulefilenamew.c
+**
+** Purpose: Test the GetModuleFileNameW to retrieve the specified module
+** full path and file name in UNICODE.
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+#define MODULENAMEBUFFERSIZE 1024
+
+/* SHLEXT is defined only for Unix variants */
+
+#if defined(SHLEXT)
+#define ModuleName "librotor_pal"SHLEXT
+#define Delimiter "/"
+#else
+#define ModuleName "rotor_pal.dll"
+#define Delimiter "\\"
+#endif
+
+int __cdecl main(int argc, char *argv[])
+{
+ HMODULE ModuleHandle;
+ int err;
+ WCHAR *lpModuleName;
+ DWORD ModuleNameLength;
+ WCHAR *ModuleFileNameBuf;
+ char* TempBuf = NULL;
+ char* LastBuf = NULL;
+ char NewModuleFileNameBuf[MODULENAMEBUFFERSIZE+200] = "";
+
+
+ //Initialize the PAL environment
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ ExitProcess(FAIL);
+ }
+
+ ModuleFileNameBuf = (WCHAR*)malloc(MODULENAMEBUFFERSIZE*sizeof(WCHAR));
+
+ //convert a normal string to a wide one
+ lpModuleName = convert(ModuleName);
+
+ //load a module
+ ModuleHandle = LoadLibrary(lpModuleName);
+
+ //free the memory
+ free(lpModuleName);
+
+ if(!ModuleHandle)
+ {
+ Fail("Failed to call LoadLibrary API!\n");
+ }
+
+
+ //retrieve the specified module full path and file name
+ ModuleNameLength = GetModuleFileName(
+ ModuleHandle,//specified module handle
+ ModuleFileNameBuf,//buffer for module file name
+ MODULENAMEBUFFERSIZE);
+
+
+
+ //convert a wide full path name to a normal one
+ strcpy(NewModuleFileNameBuf,convertC(ModuleFileNameBuf));
+
+ //strip out all full path
+ TempBuf = strtok(NewModuleFileNameBuf,Delimiter);
+ LastBuf = TempBuf;
+ while(NULL != TempBuf)
+ {
+ LastBuf = TempBuf;
+ TempBuf = strtok(NULL,Delimiter);
+ }
+
+
+ //free the memory
+ free(ModuleFileNameBuf);
+
+ if(0 == ModuleNameLength || strcmp(ModuleName,LastBuf))
+ {
+ Trace("\nFailed to all GetModuleFileName API!\n");
+ err = FreeLibrary(ModuleHandle);
+ if(0 == err)
+ {
+ Fail("\nFailed to all FreeLibrary API!\n");
+ }
+ Fail("");
+ }
+
+
+
+ //decrement the reference count of the loaded dll
+ err = FreeLibrary(ModuleHandle);
+ if(0 == err)
+ {
+ Fail("\nFailed to all FreeLibrary API!\n");
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/CMakeLists.txt
index 857feb330d..7b23e92772 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetModuleFileNameW.c
+ GetModuleFileNameW.cpp
)
add_executable(paltest_getmodulefilenamew_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.c b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.c
deleted file mode 100644
index 6009a9d298..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.c
+++ /dev/null
@@ -1,57 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: getmodulefilenamew.c
-**
-** Purpose: Positive test the GetModuleFileName API.
-** Call GetModuleFileName to retrieve current process
-** full path and file name by passing a NULL module handle
-** in UNICODE
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-#define MODULENAMEBUFFERSIZE 1024
-
-
-int __cdecl main(int argc, char *argv[])
-{
-
- DWORD ModuleNameLength;
- WCHAR *ModuleFileNameBuf;
- int err;
-
-
- //Initialize the PAL environment
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- ExitProcess(FAIL);
- }
-
- ModuleFileNameBuf = malloc(MODULENAMEBUFFERSIZE*sizeof(WCHAR));
-
- //retrieve the current process full path and file name
- //by passing a NULL module handle
- ModuleNameLength = GetModuleFileName(
- NULL, //a NULL handle
- ModuleFileNameBuf,//buffer for module file name
- MODULENAMEBUFFERSIZE);
-
- //free the memory
- free(ModuleFileNameBuf);
-
- if(0 == ModuleNameLength)
- {
- Fail("\nFailed to all GetModuleFileName API!\n");
- }
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.cpp b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.cpp
new file mode 100644
index 0000000000..f23d97c138
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetModuleFileNameW/test2/GetModuleFileNameW.cpp
@@ -0,0 +1,57 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: getmodulefilenamew.c
+**
+** Purpose: Positive test the GetModuleFileName API.
+** Call GetModuleFileName to retrieve current process
+** full path and file name by passing a NULL module handle
+** in UNICODE
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+#define MODULENAMEBUFFERSIZE 1024
+
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ DWORD ModuleNameLength;
+ WCHAR *ModuleFileNameBuf;
+ int err;
+
+
+ //Initialize the PAL environment
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ ExitProcess(FAIL);
+ }
+
+ ModuleFileNameBuf = (WCHAR*)malloc(MODULENAMEBUFFERSIZE*sizeof(WCHAR));
+
+ //retrieve the current process full path and file name
+ //by passing a NULL module handle
+ ModuleNameLength = GetModuleFileName(
+ NULL, //a NULL handle
+ ModuleFileNameBuf,//buffer for module file name
+ MODULENAMEBUFFERSIZE);
+
+ //free the memory
+ free(ModuleFileNameBuf);
+
+ if(0 == ModuleNameLength)
+ {
+ Fail("\nFailed to all GetModuleFileName API!\n");
+ }
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/CMakeLists.txt
index 541ef8b98e..3dedba3cce 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
- testlib.c
+ test1.cpp
+ testlib.cpp
)
add_executable(paltest_getprocaddress_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/test1.c b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/test1.cpp
index f0b76c615f..f0b76c615f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/test1.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/testlib.c b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/testlib.cpp
index e8fe48e05d..e8fe48e05d 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/testlib.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test1/testlib.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/CMakeLists.txt
index 60a5ba1a6e..983c16f12f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
- testlib.c
+ test2.cpp
+ testlib.cpp
)
add_executable(paltest_getprocaddress_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/test2.c b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/test2.cpp
index 9107728423..9107728423 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/test2.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/testlib.c b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/testlib.cpp
index 23e58e871e..23e58e871e 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/testlib.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetProcAddress/test2/testlib.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/CMakeLists.txt
index 18871abf00..3e9c725f95 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetProcessHeap.c
+ GetProcessHeap.cpp
)
add_executable(paltest_getprocessheap_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/GetProcessHeap.c b/src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/GetProcessHeap.cpp
index bec6b5c616..bec6b5c616 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/GetProcessHeap.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/GetProcessHeap/test1/GetProcessHeap.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/CMakeLists.txt
index 3a64a0c58a..b9ce32b35e 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- HeapAlloc.c
+ HeapAlloc.cpp
)
add_executable(paltest_heapalloc_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/HeapAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/HeapAlloc.cpp
index 04de274e80..04de274e80 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/HeapAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test1/HeapAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/CMakeLists.txt
index 5253110d8d..1b9655ddba 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- HeapAlloc.c
+ HeapAlloc.cpp
)
add_executable(paltest_heapalloc_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/HeapAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/HeapAlloc.cpp
index 5f4ff90498..5f4ff90498 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/HeapAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test2/HeapAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/CMakeLists.txt
index f0b89461d2..1c3845c6e9 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- HeapAlloc.c
+ HeapAlloc.cpp
)
add_executable(paltest_heapalloc_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/HeapAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/HeapAlloc.cpp
index 4a74fe8194..4a74fe8194 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/HeapAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapAlloc/test3/HeapAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/CMakeLists.txt
index 898047a9ad..004912256c 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- HeapFree.c
+ HeapFree.cpp
)
add_executable(paltest_heapfree_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/HeapFree.c b/src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/HeapFree.cpp
index 37b6b3bf60..37b6b3bf60 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/HeapFree.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapFree/test1/HeapFree.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/CMakeLists.txt
index 1decb02c73..17e0127435 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_heaprealloc_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/test1.c b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/test1.c
deleted file mode 100644
index 497d208eca..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/test1.c
+++ /dev/null
@@ -1,72 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test1.c
-**
-** Purpose: Allocate some memory. Then reallocate that memory. Ensure the
-** return values are correct, and also that data placed in the allocated
-** memory carries over to the reallocated block.
-**
-**
-**============================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
- HANDLE TheHeap;
- char* TheMemory;
- char* ReAllocMemory;
- int i;
-
- if(PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- TheHeap = GetProcessHeap();
-
- if(TheHeap == NULL)
- {
- Fail("ERROR: GetProcessHeap() returned NULL when it was called. "
- "GetLastError() returned %d.",GetLastError());
- }
-
- /* Allocate 100 bytes on the heap */
- if((TheMemory = HeapAlloc(TheHeap, 0, 100)) == NULL)
- {
- Fail("ERROR: HeapAlloc returned NULL when it was called. "
- "GetLastError() returned %d.",GetLastError());
- }
-
- /* Set each byte of that memory block to 'x' */
- memset(TheMemory, 'X', 100);
-
- /* Reallocate the memory */
- ReAllocMemory = HeapReAlloc(TheHeap, 0, TheMemory, 100);
-
- if(ReAllocMemory == NULL)
- {
- Fail("ERROR: HeapReAlloc failed to reallocate the 100 bytes of "
- "heap memory. GetLastError returns %d.",GetLastError());
- }
-
- /* Check that each byte of the memory Reallocated is 'x' */
-
- for(i=0; i<100; ++i)
- {
- if(ReAllocMemory[i] != 'X')
- {
- Fail("ERROR: Byte number %d of the reallocated memory block "
- "is not set to 'X' as it should be.",i);
- }
- }
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/test1.cpp b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/test1.cpp
new file mode 100644
index 0000000000..eedd45e45d
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test1/test1.cpp
@@ -0,0 +1,72 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: test1.c
+**
+** Purpose: Allocate some memory. Then reallocate that memory. Ensure the
+** return values are correct, and also that data placed in the allocated
+** memory carries over to the reallocated block.
+**
+**
+**============================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ HANDLE TheHeap;
+ char* TheMemory;
+ char* ReAllocMemory;
+ int i;
+
+ if(PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ TheHeap = GetProcessHeap();
+
+ if(TheHeap == NULL)
+ {
+ Fail("ERROR: GetProcessHeap() returned NULL when it was called. "
+ "GetLastError() returned %d.",GetLastError());
+ }
+
+ /* Allocate 100 bytes on the heap */
+ if((TheMemory = (char*)HeapAlloc(TheHeap, 0, 100)) == NULL)
+ {
+ Fail("ERROR: HeapAlloc returned NULL when it was called. "
+ "GetLastError() returned %d.",GetLastError());
+ }
+
+ /* Set each byte of that memory block to 'x' */
+ memset(TheMemory, 'X', 100);
+
+ /* Reallocate the memory */
+ ReAllocMemory = (char*)HeapReAlloc(TheHeap, 0, TheMemory, 100);
+
+ if(ReAllocMemory == NULL)
+ {
+ Fail("ERROR: HeapReAlloc failed to reallocate the 100 bytes of "
+ "heap memory. GetLastError returns %d.",GetLastError());
+ }
+
+ /* Check that each byte of the memory Reallocated is 'x' */
+
+ for(i=0; i<100; ++i)
+ {
+ if(ReAllocMemory[i] != 'X')
+ {
+ Fail("ERROR: Byte number %d of the reallocated memory block "
+ "is not set to 'X' as it should be.",i);
+ }
+ }
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/CMakeLists.txt
index 6f5510387a..a9239354ba 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_heaprealloc_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/test2.c b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/test2.c
deleted file mode 100644
index 13e789f901..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/test2.c
+++ /dev/null
@@ -1,79 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test2.c
-**
-** Purpose: Allocate some memory. Then reallocate that memory into less
-** space than the original amount. Ensure the
-** return values are correct, and also that data placed in the allocated
-** memory carries over to the reallocated block.
-**
-**
-**============================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
- HANDLE TheHeap;
- char* TheMemory;
- char* ReAllocMemory;
- int i;
-
- if(PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- TheHeap = GetProcessHeap();
-
- if(TheHeap == NULL)
- {
- Fail("ERROR: GetProcessHeap() returned NULL when it was called. "
- "GetLastError() returned %d.",GetLastError());
- }
-
- /* Allocate 200 bytes on the heap */
- if((TheMemory = HeapAlloc(TheHeap, 0, 200)) == NULL)
- {
- Fail("ERROR: HeapAlloc returned NULL when it was called. "
- "GetLastError() returned %d.",GetLastError());
- }
-
- /* Set the first 100 bytes to 'X' */
- memset(TheMemory, 'X', 100);
-
- /* Set the second 100 bytes to 'Z' */
- memset(TheMemory+100, 'Z', 100);
-
- /* Reallocate the memory to 100 bytes */
- ReAllocMemory = HeapReAlloc(TheHeap, 0, TheMemory, 100);
-
- if(ReAllocMemory == NULL)
- {
- Fail("ERROR: HeapReAlloc failed to reallocate the 100 bytes of "
- "heap memory. GetLastError returns %d.",GetLastError());
- }
-
- /* Check that each of the first 100 bytes hasn't lost any data.
- Anything beyond the first 100 might still be valid, but we can't
- gaurentee it.
- */
-
- for(i=0; i<100; ++i)
- {
- /* Note: Cast to char* so the function knows the size is 1 */
- if(ReAllocMemory[i] != 'X')
- {
- Fail("ERROR: Byte number %d of the reallocated memory block "
- "is not set to 'X' as it should be.",i);
- }
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/test2.cpp b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/test2.cpp
new file mode 100644
index 0000000000..a7e3b2a055
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test2/test2.cpp
@@ -0,0 +1,79 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: test2.c
+**
+** Purpose: Allocate some memory. Then reallocate that memory into less
+** space than the original amount. Ensure the
+** return values are correct, and also that data placed in the allocated
+** memory carries over to the reallocated block.
+**
+**
+**============================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ HANDLE TheHeap;
+ char* TheMemory;
+ char* ReAllocMemory;
+ int i;
+
+ if(PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ TheHeap = GetProcessHeap();
+
+ if(TheHeap == NULL)
+ {
+ Fail("ERROR: GetProcessHeap() returned NULL when it was called. "
+ "GetLastError() returned %d.",GetLastError());
+ }
+
+ /* Allocate 200 bytes on the heap */
+ if((TheMemory = (char*)HeapAlloc(TheHeap, 0, 200)) == NULL)
+ {
+ Fail("ERROR: HeapAlloc returned NULL when it was called. "
+ "GetLastError() returned %d.",GetLastError());
+ }
+
+ /* Set the first 100 bytes to 'X' */
+ memset(TheMemory, 'X', 100);
+
+ /* Set the second 100 bytes to 'Z' */
+ memset(TheMemory+100, 'Z', 100);
+
+ /* Reallocate the memory to 100 bytes */
+ ReAllocMemory = (char*)HeapReAlloc(TheHeap, 0, TheMemory, 100);
+
+ if(ReAllocMemory == NULL)
+ {
+ Fail("ERROR: HeapReAlloc failed to reallocate the 100 bytes of "
+ "heap memory. GetLastError returns %d.",GetLastError());
+ }
+
+ /* Check that each of the first 100 bytes hasn't lost any data.
+ Anything beyond the first 100 might still be valid, but we can't
+ gaurentee it.
+ */
+
+ for(i=0; i<100; ++i)
+ {
+ /* Note: Cast to char* so the function knows the size is 1 */
+ if(ReAllocMemory[i] != 'X')
+ {
+ Fail("ERROR: Byte number %d of the reallocated memory block "
+ "is not set to 'X' as it should be.",i);
+ }
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/CMakeLists.txt
index 7ad836706a..2d82b6efdd 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_heaprealloc_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/test3.c b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/test3.c
deleted file mode 100644
index dea9de348d..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/test3.c
+++ /dev/null
@@ -1,78 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test3.c
-**
-** Purpose: Allocate some memory. Then reallocate that memory into a
-** bigger space on the heap. Check that the first portion of the data is
-** unchanged. Then set the new portion to a value, to ensure that it is
-** properly writable memory.
-**
-**
-**============================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
- HANDLE TheHeap;
- char* TheMemory;
- char* ReAllocMemory;
- int i;
-
- if(PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- TheHeap = GetProcessHeap();
-
- if(TheHeap == NULL)
- {
- Fail("ERROR: GetProcessHeap() returned NULL when it was called. "
- "GetLastError() returned %d.",GetLastError());
- }
-
- /* Allocate 100 bytes on the heap */
- if((TheMemory = HeapAlloc(TheHeap, 0, 100)) == NULL)
- {
- Fail("ERROR: HeapAlloc returned NULL when it was called. "
- "GetLastError() returned %d.",GetLastError());
- }
-
- /* Set the first 100 bytes to 'X' */
- memset(TheMemory, 'X', 100);
-
- /* Reallocate the memory to 200 bytes */
- ReAllocMemory = HeapReAlloc(TheHeap, 0, TheMemory, 200);
-
- if(ReAllocMemory == NULL)
- {
- Fail("ERROR: HeapReAlloc failed to reallocate the 100 bytes of "
- "heap memory. GetLastError returns %d.",GetLastError());
- }
-
- /* Check that each of the first 100 bytes hasn't lost any data. */
- for(i=0; i<100; ++i)
- {
-
- if(ReAllocMemory[i] != 'X')
- {
- Fail("ERROR: Byte number %d of the reallocated memory block "
- "is not set to 'X' as it should be.",i);
- }
- }
-
- /* Beyond the first 100 bytes is valid free memory. We'll set all this
- memory to a value -- though, even if HeapReAlloc didn't work, it might
- still be possible to memset this memory without raising an exception.
- */
- memset(ReAllocMemory+100, 'Z', 100);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/test3.cpp b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/test3.cpp
new file mode 100644
index 0000000000..d4139e8d5e
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test3/test3.cpp
@@ -0,0 +1,78 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: test3.c
+**
+** Purpose: Allocate some memory. Then reallocate that memory into a
+** bigger space on the heap. Check that the first portion of the data is
+** unchanged. Then set the new portion to a value, to ensure that it is
+** properly writable memory.
+**
+**
+**============================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ HANDLE TheHeap;
+ char* TheMemory;
+ char* ReAllocMemory;
+ int i;
+
+ if(PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ TheHeap = GetProcessHeap();
+
+ if(TheHeap == NULL)
+ {
+ Fail("ERROR: GetProcessHeap() returned NULL when it was called. "
+ "GetLastError() returned %d.",GetLastError());
+ }
+
+ /* Allocate 100 bytes on the heap */
+ if((TheMemory = (char*)HeapAlloc(TheHeap, 0, 100)) == NULL)
+ {
+ Fail("ERROR: HeapAlloc returned NULL when it was called. "
+ "GetLastError() returned %d.",GetLastError());
+ }
+
+ /* Set the first 100 bytes to 'X' */
+ memset(TheMemory, 'X', 100);
+
+ /* Reallocate the memory to 200 bytes */
+ ReAllocMemory = (char*)HeapReAlloc(TheHeap, 0, TheMemory, 200);
+
+ if(ReAllocMemory == NULL)
+ {
+ Fail("ERROR: HeapReAlloc failed to reallocate the 100 bytes of "
+ "heap memory. GetLastError returns %d.",GetLastError());
+ }
+
+ /* Check that each of the first 100 bytes hasn't lost any data. */
+ for(i=0; i<100; ++i)
+ {
+
+ if(ReAllocMemory[i] != 'X')
+ {
+ Fail("ERROR: Byte number %d of the reallocated memory block "
+ "is not set to 'X' as it should be.",i);
+ }
+ }
+
+ /* Beyond the first 100 bytes is valid free memory. We'll set all this
+ memory to a value -- though, even if HeapReAlloc didn't work, it might
+ still be possible to memset this memory without raising an exception.
+ */
+ memset(ReAllocMemory+100, 'Z', 100);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/CMakeLists.txt
index 024a4ef840..129d8a47cd 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_heaprealloc_test4
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/test4.c b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/test4.cpp
index cebf904501..cebf904501 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/test4.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/CMakeLists.txt
index 3ab3ec16e8..ed3d390625 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_heaprealloc_test5
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/test5.c b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/test5.c
deleted file mode 100644
index 230e65e492..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/test5.c
+++ /dev/null
@@ -1,69 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test5.c
-**
-** Purpose: Allocate some memory. Then call HeapRealloc with 0 as the
-** amount of memory to reallocate. This should work, essentially freeing
-** the memory (though we can't verfiy this)
-**
-**
-**============================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
- HANDLE TheHeap;
- char* TheMemory;
- char* ReAllocMemory;
- char* ReAllocMemory2;
-
- if(PAL_Initialize(argc, argv) != 0)
- {
- return FAIL;
- }
-
- TheHeap = GetProcessHeap();
-
- if(TheHeap == NULL)
- {
- Fail("ERROR: GetProcessHeap() returned NULL when it was called. "
- "GetLastError() returned %d.",GetLastError());
- }
-
- /* Allocate 100 bytes on the heap */
- if((TheMemory = HeapAlloc(TheHeap, 0, 100)) == NULL)
- {
- Fail("ERROR: HeapAlloc returned NULL when it was called. "
- "GetLastError() returned %d.",GetLastError());
- }
-
- /* Set each byte of that memory block to 'x' */
- memset(TheMemory, 'X', 100);
-
- /* Reallocate the memory into 0 bytes */
- ReAllocMemory = HeapReAlloc(TheHeap, 0, TheMemory, 0);
-
- if(ReAllocMemory == NULL)
- {
- Fail("ERROR: HeapReAlloc failed to reallocate the 100 bytes of "
- "heap memory. GetLastError returns %d.",GetLastError());
- }
-
- /* Reallocate the memory we just put into 0 bytes, into 100 bytes. */
- ReAllocMemory2 = HeapReAlloc(TheHeap, 0, ReAllocMemory, 100);
-
- if(ReAllocMemory2 == NULL)
- {
- Fail("ERROR: HeapReAlloc failed to reallocate the 0 bytes of "
- "heap memory into 100. GetLastError returns %d.",GetLastError());
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/test5.cpp b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/test5.cpp
new file mode 100644
index 0000000000..fcd38376ec
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/HeapReAlloc/test5/test5.cpp
@@ -0,0 +1,69 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: test5.c
+**
+** Purpose: Allocate some memory. Then call HeapRealloc with 0 as the
+** amount of memory to reallocate. This should work, essentially freeing
+** the memory (though we can't verfiy this)
+**
+**
+**============================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ HANDLE TheHeap;
+ char* TheMemory;
+ char* ReAllocMemory;
+ char* ReAllocMemory2;
+
+ if(PAL_Initialize(argc, argv) != 0)
+ {
+ return FAIL;
+ }
+
+ TheHeap = GetProcessHeap();
+
+ if(TheHeap == NULL)
+ {
+ Fail("ERROR: GetProcessHeap() returned NULL when it was called. "
+ "GetLastError() returned %d.",GetLastError());
+ }
+
+ /* Allocate 100 bytes on the heap */
+ if((TheMemory = (char*)HeapAlloc(TheHeap, 0, 100)) == NULL)
+ {
+ Fail("ERROR: HeapAlloc returned NULL when it was called. "
+ "GetLastError() returned %d.",GetLastError());
+ }
+
+ /* Set each byte of that memory block to 'x' */
+ memset(TheMemory, 'X', 100);
+
+ /* Reallocate the memory into 0 bytes */
+ ReAllocMemory = (char*)HeapReAlloc(TheHeap, 0, TheMemory, 0);
+
+ if(ReAllocMemory == NULL)
+ {
+ Fail("ERROR: HeapReAlloc failed to reallocate the 100 bytes of "
+ "heap memory. GetLastError returns %d.",GetLastError());
+ }
+
+ /* Reallocate the memory we just put into 0 bytes, into 100 bytes. */
+ ReAllocMemory2 = (char*)HeapReAlloc(TheHeap, 0, ReAllocMemory, 100);
+
+ if(ReAllocMemory2 == NULL)
+ {
+ Fail("ERROR: HeapReAlloc failed to reallocate the 0 bytes of "
+ "heap memory into 100. GetLastError returns %d.",GetLastError());
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/CMakeLists.txt
index c96e00a170..f74e442d76 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- LocalAlloc.c
+ LocalAlloc.cpp
)
add_executable(paltest_localalloc_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/LocalAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/LocalAlloc.cpp
index 17afbc6020..17afbc6020 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/LocalAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LocalAlloc/test1/LocalAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/CMakeLists.txt
index 47ad76ebe6..d92939c7cc 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- LocalFree.c
+ LocalFree.cpp
)
add_executable(paltest_localfree_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/LocalFree.c b/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/LocalFree.cpp
index d9c062e761..d9c062e761 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/LocalFree.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test1/LocalFree.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/CMakeLists.txt
index ac7a11a05f..e087b08ad7 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- LocalFree.c
+ LocalFree.cpp
)
add_executable(paltest_localfree_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/LocalFree.c b/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/LocalFree.cpp
index 4d4567dc3f..4d4567dc3f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/LocalFree.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LocalFree/test2/LocalFree.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/CMakeLists.txt
index 0af09480ef..1d08065b2a 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_lockfile_test1
@@ -20,7 +20,7 @@ target_link_libraries(paltest_lockfile_test1
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_lockfile_test1_helper
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/helper.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/helper.cpp
index 05b4b8451a..05b4b8451a 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/helper.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/helper.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/test1.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/test1.cpp
index cee223ef81..cee223ef81 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/test1.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/CMakeLists.txt
index 157c517e62..ca5e5faed4 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_lockfile_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/test2.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/test2.cpp
index 8aef130ef4..8aef130ef4 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/test2.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/CMakeLists.txt
index 69516de69b..117c715084 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_lockfile_test3
@@ -20,7 +20,7 @@ target_link_libraries(paltest_lockfile_test3
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_lockfile_test3_helper
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/helper.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/helper.cpp
index 079417fce8..079417fce8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/helper.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/helper.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/test3.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/test3.cpp
index 78662c5685..78662c5685 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/test3.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/CMakeLists.txt
index fb8f6745d4..aee1b1a0be 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_lockfile_test4
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/test4.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/test4.cpp
index f5cd359fb5..f5cd359fb5 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/test4.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/CMakeLists.txt
index cc4548a6f0..70e3db4561 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_lockfile_test5
@@ -20,7 +20,7 @@ target_link_libraries(paltest_lockfile_test5
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_lockfile_test5_helper
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/helper.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/helper.cpp
index 1fc9b1a9a5..1fc9b1a9a5 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/helper.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/helper.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/test5.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/test5.cpp
index a02a3c5a49..a02a3c5a49 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/test5.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/CMakeLists.txt
index 5049977582..255ecbcc8d 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_lockfile_test6
@@ -20,7 +20,7 @@ target_link_libraries(paltest_lockfile_test6
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_lockfile_test6_helper
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/helper.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/helper.cpp
index 98112fc4a5..98112fc4a5 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/helper.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/helper.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/test6.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/test6.cpp
index ba01b9710a..ba01b9710a 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/test6.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/CMakeLists.txt
index e8434cc787..68a5b9f659 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_lockfile_test7
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/test7.c b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/test7.cpp
index c572a6e653..c572a6e653 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/test7.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/LockFile/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/CMakeLists.txt
index ef9838d41e..01679e5387 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- MapViewOfFile.c
+ MapViewOfFile.cpp
)
add_executable(paltest_mapviewoffile_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.c b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp
index 6177e0decf..6177e0decf 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test1/MapViewOfFile.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/CMakeLists.txt
index 18a9d105b1..88f3344567 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- MapViewOfFile.c
+ MapViewOfFile.cpp
)
add_executable(paltest_mapviewoffile_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.c b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.cpp
index c08f585c0e..c08f585c0e 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test2/MapViewOfFile.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/CMakeLists.txt
index 76bd3276a4..e48ce13408 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- MapViewOfFile.c
+ MapViewOfFile.cpp
)
add_executable(paltest_mapviewoffile_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.c b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.cpp
index 63bee768f9..63bee768f9 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test3/MapViewOfFile.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/CMakeLists.txt
index 52381c510f..7f6d905212 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- mapviewoffile.c
+ mapviewoffile.cpp
)
add_executable(paltest_mapviewoffile_test4
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.c b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.cpp
index 7f3252144b..7f3252144b 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test4/mapviewoffile.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/CMakeLists.txt
index f98a4b7779..3911ffa53c 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- mapviewoffile.c
+ mapviewoffile.cpp
)
add_executable(paltest_mapviewoffile_test5
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.c b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.cpp
index 219b3fa12a..219b3fa12a 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test5/mapviewoffile.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/CMakeLists.txt
index dad03aaf80..8199981eec 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- mapviewoffile.c
+ mapviewoffile.cpp
)
add_executable(paltest_mapviewoffile_test6
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.c b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.cpp
index f7d7302a4c..f7d7302a4c 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/MapViewOfFile/test6/mapviewoffile.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/CMakeLists.txt
index b286924864..e4d87d5e0f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- OpenFileMappingA.c
+ OpenFileMappingA.cpp
)
add_executable(paltest_openfilemappinga_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/OpenFileMappingA.c b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/OpenFileMappingA.cpp
index 9087285112..9087285112 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/OpenFileMappingA.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test1/OpenFileMappingA.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/CMakeLists.txt
index 3a0eff04a7..670346fe3b 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- OpenFileMappingA.c
+ OpenFileMappingA.cpp
)
add_executable(paltest_openfilemappinga_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/OpenFileMappingA.c b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/OpenFileMappingA.cpp
index 5e41a92024..5e41a92024 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/OpenFileMappingA.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test2/OpenFileMappingA.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/CMakeLists.txt
index 599a09ffc7..dab27b5c74 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- OpenFileMappingA.c
+ OpenFileMappingA.cpp
)
add_executable(paltest_openfilemappinga_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/OpenFileMappingA.c b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/OpenFileMappingA.cpp
index b01a3e8c0b..b01a3e8c0b 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/OpenFileMappingA.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingA/test3/OpenFileMappingA.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/CMakeLists.txt
index 04e9e47ef0..b2f4494ad8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- OpenFileMappingW.c
+ OpenFileMappingW.cpp
)
add_executable(paltest_openfilemappingw_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.c b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.cpp
index 079af4a5c0..079af4a5c0 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test1/OpenFileMappingW.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/CMakeLists.txt
index 22e960b788..655fa753f2 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- OpenFileMappingW.c
+ OpenFileMappingW.cpp
)
add_executable(paltest_openfilemappingw_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.c b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.cpp
index e6a69651fa..e6a69651fa 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test2/OpenFileMappingW.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/CMakeLists.txt
index 5a54368110..a7039a1c73 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- OpenFileMappingW.c
+ OpenFileMappingW.cpp
)
add_executable(paltest_openfilemappingw_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.c b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.cpp
index 9c83491f6b..9c83491f6b 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/OpenFileMappingW/test3/OpenFileMappingW.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/CMakeLists.txt
new file mode 100644
index 0000000000..c6eddf74e8
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+add_subdirectory(ProbeMemory_neg1)
+add_subdirectory(test1)
+
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/CMakeLists.txt
new file mode 100644
index 0000000000..e96c92e2ae
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ ProbeMemory_neg.cpp
+)
+
+add_executable(paltest_probememory_probememory_neg1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_probememory_probememory_neg1 coreclrpal)
+
+target_link_libraries(paltest_probememory_probememory_neg1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/ProbeMemory_neg.cpp b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/ProbeMemory_neg.cpp
new file mode 100644
index 0000000000..80de809e14
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/ProbeMemory_neg.cpp
@@ -0,0 +1,95 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: ReadProcessMemory_neg.c
+**
+** Purpose: Negative test the ReadProcessMemory API.
+** Call ReadProcessMemory to read unreadabel memory area
+**
+**
+**============================================================*/
+#include <palsuite.h>
+
+#define REGIONSIZE 1024
+
+int __cdecl main(int argc, char *argv[])
+{
+ int err;
+ BOOL bResult;
+ LPVOID lpProcessAddress = NULL;
+
+ /*Initialize the PAL environment*/
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ /*allocate the virtual memory*/
+ lpProcessAddress = VirtualAlloc(
+ NULL, /*system determine where to allocate the region*/
+ REGIONSIZE, /*specify the size*/
+ MEM_RESERVE, /*allocation type*/
+ PAGE_READONLY); /*access protection*/
+
+ if(NULL == lpProcessAddress)
+ {
+ Fail("\nFailed to call VirtualAlloc API to allocate "
+ "virtual memory, error code=%u\n", GetLastError());
+ }
+
+ /*try to probe the unreadable memory area*/
+ bResult = PAL_ProbeMemory(
+ lpProcessAddress, /*base of memory area*/
+ REGIONSIZE, /*buffer length in bytes*/
+ FALSE); /*read access*/
+
+ /*check the return value*/
+ if(bResult)
+ {
+ Trace("\nProbeMemory for read didn't FAILED\n");
+
+ /*decommit the specified region*/
+ err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
+ if(0 == err)
+ {
+ Fail("\nFailed to call VirtualFree API, error code=%u\n", GetLastError());
+ }
+
+ Fail("");
+ }
+
+ /*try to probe the unwriteable memory area*/
+ bResult = PAL_ProbeMemory(
+ lpProcessAddress, /*base of memory area*/
+ REGIONSIZE, /*buffer length in bytes*/
+ FALSE); /*write access */
+
+ /*check the return value*/
+ if(bResult)
+ {
+ Trace("\nProbeMemory for write didn't FAILED\n");
+
+ /*decommit the specified region*/
+ err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
+ if(0 == err)
+ {
+ Fail("\nFailed to call VirtualFree API, error code=%u\n", GetLastError());
+ }
+
+ Fail("");
+ }
+
+ /*decommit the specified region*/
+ err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
+ if(0 == err)
+ {
+ Fail("\nFailed to call VirtualFree API, error code=%u\n", GetLastError());
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/testinfo.dat b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/testinfo.dat
new file mode 100644
index 0000000000..4d11a71bdb
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = Filemapping_memmgt
+Function = PAL_ProbeMemory
+Name = Negative test PAL_ProbeMemory API to read unreadable memory area
+TYPE = DEFAULT
+EXE1 = probememory_neg
+Description
+=Test the PAL_ProbeMemory to read unreadable memory area
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/CMakeLists.txt
new file mode 100644
index 0000000000..739ba62284
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ ProbeMemory.cpp
+)
+
+add_executable(paltest_probememory_test1
+ ${SOURCES}
+)
+
+add_dependencies(paltest_probememory_test1 coreclrpal)
+
+target_link_libraries(paltest_probememory_test1
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/ProbeMemory.cpp b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/ProbeMemory.cpp
new file mode 100644
index 0000000000..30b358d315
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/ProbeMemory.cpp
@@ -0,0 +1,94 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: ReadProcessMemory.c
+**
+** Purpose: Positive test the ReadProcessMemory API.
+** Call ReadProcessMemory to read memory contents
+** inside current process.
+**
+**
+**============================================================*/
+#include <palsuite.h>
+
+#define REGIONSIZE 1024
+
+int __cdecl main(int argc, char *argv[])
+{
+ int err;
+ BOOL bResult;
+ LPVOID lpProcessAddress = NULL;
+
+ /*Initialize the PAL environment*/
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ /*allocate the virtual memory*/
+ lpProcessAddress = VirtualAlloc(
+ NULL, /*system determine where to allocate the region*/
+ REGIONSIZE, /*specify the size*/
+ MEM_COMMIT, /*allocation type*/
+ PAGE_READWRITE); /*access protection*/
+
+ if(NULL == lpProcessAddress)
+ {
+ Fail("\nFailed to call VirtualAlloc API to allocate "
+ "virtual memory, error code=%u!\n", GetLastError());
+ }
+
+ /*probe the memory for read*/
+ bResult = PAL_ProbeMemory(
+ lpProcessAddress, /*base of memory area*/
+ REGIONSIZE, /*buffer length in bytes*/
+ FALSE); /*read access*/
+
+ if(!bResult)
+ {
+ Trace("\nProbeMemory for read access FAILED\n");
+
+ /*decommit the specified region*/
+ err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
+ if(0 == err)
+ {
+ Fail("\nFailed to call VirtualFree API, error code=%u\n", GetLastError());
+ }
+
+ Fail("");
+ }
+
+ /*probe the memory for write */
+ bResult = PAL_ProbeMemory(
+ lpProcessAddress, /*base of memory area*/
+ REGIONSIZE, /*buffer length in bytes*/
+ TRUE); /*write access*/
+
+ if(!bResult)
+ {
+ Trace("\nProbeMemory for write access FAILED\n");
+
+ /*decommit the specified region*/
+ err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
+ if(0 == err)
+ {
+ Fail("\nFailed to call VirtualFree API, error code=%u\n", GetLastError());
+ }
+
+ Fail("");
+ }
+
+ /*decommit the specified region*/
+ err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
+ if(0 == err)
+ {
+ Fail("\nFailed to call VirtualFree API, error code=%u\n", GetLastError());
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/testinfo.dat b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/testinfo.dat
new file mode 100644
index 0000000000..512b945c4a
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/ProbeMemory/test1/testinfo.dat
@@ -0,0 +1,12 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = Filemapping_memmgt
+Function = PAL_ProbeMemory
+Name = Positive test for PAL_ProbeMemory API to probe for read/write
+TYPE = DEFAULT
+EXE1 = probememory
+Description
+=Test the PAL_ProbeMemory to probe for read and write
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/CMakeLists.txt
deleted file mode 100644
index d2ae61f923..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(ReadProcessMemory_neg1)
-add_subdirectory(test1)
-add_subdirectory(test2)
-
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/CMakeLists.txt
deleted file mode 100644
index 400c9219f6..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- ReadProcessMemory_neg.c
-)
-
-add_executable(paltest_readprocessmemory_readprocessmemory_neg1
- ${SOURCES}
-)
-
-add_dependencies(paltest_readprocessmemory_readprocessmemory_neg1 coreclrpal)
-
-target_link_libraries(paltest_readprocessmemory_readprocessmemory_neg1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/ReadProcessMemory_neg.c b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/ReadProcessMemory_neg.c
deleted file mode 100644
index aecd5ad576..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/ReadProcessMemory_neg.c
+++ /dev/null
@@ -1,127 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: ReadProcessMemory_neg.c
-**
-** Purpose: Negative test the ReadProcessMemory API.
-** Call ReadProcessMemory to read unreadabel memory area
-**
-**
-**============================================================*/
-#include <palsuite.h>
-
-#define REGIONSIZE 1024
-
-int __cdecl main(int argc, char *argv[])
-{
- int err;
- BOOL bResult;
- HANDLE ProcessHandle;
- DWORD ProcessID;
- LPVOID lpProcessAddress = NULL;
- char ProcessBuffer[REGIONSIZE];
- ULONG_PTR size = 0;
-
-
- /*Initialize the PAL environment*/
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- /*retrieve the current process ID*/
- ProcessID = GetCurrentProcessId();
-
- /*retrieve the current process handle*/
- ProcessHandle = OpenProcess(
- PROCESS_ALL_ACCESS,
- FALSE, /*not inherited*/
- ProcessID);
-
- if(NULL == ProcessHandle)
- {
- Fail("\nFailed to call OpenProcess API to retrieve "
- "current process handle error code=%u\n",
- GetLastError());
- }
-
-
-
- /*allocate the virtual memory*/
- lpProcessAddress = VirtualAlloc(
- NULL, /*system determine where to allocate the region*/
- REGIONSIZE, /*specify the size*/
- MEM_RESERVE, /*allocation type*/
- PAGE_READONLY); /*access protection*/
-
- if(NULL == lpProcessAddress)
- {
- Fail("\nFailed to call VirtualAlloc API to allocate "
- "virtual memory, error code=%u\n", GetLastError());
- }
-
- /*zero the memory*/
- memset(ProcessBuffer, 0, REGIONSIZE);
- /*try to retrieve the unreadable memory area*/
- bResult = ReadProcessMemory(
- ProcessHandle, /*current process handle*/
- lpProcessAddress, /*base of memory area*/
- (LPVOID)ProcessBuffer,
- REGIONSIZE, /*buffer length in bytes*/
- &size);
-
-
- /*check the return value*/
- if(0 != bResult)
- {
- Trace("\nFailed to call ReadProcessMemory API for a negative test, "
- "Try to read an unreadable memory area will cause fail "
- "but it successes\n");
-
- err = CloseHandle(ProcessHandle);
- if(0 == err)
- {
- Trace("\nFailed to call CloseHandle API, error code=%u\n",
- GetLastError());
- }
-
- /*decommit the specified region*/
- err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
- if(0 == err)
- {
- Trace("\nFailed to call VirtualFree API, error code=%u\n",
- GetLastError());
- }
- Fail("");
- }
-
- err = CloseHandle(ProcessHandle);
- if(0 == err)
- {
- Trace("\nFailed to call CloseHandle API, error code = %u\n",
- GetLastError());
-
- err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
- if(0 == err)
- {
- Trace("\nFailed to call VirtualFree API, error code=%u\n",
- GetLastError());
- }
-
- Fail("");
- }
- /*decommit the specified region*/
- err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
- if(0 == err)
- {
- Fail("\nFailed to call VirtualFree API, error code=%u\n",
- GetLastError());
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/testinfo.dat b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/testinfo.dat
deleted file mode 100644
index 08c8f3291d..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/ReadProcessMemory_neg1/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Filemapping_memmgt
-Function = ReadProcessMemory
-Name = Negative test ReadProcessMemory API to read unreadable memory area
-TYPE = DEFAULT
-EXE1 = readprocessmemory_neg
-Description
-=Test the ReadProcessMemory to read unreadable memory area
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/CMakeLists.txt
deleted file mode 100644
index 8c21f01562..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- ReadProcessMemory.c
-)
-
-add_executable(paltest_readprocessmemory_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_readprocessmemory_test1 coreclrpal)
-
-target_link_libraries(paltest_readprocessmemory_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/ReadProcessMemory.c b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/ReadProcessMemory.c
deleted file mode 100644
index c9475f13f1..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/ReadProcessMemory.c
+++ /dev/null
@@ -1,126 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: ReadProcessMemory.c
-**
-** Purpose: Positive test the ReadProcessMemory API.
-** Call ReadProcessMemory to read memory contents
-** inside current process.
-**
-**
-**============================================================*/
-#include <palsuite.h>
-
-#define REGIONSIZE 1024
-
-int __cdecl main(int argc, char *argv[])
-{
- int err;
- BOOL bResult;
- HANDLE ProcessHandle;
- DWORD ProcessID;
- LPVOID lpProcessAddress = NULL;
- char ProcessBuffer[REGIONSIZE];
- ULONG_PTR size = 0;
-
-
- /*Initialize the PAL environment*/
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- /*retrieve the current process ID*/
- ProcessID = GetCurrentProcessId();
-
- /*retrieve the current process handle*/
- ProcessHandle = OpenProcess(
- PROCESS_VM_READ,/*access flag*/
- FALSE, /*not inherited*/
- ProcessID);
-
- if(NULL == ProcessHandle)
- {
- Fail("\nFailed to call OpenProcess API to retrieve "
- "current process handle error code=%u\n",
- GetLastError());
- }
-
- /*allocate the virtual memory*/
- lpProcessAddress = VirtualAlloc(
- NULL, /*system determine where to allocate the region*/
- REGIONSIZE, /*specify the size*/
- MEM_COMMIT, /*allocation type*/
- PAGE_READONLY); /*access protection*/
-
- if(NULL == lpProcessAddress)
- {
- Fail("\nFailed to call VirtualAlloc API to allocate "
- "virtual memory, error code=%u!\n", GetLastError());
- }
-
- /*zero the memory*/
- memset(ProcessBuffer, 0, REGIONSIZE);
-
- /*retrieve the memory contents*/
- bResult = ReadProcessMemory(
- ProcessHandle, /*current process handle*/
- lpProcessAddress, /*base of memory area*/
- (LPVOID)ProcessBuffer,
- REGIONSIZE, /*buffer length in bytes*/
- &size);
-
- if(!bResult || REGIONSIZE != size)
- {
- Trace("\nFailed to call ReadProcessMemory API "
- "to retrieve the memory contents, error code=%u\n",
- GetLastError());
-
- err = CloseHandle(ProcessHandle);
- if(0 == err)
- {
- Trace("\nFailed to call CloseHandle API, error code=%u\n",
- GetLastError());
- }
-
- /*decommit the specified region*/
- err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
- if(0 == err)
- {
- Trace("\nFailed to call VirtualFree API, error code=%u\n",
- GetLastError());
- }
- Fail("");
- }
-
- err = CloseHandle(ProcessHandle);
- if(0 == err)
- {
- Trace("\nFailed to call CloseHandle API, error code = %u\n",
- GetLastError());
-
- err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
- if(0 == err)
- {
- Trace("\nFailed to call VirtualFree API, error code=%u\n",
- GetLastError());
- }
-
- Fail("");
- }
-
- /*decommit the specified region*/
- err = VirtualFree(lpProcessAddress, REGIONSIZE, MEM_DECOMMIT);
- if(0 == err)
- {
- Fail("\nFailed to call VirtualFree API, error code=%u\n",
- GetLastError());
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/testinfo.dat b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/testinfo.dat
deleted file mode 100644
index c56920d206..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test1/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Filemapping_memmgt
-Function = ReadProcessMemory
-Name = Positive test for ReadProcessMemory API to read memory contents
-TYPE = DEFAULT
-EXE1 = readprocessmemory
-Description
-=Test the ReadProcessMemory to read the memory contents
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/CMakeLists.txt
deleted file mode 100644
index 9e0de95a0a..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(TESTSOURCES
- test2.c
-)
-
-add_executable(paltest_readprocessmemory_test2
- ${TESTSOURCES}
-)
-
-add_dependencies(paltest_readprocessmemory_test2 coreclrpal)
-
-target_link_libraries(paltest_readprocessmemory_test2
- pthread
- m
- coreclrpal
-)
-
-
-set(HELPERSOURCES
- helper.c
-)
-
-add_executable(paltest_readprocessmemory_test2_helper
- ${HELPERSOURCES}
-)
-
-add_dependencies(paltest_readprocessmemory_test2_helper coreclrpal)
-
-target_link_libraries(paltest_readprocessmemory_test2_helper
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/commonconsts.h b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/commonconsts.h
deleted file mode 100644
index 433d820f0f..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/commonconsts.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: commonconsts.h
-**
-**
-**============================================================*/
-
-#ifndef _COMMONCONSTS_H_
-#define _COMMONCONSTS_H_
-
-#include <pal.h>
-#define REGIONSIZE 1024
-
-const int TIMEOUT = 40000;
-
-const WCHAR szcToHelperEvName[] = { 'T', 'o', '\0' };
-const WCHAR szcFromHelperEvName[] = { 'F', 'r', 'o', 'm', '\0' };
-
-const char initialValue = '-';
-const char nextValue = '|';
-const char guardValue = '*';
-const char *commsFileName = "AddrNLen.dat";
-
-
-/* PEDANTIC and PEDANTIC0 is a helper macro that just grumps about any
- * zero return codes in a generic way. with little typing */
-#define PEDANTIC(function, parameters) \
-{ \
- if (! (function parameters) ) \
- { \
- Trace("%s: NonFatal failure of %s%s for reasons %u and %u\n", \
- __FILE__, #function, #parameters, GetLastError(), errno); \
- } \
-}
-#define PEDANTIC1(function, parameters) \
-{ \
- if ( (function parameters) ) \
- { \
- Trace("%s: NonFatal failure of %s%s for reasons %u and %u\n", \
- __FILE__, #function, #parameters, GetLastError(), errno); \
- } \
-}
-
-#endif
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/helper.c b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/helper.c
deleted file mode 100644
index 59e882fc1f..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/helper.c
+++ /dev/null
@@ -1,249 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: helper.c
-**
-** Purpose: This helper process sets up a several blocks of memory,
-** then uses a file to tell its parent process where that memory is
-** So it can do a WriteProcessMemory on it. When the parent process is done
-** we check here that it was written properly.
-**
-**
-**============================================================*/
-
-#include "commonconsts.h"
-
-#include <palsuite.h>
-
-#if defined(BIT64) && defined(PLATFORM_UNIX)
-#define LLFORMAT "%I64u"
-#else
-#define LLFORMAT "%u"
-#endif
-
-struct allhandles_t
-{
- HANDLE hEvToHelper;
- HANDLE hEvFromHelper;
- char *valuesFileName;
-};
-
-
-/* function: wpmDoIt
- *
- * This is a general WriteProcessMemory testing function that sets up
- * the RAM pointed to and tells the companion process on the other end
- * of the handles in 'Comms' to attempt to alter 'lenDest' bytes at
- * '*pDest'.
- *
- * '*pBuffer'[0..'lenBuffer'] is expected to be a guard region
- * surrounding the '*pDest'[0..'lenDest'] region so that this function
- * can verify that only the proper bytes were altered.
- */
-
-int wpmDoIt(struct allhandles_t Comms,
- char * pBuffer, unsigned int lenBuffer,
- char * pDest, unsigned int lenDest,
- const char* storageDescription)
-{
- char *pCurr;
- FILE *commsFile;
- DWORD dwRet;
-
- if (pBuffer > pDest || lenDest > lenBuffer)
- {
- Trace("WriteProcessMemory::DoIt() test implementation: "
- "(pBuffer > pDest || lenDest > lenBuffer)\n");
- return FALSE;
- }
-
- /* set up the storage */
- memset(pBuffer, guardValue, lenBuffer);
- memset(pDest, initialValue, lenDest);
-
- /* tell the parent what RAM to adjust */
- if(!(commsFile = fopen(Comms.valuesFileName, "w")))
- {
- Trace("WriteProcessMemory: fopen of '%S' failed (%u). \n",
- Comms.valuesFileName, GetLastError());
- return FALSE;
- }
- if (!fprintf(commsFile, LLFORMAT " " LLFORMAT " '%s'\n",
- pDest, lenDest, storageDescription))
- {
- Trace("WriteProcessMemory: fprintf to '%S' failed (%u). \n",
- Comms.valuesFileName, GetLastError());
- return FALSE;
- }
- PEDANTIC1(fclose, (commsFile));
-
- /* Tell the parent the data is ready for it to adjust */
- PEDANTIC(ResetEvent, (Comms.hEvToHelper));
- PEDANTIC(SetEvent, (Comms.hEvFromHelper));
-
- dwRet = WaitForSingleObject(Comms.hEvToHelper, TIMEOUT); /* parent is done */
- if (dwRet != WAIT_OBJECT_0)
- {
- Trace("helper WaitForSingleObjectTest: WaitForSingleObject "
- "failed (%u)\n", GetLastError());
- return FALSE;
- }
-
- /* check the stuff that SHOULD have changed */
- for (pCurr = pDest; pCurr < (pDest + lenDest); pCurr++)
- {
- if ( *pCurr != nextValue)
- {
- Trace("When testing '%s': alteration test failed "
- "at " LLFORMAT " offset " LLFORMAT " Found '%c' instead of '%c'\n.",
- storageDescription, pDest, pCurr - pDest, *pCurr, nextValue);
- Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer);
- return FALSE;
- }
- }
- /* check the stuff that should NOT have changed */
- for (pCurr = pBuffer; pCurr < pDest; pCurr++ )
- {
- if ( *pCurr != guardValue)
- {
- Trace("When testing '%s': leading guard zone test failed "
- "at " LLFORMAT " offset " LLFORMAT ". Found '%c' instead of '%c'\n.",
- storageDescription, pDest, pCurr - pBuffer, *pCurr, guardValue);
- Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer);
- return FALSE;
- }
- }
- for (pCurr = pDest + lenDest; pCurr < (pBuffer + lenBuffer); pCurr++ )
- {
- if ( *pCurr != guardValue)
- {
- Trace("When testing '%s': trailing guard zone test failed "
- "at " LLFORMAT " offset " LLFORMAT ". Found '%c' instead of '%c'\n.",
- storageDescription, pDest + lenDest, pCurr - pBuffer, *pCurr, guardValue);
- Trace(" 'Altered' string: '%.*s'\n",lenBuffer, pBuffer);
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- BOOL success = TRUE; /* assume success */
- struct allhandles_t Comms = {0,0,0} ;
-
- /* variables to track storage to alter */
- char *pTarget = NULL;
- unsigned int sizeTarget;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* hook up with the events created by the parent */
- Comms.hEvToHelper = OpenEventW(EVENT_ALL_ACCESS, 0, szcToHelperEvName);
- if (!Comms.hEvToHelper)
- {
- Fail("WriteProcessMemory: OpenEvent of '%S' failed (%u). "
- "(the event should already exist!)\n",
- szcToHelperEvName, GetLastError());
- }
- Comms.hEvFromHelper = OpenEventW(EVENT_ALL_ACCESS, 0, szcFromHelperEvName);
- if (!Comms.hEvToHelper)
- {
- Trace("WriteProcessMemory: OpenEvent of '%S' failed (%u). "
- "(the event should already exist!)\n",
- szcFromHelperEvName, GetLastError());
- success = FALSE;
- goto EXIT;
- }
- Comms.valuesFileName = argv[1];
-
- {
- char autoAllocatedOnStack[51];
-
- /* Get the parent process to write to the local stack */
- success &= wpmDoIt(Comms, autoAllocatedOnStack,
- sizeof(autoAllocatedOnStack),
- autoAllocatedOnStack + sizeof(int),
- sizeof(autoAllocatedOnStack) - 2 * sizeof(int),
- "const size array on stack with int sized guards");
- }
-
- /* Get the parent process to write to stuff on the heap */
- sizeTarget = 2 * sizeof(int) + 23 ; /* 23 is just a random prime > 16 */
- if (!(pTarget = malloc(sizeTarget)))
- {
- Trace("WriteProcessMemory helper: unable to allocate '%s'->%d bytes of memory"
- "(%u).\n",
- argv[3], sizeTarget, GetLastError());
- success = FALSE;
- goto EXIT;
-
- }
- success &= wpmDoIt(Comms, pTarget, sizeTarget,
- pTarget + sizeof(int),
- sizeTarget - 2 * sizeof(int),
- "array on heap with int sized guards");
-
- /* just to be nice try something 16 - 2 * sizeof(int) bytes long */
- {
- char autoAllocatedOnStack[16];
-
- /* Get the parent process to write to the local stack */
- success &= wpmDoIt(Comms, autoAllocatedOnStack,
- sizeof(autoAllocatedOnStack),
- autoAllocatedOnStack + sizeof(int),
- sizeof(autoAllocatedOnStack) - 2 * sizeof(int),
- "another 16 byte array on stack with int sized guards inside");
- }
-
- /* NOTE: Don't try 0 bytes long. Win32 WriteProcessMemory claims
- * it writes 8 bytes in that case! */
-
- /* and 1 byte long... */
- {
- char autoAllocatedOnStack[1+ 2 * sizeof(int)];
-
- /* Get the parent process to write to the local stack */
- success &= wpmDoIt(Comms, autoAllocatedOnStack,
- sizeof(autoAllocatedOnStack),
- autoAllocatedOnStack + sizeof(int),
- 1,
- "no bytes with int sized guards outside on stack");
- }
-
-
-EXIT:
- /* Tell the parent that we are done */
- if (!DeleteFile(Comms.valuesFileName))
- {
- Trace("helper: DeleteFile failed so parent (test1) is unlikely "
- "to exit cleanly\n");
- }
- PEDANTIC(ResetEvent, (Comms.hEvToHelper));
- if (!SetEvent(Comms.hEvFromHelper))
- {
- Trace("helper: SetEvent failed so parent (test1) is unlikely "
- "to exit cleanly\n");
- }
-
- free(pTarget);
- PEDANTIC(CloseHandle, (Comms.hEvToHelper));
- PEDANTIC(CloseHandle, (Comms.hEvFromHelper));
-
- if (!success)
- {
- Fail("");
- }
-
- PAL_Terminate();
-
- return success ? PASS : FAIL;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/test2.c b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/test2.c
deleted file mode 100644
index eda40599ce..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/test2.c
+++ /dev/null
@@ -1,258 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test2.c
-**
-** Purpose: Create a child process and some events for communications with it.
-** When the child gets back to us with a memory location and a length,
-** Call WriteProcessMemory on this location and check to see that it
-** writes successfully. Then call ReadProcessMemory to check if the
-** contents read are same as those written
-**
-**
-**============================================================*/
-
-#define UNICODE
-
-#include "commonconsts.h"
-
-#include <palsuite.h>
-
-#if defined(BIT64) && defined(PLATFORM_UNIX)
-#define LLFORMAT "%I64u"
-#else
-#define LLFORMAT "%u"
-#endif
-
-int __cdecl main(int argc, char *argv[])
-{
-
- PROCESS_INFORMATION pi;
- STARTUPINFO si;
- HANDLE hEvToHelper;
- HANDLE hEvFromHelper;
- DWORD dwExitCode;
-
- DWORD dwRet;
- char cmdComposeBuf[MAX_PATH];
- PWCHAR uniString;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Create the signals we need for cross process communication */
- hEvToHelper = CreateEvent(NULL, TRUE, FALSE, szcToHelperEvName);
- if (!hEvToHelper)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "GetLastError() returned %d.\n", szcToHelperEvName,
- GetLastError());
- }
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "(already exists!)\n", szcToHelperEvName);
- }
- hEvFromHelper = CreateEvent(NULL, TRUE, FALSE, szcFromHelperEvName);
- if (!hEvToHelper)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "GetLastError() returned %d.\n", szcFromHelperEvName,
- GetLastError());
- }
- if (GetLastError() == ERROR_ALREADY_EXISTS)
- {
- Fail("WriteProcessMemory: CreateEvent of '%S' failed. "
- "(already exists!)\n", szcFromHelperEvName);
- }
- ResetEvent(hEvFromHelper);
- ResetEvent(hEvToHelper);
-
- if (!sprintf(cmdComposeBuf, "helper %s", commsFileName))
- {
- Fail("Could not convert command line\n");
- }
- uniString = convert(cmdComposeBuf);
-
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory( &pi, sizeof(pi) );
-
- /* Create a new process. This is the process that will ask for
- * memory munging */
- if(!CreateProcess( NULL, uniString, NULL, NULL,
- FALSE, 0, NULL, NULL, &si, &pi))
- {
- Trace("ERROR: CreateProcess failed to load executable '%S'. "
- "GetLastError() returned %u.\n",
- uniString, GetLastError());
- free(uniString);
- Fail("");
- }
- free(uniString);
-
-
- while(1)
- {
- FILE *commsFile;
- char* pSrcMemory;
- char* pDestMemory;
- SIZE_T Count;
- SIZE_T wpmCount;
- char incomingCMDBuffer[MAX_PATH + 1];
-
- int err;
- HANDLE readProcessHandle;
- DWORD readProcessID;
- char readProcessBuffer[REGIONSIZE]; // size 1024
- BOOL bResult;
- size_t size = 0;
-
- readProcessID = pi.dwProcessId;
-
- /* wait until the helper tells us that it has given us
- * something to do */
- dwRet = WaitForSingleObject(hEvFromHelper, TIMEOUT);
- if (dwRet != WAIT_OBJECT_0)
- {
- Trace("test1 WaitForSingleObjectTest: WaitForSingleObject "
- "failed (%u)\n", GetLastError());
- break; /* no more work incoming */
- }
-
- /* get the parameters to test WriteProcessMemory with */
- if (!(commsFile = fopen(commsFileName, "r")))
- {
- /* no file means there is no more work */
- break;
- }
- if ( NULL == fgets(incomingCMDBuffer, MAX_PATH, commsFile))
- {
- Fail ("unable to read from communication file %s "
- "for reasons %u & %u\n",
- errno, GetLastError());
- }
- PEDANTIC1(fclose,(commsFile));
- sscanf(incomingCMDBuffer, LLFORMAT " " LLFORMAT, &pDestMemory, &Count);
- if (argc > 1)
- {
- Trace("Preparing to write to " LLFORMAT " bytes @ " LLFORMAT "('%s')\n",
- Count, pDestMemory, incomingCMDBuffer);
- }
-
- /* compose some data to write to the client process */
- if (!(pSrcMemory = malloc(Count)))
- {
- Trace("could not dynamically allocate memory to copy from "
- "for reasons %u & %u\n",
- errno, GetLastError());
- goto doneIteration;
- }
- memset(pSrcMemory, nextValue, Count);
- Trace("Preparing to write to " LLFORMAT " bytes @ " LLFORMAT " ('%s')[%u]\n",
- Count, pDestMemory, incomingCMDBuffer, pSrcMemory);
-
- /* do the work */
- dwRet = WriteProcessMemory(pi.hProcess,
- pDestMemory,
- pSrcMemory,
- Count,
- &wpmCount);
-
- if (!dwRet)
- {
- Trace("%s: Problem: on a write to "LLFORMAT " bytes @ " LLFORMAT " ('%s')\n",
- argv[0], Count, pDestMemory, incomingCMDBuffer);
- Trace("test1 WriteProcessMemory returned a (!=0) (GLE=%u)\n",
- GetLastError());
- }
- if(Count != wpmCount)
- {
- Trace("%s: Problem: on a write to " LLFORMAT " bytes @ " LLFORMAT " ('%s')\n",
- argv[0], Count, pDestMemory, incomingCMDBuffer);
- Trace("The number of bytes written should have been "
- LLFORMAT ", but was reported as " LLFORMAT " \n", Count, wpmCount);
- }
-
- readProcessHandle = OpenProcess(
- PROCESS_VM_READ,
- FALSE,
- readProcessID);
-
- if(NULL == readProcessHandle)
- {
- Fail("\nFailed to call OpenProcess API to retrieve "
- "current process handle error code=%u\n",
- GetLastError());
- }
-
- /*zero the memory*/
- memset(readProcessBuffer, 0, size);
-
- /*retrieve the memory contents*/
- bResult = ReadProcessMemory(
- readProcessHandle, /*current process handle*/
- pDestMemory, /*base of memory area*/
- (LPVOID)readProcessBuffer,
- Count, /*buffer length in bytes*/
- &size);
-
-
- if( !bResult || (Count != size) )
- {
- Trace("\nFailed to call ReadProcessMemory API "
- "to retrieve the memory contents, error code=%u; Bresult[%u] Count[" LLFORMAT "], Size[%d]\n",
- GetLastError(), bResult, Count, size);
-
- err = CloseHandle(readProcessHandle);
-
- if(0 == err)
- {
- Trace("\nFailed to call CloseHandle API, error code=%u\n",
- GetLastError());
- }
- dwExitCode = FAIL;
- }
-
- if( !memcmp (pDestMemory, readProcessBuffer, Count ) )
- {
- Trace("Difference in memory contents, expected [%s], but received [%s]\n", pDestMemory, readProcessBuffer);
- dwExitCode = FAIL;
- }
-
- Trace("ReadProcessBuffer contains [%s]\n", readProcessBuffer);
- err = CloseHandle(readProcessHandle);
-
- free(pSrcMemory);
-
- doneIteration:
- PEDANTIC(ResetEvent, (hEvFromHelper));
- PEDANTIC(SetEvent, (hEvToHelper));
- }
-
- /* wait for the child process to complete */
- WaitForSingleObject ( pi.hProcess, TIMEOUT );
- /* this may return a failure code on a success path */
-
- /* check the exit code from the process */
- if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) )
- {
- Trace( "GetExitCodeProcess call failed with error code %u\n",
- GetLastError() );
- dwExitCode = FAIL;
- }
-
-
- PEDANTIC(CloseHandle, (hEvToHelper));
- PEDANTIC(CloseHandle, (hEvFromHelper));
- PEDANTIC(CloseHandle, (pi.hThread));
- PEDANTIC(CloseHandle, (pi.hProcess));
-
- PAL_TerminateEx(dwExitCode);
- return dwExitCode;
-}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/testinfo.dat b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/testinfo.dat
deleted file mode 100644
index 58a9935a08..0000000000
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/testinfo.dat
+++ /dev/null
@@ -1,18 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Debug
-Function = ReadProcessMemory
-Name = Check that writing/reading text to/from process memory succeeds.
-TYPE = DEFAULT
-EXE1 = test2
-EXE2 = helper
-Description
-= Create a child process and attempt to write to its memory
-= at the places and lengths it specifies via a data file.
-= the child verifies that all the specified memory was altered
-= with no overruns. Parent then tries to read memory from child
-= and does memory compare to ensure it read memory contents
-= correctly
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/CMakeLists.txt
index 987c413d03..8aa1c80368 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_rtlmovememory_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/test1.c b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/test1.cpp
index 7fc56510d8..7fc56510d8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/test1.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/CMakeLists.txt
index 14098a8dc1..d292cff494 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_rtlmovememory_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/test3.c b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/test3.cpp
index 279c0c1199..279c0c1199 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/test3.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/CMakeLists.txt
index 00aec7e8f7..e8aeb0c0b3 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_rtlmovememory_test4
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/test4.c b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/test4.cpp
index b6e1ecd6f7..b6e1ecd6f7 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/test4.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/CMakeLists.txt
index f2de78216e..7f4986eb27 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_rtlmovememory_test5
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/test5.c b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/test5.cpp
index affcb0abc9..affcb0abc9 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/test5.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/RtlMoveMemory/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/CMakeLists.txt
index 0e6d6fef4c..8ed46bae43 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_unlockfile_test1
@@ -20,7 +20,7 @@ target_link_libraries(paltest_unlockfile_test1
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_unlockfile_test1_helper
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/helper.c b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/helper.cpp
index c2ef5a6736..c2ef5a6736 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/helper.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/helper.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/test1.c b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/test1.cpp
index 14634c7f7a..14634c7f7a 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/test1.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/CMakeLists.txt
index 142b2763cb..3033876f80 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_unlockfile_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/test2.c b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/test2.cpp
index 22c2cce2fb..22c2cce2fb 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/test2.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/CMakeLists.txt
index b4ec37c88c..d46d7db344 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_unlockfile_test3
@@ -20,7 +20,7 @@ target_link_libraries(paltest_unlockfile_test3
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_unlockfile_test3_helper
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/helper.c b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/helper.cpp
index 650abf49ad..650abf49ad 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/helper.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/helper.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/test3.c b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/test3.cpp
index cf27aba0a3..cf27aba0a3 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/test3.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/CMakeLists.txt
index d6bee307c2..635a1ca07c 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_unlockfile_test4
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/test4.c b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/test4.cpp
index 55abcd24bc..55abcd24bc 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/test4.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnlockFile/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/CMakeLists.txt
index 5ebda77ba6..1b8062ff9c 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- UnmapViewOfFile.c
+ UnmapViewOfFile.cpp
)
add_executable(paltest_unmapviewoffile_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.c b/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.cpp
index a970ccc3b5..a970ccc3b5 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test1/UnmapViewOfFile.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/CMakeLists.txt
index 5c12cf9825..750e446a17 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- unmapviewoffile.c
+ unmapviewoffile.cpp
)
add_executable(paltest_unmapviewoffile_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.c b/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.cpp
index 2ca185d234..2ca185d234 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/UnmapViewOfFile/test2/unmapviewoffile.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/CMakeLists.txt
index eafaa66856..b2cafde93a 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/CMakeLists.txt
@@ -14,6 +14,7 @@ add_subdirectory(test19)
add_subdirectory(test2)
add_subdirectory(test20)
add_subdirectory(test21)
+add_subdirectory(test22)
add_subdirectory(test3)
add_subdirectory(test4)
add_subdirectory(test5)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/CMakeLists.txt
index 90ba41bd79..f8c0645a4b 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.cpp
index 26ee942ba1..26ee942ba1 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test1/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/CMakeLists.txt
index 51b0e1d92e..1b66f0d7cb 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test10
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.cpp
index ac06b9b5c8..ac06b9b5c8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test10/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/CMakeLists.txt
index adff47087b..95e1a06f55 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test11
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.cpp
index a3df39b634..a3df39b634 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test11/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/CMakeLists.txt
index 26f303573e..7564f960fe 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test12
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.cpp
index 8b3508635f..8b3508635f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test12/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/CMakeLists.txt
index f85cbdc694..a49dcfc81d 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test13
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.cpp
index d2109c0339..d2109c0339 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test13/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/CMakeLists.txt
index 41ed0ca208..180a48e74d 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test14
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.cpp
index 49bd21875e..49bd21875e 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test14/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/CMakeLists.txt
index 87b29108b2..4ba219472e 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test15
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.cpp
index 3cf1502f26..3cf1502f26 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test15/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/CMakeLists.txt
index 90e3f3bdb2..1c5f63dce5 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test16
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.cpp
index ce61b9aa39..ce61b9aa39 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test16/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/CMakeLists.txt
index 461b48ccc0..6523bb9292 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test17
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.cpp
index eb609f14e4..eb609f14e4 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test17/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/CMakeLists.txt
index 69823be14b..3fe65b4ac8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test18
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.cpp
index e46da851db..e46da851db 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test18/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/CMakeLists.txt
index fa65b4fa46..1795b8ba54 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test19
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.cpp
index 5cbe48b15e..5cbe48b15e 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test19/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/CMakeLists.txt
index 1753b1edc5..20da178bfc 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.cpp
index 99cf76a523..99cf76a523 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test2/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/CMakeLists.txt
index 2c55071149..5c23fe2b0d 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- virtualalloc.c
+ virtualalloc.cpp
)
add_executable(paltest_virtualalloc_test20
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/virtualalloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/virtualalloc.cpp
index 7aec3c7f55..7aec3c7f55 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/virtualalloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test20/virtualalloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/CMakeLists.txt
index f97c32af75..96a3144e8a 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- virtualalloc.c
+ virtualalloc.cpp
)
add_executable(paltest_virtualalloc_test21
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/virtualalloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/virtualalloc.cpp
index 065a2ff5c8..065a2ff5c8 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/virtualalloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test21/virtualalloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/CMakeLists.txt
new file mode 100644
index 0000000000..cdad2ca19d
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/CMakeLists.txt
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.12.2)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(SOURCES
+ VirtualAlloc.cpp
+)
+
+add_executable(paltest_virtualalloc_test22
+ ${SOURCES}
+)
+
+add_dependencies(paltest_virtualalloc_test22 coreclrpal)
+
+target_link_libraries(paltest_virtualalloc_test22
+ pthread
+ m
+ coreclrpal
+)
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/VirtualAlloc.cpp b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/VirtualAlloc.cpp
new file mode 100644
index 0000000000..489926f48d
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/VirtualAlloc.cpp
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: virtualalloc.c
+**
+** Purpose: Negative test the VirtualAlloc API.
+** Call VirtualAlloc with MEM_COMMIT allocation type
+** and PAGE_READWRITE access protection
+
+**
+**============================================================*/
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ int err;
+ LPVOID lpVirtualAddress;
+
+
+ //Initialize the PAL environment
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ ExitProcess(FAIL);
+ }
+
+ //Allocate the physical storage in memory or in the paging file on disk
+ lpVirtualAddress = VirtualAlloc(NULL,//system determine where to allocate the region
+ (SIZE_T)(2147483647000000), //specify the size to be int32.maxvalue mega bytes
+ MEM_COMMIT, //allocation type
+ PAGE_READWRITE); //access protection
+ if(NULL != lpVirtualAddress)
+ {
+ Fail("\nWelcome to the Future, where Unlimited Memory is Available, disregard this test!\n");
+ }
+
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/testinfo.dat b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/testinfo.dat
new file mode 100644
index 0000000000..3d5962c7af
--- /dev/null
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test22/testinfo.dat
@@ -0,0 +1,13 @@
+# Licensed to the .NET Foundation under one or more agreements.
+# The .NET Foundation licenses this file to you under the MIT license.
+# See the LICENSE file in the project root for more information.
+
+Version = 1.0
+Section = Filemapping_memmgt
+Function = VirtualAlloc
+Name = Negative test for VirtualAlloc API
+TYPE = DEFAULT
+EXE1 = virtualalloc
+Description
+=Test the VirtualAlloc with MEM_COMMIT allocation type
+=and PAGE_READWRITEaccess protection
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/CMakeLists.txt
index 035594bd79..77822f7862 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.cpp
index 5c57ec337f..5c57ec337f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test3/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/CMakeLists.txt
index 5ce80bf52f..0e2c448659 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test4
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.cpp
index c134a14eb1..c134a14eb1 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test4/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/CMakeLists.txt
index 138d9c9727..247053ff0f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test5
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.cpp
index 8c4f9dcdb6..8c4f9dcdb6 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test5/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/CMakeLists.txt
index c61add9db4..d19391d294 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test6
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.cpp
index e9c33d86df..e9c33d86df 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test6/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/CMakeLists.txt
index b5452a0c48..8c01e041de 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test7
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.cpp
index bee2735c9f..bee2735c9f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test7/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/CMakeLists.txt
index 584a0c505a..db2a7447be 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test8
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.cpp
index d548e0c8db..d548e0c8db 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test8/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/CMakeLists.txt
index aee950b2e4..254fc6fcf2 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualAlloc.c
+ VirtualAlloc.cpp
)
add_executable(paltest_virtualalloc_test9
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.cpp
index 2711addacc..2711addacc 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualAlloc/test9/VirtualAlloc.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/CMakeLists.txt
index 1914f76fe6..d2319506f2 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualFree.c
+ VirtualFree.cpp
)
add_executable(paltest_virtualfree_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/VirtualFree.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/VirtualFree.cpp
index 0f4f144aa5..0f4f144aa5 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/VirtualFree.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test1/VirtualFree.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/CMakeLists.txt
index a288b37154..9a3bc7ac61 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualFree.c
+ VirtualFree.cpp
)
add_executable(paltest_virtualfree_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/VirtualFree.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/VirtualFree.cpp
index 70064a3bf9..70064a3bf9 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/VirtualFree.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test2/VirtualFree.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/CMakeLists.txt
index 993189c1aa..8484c0fd94 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualFree.c
+ VirtualFree.cpp
)
add_executable(paltest_virtualfree_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/VirtualFree.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/VirtualFree.cpp
index 27f1936be7..27f1936be7 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/VirtualFree.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualFree/test3/VirtualFree.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/CMakeLists.txt
index 214cf460ae..4283398a6f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualProtect.c
+ VirtualProtect.cpp
)
add_executable(paltest_virtualprotect_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/VirtualProtect.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/VirtualProtect.cpp
index 1a28bd156d..1a28bd156d 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/VirtualProtect.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test1/VirtualProtect.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/CMakeLists.txt
index 27f43477ea..aed68fd27f 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualProtect.c
+ VirtualProtect.cpp
)
add_executable(paltest_virtualprotect_test2
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/VirtualProtect.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/VirtualProtect.cpp
index 64a08d7885..64a08d7885 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/VirtualProtect.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test2/VirtualProtect.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/CMakeLists.txt
index 994d4e2f41..70728592ad 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualProtect.c
+ VirtualProtect.cpp
)
add_executable(paltest_virtualprotect_test3
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/VirtualProtect.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/VirtualProtect.cpp
index 0f738630ee..0f738630ee 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/VirtualProtect.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test3/VirtualProtect.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/CMakeLists.txt
index 2e0fba50bb..5ad64a74eb 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualProtect.c
+ VirtualProtect.cpp
)
add_executable(paltest_virtualprotect_test4
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/VirtualProtect.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/VirtualProtect.cpp
index 926d501d0d..926d501d0d 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/VirtualProtect.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test4/VirtualProtect.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/CMakeLists.txt
index 6d6fd07df8..78932ef453 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualProtect.c
+ VirtualProtect.cpp
)
add_executable(paltest_virtualprotect_test6
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/VirtualProtect.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/VirtualProtect.cpp
index d60b323ec6..d60b323ec6 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/VirtualProtect.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test6/VirtualProtect.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/CMakeLists.txt
index 06af860559..caf5ef91f4 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualProtect.c
+ VirtualProtect.cpp
)
add_executable(paltest_virtualprotect_test7
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/VirtualProtect.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/VirtualProtect.cpp
index edc37711f4..edc37711f4 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/VirtualProtect.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualProtect/test7/VirtualProtect.cpp
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/CMakeLists.txt b/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/CMakeLists.txt
index 4f4e4bc5f0..17cbdee4a5 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- VirtualQuery.c
+ VirtualQuery.cpp
)
add_executable(paltest_virtualquery_test1
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/VirtualQuery.c b/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/VirtualQuery.cpp
index 44216ae563..44216ae563 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/VirtualQuery.c
+++ b/src/pal/tests/palsuite/filemapping_memmgt/VirtualQuery/test1/VirtualQuery.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test1/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryA/test1/CMakeLists.txt
index 542f8d3277..62b896df65 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- LoadLibraryA.c
+ LoadLibraryA.cpp
)
add_executable(paltest_loadlibrarya_test1
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test1/LoadLibraryA.c b/src/pal/tests/palsuite/loader/LoadLibraryA/test1/LoadLibraryA.cpp
index b4a8de1367..b4a8de1367 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test1/LoadLibraryA.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test1/LoadLibraryA.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test2/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryA/test2/CMakeLists.txt
index 63cfb22545..48a4c36cd0 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- LoadLibraryA.c
+ LoadLibraryA.cpp
)
add_executable(paltest_loadlibrarya_test2
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test2/LoadLibraryA.c b/src/pal/tests/palsuite/loader/LoadLibraryA/test2/LoadLibraryA.cpp
index d7cd9cb875..d7cd9cb875 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test2/LoadLibraryA.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test2/LoadLibraryA.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test2/MyModule.c b/src/pal/tests/palsuite/loader/LoadLibraryA/test2/MyModule.cpp
index 883b3fbc4a..883b3fbc4a 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test2/MyModule.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test2/MyModule.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test3/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryA/test3/CMakeLists.txt
index 143d0ec096..ae05b3560d 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- loadlibrarya.c
+ loadlibrarya.cpp
)
add_executable(paltest_loadlibrarya_test3
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test3/loadlibrarya.c b/src/pal/tests/palsuite/loader/LoadLibraryA/test3/loadlibrarya.cpp
index da38f98d04..da38f98d04 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test3/loadlibrarya.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test3/loadlibrarya.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test5/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryA/test5/CMakeLists.txt
index a9d791c916..99915eea2c 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- loadlibrarya.c
+ loadlibrarya.cpp
)
add_executable(paltest_loadlibrarya_test5
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.c b/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.c
deleted file mode 100644
index d1e6b6d1dc..0000000000
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.c
+++ /dev/null
@@ -1,67 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: loadlibrarya.c
-**
-** Purpose: Negative test the LoadLibraryA API.
-** Call LoadLibraryA by passing a module name
-** without extension but with a trailing dot.
-**
-**
-**============================================================*/
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- HMODULE ModuleHandle;
- char ModuleName[_MAX_FNAME];
- int err;
-
- /* Initialize the PAL environment */
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- memset(ModuleName, 0, _MAX_FNAME);
-
- /*Module name without extension but with a trailing dot*/
-#if WIN32
- sprintf(ModuleName, "%s", "rotor_pal.");
-#else
- /* Under FreeBSD */
- sprintf(ModuleName, "%s", "librotor_pal.");
-#endif
-
- /* load a module which does not have the file extension,
- * but has a trailing dot
- */
- ModuleHandle = LoadLibraryA(ModuleName);
- if(NULL != ModuleHandle)
- {
- Trace("Failed to call LoadLibraryA API for a negative test "
- "call LoadLibraryA with module name which does not have "
- "extension except a trailing dot, a NULL module handle is"
- "expected, but no NULL module handle is returned, "
- "error code = %u\n", GetLastError());
-
-
- /* decrement the reference count of the loaded dll */
- err = FreeLibrary(ModuleHandle);
- if(0 == err)
- {
- Trace("\nFailed to call FreeLibrary API, "
- "error code = %u\n", GetLastError());
- }
-
- Fail("");
- }
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp b/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp
new file mode 100644
index 0000000000..ab38d1a632
--- /dev/null
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp
@@ -0,0 +1,67 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: loadlibrarya.c
+**
+** Purpose: Negative test the LoadLibraryA API.
+** Call LoadLibraryA by passing a module name
+** without extension but with a trailing dot.
+**
+**
+**============================================================*/
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ HMODULE ModuleHandle;
+ char ModuleName[_MAX_FNAME];
+ int err;
+
+ /* Initialize the PAL environment */
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ memset(ModuleName, 0, _MAX_FNAME);
+
+ /*Module name without extension but with a trailing dot*/
+#if WIN32
+ sprintf_s(ModuleName, _countof(ModuleName), "%s", "rotor_pal.");
+#else
+ /* Under FreeBSD */
+ sprintf_s(ModuleName, _countof(ModuleName), "%s", "librotor_pal.");
+#endif
+
+ /* load a module which does not have the file extension,
+ * but has a trailing dot
+ */
+ ModuleHandle = LoadLibraryA(ModuleName);
+ if(NULL != ModuleHandle)
+ {
+ Trace("Failed to call LoadLibraryA API for a negative test "
+ "call LoadLibraryA with module name which does not have "
+ "extension except a trailing dot, a NULL module handle is"
+ "expected, but no NULL module handle is returned, "
+ "error code = %u\n", GetLastError());
+
+
+ /* decrement the reference count of the loaded dll */
+ err = FreeLibrary(ModuleHandle);
+ if(0 == err)
+ {
+ Trace("\nFailed to call FreeLibrary API, "
+ "error code = %u\n", GetLastError());
+ }
+
+ Fail("");
+ }
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test6/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryA/test6/CMakeLists.txt
index bb66adef77..0fac8785a8 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- loadlibrarya.c
+ loadlibrarya.cpp
)
add_executable(paltest_loadlibrarya_test6
@@ -20,7 +20,7 @@ target_link_libraries(paltest_loadlibrarya_test6
set(HELPERSOURCES
- dlltest.c
+ dlltest.cpp
)
add_executable(paltest_loadlibrarya_test6_dlltest
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test6/dlltest.c b/src/pal/tests/palsuite/loader/LoadLibraryA/test6/dlltest.cpp
index 72380eebb5..72380eebb5 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test6/dlltest.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test6/dlltest.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test6/loadlibrarya.c b/src/pal/tests/palsuite/loader/LoadLibraryA/test6/loadlibrarya.cpp
index ee825e6439..ee825e6439 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test6/loadlibrarya.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test6/loadlibrarya.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test7/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryA/test7/CMakeLists.txt
index 6c0d174600..bb403c6466 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- LoadLibraryA.c
+ LoadLibraryA.cpp
)
add_executable(paltest_loadlibrarya_test7
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test7/LoadLibraryA.c b/src/pal/tests/palsuite/loader/LoadLibraryA/test7/LoadLibraryA.cpp
index 5e6db8bb68..5e6db8bb68 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test7/LoadLibraryA.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test7/LoadLibraryA.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test8/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryA/test8/CMakeLists.txt
index b663a7b5bc..9e3449166b 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- loadlibrarya.c
+ loadlibrarya.cpp
)
add_executable(paltest_loadlibrarya_test8
@@ -20,7 +20,7 @@ target_link_libraries(paltest_loadlibrarya_test8
set(HELPERSOURCES
- dlltest.c
+ dlltest.cpp
)
add_executable(paltest_loadlibrarya_test8_dlltest
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test8/dlltest.c b/src/pal/tests/palsuite/loader/LoadLibraryA/test8/dlltest.cpp
index 72380eebb5..72380eebb5 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test8/dlltest.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test8/dlltest.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test8/loadlibrarya.c b/src/pal/tests/palsuite/loader/LoadLibraryA/test8/loadlibrarya.cpp
index 6556e9c896..6556e9c896 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test8/loadlibrarya.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test8/loadlibrarya.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test1/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryW/test1/CMakeLists.txt
index 87038012b7..171d1d59d4 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- LoadLibraryW.c
+ LoadLibraryW.cpp
)
add_executable(paltest_loadlibraryw_test1
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test1/LoadLibraryW.c b/src/pal/tests/palsuite/loader/LoadLibraryW/test1/LoadLibraryW.cpp
index 4c1a551de1..4c1a551de1 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryW/test1/LoadLibraryW.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryW/test1/LoadLibraryW.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test2/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryW/test2/CMakeLists.txt
index 5e8486d23b..9873e1332d 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- loadlibraryw.c
+ loadlibraryw.cpp
)
add_executable(paltest_loadlibraryw_test2
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test2/loadlibraryw.c b/src/pal/tests/palsuite/loader/LoadLibraryW/test2/loadlibraryw.cpp
index e8aebf77e9..e8aebf77e9 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryW/test2/loadlibraryw.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryW/test2/loadlibraryw.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test3/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryW/test3/CMakeLists.txt
index 2c96fa23da..be758643fa 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- loadlibraryw.c
+ loadlibraryw.cpp
)
add_executable(paltest_loadlibraryw_test3
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.c b/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp
index c722edaf13..c722edaf13 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.c
+++ b/src/pal/tests/palsuite/loader/LoadLibraryW/test3/loadlibraryw.cpp
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test5/CMakeLists.txt b/src/pal/tests/palsuite/loader/LoadLibraryW/test5/CMakeLists.txt
index 7b8931a961..1ca990b514 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryW/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/loader/LoadLibraryW/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- loadlibraryw.c
+ loadlibraryw.cpp
)
add_executable(paltest_loadlibraryw_test5
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.c b/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.c
deleted file mode 100644
index acaa200a06..0000000000
--- a/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.c
+++ /dev/null
@@ -1,71 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: loadlibraryw.c
-**
-** Purpose: Negative test the LoadLibraryW API.
-** Call LoadLibraryW by passing a module name
-** without extension but with a trailing dot.
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- HMODULE ModuleHandle;
- int err;
- WCHAR *lpModuleName;
- char ModuleName[_MAX_FNAME];
-
- /* Initialize the PAL environment */
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- memset(ModuleName, 0, _MAX_FNAME);
-
- /*Module name without extension but with a trailing dot*/
-#if WIN32
- sprintf(ModuleName,"%s","rotor_pal.");
-#else
- sprintf(ModuleName,"%s","librotor_pal.");
-#endif
-
- /* convert a normal string to a wide one */
- lpModuleName = convert(ModuleName);
-
- /* load a module */
- ModuleHandle = LoadLibraryW(lpModuleName);
-
- /* free the memory */
- free(lpModuleName);
-
- if(NULL != ModuleHandle)
- {
- Trace("Failed to call LoadLibraryW API for a negative test "
- "call LoadLibraryW with module name which does not have "
- "extension except a trailing dot, a NULL module handle is"
- "expected, but no NULL module handle is returned, "
- "error code = %u\n", GetLastError());
-
- /* decrement the reference count of the loaded dll */
- err = FreeLibrary(ModuleHandle);
- if(0 == err)
- {
- Trace("\nFailed to call FreeLibrary API, "
- "error code = %u\n", GetLastError());
- }
-
- Fail("");
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp b/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp
new file mode 100644
index 0000000000..6d92f029e4
--- /dev/null
+++ b/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp
@@ -0,0 +1,71 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: loadlibraryw.c
+**
+** Purpose: Negative test the LoadLibraryW API.
+** Call LoadLibraryW by passing a module name
+** without extension but with a trailing dot.
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ HMODULE ModuleHandle;
+ int err;
+ WCHAR *lpModuleName;
+ char ModuleName[_MAX_FNAME];
+
+ /* Initialize the PAL environment */
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ memset(ModuleName, 0, _MAX_FNAME);
+
+ /*Module name without extension but with a trailing dot*/
+#if WIN32
+ sprintf_s(ModuleName, _countof(ModuleName),"%s","rotor_pal.");
+#else
+ sprintf_s(ModuleName, _countof(ModuleName),"%s","librotor_pal.");
+#endif
+
+ /* convert a normal string to a wide one */
+ lpModuleName = convert(ModuleName);
+
+ /* load a module */
+ ModuleHandle = LoadLibraryW(lpModuleName);
+
+ /* free the memory */
+ free(lpModuleName);
+
+ if(NULL != ModuleHandle)
+ {
+ Trace("Failed to call LoadLibraryW API for a negative test "
+ "call LoadLibraryW with module name which does not have "
+ "extension except a trailing dot, a NULL module handle is"
+ "expected, but no NULL module handle is returned, "
+ "error code = %u\n", GetLastError());
+
+ /* decrement the reference count of the loaded dll */
+ err = FreeLibrary(ModuleHandle);
+ if(0 == err)
+ {
+ Trace("\nFailed to call FreeLibrary API, "
+ "error code = %u\n", GetLastError());
+ }
+
+ Fail("");
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/locale_info/CompareStringA/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/CompareStringA/test1/CMakeLists.txt
index 96ee18d857..171d5b77e8 100644
--- a/src/pal/tests/palsuite/locale_info/CompareStringA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/CompareStringA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_comparestringa_test1
diff --git a/src/pal/tests/palsuite/locale_info/CompareStringA/test1/test1.c b/src/pal/tests/palsuite/locale_info/CompareStringA/test1/test1.cpp
index 98c147af48..98c147af48 100644
--- a/src/pal/tests/palsuite/locale_info/CompareStringA/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/CompareStringA/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/CompareStringW/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/CompareStringW/test1/CMakeLists.txt
index 8652977387..15a7fe7685 100644
--- a/src/pal/tests/palsuite/locale_info/CompareStringW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/CompareStringW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_comparestringw_test1
diff --git a/src/pal/tests/palsuite/locale_info/CompareStringW/test1/test1.c b/src/pal/tests/palsuite/locale_info/CompareStringW/test1/test1.cpp
index bdf2c3dcf3..bdf2c3dcf3 100644
--- a/src/pal/tests/palsuite/locale_info/CompareStringW/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/CompareStringW/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetACP/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetACP/test1/CMakeLists.txt
index c5513da2c1..cf4431ea94 100644
--- a/src/pal/tests/palsuite/locale_info/GetACP/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetACP/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getacp_test1
diff --git a/src/pal/tests/palsuite/locale_info/GetACP/test1/test1.c b/src/pal/tests/palsuite/locale_info/GetACP/test1/test1.cpp
index 8ea078ee69..8ea078ee69 100644
--- a/src/pal/tests/palsuite/locale_info/GetACP/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/GetACP/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/CMakeLists.txt
index c209b121b2..b4cf017c2b 100644
--- a/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getcpinfo_test1
diff --git a/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/test1.c b/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/test1.cpp
index ed9bbf93fc..ed9bbf93fc 100644
--- a/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/GetCPInfo/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/CMakeLists.txt
index 6132e9b3fa..b366f3ce8d 100644
--- a/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_getcpinfo_test2
diff --git a/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/test2.c b/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/test2.cpp
index f52320f167..f52320f167 100644
--- a/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/test2.c
+++ b/src/pal/tests/palsuite/locale_info/GetCPInfo/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/CMakeLists.txt
index 3e4a09b51d..032dd00290 100644
--- a/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_getcpinfo_test3
diff --git a/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/test3.c b/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/test3.cpp
index aa9df935b8..aa9df935b8 100644
--- a/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/test3.c
+++ b/src/pal/tests/palsuite/locale_info/GetCPInfo/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/CMakeLists.txt
index f373b98f7c..4f685cb8a4 100644
--- a/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getlocaleinfow_test1
diff --git a/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.c b/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp
index 0994940a57..0994940a57 100644
--- a/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/CMakeLists.txt
index dd5b82ef61..7851b36b96 100644
--- a/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_getlocaleinfow_test2
diff --git a/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/test2.c b/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/test2.cpp
index f00fa79c59..f00fa79c59 100644
--- a/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/test2.c
+++ b/src/pal/tests/palsuite/locale_info/GetLocaleInfoW/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/CMakeLists.txt
index 5bb7b8c8b5..e68621681a 100644
--- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getstringtypeexw_test1
diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/test1.c b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/test1.cpp
index e15c3d66cd..e15c3d66cd 100644
--- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/CMakeLists.txt
index 4a8fab243e..e37b7495d0 100644
--- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_getstringtypeexw_test2
diff --git a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/test2.c b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/test2.cpp
index 6dca7e8ac5..6dca7e8ac5 100644
--- a/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/test2.c
+++ b/src/pal/tests/palsuite/locale_info/GetStringTypeExW/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/CMakeLists.txt
index ef87b5f87f..e34e1837e0 100644
--- a/src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getsystemdefaultlangid_test1
diff --git a/src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/test1.c b/src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/test1.cpp
index 1bc5120815..1bc5120815 100644
--- a/src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/GetSystemDefaultLangID/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/CMakeLists.txt
index 8cec9d8306..8abbd822c2 100644
--- a/src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getthreadlocale_test1
diff --git a/src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/test1.c b/src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/test1.cpp
index 8eb7252e37..8eb7252e37 100644
--- a/src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/GetThreadLocale/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/CMakeLists.txt
index 281f3bf9c3..8bf0a6ca23 100644
--- a/src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_gettimezoneinformation_test1
diff --git a/src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/test1.c b/src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/test1.cpp
index bb83ade231..bb83ade231 100644
--- a/src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/GetTimeZoneInformation/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/CMakeLists.txt
index e039d46ccd..b6f08b1f7d 100644
--- a/src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getuserdefaultlcid_test1
diff --git a/src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/test1.c b/src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/test1.cpp
index 4a336f9bb7..4a336f9bb7 100644
--- a/src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/GetUserDefaultLCID/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/CMakeLists.txt
index 71fa0464bb..8fc795a52b 100644
--- a/src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getuserdefaultlangid_test1
diff --git a/src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/test1.c b/src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/test1.cpp
index 51c5678086..51c5678086 100644
--- a/src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/GetUserDefaultLangID/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/CMakeLists.txt
index ad5ad7508d..e9b22dcfc5 100644
--- a/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isdbcsleadbyte_test1
diff --git a/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/test1.c b/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/test1.cpp
index ad326be084..ad326be084 100644
--- a/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/IsDBCSLeadByte/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/CMakeLists.txt
index 9d53ee9b3b..f3a232b143 100644
--- a/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isdbcsleadbyteex_test1
diff --git a/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/test1.c b/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/test1.cpp
index 9466f4817f..9466f4817f 100644
--- a/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/IsDBCSLeadByteEx/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/CMakeLists.txt
index d87e8c0d6b..ae12b37950 100644
--- a/src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isvalidcodepage_test1
diff --git a/src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/test1.c b/src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/test1.cpp
index deb6a7ae72..deb6a7ae72 100644
--- a/src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/IsValidCodePage/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/CMakeLists.txt
index adcae86ff9..6eeff25d4d 100644
--- a/src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_isvalidcodepage_test2
diff --git a/src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/test2.c b/src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/test2.cpp
index d9362cfd96..d9362cfd96 100644
--- a/src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/test2.c
+++ b/src/pal/tests/palsuite/locale_info/IsValidCodePage/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/locale_info/IsValidLocale/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/IsValidLocale/test1/CMakeLists.txt
index 8fc7604a49..27d61693b0 100644
--- a/src/pal/tests/palsuite/locale_info/IsValidLocale/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/IsValidLocale/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isvalidlocale_test1
diff --git a/src/pal/tests/palsuite/locale_info/IsValidLocale/test1/test1.c b/src/pal/tests/palsuite/locale_info/IsValidLocale/test1/test1.cpp
index 4dd63653f5..4dd63653f5 100644
--- a/src/pal/tests/palsuite/locale_info/IsValidLocale/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/IsValidLocale/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/CMakeLists.txt
index 044c47712b..7bf79e36a7 100644
--- a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_multibytetowidechar_test1
diff --git a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/test1.c b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/test1.cpp
index 81f58a532c..81f58a532c 100644
--- a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/CMakeLists.txt
index 0367d53938..b3e3f64c5c 100644
--- a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_multibytetowidechar_test2
diff --git a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/test2.c b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/test2.cpp
index 1370dba894..1370dba894 100644
--- a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/test2.c
+++ b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/CMakeLists.txt
index 57e3d66faf..c6eac9bd60 100644
--- a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_multibytetowidechar_test3
diff --git a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/test3.c b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/test3.cpp
index 1b3a4bd4f5..1b3a4bd4f5 100644
--- a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/test3.c
+++ b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/CMakeLists.txt
index 3d167dff7c..c9c92952f2 100644
--- a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_multibytetowidechar_test4
diff --git a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.c b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.c
deleted file mode 100644
index 2ba606cf35..0000000000
--- a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.c
+++ /dev/null
@@ -1,230 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test4.c
-**
-** Purpose: Tests MultiByteToWideChar with a UTF-8 encoding
-**
-**
-**==========================================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- int ret;
- int ret2;
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- const char * const utf8Strings[] =
- {
- // Correct strings
-
- // Empty string
- "",
- // 1 byte encoded 1 character long string
- "A",
- // 2 byte encoded 1 character long string
- "\xC2\x80",
- // 3 byte encoded 1 character long string
- "\xE0\xA0\x80",
- // 1 byte encoded characters only
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
- // valid 2 byte encoded characters only
- "\xC2\x80\xC3\xBF\xC7\x81\xDF\xBF",
- // valid 3 byte encoded characters only
- "\xE0\xA0\x80\xE1\xB6\x88\xE1\x80\x80\xEF\xBF\xBF",
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 1 byte char
- "\x41\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF\x45",
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 1 byte char, ending with 2 byte one
- "\x41\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF",
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 2 byte char, ending with 1 byte one
- "\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF\x45",
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 2 byte char
- "\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF",
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 1 byte char
- "\x41\x42\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF\x45\x46",
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 1 byte char, ending with 2 byte one
- "\x41\x42\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF",
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 2 byte char, ending with 1 byte one
- "\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF\x45\x46",
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 2 byte char
- "\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF",
- // surrogates
- "\xF0\x90\x80\x80\xF0\x90\x89\x80\xF3\x80\x8E\xB0\xF4\x8F\xBF\xBF",
-
- // Strings with errors
- // Incomplete 2 byte encoded character 1 byte missing standalone
- "\xC2",
- // Incomplete 3 byte encoded character 1 byte missing standalone
- "\xE0\xA0",
- // Incomplete 3 byte encoded character 2 bytes missing standalone
- "\xE0",
- // Incomplete surrogate character 1 byte missing standalone
- "\xF0\x90\x80",
- // Incomplete surrogate character 2 bytes missing standalone
- "\xF0\x90",
- // Incomplete surrogate character 3 bytes missing standalone
- "\xF0",
- // Trailing byte with no lead byte standalone
- "\x80",
- // Incomplete 2 byte encoded character 1 byte missing between 1 byte chars
- "\x41\xC2\x42",
- // Incomplete 3 byte encoded character 1 byte missing between 1 byte chars
- "\x41\xE0\xA0\x42",
- // Incomplete 3 byte encoded character 2 bytes missing between 1 byte chars
- "\x41\xE0\x42",
- // Trailing byte with no lead byte between 1 byte chars
- "\x41\x80\x42",
- // Incomplete 2 byte encoded character 1 byte missing before 1 byte char
- "\xC2\x42",
- // Incomplete 3 byte encoded character 1 byte missing before 1 byte char
- "\xE0\xA0\x42",
- // Incomplete 3 byte encoded character 2 bytes missing before 1 byte char
- "\xE0\x42",
- // Trailing byte with no lead byte before 1 byte char
- "\x80\x42",
- // Incomplete 2 byte encoded character 1 byte missing after 1 byte char
- "\x41\xC2",
- // Incomplete 3 byte encoded character 1 byte missing after 1 byte char
- "\x41\xE0\xA0",
- // Incomplete 3 byte encoded character 2 bytes missing after 1 byte char
- "\x41\xE0",
- // Trailing byte with no lead byte after 1 byte char
- "\x41\x80",
- // Incomplete 2 byte encoded character 1 byte missing between 2 byte chars
- "\xC2\x80\xC2\xC3\xBF",
- // Incomplete 3 byte encoded character 1 byte missing between 2 byte chars
- "\xC2\x80\xE0\xA0\xC3\xBF",
- // Incomplete 3 byte encoded character 2 bytes missing between 2 byte chars
- "\xC2\x80\xE0\xC3\xBF",
- // Trailing byte with no lead byte between 2 byte chars
- "\xC2\x80\x80\xC3\xBF",
- // 2 byte encoded character in non-shortest form encodings (these are not allowed)
- "\xC0\x80",
- // 3 byte encoded character in non-shortest form encodings (these are not allowed)
- "\xE0\x80\x80",
- // 4 byte encoded character in non-shortest form encodings (these are not allowed)
- "\xF0\x80\x80\x80",
- };
-
- const WCHAR * const unicodeStrings[] =
- {
- // Empty string
- W(""),
- // 1 byte encoded 1 character long string
- W("A"),
- // 2 byte encoded 1 character long string
- W("\x0080"),
- // 3 byte encoded 1 character long string
- W("\x0800"),
- // 1 byte encoded characters only
- W("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
- // 2 byte encoded characters only
- W("\x0080\x00FF\x01C1\x07FF"),
- // valid 3 byte encoded characters only
- W("\x0800\x1D88\x1000\xFFFF"),
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 1 byte char
- W("\x0041\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF\x0045"),
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 1 byte char, ending with 2 byte one
- W("\x0041\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF"),
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 2 byte char, ending with 1 byte one
- W("\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF\x0045"),
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 2 byte char
- W("\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF"),
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 1 byte char
- W("\x0041\x0042\x0080\x00FF\x0043\x0044\x01C1\x07FF\x0045\x0046"),
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 1 byte char, ending with 2 byte one
- W("\x0041\x0042\x0080\x00FF\x0043\x0044\x01C1\x07FF"),
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 2 byte char, ending with 1 byte one
- W("\x0080\x00FF\x0043\x0044\x01C1\x07FF\x0045\x0046"),
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 2 byte char
- W("\x0080\x00FF\x0043\x0044\x01C1\x07FF"),
- // surrogates
- W("\xD800\xDC00\xD800\xDE40\xDAC0\xDFB0\xDBFF\xDFFF"),
-
- // Strings with errors
- // Incomplete 2 byte encoded character standalone
- W(""),
- // Incomplete 3 byte encoded character 1 byte missing standalone
- W(""),
- // Incomplete 3 byte encoded character 2 bytes missing standalone
- W(""),
- // Incomplete surrogate character 1 byte missing standalone
- W(""),
- // Incomplete surrogate character 2 bytes missing standalone
- W(""),
- // Incomplete surrogate character 3 bytes missing standalone
- W(""),
- // Trailing byte with no lead byte standalone
- W(""),
- // Incomplete 2 byte encoded character 1 byte missing between 1 byte chars
- W("\x0041\x0042"),
- // Incomplete 3 byte encoded character 1 byte missing between 1 byte chars
- W("\x0041\x0042"),
- // Incomplete 3 byte encoded character 2 bytes missing between 1 byte chars
- W("\x0041\x0042"),
- // Trailing byte with no lead byte between 1 byte chars
- W("\x0041\x0042"),
- // Incomplete 2 byte encoded character 1 byte missing before 1 byte char
- W("\x0042"),
- // Incomplete 3 byte encoded character 1 byte missing before 1 byte char
- W("\x0042"),
- // Incomplete 3 byte encoded character 2 bytes missing before 1 byte char
- W("\x0042"),
- // Trailing byte with no lead byte before 1 byte char
- W("\x0042"),
- // Incomplete 2 byte encoded character 1 byte missing after 1 byte char
- W("\x0041"),
- // Incomplete 3 byte encoded character 1 byte missing after 1 byte char
- W("\x0041"),
- // Incomplete 3 byte encoded character 2 bytes missing after 1 byte char
- W("\x0041"),
- // Trailing byte with no lead byte after 1 byte char
- W("\x0041"),
- // Incomplete 2 byte encoded character 1 byte missing between 2 byte chars
- W("\x0080\x00FF"),
- // Incomplete 3 byte encoded character 1 byte missing between 2 byte chars
- W("\x0080\x00FF"),
- // Incomplete 3 byte encoded character 2 bytes missing between 2 byte chars
- W("\x0080\x00FF"),
- // Trailing byte with no lead byte between 2 byte chars
- W("\x0080\x00FF"),
- // 2 byte encoded character in non-shortest form encodings (these are not allowed)
- W(""),
- // 3 byte encoded character in non-shortest form encodings (these are not allowed)
- W(""),
- // 4 byte encoded character in non-shortest form encodings (these are not allowed)
- W(""),
- };
-
- for (int i = 0; i < (sizeof(utf8Strings) / sizeof(utf8Strings[0])); i++)
- {
- ret = MultiByteToWideChar(CP_UTF8, 0, utf8Strings[i], -1, NULL, 0);
- WCHAR* wideBuffer = malloc(ret * sizeof(WCHAR));
- ret2 = MultiByteToWideChar(CP_UTF8, 0, utf8Strings[i], -1, wideBuffer, ret);
- if (ret != ret2)
- {
- Fail("MultiByteToWideChar string %d: returned different string length for empty and real dest buffers!\n"
- "Got %d for the empty one, %d for real one.\n", i, ret2, ret);
- }
-
- if (wcscmp(wideBuffer, unicodeStrings[i]) != 0)
- {
- Fail("MultiByteToWideChar string %d: the resulting string doesn't match the expected one!\n", i);
- }
-
- free(wideBuffer);
- }
-
- PAL_Terminate();
-
- return PASS;
-} \ No newline at end of file
diff --git a/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.cpp b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.cpp
new file mode 100644
index 0000000000..1d7234640b
--- /dev/null
+++ b/src/pal/tests/palsuite/locale_info/MultiByteToWideChar/test4/test4.cpp
@@ -0,0 +1,230 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test4.c
+**
+** Purpose: Tests MultiByteToWideChar with a UTF-8 encoding
+**
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ int ret;
+ int ret2;
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ const char * const utf8Strings[] =
+ {
+ // Correct strings
+
+ // Empty string
+ "",
+ // 1 byte encoded 1 character long string
+ "A",
+ // 2 byte encoded 1 character long string
+ "\xC2\x80",
+ // 3 byte encoded 1 character long string
+ "\xE0\xA0\x80",
+ // 1 byte encoded characters only
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ // valid 2 byte encoded characters only
+ "\xC2\x80\xC3\xBF\xC7\x81\xDF\xBF",
+ // valid 3 byte encoded characters only
+ "\xE0\xA0\x80\xE1\xB6\x88\xE1\x80\x80\xEF\xBF\xBF",
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 1 byte char
+ "\x41\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF\x45",
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 1 byte char, ending with 2 byte one
+ "\x41\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF",
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 2 byte char, ending with 1 byte one
+ "\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF\x45",
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 2 byte char
+ "\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF",
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 1 byte char
+ "\x41\x42\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF\x45\x46",
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 1 byte char, ending with 2 byte one
+ "\x41\x42\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF",
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 2 byte char, ending with 1 byte one
+ "\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF\x45\x46",
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 2 byte char
+ "\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF",
+ // surrogates
+ "\xF0\x90\x80\x80\xF0\x90\x89\x80\xF3\x80\x8E\xB0\xF4\x8F\xBF\xBF",
+
+ // Strings with errors
+ // Incomplete 2 byte encoded character 1 byte missing standalone
+ "\xC2",
+ // Incomplete 3 byte encoded character 1 byte missing standalone
+ "\xE0\xA0",
+ // Incomplete 3 byte encoded character 2 bytes missing standalone
+ "\xE0",
+ // Incomplete surrogate character 1 byte missing standalone
+ "\xF0\x90\x80",
+ // Incomplete surrogate character 2 bytes missing standalone
+ "\xF0\x90",
+ // Incomplete surrogate character 3 bytes missing standalone
+ "\xF0",
+ // Trailing byte with no lead byte standalone
+ "\x80",
+ // Incomplete 2 byte encoded character 1 byte missing between 1 byte chars
+ "\x41\xC2\x42",
+ // Incomplete 3 byte encoded character 1 byte missing between 1 byte chars
+ "\x41\xE0\xA0\x42",
+ // Incomplete 3 byte encoded character 2 bytes missing between 1 byte chars
+ "\x41\xE0\x42",
+ // Trailing byte with no lead byte between 1 byte chars
+ "\x41\x80\x42",
+ // Incomplete 2 byte encoded character 1 byte missing before 1 byte char
+ "\xC2\x42",
+ // Incomplete 3 byte encoded character 1 byte missing before 1 byte char
+ "\xE0\xA0\x42",
+ // Incomplete 3 byte encoded character 2 bytes missing before 1 byte char
+ "\xE0\x42",
+ // Trailing byte with no lead byte before 1 byte char
+ "\x80\x42",
+ // Incomplete 2 byte encoded character 1 byte missing after 1 byte char
+ "\x41\xC2",
+ // Incomplete 3 byte encoded character 1 byte missing after 1 byte char
+ "\x41\xE0\xA0",
+ // Incomplete 3 byte encoded character 2 bytes missing after 1 byte char
+ "\x41\xE0",
+ // Trailing byte with no lead byte after 1 byte char
+ "\x41\x80",
+ // Incomplete 2 byte encoded character 1 byte missing between 2 byte chars
+ "\xC2\x80\xC2\xC3\xBF",
+ // Incomplete 3 byte encoded character 1 byte missing between 2 byte chars
+ "\xC2\x80\xE0\xA0\xC3\xBF",
+ // Incomplete 3 byte encoded character 2 bytes missing between 2 byte chars
+ "\xC2\x80\xE0\xC3\xBF",
+ // Trailing byte with no lead byte between 2 byte chars
+ "\xC2\x80\x80\xC3\xBF",
+ // 2 byte encoded character in non-shortest form encodings (these are not allowed)
+ "\xC0\x80",
+ // 3 byte encoded character in non-shortest form encodings (these are not allowed)
+ "\xE0\x80\x80",
+ // 4 byte encoded character in non-shortest form encodings (these are not allowed)
+ "\xF0\x80\x80\x80",
+ };
+
+ const WCHAR * const unicodeStrings[] =
+ {
+ // Empty string
+ W(""),
+ // 1 byte encoded 1 character long string
+ W("A"),
+ // 2 byte encoded 1 character long string
+ W("\x0080"),
+ // 3 byte encoded 1 character long string
+ W("\x0800"),
+ // 1 byte encoded characters only
+ W("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
+ // 2 byte encoded characters only
+ W("\x0080\x00FF\x01C1\x07FF"),
+ // valid 3 byte encoded characters only
+ W("\x0800\x1D88\x1000\xFFFF"),
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 1 byte char
+ W("\x0041\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF\x0045"),
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 1 byte char, ending with 2 byte one
+ W("\x0041\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF"),
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 2 byte char, ending with 1 byte one
+ W("\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF\x0045"),
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 2 byte char
+ W("\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF"),
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 1 byte char
+ W("\x0041\x0042\x0080\x00FF\x0043\x0044\x01C1\x07FF\x0045\x0046"),
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 1 byte char, ending with 2 byte one
+ W("\x0041\x0042\x0080\x00FF\x0043\x0044\x01C1\x07FF"),
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 2 byte char, ending with 1 byte one
+ W("\x0080\x00FF\x0043\x0044\x01C1\x07FF\x0045\x0046"),
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 2 byte char
+ W("\x0080\x00FF\x0043\x0044\x01C1\x07FF"),
+ // surrogates
+ W("\xD800\xDC00\xD800\xDE40\xDAC0\xDFB0\xDBFF\xDFFF"),
+
+ // Strings with errors
+ // Incomplete 2 byte encoded character standalone
+ W(""),
+ // Incomplete 3 byte encoded character 1 byte missing standalone
+ W(""),
+ // Incomplete 3 byte encoded character 2 bytes missing standalone
+ W(""),
+ // Incomplete surrogate character 1 byte missing standalone
+ W(""),
+ // Incomplete surrogate character 2 bytes missing standalone
+ W(""),
+ // Incomplete surrogate character 3 bytes missing standalone
+ W(""),
+ // Trailing byte with no lead byte standalone
+ W(""),
+ // Incomplete 2 byte encoded character 1 byte missing between 1 byte chars
+ W("\x0041\x0042"),
+ // Incomplete 3 byte encoded character 1 byte missing between 1 byte chars
+ W("\x0041\x0042"),
+ // Incomplete 3 byte encoded character 2 bytes missing between 1 byte chars
+ W("\x0041\x0042"),
+ // Trailing byte with no lead byte between 1 byte chars
+ W("\x0041\x0042"),
+ // Incomplete 2 byte encoded character 1 byte missing before 1 byte char
+ W("\x0042"),
+ // Incomplete 3 byte encoded character 1 byte missing before 1 byte char
+ W("\x0042"),
+ // Incomplete 3 byte encoded character 2 bytes missing before 1 byte char
+ W("\x0042"),
+ // Trailing byte with no lead byte before 1 byte char
+ W("\x0042"),
+ // Incomplete 2 byte encoded character 1 byte missing after 1 byte char
+ W("\x0041"),
+ // Incomplete 3 byte encoded character 1 byte missing after 1 byte char
+ W("\x0041"),
+ // Incomplete 3 byte encoded character 2 bytes missing after 1 byte char
+ W("\x0041"),
+ // Trailing byte with no lead byte after 1 byte char
+ W("\x0041"),
+ // Incomplete 2 byte encoded character 1 byte missing between 2 byte chars
+ W("\x0080\x00FF"),
+ // Incomplete 3 byte encoded character 1 byte missing between 2 byte chars
+ W("\x0080\x00FF"),
+ // Incomplete 3 byte encoded character 2 bytes missing between 2 byte chars
+ W("\x0080\x00FF"),
+ // Trailing byte with no lead byte between 2 byte chars
+ W("\x0080\x00FF"),
+ // 2 byte encoded character in non-shortest form encodings (these are not allowed)
+ W(""),
+ // 3 byte encoded character in non-shortest form encodings (these are not allowed)
+ W(""),
+ // 4 byte encoded character in non-shortest form encodings (these are not allowed)
+ W(""),
+ };
+
+ for (int i = 0; i < (sizeof(utf8Strings) / sizeof(utf8Strings[0])); i++)
+ {
+ ret = MultiByteToWideChar(CP_UTF8, 0, utf8Strings[i], -1, NULL, 0);
+ WCHAR* wideBuffer = (WCHAR*)malloc(ret * sizeof(WCHAR));
+ ret2 = MultiByteToWideChar(CP_UTF8, 0, utf8Strings[i], -1, wideBuffer, ret);
+ if (ret != ret2)
+ {
+ Fail("MultiByteToWideChar string %d: returned different string length for empty and real dest buffers!\n"
+ "Got %d for the empty one, %d for real one.\n", i, ret2, ret);
+ }
+
+ if (wcscmp(wideBuffer, unicodeStrings[i]) != 0)
+ {
+ Fail("MultiByteToWideChar string %d: the resulting string doesn't match the expected one!\n", i);
+ }
+
+ free(wideBuffer);
+ }
+
+ PAL_Terminate();
+
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/CMakeLists.txt
index 85824dd836..5ac7433c98 100644
--- a/src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_setthreadlocale_test1
diff --git a/src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/test1.c b/src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/test1.cpp
index 794093cf4c..794093cf4c 100644
--- a/src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/SetThreadLocale/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/CMakeLists.txt
index 0d1d12b41e..07dae640f1 100644
--- a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_widechartomultibyte_test1
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/test1.c b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/test1.cpp
index cd763f33be..cd763f33be 100644
--- a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/test1.c
+++ b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/CMakeLists.txt
index bbfad2ca9f..99c64afa2a 100644
--- a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_widechartomultibyte_test2
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/test2.c b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/test2.cpp
index f5d40ae903..f5d40ae903 100644
--- a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/test2.c
+++ b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/CMakeLists.txt
index 0edfd73931..70dabead6f 100644
--- a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_widechartomultibyte_test3
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/test3.c b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/test3.cpp
index ecd26addb4..ecd26addb4 100644
--- a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/test3.c
+++ b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/CMakeLists.txt
index f0ffd84ee9..8839c19183 100644
--- a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_widechartomultibyte_test4
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/test4.c b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/test4.cpp
index 8ab5fe90af..8ab5fe90af 100644
--- a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/test4.c
+++ b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/CMakeLists.txt b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/CMakeLists.txt
index 6ca2a628bf..e00657879d 100644
--- a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_widechartomultibyte_test5
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.c b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.c
deleted file mode 100644
index 3ca0d90d0f..0000000000
--- a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.c
+++ /dev/null
@@ -1,154 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test4.c
-**
-** Purpose: Tests WideCharMultiByte with UTF-8 encoding
-**
-**
-**==========================================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- int ret;
- int ret2;
-
- if (PAL_Initialize(argc, argv))
- {
- return FAIL;
- }
-
- const WCHAR * const unicodeStrings[] =
- {
- // Correct strings
-
- // Empty string
- W(""),
- // 1 byte encoded 1 character long string
- W("A"),
- // 2 byte encoded 1 character long string
- W("\x0080"),
- // 3 byte encoded 1 character long string
- W("\x0800"),
- // 1 byte encoded characters only
- W("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
- // 2 byte encoded characters only
- W("\x0080\x00FF\x01C1\x07FF"),
- // valid 3 byte encoded characters only
- W("\x0800\x1D88\x1000\xFFFF"),
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 1 byte char
- W("\x0041\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF\x0045"),
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 1 byte char, ending with 2 byte one
- W("\x0041\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF"),
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 2 byte char, ending with 1 byte one
- W("\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF\x0045"),
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 2 byte char
- W("\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF"),
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 1 byte char
- W("\x0041\x0042\x0080\x00FF\x0043\x0044\x01C1\x07FF\x0045\x0046"),
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 1 byte char, ending with 2 byte one
- W("\x0041\x0042\x0080\x00FF\x0043\x0044\x01C1\x07FF"),
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 2 byte char, ending with 1 byte one
- W("\x0080\x00FF\x0043\x0044\x01C1\x07FF\x0045\x0046"),
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 2 byte char
- W("\x0080\x00FF\x0043\x0044\x01C1\x07FF"),
- // Surrogates
- W("\xD800\xDC00\xD800\xDE40\xDAC0\xDFB0\xDBFF\xDFFF"),
-
- // Strings with errors
-
- // Single high surrogate
- W("\xD800"),
- // Single low surrogate
- W("\xDC00"),
- // Character followed by single high surrogate
- W("\x0041\xD800"),
- // Character followed by single low surrogate
- W("\x0041\xDC00"),
- // Single high surrogate between two characters
- W("\x0041\xD800\x0042"),
- // Single low surrogate between two characters
- W("\x0041\xDC00\x0042"),
- };
-
- const char * const utf8Strings[] =
- {
- // Correct strings
-
- // Empty string
- "",
- // 1 byte encoded 1 character long string
- "A",
- // 2 byte encoded 1 character long string
- "\xC2\x80",
- // 3 byte encoded 1 character long string
- "\xE0\xA0\x80",
- // 1 byte encoded characters only
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
- // valid 2 byte encoded characters only
- "\xC2\x80\xC3\xBF\xC7\x81\xDF\xBF",
- // valid 3 byte encoded characters only
- "\xE0\xA0\x80\xE1\xB6\x88\xE1\x80\x80\xEF\xBF\xBF",
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 1 byte char
- "\x41\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF\x45",
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 1 byte char, ending with 2 byte one
- "\x41\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF",
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 2 byte char, ending with 1 byte one
- "\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF\x45",
- // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 2 byte char
- "\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF",
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 1 byte char
- "\x41\x42\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF\x45\x46",
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 1 byte char, ending with 2 byte one
- "\x41\x42\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF",
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 2 byte char, ending with 1 byte one
- "\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF\x45\x46",
- // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 2 byte char
- "\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF",
- // Surrogates
- "\xF0\x90\x80\x80\xF0\x90\x89\x80\xF3\x80\x8E\xB0\xF4\x8F\xBF\xBF",
-
- // Strings with errors
-
- // Single high surrogate
- "\xEF\xBF\xBD",
- // Single low surrogate
- "\xEF\xBF\xBD",
- // Character followed by single high surrogate
- "\x41\xEF\xBF\xBD",
- // Character followed by single low surrogate
- "\x41\xEF\xBF\xBD",
- // Single high surrogate between two characters
- "\x41\xEF\xBF\xBD\x42",
- // Single low surrogate between two characters
- "\x41\xEF\xBF\xBD\x42",
- };
-
- for (int i = 0; i < (sizeof(unicodeStrings) / sizeof(unicodeStrings[0])); i++)
- {
- ret = WideCharToMultiByte(CP_UTF8, 0, unicodeStrings[i], -1, NULL, 0, NULL, NULL);
- CHAR* utf8Buffer = malloc(ret * sizeof(CHAR));
- ret2 = WideCharToMultiByte(CP_UTF8, 0, unicodeStrings[i], -1, utf8Buffer, ret, NULL, NULL);
- if (ret != ret2)
- {
- Fail("WideCharToMultiByte string %d: returned different string length for empty and real dest buffers!\n"
- "Got %d for the empty one, %d for real one.\n", i, ret2, ret);
- }
-
- if (strcmp(utf8Buffer, utf8Strings[i]) != 0)
- {
- Fail("WideCharToMultiByte string %d: the resulting string doesn't match the expected one!\n", i);
- }
-
- free(utf8Buffer);
- }
-
- PAL_Terminate();
-
- return PASS;
-} \ No newline at end of file
diff --git a/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.cpp b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.cpp
new file mode 100644
index 0000000000..393516a198
--- /dev/null
+++ b/src/pal/tests/palsuite/locale_info/WideCharToMultiByte/test5/test5.cpp
@@ -0,0 +1,154 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================================
+**
+** Source: test4.c
+**
+** Purpose: Tests WideCharMultiByte with UTF-8 encoding
+**
+**
+**==========================================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ int ret;
+ int ret2;
+
+ if (PAL_Initialize(argc, argv))
+ {
+ return FAIL;
+ }
+
+ const WCHAR * const unicodeStrings[] =
+ {
+ // Correct strings
+
+ // Empty string
+ W(""),
+ // 1 byte encoded 1 character long string
+ W("A"),
+ // 2 byte encoded 1 character long string
+ W("\x0080"),
+ // 3 byte encoded 1 character long string
+ W("\x0800"),
+ // 1 byte encoded characters only
+ W("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
+ // 2 byte encoded characters only
+ W("\x0080\x00FF\x01C1\x07FF"),
+ // valid 3 byte encoded characters only
+ W("\x0800\x1D88\x1000\xFFFF"),
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 1 byte char
+ W("\x0041\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF\x0045"),
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 1 byte char, ending with 2 byte one
+ W("\x0041\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF"),
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 2 byte char, ending with 1 byte one
+ W("\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF\x0045"),
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 2 byte char
+ W("\x0080\x0042\x00FF\x0043\x01C1\x0044\x07FF"),
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 1 byte char
+ W("\x0041\x0042\x0080\x00FF\x0043\x0044\x01C1\x07FF\x0045\x0046"),
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 1 byte char, ending with 2 byte one
+ W("\x0041\x0042\x0080\x00FF\x0043\x0044\x01C1\x07FF"),
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 2 byte char, ending with 1 byte one
+ W("\x0080\x00FF\x0043\x0044\x01C1\x07FF\x0045\x0046"),
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 2 byte char
+ W("\x0080\x00FF\x0043\x0044\x01C1\x07FF"),
+ // Surrogates
+ W("\xD800\xDC00\xD800\xDE40\xDAC0\xDFB0\xDBFF\xDFFF"),
+
+ // Strings with errors
+
+ // Single high surrogate
+ W("\xD800"),
+ // Single low surrogate
+ W("\xDC00"),
+ // Character followed by single high surrogate
+ W("\x0041\xD800"),
+ // Character followed by single low surrogate
+ W("\x0041\xDC00"),
+ // Single high surrogate between two characters
+ W("\x0041\xD800\x0042"),
+ // Single low surrogate between two characters
+ W("\x0041\xDC00\x0042"),
+ };
+
+ const char * const utf8Strings[] =
+ {
+ // Correct strings
+
+ // Empty string
+ "",
+ // 1 byte encoded 1 character long string
+ "A",
+ // 2 byte encoded 1 character long string
+ "\xC2\x80",
+ // 3 byte encoded 1 character long string
+ "\xE0\xA0\x80",
+ // 1 byte encoded characters only
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ // valid 2 byte encoded characters only
+ "\xC2\x80\xC3\xBF\xC7\x81\xDF\xBF",
+ // valid 3 byte encoded characters only
+ "\xE0\xA0\x80\xE1\xB6\x88\xE1\x80\x80\xEF\xBF\xBF",
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 1 byte char
+ "\x41\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF\x45",
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 1 byte char, ending with 2 byte one
+ "\x41\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF",
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting with 2 byte char, ending with 1 byte one
+ "\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF\x45",
+ // 1 byte and 2 byte encoded characters interleaved 1:1 starting and ending with 2 byte char
+ "\xC2\x80\x42\xC3\xBF\x43\xC7\x81\x44\xDF\xBF",
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 1 byte char
+ "\x41\x42\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF\x45\x46",
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 1 byte char, ending with 2 byte one
+ "\x41\x42\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF",
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting with 2 byte char, ending with 1 byte one
+ "\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF\x45\x46",
+ // 1 byte and 2 byte encoded characters interleaved 2:2 starting and ending with 2 byte char
+ "\xC2\x80\xC3\xBF\x43\x44\xC7\x81\xDF\xBF",
+ // Surrogates
+ "\xF0\x90\x80\x80\xF0\x90\x89\x80\xF3\x80\x8E\xB0\xF4\x8F\xBF\xBF",
+
+ // Strings with errors
+
+ // Single high surrogate
+ "\xEF\xBF\xBD",
+ // Single low surrogate
+ "\xEF\xBF\xBD",
+ // Character followed by single high surrogate
+ "\x41\xEF\xBF\xBD",
+ // Character followed by single low surrogate
+ "\x41\xEF\xBF\xBD",
+ // Single high surrogate between two characters
+ "\x41\xEF\xBF\xBD\x42",
+ // Single low surrogate between two characters
+ "\x41\xEF\xBF\xBD\x42",
+ };
+
+ for (int i = 0; i < (sizeof(unicodeStrings) / sizeof(unicodeStrings[0])); i++)
+ {
+ ret = WideCharToMultiByte(CP_UTF8, 0, unicodeStrings[i], -1, NULL, 0, NULL, NULL);
+ CHAR* utf8Buffer = (CHAR*)malloc(ret * sizeof(CHAR));
+ ret2 = WideCharToMultiByte(CP_UTF8, 0, unicodeStrings[i], -1, utf8Buffer, ret, NULL, NULL);
+ if (ret != ret2)
+ {
+ Fail("WideCharToMultiByte string %d: returned different string length for empty and real dest buffers!\n"
+ "Got %d for the empty one, %d for real one.\n", i, ret2, ret);
+ }
+
+ if (strcmp(utf8Buffer, utf8Strings[i]) != 0)
+ {
+ Fail("WideCharToMultiByte string %d: the resulting string doesn't match the expected one!\n", i);
+ }
+
+ free(utf8Buffer);
+ }
+
+ PAL_Terminate();
+
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt
index 86f194198b..0fd4df8ad5 100644
--- a/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/CMakeLists.txt
@@ -27,9 +27,6 @@ add_subdirectory(InterLockedExchangeAdd)
add_subdirectory(InterlockedExchangePointer)
add_subdirectory(InterlockedIncrement)
add_subdirectory(InterlockedIncrement64)
-add_subdirectory(lstrcatW)
-add_subdirectory(lstrcpynW)
-add_subdirectory(lstrcpyW)
add_subdirectory(lstrlenA)
add_subdirectory(lstrlenW)
add_subdirectory(queryperformancecounter)
@@ -37,8 +34,5 @@ add_subdirectory(queryperformancefrequency)
add_subdirectory(SetEnvironmentVariableA)
add_subdirectory(SetEnvironmentVariableW)
add_subdirectory(SetLastError)
-add_subdirectory(wsprintfA)
-add_subdirectory(wsprintfW)
add_subdirectory(_i64tow)
-add_subdirectory(_ui64tow)
diff --git a/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/CMakeLists.txt
index 8506d86737..23df52b430 100644
--- a/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_charnexta_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/test.c b/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/test.cpp
index d2a3db31d5..d2a3db31d5 100644
--- a/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/CharNextA/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/CMakeLists.txt
index 04f4679630..5f089e963c 100644
--- a/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_charnexta_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/test.c b/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/test.cpp
index 7261959021..7261959021 100644
--- a/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/CharNextA/test2/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/CMakeLists.txt
index bfa12b5526..ae1433f089 100644
--- a/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_charnextexa_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/test.c b/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/test.cpp
index 9671ca86b8..9671ca86b8 100644
--- a/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/CharNextExA/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/CMakeLists.txt
index 556043abcd..1c81d1f9a4 100644
--- a/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_charnextexa_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/test.c b/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/test.cpp
index ffc153f5e6..ffc153f5e6 100644
--- a/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/CharNextExA/test2/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/CMakeLists.txt
index bbe37ddd19..78bb701959 100644
--- a/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_closehandle_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.c b/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.c
deleted file mode 100644
index 8e42229c29..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.c
+++ /dev/null
@@ -1,64 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for CloseHandle function
-**
-**
-**=========================================================*/
-
-/* Depends on: CreateFile and WriteFile */
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
- HANDLE FileHandle = NULL;
- LPDWORD WriteBuffer; /* Used with WriteFile */
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- WriteBuffer = malloc(sizeof(WORD));
-
- if ( WriteBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for WriteBuffer pointer. "
- "Can't properly exec test case without this.\n");
- }
-
-
- /* Create a file, since this returns to us a HANDLE we can use */
- FileHandle = CreateFile("testfile",
- GENERIC_READ | GENERIC_WRITE,0,NULL,CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL,
- NULL);
-
- /* Should be able to close this handle */
- if(CloseHandle(FileHandle) == 0)
- {
- free(WriteBuffer);
- Fail("ERROR: (Test 1) Attempted to close a HANDLE on a file, but the "
- "return value was <=0, indicating failure.\n");
- }
-
- free(WriteBuffer);
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.cpp b/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.cpp
new file mode 100644
index 0000000000..443f89bace
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/CloseHandle/test1/test.cpp
@@ -0,0 +1,64 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: test.c
+**
+** Purpose: Test for CloseHandle function
+**
+**
+**=========================================================*/
+
+/* Depends on: CreateFile and WriteFile */
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ HANDLE FileHandle = NULL;
+ LPDWORD WriteBuffer; /* Used with WriteFile */
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ WriteBuffer = (LPDWORD)malloc(sizeof(WORD));
+
+ if ( WriteBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for WriteBuffer pointer. "
+ "Can't properly exec test case without this.\n");
+ }
+
+
+ /* Create a file, since this returns to us a HANDLE we can use */
+ FileHandle = CreateFile("testfile",
+ GENERIC_READ | GENERIC_WRITE,0,NULL,CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+
+ /* Should be able to close this handle */
+ if(CloseHandle(FileHandle) == 0)
+ {
+ free(WriteBuffer);
+ Fail("ERROR: (Test 1) Attempted to close a HANDLE on a file, but the "
+ "return value was <=0, indicating failure.\n");
+ }
+
+ free(WriteBuffer);
+
+ PAL_Terminate();
+ return PASS;
+}
+
+
+
+
diff --git a/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/CMakeLists.txt
index 75de513be7..18350f20ad 100644
--- a/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_closehandle_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/test.c b/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/test.cpp
index c1eea44070..c1eea44070 100644
--- a/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/CloseHandle/test2/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/CMakeLists.txt
index af878cb873..15a0f572bb 100644
--- a/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_createpipe_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/test1.c b/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/test1.cpp
index 3930183b60..3930183b60 100644
--- a/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/test1.c
+++ b/src/pal/tests/palsuite/miscellaneous/CreatePipe/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/CMakeLists.txt
index fbd8b0f87d..47ee4b0abd 100644
--- a/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_flushinstructioncache_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/test1.c b/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/test1.cpp
index cdbefd01cc..cdbefd01cc 100644
--- a/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/test1.c
+++ b/src/pal/tests/palsuite/miscellaneous/FlushInstructionCache/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/CMakeLists.txt
index 0f242e9b30..df91482855 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_formatmessagew_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/test.cpp
index 0cc4c43432..0cc4c43432 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/CMakeLists.txt
index 26092ac300..818649aac7 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_formatmessagew_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/test.c b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/test.cpp
index 6c2d80b3f4..6c2d80b3f4 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test2/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/CMakeLists.txt
index b430511c4c..516d4bcc9a 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_formatmessagew_test3
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/test.c b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/test.cpp
index a390c00fea..a390c00fea 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test3/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/CMakeLists.txt
index cae8ff149c..642727c6dc 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_formatmessagew_test4
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/test.c b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/test.cpp
index 4f865efe7e..4f865efe7e 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test4/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/CMakeLists.txt
index 6779f94ff9..bae113475d 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_formatmessagew_test5
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/test.c b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/test.cpp
index 148c2ff236..148c2ff236 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test5/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/CMakeLists.txt
index 450b2b808b..f403cba0f4 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_formatmessagew_test6
diff --git a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/test.c b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/test.cpp
index 48f5e3e93d..48f5e3e93d 100644
--- a/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/FormatMessageW/test6/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/CMakeLists.txt
index be39b63ec9..206707efa6 100644
--- a/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_freeenvironmentstringsw_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/test.cpp
index 56010039d7..56010039d7 100644
--- a/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/CMakeLists.txt
index a3688dd24a..d8197d1c90 100644
--- a/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_freeenvironmentstringsw_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/test.c b/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/test.cpp
index 1bb05cdb12..1bb05cdb12 100644
--- a/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/FreeEnvironmentStringsW/test2/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/CMakeLists.txt
index e3acf4061a..92cabba428 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetCalendarInfoW.c
+ GetCalendarInfoW.cpp
)
add_executable(paltest_getcalendarinfow_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/GetCalendarInfoW.c b/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/GetCalendarInfoW.cpp
index 4876fe180f..4876fe180f 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/GetCalendarInfoW.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test1/GetCalendarInfoW.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/CMakeLists.txt
index cbfd1aa5db..0cfc9679e7 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetCalendarInfoW.c
+ GetCalendarInfoW.cpp
)
add_executable(paltest_getcalendarinfow_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/GetCalendarInfoW.c b/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/GetCalendarInfoW.cpp
index d8a59a0fc0..d8a59a0fc0 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/GetCalendarInfoW.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetCalendarInfoW/test2/GetCalendarInfoW.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/CMakeLists.txt
index 491fdca9b5..d15b84a59e 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getcommandlinew_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.c
deleted file mode 100644
index d8a81746b6..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.c
+++ /dev/null
@@ -1,71 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source : test.c
-**
-** Purpose: Test for GetCommandLineW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
- LPWSTR TheResult = NULL;
- WCHAR *CommandLine;
- int i;
- WCHAR * p;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- CommandLine = malloc(1024);
- wcscpy(CommandLine,convert(argv[0]));
-
- for(i=1;i<argc;++i)
- {
- wcscat(CommandLine,convert(" "));
- wcscat(CommandLine,convert(argv[i]));
- }
-
- TheResult = GetCommandLine();
-
- /* If it is NULL, it failed. */
- if(TheResult == NULL)
- {
- Fail("ERROR: The command line returned was NULL -- but should be "
- "a LPWSTR.");
- }
-
- // It's ok that if there is trailing white spaces in "TheResult"
- // Let's trim them.
- p = TheResult + wcslen(TheResult) - 1;
- while (* p == L' ' || * p == L'\t') { printf("%c\n", *p); * p-- = 0 ; }
-
- if(memcmp(TheResult,CommandLine,wcslen(TheResult)*2+2) != 0)
- {
- Fail("ERROR: The command line returned was %s instead of %s "
- "which was the command.\n",
- convertC(TheResult), convertC(CommandLine));
- }
-
- free(CommandLine);
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.cpp b/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.cpp
new file mode 100644
index 0000000000..3417c149a0
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetCommandLineW/test1/test.cpp
@@ -0,0 +1,71 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source : test.c
+**
+** Purpose: Test for GetCommandLineW() function
+**
+**
+**=========================================================*/
+
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ LPWSTR TheResult = NULL;
+ WCHAR *CommandLine;
+ int i;
+ WCHAR * p;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ CommandLine = (WCHAR*)malloc(1024);
+ wcscpy(CommandLine,convert(argv[0]));
+
+ for(i=1;i<argc;++i)
+ {
+ wcscat(CommandLine,convert(" "));
+ wcscat(CommandLine,convert(argv[i]));
+ }
+
+ TheResult = GetCommandLine();
+
+ /* If it is NULL, it failed. */
+ if(TheResult == NULL)
+ {
+ Fail("ERROR: The command line returned was NULL -- but should be "
+ "a LPWSTR.");
+ }
+
+ // It's ok that if there is trailing white spaces in "TheResult"
+ // Let's trim them.
+ p = TheResult + wcslen(TheResult) - 1;
+ while (* p == L' ' || * p == L'\t') { printf("%c\n", *p); * p-- = 0 ; }
+
+ if(memcmp(TheResult,CommandLine,wcslen(TheResult)*2+2) != 0)
+ {
+ Fail("ERROR: The command line returned was %s instead of %s "
+ "which was the command.\n",
+ convertC(TheResult), convertC(CommandLine));
+ }
+
+ free(CommandLine);
+
+ PAL_Terminate();
+ return PASS;
+
+}
+
+
diff --git a/src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/CMakeLists.txt
index 980dae88ae..0ce9ac07b7 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getcomputernamew_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/test.cpp
index 7a00cad598..7a00cad598 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetComputerNameW/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/CMakeLists.txt
index 5a340c6cfb..04ef85b74d 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetDateFormatW_neg.c
+ GetDateFormatW_neg.cpp
)
add_executable(paltest_getdateformatw_getdateformatw_neg1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.c b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.c
deleted file mode 100644
index c64dc74cb6..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.c
+++ /dev/null
@@ -1,85 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: GetDateFormatW_neg.c
-**
-** Purpose: Negative test the GetDateFormatW API.
-** Call GetDateFormatW by passing an invalid parameter
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- int err;
- WCHAR *wpFormat;
- LPCSTR lpString = "gg";
- CONST SYSTEMTIME *lpDate = NULL;
- LCID DefaultLocale;
- DWORD dwFlags;
- int DateSize;
- WCHAR *wpBuffer = NULL;
-
- /*Initialize the PAL environment*/
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- /*convert to a wide character string*/
- wpFormat = convert((char *)lpString);
-
- dwFlags = DATE_USE_ALT_CALENDAR; /*set the flags*/
-
-
- DateSize = 0;
-
- /*retrieve the buffer size*/
- DateSize = GetDateFormatW(
- DefaultLocale, /*system default locale*/
- dwFlags, /*function option*/
- (SYSTEMTIME *)lpDate, /*always is NULL*/
- wpFormat, /*pointer to a picture string*/
- wpBuffer, /*out buffer*/
- DateSize); /*buffer size*/
-
- if(DateSize <= 0)
- {
- free(wpFormat);
- Fail("\nRetrieved an invalid buffer size\n");
- }
-
- wpBuffer = malloc((DateSize + 1)*sizeof(WCHAR));
- if(NULL == wpBuffer)
- {
- free(wpFormat);
- Fail("\nFailed to allocate memory to store the formatted string\n");
- }
-
- /*format a date by passing an invalid locale indentifier*/
- err = GetDateFormatW(
- -1, /*invalid locale identifier*/
- dwFlags, /*function option*/
- (SYSTEMTIME *)lpDate, /*always is NULL, or use system date*/
- wpFormat, /*pointer to a picture string*/
- wpBuffer, /*out buffer*/
- DateSize); /*buffer size*/
-
- free(wpBuffer);
- free(wpFormat);
-
- if(0 != err || GetLastError() != ERROR_INVALID_PARAMETER)
- {
- Fail("\nFailed to call GetDateFormatW for a negative test by "
- "passing an invalid parameter, error code=%d\n", GetLastError());
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.cpp b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.cpp
new file mode 100644
index 0000000000..96a481167f
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg1/GetDateFormatW_neg.cpp
@@ -0,0 +1,85 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: GetDateFormatW_neg.c
+**
+** Purpose: Negative test the GetDateFormatW API.
+** Call GetDateFormatW by passing an invalid parameter
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ int err;
+ WCHAR *wpFormat;
+ LPCSTR lpString = "gg";
+ CONST SYSTEMTIME *lpDate = NULL;
+ LCID DefaultLocale;
+ DWORD dwFlags;
+ int DateSize;
+ WCHAR *wpBuffer = NULL;
+
+ /*Initialize the PAL environment*/
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ /*convert to a wide character string*/
+ wpFormat = convert((char *)lpString);
+
+ dwFlags = DATE_USE_ALT_CALENDAR; /*set the flags*/
+
+
+ DateSize = 0;
+
+ /*retrieve the buffer size*/
+ DateSize = GetDateFormatW(
+ DefaultLocale, /*system default locale*/
+ dwFlags, /*function option*/
+ (SYSTEMTIME *)lpDate, /*always is NULL*/
+ wpFormat, /*pointer to a picture string*/
+ wpBuffer, /*out buffer*/
+ DateSize); /*buffer size*/
+
+ if(DateSize <= 0)
+ {
+ free(wpFormat);
+ Fail("\nRetrieved an invalid buffer size\n");
+ }
+
+ wpBuffer = (WCHAR*)malloc((DateSize + 1)*sizeof(WCHAR));
+ if(NULL == wpBuffer)
+ {
+ free(wpFormat);
+ Fail("\nFailed to allocate memory to store the formatted string\n");
+ }
+
+ /*format a date by passing an invalid locale indentifier*/
+ err = GetDateFormatW(
+ -1, /*invalid locale identifier*/
+ dwFlags, /*function option*/
+ (SYSTEMTIME *)lpDate, /*always is NULL, or use system date*/
+ wpFormat, /*pointer to a picture string*/
+ wpBuffer, /*out buffer*/
+ DateSize); /*buffer size*/
+
+ free(wpBuffer);
+ free(wpFormat);
+
+ if(0 != err || GetLastError() != ERROR_INVALID_PARAMETER)
+ {
+ Fail("\nFailed to call GetDateFormatW for a negative test by "
+ "passing an invalid parameter, error code=%d\n", GetLastError());
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/CMakeLists.txt
index 646de9160b..fcd56fc7f2 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetDateFormatW_neg.c
+ GetDateFormatW_neg.cpp
)
add_executable(paltest_getdateformatw_getdateformatw_neg2
diff --git a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.c b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.c
deleted file mode 100644
index 676038f03a..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.c
+++ /dev/null
@@ -1,98 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: GetDateFormatW_neg.c
-**
-** Purpose: Negative test the GetDateFormatW API.
-** Call GetDateFormatW by passing an invalid flag
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- int err;
- WCHAR *wpFormat;
- LPCSTR lpString = "gg";
- CONST SYSTEMTIME *lpDate = NULL;
- LCID DefaultLocale;
- DWORD dwFlags;
- int DateSize;
- WCHAR *wpBuffer = NULL;
-
- /*Initialize the PAL environment*/
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- /*convert to a wide character string*/
- wpFormat = convert((char *)lpString);
-
- /*
- DefaultLocale = GetSystemDefaultLCID() which is not defined in PAL;
-
- LOCALE_SYSTEM_DEFAULT = MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)
-
- LANG_SYSTEM_DEFAULT = MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT);
- SUBLANG_SYS_DEFAULT is not defined in PAL, here use hardcoding,
- the value is from winnt.h
- */
-
- DefaultLocale = MAKELCID(MAKELANGID(LANG_NEUTRAL, 0x02), SORT_DEFAULT);
-
- dwFlags = DATE_USE_ALT_CALENDAR; /*set the flags*/
-
-
- DateSize = 0;
-
- /*retrieve the buffer size*/
- DateSize = GetDateFormatW(
- DefaultLocale, /*system default locale*/
- dwFlags, /*function option*/
- (SYSTEMTIME *)lpDate, /*always is NULL*/
- wpFormat, /*pointer to a picture string*/
- wpBuffer, /*out buffer*/
- DateSize); /*buffer size*/
-
- if(DateSize <= 0)
- {
- free(wpFormat);
- Fail("\nRetrieved an invalid buffer size\n");
- }
-
- wpBuffer = malloc((DateSize + 1)*sizeof(WCHAR));
- if(NULL == wpBuffer)
- {
- free(wpFormat);
- Fail("\nFailed to allocate memory to store the formatted string\n");
- }
-
- err = GetDateFormatW(
- DefaultLocale, /*system default locale*/
- 0x00000001|0x00000008,/*DATE_SHORTDATE|DATE_YEARMONTH */
- /*an invalid flag*/
- (SYSTEMTIME *)lpDate, /*always is NULL, or use system date*/
- wpFormat, /*pointer to a picture string*/
- wpBuffer, /*out buffer*/
- DateSize); /*buffer size*/
-
- free(wpBuffer);
- free(wpFormat);
-
- if(0 != err || GetLastError() != ERROR_INVALID_FLAGS)
- {
- Fail("\nFailed to call GetDateFormatW for a negative test by "
- "passing an invalid flag, error code=%d\n", GetLastError());
- }
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.cpp b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.cpp
new file mode 100644
index 0000000000..43f32cf69e
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/GetDateFormatW_neg2/GetDateFormatW_neg.cpp
@@ -0,0 +1,98 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: GetDateFormatW_neg.c
+**
+** Purpose: Negative test the GetDateFormatW API.
+** Call GetDateFormatW by passing an invalid flag
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ int err;
+ WCHAR *wpFormat;
+ LPCSTR lpString = "gg";
+ CONST SYSTEMTIME *lpDate = NULL;
+ LCID DefaultLocale;
+ DWORD dwFlags;
+ int DateSize;
+ WCHAR *wpBuffer = NULL;
+
+ /*Initialize the PAL environment*/
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ /*convert to a wide character string*/
+ wpFormat = convert((char *)lpString);
+
+ /*
+ DefaultLocale = GetSystemDefaultLCID() which is not defined in PAL;
+
+ LOCALE_SYSTEM_DEFAULT = MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)
+
+ LANG_SYSTEM_DEFAULT = MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT);
+ SUBLANG_SYS_DEFAULT is not defined in PAL, here use hardcoding,
+ the value is from winnt.h
+ */
+
+ DefaultLocale = MAKELCID(MAKELANGID(LANG_NEUTRAL, 0x02), SORT_DEFAULT);
+
+ dwFlags = DATE_USE_ALT_CALENDAR; /*set the flags*/
+
+
+ DateSize = 0;
+
+ /*retrieve the buffer size*/
+ DateSize = GetDateFormatW(
+ DefaultLocale, /*system default locale*/
+ dwFlags, /*function option*/
+ (SYSTEMTIME *)lpDate, /*always is NULL*/
+ wpFormat, /*pointer to a picture string*/
+ wpBuffer, /*out buffer*/
+ DateSize); /*buffer size*/
+
+ if(DateSize <= 0)
+ {
+ free(wpFormat);
+ Fail("\nRetrieved an invalid buffer size\n");
+ }
+
+ wpBuffer = (WCHAR*)malloc((DateSize + 1)*sizeof(WCHAR));
+ if(NULL == wpBuffer)
+ {
+ free(wpFormat);
+ Fail("\nFailed to allocate memory to store the formatted string\n");
+ }
+
+ err = GetDateFormatW(
+ DefaultLocale, /*system default locale*/
+ 0x00000001|0x00000008,/*DATE_SHORTDATE|DATE_YEARMONTH */
+ /*an invalid flag*/
+ (SYSTEMTIME *)lpDate, /*always is NULL, or use system date*/
+ wpFormat, /*pointer to a picture string*/
+ wpBuffer, /*out buffer*/
+ DateSize); /*buffer size*/
+
+ free(wpBuffer);
+ free(wpFormat);
+
+ if(0 != err || GetLastError() != ERROR_INVALID_FLAGS)
+ {
+ Fail("\nFailed to call GetDateFormatW for a negative test by "
+ "passing an invalid flag, error code=%d\n", GetLastError());
+ }
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/CMakeLists.txt
index 8c1e4b024e..bd86370611 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- GetDateFormatW.c
+ GetDateFormatW.cpp
)
add_executable(paltest_getdateformatw_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.c b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.c
deleted file mode 100644
index 264e397a49..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.c
+++ /dev/null
@@ -1,100 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: GetDateFormatW.c
-**
-** Purpose: Positive test the GetDateFormatW API.
-** Call GetDateFormatW to format a date string for
-** a specified locale
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- int err;
- WCHAR *wpFormat;
- LPCSTR lpString = "gg";
- CONST SYSTEMTIME *lpDate = NULL;
- LCID DefaultLocale;
- DWORD dwFlags;
- int DateSize;
- WCHAR *wpBuffer = NULL;
-
- /*Initialize the PAL environment*/
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- /*convert to a wide character string*/
- wpFormat = convert((char *)lpString);
-
- /*
- DefaultLocale = GetSystemDefaultLCID() which is not defined in PAL;
-
- LOCALE_SYSTEM_DEFAULT = MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)
-
- LANG_SYSTEM_DEFAULT = MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT);
- SUBLANG_SYS_DEFAULT is not defined in PAL, here use hardcoding,
- the value is from winnt.h
- */
- DefaultLocale = MAKELCID(MAKELANGID(LANG_NEUTRAL, 0x02), SORT_DEFAULT);
-
- dwFlags = DATE_USE_ALT_CALENDAR; /*set the flags*/
-
-
- DateSize = 0;
-
- /*retrieve the buffer size*/
- DateSize = GetDateFormatW(
- DefaultLocale, /*system default locale*/
- dwFlags, /*function option*/
- (SYSTEMTIME *)lpDate, /*always is NULL*/
- wpFormat, /*pointer to a picture string*/
- wpBuffer, /*out buffer*/
- DateSize); /*buffer size*/
-
- if(DateSize <= 0)
- {
- free(wpFormat);
- Fail("\nRetrieved an invalid buffer size\n");
- }
-
-
- wpBuffer = malloc((DateSize+1)*sizeof(WCHAR));
- if(NULL == wpBuffer)
- {
- free(wpFormat);
- Fail("\nFailed to allocate memory to store a formatted string\n");
- }
-
- /*retrieve the formatted string for a specified locale*/
- err = GetDateFormatW(
- DefaultLocale, /*system default locale*/
- dwFlags, /*function option*/
- (SYSTEMTIME *)lpDate, /*always is NULL*/
- wpFormat, /*pointer to a picture string*/
- wpBuffer, /*out buffer*/
- DateSize); /*buffer size*/
-
- if(0 == err)
- {
- free(wpBuffer);
- free(wpFormat);
- Fail("\nFailed to call GetDateFormatW to format a system data "
- "as a data string for system default locale!\n");
- }
-
- free(wpBuffer);
- free(wpFormat);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.cpp b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.cpp
new file mode 100644
index 0000000000..6e3c3b4894
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetDateFormatW/test1/GetDateFormatW.cpp
@@ -0,0 +1,100 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: GetDateFormatW.c
+**
+** Purpose: Positive test the GetDateFormatW API.
+** Call GetDateFormatW to format a date string for
+** a specified locale
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ int err;
+ WCHAR *wpFormat;
+ LPCSTR lpString = "gg";
+ CONST SYSTEMTIME *lpDate = NULL;
+ LCID DefaultLocale;
+ DWORD dwFlags;
+ int DateSize;
+ WCHAR *wpBuffer = NULL;
+
+ /*Initialize the PAL environment*/
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ /*convert to a wide character string*/
+ wpFormat = convert((char *)lpString);
+
+ /*
+ DefaultLocale = GetSystemDefaultLCID() which is not defined in PAL;
+
+ LOCALE_SYSTEM_DEFAULT = MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)
+
+ LANG_SYSTEM_DEFAULT = MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT);
+ SUBLANG_SYS_DEFAULT is not defined in PAL, here use hardcoding,
+ the value is from winnt.h
+ */
+ DefaultLocale = MAKELCID(MAKELANGID(LANG_NEUTRAL, 0x02), SORT_DEFAULT);
+
+ dwFlags = DATE_USE_ALT_CALENDAR; /*set the flags*/
+
+
+ DateSize = 0;
+
+ /*retrieve the buffer size*/
+ DateSize = GetDateFormatW(
+ DefaultLocale, /*system default locale*/
+ dwFlags, /*function option*/
+ (SYSTEMTIME *)lpDate, /*always is NULL*/
+ wpFormat, /*pointer to a picture string*/
+ wpBuffer, /*out buffer*/
+ DateSize); /*buffer size*/
+
+ if(DateSize <= 0)
+ {
+ free(wpFormat);
+ Fail("\nRetrieved an invalid buffer size\n");
+ }
+
+
+ wpBuffer = (WCHAR*)malloc((DateSize+1)*sizeof(WCHAR));
+ if(NULL == wpBuffer)
+ {
+ free(wpFormat);
+ Fail("\nFailed to allocate memory to store a formatted string\n");
+ }
+
+ /*retrieve the formatted string for a specified locale*/
+ err = GetDateFormatW(
+ DefaultLocale, /*system default locale*/
+ dwFlags, /*function option*/
+ (SYSTEMTIME *)lpDate, /*always is NULL*/
+ wpFormat, /*pointer to a picture string*/
+ wpBuffer, /*out buffer*/
+ DateSize); /*buffer size*/
+
+ if(0 == err)
+ {
+ free(wpBuffer);
+ free(wpFormat);
+ Fail("\nFailed to call GetDateFormatW to format a system data "
+ "as a data string for system default locale!\n");
+ }
+
+ free(wpBuffer);
+ free(wpFormat);
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/CMakeLists.txt
index 306400e558..3a745fdbd3 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getenvironmentstringsw_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/test.cpp
index 2bd9153e59..2bd9153e59 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentStringsW/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/CMakeLists.txt
index 184a6ef1f0..0721fd60b7 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getenvironmentvariablea_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.c
deleted file mode 100644
index 8862e823bc..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.c
+++ /dev/null
@@ -1,84 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source : test.c
-**
-** Purpose: Test for GetEnvironmentVariable() function
-** Assign a properly sized buffer and get an environment
-** variable, check to ensure it returns the correct values.
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[]) {
-
- /* Define some buffers needed for the function */
- char * pResultBuffer = NULL;
- int size = 0;
-
- /* A place to stash the returned values */
- int ReturnValueForLargeBuffer = 0;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Recieve and allocate the correct amount of memory for the buffer */
- size = ReturnValueForLargeBuffer = GetEnvironmentVariable("PATH",
- pResultBuffer,
- 0);
- pResultBuffer = malloc(size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer. "
- "Can't properly exec test case without this.\n");
- }
-
-
- /* Normal case, PATH should fit into this buffer */
- ReturnValueForLargeBuffer = GetEnvironmentVariable("PATH",
- pResultBuffer,
- size);
-
- /* Ensure that it returned a positive value */
- if(ReturnValueForLargeBuffer <= 0)
- {
- free(pResultBuffer);
-
- Fail("The return was %d, which indicates that the function failed.\n",
- ReturnValueForLargeBuffer);
- }
-
- /* Ensure that it succeeded and copied the correct number of characters.
- If this is true, then the return value should be one less of the size of
- the buffer. (Doesn't include that NULL byte)
- */
-
- if(ReturnValueForLargeBuffer != size-1)
- {
- free(pResultBuffer);
-
- Fail("The value returned was %d when it should have been %d. "
- "This should be the number of characters copied, minus the "
- "NULL byte.\n",ReturnValueForLargeBuffer, size-1);
- }
-
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.cpp b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.cpp
new file mode 100644
index 0000000000..23e9974467
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test1/test.cpp
@@ -0,0 +1,84 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source : test.c
+**
+** Purpose: Test for GetEnvironmentVariable() function
+** Assign a properly sized buffer and get an environment
+** variable, check to ensure it returns the correct values.
+**
+**
+**=========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[]) {
+
+ /* Define some buffers needed for the function */
+ char * pResultBuffer = NULL;
+ int size = 0;
+
+ /* A place to stash the returned values */
+ int ReturnValueForLargeBuffer = 0;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Recieve and allocate the correct amount of memory for the buffer */
+ size = ReturnValueForLargeBuffer = GetEnvironmentVariable("PATH",
+ pResultBuffer,
+ 0);
+ pResultBuffer = (char*)malloc(size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer. "
+ "Can't properly exec test case without this.\n");
+ }
+
+
+ /* Normal case, PATH should fit into this buffer */
+ ReturnValueForLargeBuffer = GetEnvironmentVariable("PATH",
+ pResultBuffer,
+ size);
+
+ /* Ensure that it returned a positive value */
+ if(ReturnValueForLargeBuffer <= 0)
+ {
+ free(pResultBuffer);
+
+ Fail("The return was %d, which indicates that the function failed.\n",
+ ReturnValueForLargeBuffer);
+ }
+
+ /* Ensure that it succeeded and copied the correct number of characters.
+ If this is true, then the return value should be one less of the size of
+ the buffer. (Doesn't include that NULL byte)
+ */
+
+ if(ReturnValueForLargeBuffer != size-1)
+ {
+ free(pResultBuffer);
+
+ Fail("The value returned was %d when it should have been %d. "
+ "This should be the number of characters copied, minus the "
+ "NULL byte.\n",ReturnValueForLargeBuffer, size-1);
+ }
+
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+}
+
+
+
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/CMakeLists.txt
index abfd73f458..a9be983369 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getenvironmentvariablea_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/test.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/test.cpp
index d26588e907..d26588e907 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test2/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/CMakeLists.txt
index a63c11b1a3..1c35eba54d 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getenvironmentvariablea_test3
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/test.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/test.cpp
index b51e139c95..b51e139c95 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test3/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/CMakeLists.txt
index 76cfdb6d49..331ea8ca6b 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getenvironmentvariablea_test4
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.c
deleted file mode 100644
index 1fea5719b4..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.c
+++ /dev/null
@@ -1,75 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source : test.c
-**
-** Purpose: Test for GetEnvironmentVariable() function
-** Set an Environment Variable, then use GetEnvironmentVariable to
-** retrieve it -- ensure that it retrieves properly.
-**
-**
-**=========================================================*/
-
-/* Depends on SetEnvironmentVariableW (because we're implmenting
- the wide version) and strcmp()
-*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[]) {
-
- /* Define some buffers needed for the function */
- char * pResultBuffer = NULL;
- WCHAR SomeEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
- WCHAR TheEnvironmentValue[] = {'T','E','S','T','\0'};
- int size = 0;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- SetEnvironmentVariableW(SomeEnvironmentVariable,
- TheEnvironmentValue);
-
-
- /* Normal case, PATH should fit into this buffer */
- size = GetEnvironmentVariable("PALTEST", // Variable Name
- pResultBuffer, // Buffer for Value
- 0); // Buffer size
-
- pResultBuffer = malloc(size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer. "
- "Can't properly exec test case without this.\n");
- }
-
-
- GetEnvironmentVariable("PALTEST",
- pResultBuffer,
- size);
-
- if(strcmp(pResultBuffer,"TEST") != 0)
- {
- free(pResultBuffer);
- Fail("ERROR: The value in the buffer should have been 'TEST' but "
- "was really '%s'.\n",pResultBuffer);
-
- }
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.cpp b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.cpp
new file mode 100644
index 0000000000..a09eb883e3
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test4/test.cpp
@@ -0,0 +1,75 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source : test.c
+**
+** Purpose: Test for GetEnvironmentVariable() function
+** Set an Environment Variable, then use GetEnvironmentVariable to
+** retrieve it -- ensure that it retrieves properly.
+**
+**
+**=========================================================*/
+
+/* Depends on SetEnvironmentVariableW (because we're implmenting
+ the wide version) and strcmp()
+*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[]) {
+
+ /* Define some buffers needed for the function */
+ char * pResultBuffer = NULL;
+ WCHAR SomeEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
+ WCHAR TheEnvironmentValue[] = {'T','E','S','T','\0'};
+ int size = 0;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ SetEnvironmentVariableW(SomeEnvironmentVariable,
+ TheEnvironmentValue);
+
+
+ /* Normal case, PATH should fit into this buffer */
+ size = GetEnvironmentVariable("PALTEST", // Variable Name
+ pResultBuffer, // Buffer for Value
+ 0); // Buffer size
+
+ pResultBuffer = (char*)malloc(size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer. "
+ "Can't properly exec test case without this.\n");
+ }
+
+
+ GetEnvironmentVariable("PALTEST",
+ pResultBuffer,
+ size);
+
+ if(strcmp(pResultBuffer,"TEST") != 0)
+ {
+ free(pResultBuffer);
+ Fail("ERROR: The value in the buffer should have been 'TEST' but "
+ "was really '%s'.\n",pResultBuffer);
+
+ }
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+}
+
+
+
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/CMakeLists.txt
index 548d86bb03..69bedf4947 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_getenvironmentvariablea_test5
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.c
deleted file mode 100644
index 8d63a1aecb..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.c
+++ /dev/null
@@ -1,145 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-** Source : test5.c
-**
-** Purpose: Test for GetEnvironmentVariableA() function
-** Create environment variables that differ only
-** in case and verify that they return the appropriate
-** value on the BSD environment.
-**
-**
-===========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
-#if WIN32
-
- return PASS;
-
-#else
-
- /* Define some buffers needed for the function */
- char * pResultBuffer = NULL;
-
- char FirstEnvironmentVariable[] = {"PALTEST"};
- char FirstEnvironmentValue[] = {"FIRST"};
-
- char SecondEnvironmentVariable[] = {"paltest"};
- char SecondEnvironmentValue[] = {"SECOND"};
-
- DWORD size = 0;
- BOOL bRc = TRUE;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Set the first environment variable */
- bRc = SetEnvironmentVariableA(FirstEnvironmentVariable,
- FirstEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n", GetLastError());
- }
-
-
- /* Normal case, PATH should fit into this buffer */
- size = GetEnvironmentVariableA(FirstEnvironmentVariable,
- pResultBuffer,
- 0);
-
- /* To account for the null character at the end of the string */
- size = size + 1;
-
- pResultBuffer = malloc(sizeof(char)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer\n.");
- }
-
- /* Try to retrieve the value of the first environment variable */
- GetEnvironmentVariableA(FirstEnvironmentVariable,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- free(pResultBuffer);
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the strings to see that the correct variable was returned */
- if(strcmp(pResultBuffer,FirstEnvironmentValue) != 0)
- {
- free(pResultBuffer);
- Fail("ERROR: The value in the buffer should have been '%s' but "
- "was really '%s'.\n",FirstEnvironmentValue, pResultBuffer);
- }
-
- free(pResultBuffer);
-
- /* Set the second environment Variable */
- bRc = SetEnvironmentVariableA(SecondEnvironmentVariable,
- SecondEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Reallocate the memory for the string */
- pResultBuffer = malloc(sizeof(char)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.");
- }
-
- /* Try retrieving the value of the first variable, even though the
- second variable has the same spelling and only differs in case */
- GetEnvironmentVariableA(FirstEnvironmentVariable,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- free(pResultBuffer);
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the two strings to confirm that the right value is returned */
- if(strcmp(pResultBuffer,FirstEnvironmentValue) != 0)
- {
- free(pResultBuffer);
- Fail("ERROR: The value in the buffer should have been '%s' but "
- "was really '%s'.\n",FirstEnvironmentValue,pResultBuffer);
- }
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-
-#endif
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.cpp b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.cpp
new file mode 100644
index 0000000000..19a4d25b64
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test5/test5.cpp
@@ -0,0 +1,145 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+** Source : test5.c
+**
+** Purpose: Test for GetEnvironmentVariableA() function
+** Create environment variables that differ only
+** in case and verify that they return the appropriate
+** value on the BSD environment.
+**
+**
+===========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+#if WIN32
+
+ return PASS;
+
+#else
+
+ /* Define some buffers needed for the function */
+ char * pResultBuffer = NULL;
+
+ char FirstEnvironmentVariable[] = {"PALTEST"};
+ char FirstEnvironmentValue[] = {"FIRST"};
+
+ char SecondEnvironmentVariable[] = {"paltest"};
+ char SecondEnvironmentValue[] = {"SECOND"};
+
+ DWORD size = 0;
+ BOOL bRc = TRUE;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Set the first environment variable */
+ bRc = SetEnvironmentVariableA(FirstEnvironmentVariable,
+ FirstEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n", GetLastError());
+ }
+
+
+ /* Normal case, PATH should fit into this buffer */
+ size = GetEnvironmentVariableA(FirstEnvironmentVariable,
+ pResultBuffer,
+ 0);
+
+ /* To account for the null character at the end of the string */
+ size = size + 1;
+
+ pResultBuffer = (char*)malloc(sizeof(char)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer\n.");
+ }
+
+ /* Try to retrieve the value of the first environment variable */
+ GetEnvironmentVariableA(FirstEnvironmentVariable,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ free(pResultBuffer);
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the strings to see that the correct variable was returned */
+ if(strcmp(pResultBuffer,FirstEnvironmentValue) != 0)
+ {
+ free(pResultBuffer);
+ Fail("ERROR: The value in the buffer should have been '%s' but "
+ "was really '%s'.\n",FirstEnvironmentValue, pResultBuffer);
+ }
+
+ free(pResultBuffer);
+
+ /* Set the second environment Variable */
+ bRc = SetEnvironmentVariableA(SecondEnvironmentVariable,
+ SecondEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Reallocate the memory for the string */
+ pResultBuffer = (char*)malloc(sizeof(char)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.");
+ }
+
+ /* Try retrieving the value of the first variable, even though the
+ second variable has the same spelling and only differs in case */
+ GetEnvironmentVariableA(FirstEnvironmentVariable,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ free(pResultBuffer);
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the two strings to confirm that the right value is returned */
+ if(strcmp(pResultBuffer,FirstEnvironmentValue) != 0)
+ {
+ free(pResultBuffer);
+ Fail("ERROR: The value in the buffer should have been '%s' but "
+ "was really '%s'.\n",FirstEnvironmentValue,pResultBuffer);
+ }
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+
+#endif
+}
+
+
+
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/CMakeLists.txt
index a0873bb7e7..38c186740f 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_getenvironmentvariablea_test6
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.c
deleted file mode 100644
index 8ef7571f59..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.c
+++ /dev/null
@@ -1,99 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-** Source : test6.c
-**
-** Purpose: Test for GetEnvironmentVariableA() function
-** Create environment variables that differ only
-** in case and verify that they return the appropriate
-** value on the BSD environment.
-**
-
-**
-===========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
-#if WIN32
-
- /* Define some buffers needed for the function */
- char * pResultBuffer = NULL;
-
- char FirstEnvironmentVariable[] = {"PALTEST"};
- char FirstEnvironmentValue[] = {"FIRST"};
- char ModifiedEnvVar[] = {"paltest"};
-
- DWORD size = 0;
- BOOL bRc = TRUE;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Set the first environment variable */
- bRc = SetEnvironmentVariableA(FirstEnvironmentVariable,
- FirstEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Normal case, PATH should fit into this buffer */
- size = GetEnvironmentVariableA(ModifiedEnvVar,
- pResultBuffer,
- 0);
-
- /* To account for the nul character at the end of the string */
- size = size + 1;
-
- pResultBuffer = malloc(sizeof(char)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
- }
-
- /* Try to retrieve the value of the first environment variable */
- GetEnvironmentVariableA(ModifiedEnvVar,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- free(pResultBuffer);
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the strings to see that the correct variable was returned */
- if(strcmp(pResultBuffer,FirstEnvironmentValue) != 0)
- {
- free(pResultBuffer);
- Fail("ERROR: The value in the buffer should have been '%s' but "
- "was really '%s'.\n",FirstEnvironmentValue, pResultBuffer);
- }
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-
-
-#else
-
- return PASS;
-#endif
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.cpp b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.cpp
new file mode 100644
index 0000000000..837036a0a9
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableA/test6/test6.cpp
@@ -0,0 +1,99 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+** Source : test6.c
+**
+** Purpose: Test for GetEnvironmentVariableA() function
+** Create environment variables that differ only
+** in case and verify that they return the appropriate
+** value on the BSD environment.
+**
+
+**
+===========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+#if WIN32
+
+ /* Define some buffers needed for the function */
+ char * pResultBuffer = NULL;
+
+ char FirstEnvironmentVariable[] = {"PALTEST"};
+ char FirstEnvironmentValue[] = {"FIRST"};
+ char ModifiedEnvVar[] = {"paltest"};
+
+ DWORD size = 0;
+ BOOL bRc = TRUE;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Set the first environment variable */
+ bRc = SetEnvironmentVariableA(FirstEnvironmentVariable,
+ FirstEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Normal case, PATH should fit into this buffer */
+ size = GetEnvironmentVariableA(ModifiedEnvVar,
+ pResultBuffer,
+ 0);
+
+ /* To account for the nul character at the end of the string */
+ size = size + 1;
+
+ pResultBuffer = (char*)malloc(sizeof(char)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
+ }
+
+ /* Try to retrieve the value of the first environment variable */
+ GetEnvironmentVariableA(ModifiedEnvVar,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ free(pResultBuffer);
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the strings to see that the correct variable was returned */
+ if(strcmp(pResultBuffer,FirstEnvironmentValue) != 0)
+ {
+ free(pResultBuffer);
+ Fail("ERROR: The value in the buffer should have been '%s' but "
+ "was really '%s'.\n",FirstEnvironmentValue, pResultBuffer);
+ }
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+
+
+#else
+
+ return PASS;
+#endif
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/CMakeLists.txt
index 567c992461..a3cb878ef4 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getenvironmentvariablew_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.c
deleted file mode 100644
index 6c764509d0..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.c
+++ /dev/null
@@ -1,79 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source : test.c
-**
-** Purpose: Test for GetEnvironmentVariable() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
- /* Define some buffers needed for the function */
- WCHAR * pResultBuffer = NULL;
- int size = 0;
-
- /* A place to stash the returned values */
- int ReturnValueForLargeBuffer = 0;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Recieve and allocate the correct amount of memory for the buffer */
- size = ReturnValueForLargeBuffer =
- GetEnvironmentVariable(convert("PATH"),
- pResultBuffer,
- 0);
-
- pResultBuffer = malloc(size*sizeof(WCHAR));
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer. "
- "Can't properly exec test case without this.\n");
- }
-
-
- /* Normal case, PATH should fit into this buffer */
- ReturnValueForLargeBuffer = GetEnvironmentVariable(convert("PATH"),
- pResultBuffer,
- size);
- free(pResultBuffer);
-
- /* Ensure that it returned a positive value */
- if(ReturnValueForLargeBuffer <= 0)
- {
- Fail("The return was %d, which indicates that the function failed.\n",
- ReturnValueForLargeBuffer);
- }
-
- /* Ensure that it succeeded and copied the correct number of characters.
- If this is true, then the return value should be one less of the
- size of the buffer. (Doesn't include that NULL byte)
- */
- if(ReturnValueForLargeBuffer != size-1)
- {
- Fail("The value returned was %d when it should have been %d. This "
- "should be the number of characters copied, "
- "minus the NULL byte.\n", ReturnValueForLargeBuffer, size-1);
- }
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.cpp b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.cpp
new file mode 100644
index 0000000000..cb5fc00554
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test1/test.cpp
@@ -0,0 +1,79 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source : test.c
+**
+** Purpose: Test for GetEnvironmentVariable() function
+**
+**
+**=========================================================*/
+
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ /* Define some buffers needed for the function */
+ WCHAR * pResultBuffer = NULL;
+ int size = 0;
+
+ /* A place to stash the returned values */
+ int ReturnValueForLargeBuffer = 0;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Recieve and allocate the correct amount of memory for the buffer */
+ size = ReturnValueForLargeBuffer =
+ GetEnvironmentVariable(convert("PATH"),
+ pResultBuffer,
+ 0);
+
+ pResultBuffer = (WCHAR*)malloc(size*sizeof(WCHAR));
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer. "
+ "Can't properly exec test case without this.\n");
+ }
+
+
+ /* Normal case, PATH should fit into this buffer */
+ ReturnValueForLargeBuffer = GetEnvironmentVariable(convert("PATH"),
+ pResultBuffer,
+ size);
+ free(pResultBuffer);
+
+ /* Ensure that it returned a positive value */
+ if(ReturnValueForLargeBuffer <= 0)
+ {
+ Fail("The return was %d, which indicates that the function failed.\n",
+ ReturnValueForLargeBuffer);
+ }
+
+ /* Ensure that it succeeded and copied the correct number of characters.
+ If this is true, then the return value should be one less of the
+ size of the buffer. (Doesn't include that NULL byte)
+ */
+ if(ReturnValueForLargeBuffer != size-1)
+ {
+ Fail("The value returned was %d when it should have been %d. This "
+ "should be the number of characters copied, "
+ "minus the NULL byte.\n", ReturnValueForLargeBuffer, size-1);
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
+
+
+
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/CMakeLists.txt
index 7234f61ed3..2c6ec6247e 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getenvironmentvariablew_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/test.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/test.cpp
index 6fa753c8d3..6fa753c8d3 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test2/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/CMakeLists.txt
index bafd75e52e..6af382b6cd 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getenvironmentvariablew_test3
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/test.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/test.cpp
index 03781e723f..03781e723f 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test3/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/CMakeLists.txt
index f870bd6b22..674b187fa7 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getenvironmentvariablew_test4
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.c
deleted file mode 100644
index b5894efc6e..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.c
+++ /dev/null
@@ -1,63 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source : test.c
-**
-** Purpose: Test for GetEnvironmentVariable() function
-**
-**
-**=========================================================*/
-
-/* Depends on SetEnvironmentVariableW (because we're implmenting the wide
- version) and strcmp() */
-
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[]) {
-
- /* Define some buffers needed for the function */
- WCHAR * pResultBuffer = NULL;
- WCHAR SomeEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
- WCHAR TheEnvironmentValue[] = {'T','E','S','T','\0'};
- int size;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- SetEnvironmentVariable(SomeEnvironmentVariable,
- TheEnvironmentValue);
-
-
- /* Normal case, PATH should fit into this buffer */
- size = GetEnvironmentVariable(convert("PALTEST"), // Variable Name
- pResultBuffer, // Buffer for Value
- 0); // Buffer size
-
- pResultBuffer = malloc(size*sizeof(WCHAR));
-
- GetEnvironmentVariable(convert("PALTEST"),
- pResultBuffer,
- size);
-
- if(wcsncmp(pResultBuffer,convert("TEST"),wcslen(pResultBuffer) * 2) != 0)
- {
- Fail("ERROR: The value in the buffer should have been 'TEST' but was "
- "really '%s'.",convertC(pResultBuffer));
- }
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-}
-
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.cpp b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.cpp
new file mode 100644
index 0000000000..1ee3e72c9d
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test4/test.cpp
@@ -0,0 +1,63 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source : test.c
+**
+** Purpose: Test for GetEnvironmentVariable() function
+**
+**
+**=========================================================*/
+
+/* Depends on SetEnvironmentVariableW (because we're implmenting the wide
+ version) and strcmp() */
+
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[]) {
+
+ /* Define some buffers needed for the function */
+ WCHAR * pResultBuffer = NULL;
+ WCHAR SomeEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
+ WCHAR TheEnvironmentValue[] = {'T','E','S','T','\0'};
+ int size;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ SetEnvironmentVariable(SomeEnvironmentVariable,
+ TheEnvironmentValue);
+
+
+ /* Normal case, PATH should fit into this buffer */
+ size = GetEnvironmentVariable(convert("PALTEST"), // Variable Name
+ pResultBuffer, // Buffer for Value
+ 0); // Buffer size
+
+ pResultBuffer = (WCHAR*)malloc(size*sizeof(WCHAR));
+
+ GetEnvironmentVariable(convert("PALTEST"),
+ pResultBuffer,
+ size);
+
+ if(wcsncmp(pResultBuffer,convert("TEST"),wcslen(pResultBuffer) * 2) != 0)
+ {
+ Fail("ERROR: The value in the buffer should have been 'TEST' but was "
+ "really '%s'.",convertC(pResultBuffer));
+ }
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+}
+
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/CMakeLists.txt
index ab44781279..71e974703b 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_getenvironmentvariablew_test5
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.c
deleted file mode 100644
index 58eba3a380..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.c
+++ /dev/null
@@ -1,144 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-** Source : test5.c
-**
-** Purpose: Test for GetEnvironmentVariableW() function
-** Create environment variables that differ only
-** in case and verify that they return the appropriate
-** value on the BSD environment.
-**
-**
-===========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
-#if WIN32
-
- return PASS;
-
-#else
-
- /* Define some buffers needed for the function */
- WCHAR * pResultBuffer = NULL;
-
- WCHAR FirstEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
- WCHAR FirstEnvironmentValue[] = {'F','I','R','S','T','\0'};
-
- WCHAR SecondEnvironmentVariable[] = {'p','a','l','t','e','s','t','\0'};
- WCHAR SecondEnvironmentValue[] = {'S','E','C','O','N','D','\0'};
-
- DWORD size = 0;
- BOOL bRc = TRUE;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Set the first environment variable */
- bRc = SetEnvironmentVariableW(FirstEnvironmentVariable,
- FirstEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n", GetLastError());
- }
-
- /* Normal case, PATH should fit into this buffer */
- size = GetEnvironmentVariableW(FirstEnvironmentVariable,
- pResultBuffer,
- 0);
-
- /* To account for the nul character at the end of the string */
- size = size + 1;
-
- pResultBuffer = malloc(sizeof(WCHAR)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
- }
-
- /* Try to retrieve the value of the first environment variable */
- GetEnvironmentVariableW(FirstEnvironmentVariable,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- free(pResultBuffer);
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the strings to see that the correct variable was returned */
- if(wcsncmp(pResultBuffer,FirstEnvironmentValue,wcslen(pResultBuffer)) != 0)
- {
- free(pResultBuffer);
- Fail("ERROR: The value in the buffer should have been '%S' but "
- "was really '%S'.\n",FirstEnvironmentValue, pResultBuffer);
- }
-
- free(pResultBuffer);
-
- /* Set the second environment Variable */
- bRc = SetEnvironmentVariableW(SecondEnvironmentVariable,
- SecondEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Reallocate the memory for the string */
- pResultBuffer = malloc(sizeof(WCHAR)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
- }
-
- /* Try retrieving the value of the first variable, even though the
- second variable has the same spelling and only differs in case */
- GetEnvironmentVariableW(FirstEnvironmentVariable,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- free(pResultBuffer);
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the two strings to confirm that the right value is returned */
- if(wcsncmp(pResultBuffer,FirstEnvironmentValue,wcslen(pResultBuffer)) != 0)
- {
- free(pResultBuffer);
- Fail("ERROR: The value in the buffer should have been '%S' but "
- "was really '%S'.\n",FirstEnvironmentValue,pResultBuffer);
- }
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-
-#endif
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.cpp b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.cpp
new file mode 100644
index 0000000000..179fc17f0b
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test5/test5.cpp
@@ -0,0 +1,144 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+** Source : test5.c
+**
+** Purpose: Test for GetEnvironmentVariableW() function
+** Create environment variables that differ only
+** in case and verify that they return the appropriate
+** value on the BSD environment.
+**
+**
+===========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+#if WIN32
+
+ return PASS;
+
+#else
+
+ /* Define some buffers needed for the function */
+ WCHAR * pResultBuffer = NULL;
+
+ WCHAR FirstEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
+ WCHAR FirstEnvironmentValue[] = {'F','I','R','S','T','\0'};
+
+ WCHAR SecondEnvironmentVariable[] = {'p','a','l','t','e','s','t','\0'};
+ WCHAR SecondEnvironmentValue[] = {'S','E','C','O','N','D','\0'};
+
+ DWORD size = 0;
+ BOOL bRc = TRUE;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Set the first environment variable */
+ bRc = SetEnvironmentVariableW(FirstEnvironmentVariable,
+ FirstEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n", GetLastError());
+ }
+
+ /* Normal case, PATH should fit into this buffer */
+ size = GetEnvironmentVariableW(FirstEnvironmentVariable,
+ pResultBuffer,
+ 0);
+
+ /* To account for the nul character at the end of the string */
+ size = size + 1;
+
+ pResultBuffer = (WCHAR*)malloc(sizeof(WCHAR)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
+ }
+
+ /* Try to retrieve the value of the first environment variable */
+ GetEnvironmentVariableW(FirstEnvironmentVariable,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ free(pResultBuffer);
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the strings to see that the correct variable was returned */
+ if(wcsncmp(pResultBuffer,FirstEnvironmentValue,wcslen(pResultBuffer)) != 0)
+ {
+ free(pResultBuffer);
+ Fail("ERROR: The value in the buffer should have been '%S' but "
+ "was really '%S'.\n",FirstEnvironmentValue, pResultBuffer);
+ }
+
+ free(pResultBuffer);
+
+ /* Set the second environment Variable */
+ bRc = SetEnvironmentVariableW(SecondEnvironmentVariable,
+ SecondEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Reallocate the memory for the string */
+ pResultBuffer = (WCHAR*)malloc(sizeof(WCHAR)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
+ }
+
+ /* Try retrieving the value of the first variable, even though the
+ second variable has the same spelling and only differs in case */
+ GetEnvironmentVariableW(FirstEnvironmentVariable,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ free(pResultBuffer);
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the two strings to confirm that the right value is returned */
+ if(wcsncmp(pResultBuffer,FirstEnvironmentValue,wcslen(pResultBuffer)) != 0)
+ {
+ free(pResultBuffer);
+ Fail("ERROR: The value in the buffer should have been '%S' but "
+ "was really '%S'.\n",FirstEnvironmentValue,pResultBuffer);
+ }
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+
+#endif
+}
+
+
+
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/CMakeLists.txt
index e504c8323a..8771ab0cc8 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_getenvironmentvariablew_test6
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.c b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.c
deleted file mode 100644
index 85f31be9c2..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.c
+++ /dev/null
@@ -1,99 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-** Source : test6.c
-**
-** Purpose: Test for GetEnvironmentVariableW() function
-** Create environment variables that differ only
-** in case and verify that they return the appropriate
-** value on the BSD environment.
-**
-**
-===========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
-#if WIN32
-
- /* Define some buffers needed for the function */
- WCHAR * pResultBuffer = NULL;
-
- WCHAR FirstEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
- WCHAR FirstEnvironmentValue[] = {'F','I','R','S','T','\0'};
-
- WCHAR ModifiedEnvironmentVariable[] = {'p','a','l','t','e','s','t','\0'};
-
- DWORD size = 0;
- BOOL bRc = TRUE;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Set the first environment variable */
- bRc = SetEnvironmentVariableW(FirstEnvironmentVariable,
- FirstEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Normal case, PATH should fit into this buffer */
- size = GetEnvironmentVariableW(ModifiedEnvironmentVariable,
- pResultBuffer,
- 0);
-
- /* To account for the nul character at the end of the string */
- size = size + 1;
-
- pResultBuffer = malloc(sizeof(WCHAR)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
- }
-
- /* Try to retrieve the value of the first environment variable */
- GetEnvironmentVariableW(ModifiedEnvironmentVariable,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- free(pResultBuffer);
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the strings to see that the correct variable was returned */
- if(wcsncmp(pResultBuffer,FirstEnvironmentValue,wcslen(pResultBuffer)) != 0)
- {
- free(pResultBuffer);
- Fail("ERROR: The value in the buffer should have been '%S' but "
- "was really '%S'.\n",FirstEnvironmentValue, pResultBuffer);
- }
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-
-
-#else
-
- return PASS;
-#endif
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.cpp b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.cpp
new file mode 100644
index 0000000000..e376950841
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/GetEnvironmentVariableW/test6/test6.cpp
@@ -0,0 +1,99 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+** Source : test6.c
+**
+** Purpose: Test for GetEnvironmentVariableW() function
+** Create environment variables that differ only
+** in case and verify that they return the appropriate
+** value on the BSD environment.
+**
+**
+===========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+#if WIN32
+
+ /* Define some buffers needed for the function */
+ WCHAR * pResultBuffer = NULL;
+
+ WCHAR FirstEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
+ WCHAR FirstEnvironmentValue[] = {'F','I','R','S','T','\0'};
+
+ WCHAR ModifiedEnvironmentVariable[] = {'p','a','l','t','e','s','t','\0'};
+
+ DWORD size = 0;
+ BOOL bRc = TRUE;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Set the first environment variable */
+ bRc = SetEnvironmentVariableW(FirstEnvironmentVariable,
+ FirstEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Normal case, PATH should fit into this buffer */
+ size = GetEnvironmentVariableW(ModifiedEnvironmentVariable,
+ pResultBuffer,
+ 0);
+
+ /* To account for the nul character at the end of the string */
+ size = size + 1;
+
+ pResultBuffer = (WCHAR*)malloc(sizeof(WCHAR)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
+ }
+
+ /* Try to retrieve the value of the first environment variable */
+ GetEnvironmentVariableW(ModifiedEnvironmentVariable,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ free(pResultBuffer);
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the strings to see that the correct variable was returned */
+ if(wcsncmp(pResultBuffer,FirstEnvironmentValue,wcslen(pResultBuffer)) != 0)
+ {
+ free(pResultBuffer);
+ Fail("ERROR: The value in the buffer should have been '%S' but "
+ "was really '%S'.\n",FirstEnvironmentValue, pResultBuffer);
+ }
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+
+
+#else
+
+ return PASS;
+#endif
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/CMakeLists.txt
index 09e650c924..3c851c7260 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getlasterror_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/test.cpp
index 65f56e595f..65f56e595f 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetLastError/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/CMakeLists.txt
index 960291fe79..9419517128 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getsysteminfo_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/test.cpp
index 5f3608fb70..5f3608fb70 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetSystemInfo/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/CMakeLists.txt
index 5c6ea26a41..f7be23bc0b 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_gettickcount_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/test.cpp
index ad71ba5d6c..ad71ba5d6c 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetTickCount/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/CMakeLists.txt
index a1d5ab21b8..8ed7ace073 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getusernamew_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/test.cpp
index 809f14c12d..809f14c12d 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetUserNameW/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/CMakeLists.txt
index b9dd711d36..2cb305f22b 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getversionexa_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/test.cpp
index 5dd20c6576..5dd20c6576 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetVersionExA/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/CMakeLists.txt
index d7eb683343..09494240cc 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_getversionexw_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/test.cpp
index 69aae54bcf..69aae54bcf 100644
--- a/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/GetVersionExW/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/CMakeLists.txt
index d41e6bc5ab..bc3f11b705 100644
--- a/src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_isbadcodeptr_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/test1.c b/src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/test1.cpp
index 4b2763d457..4b2763d457 100644
--- a/src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/test1.c
+++ b/src/pal/tests/palsuite/miscellaneous/IsBadCodePtr/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/CMakeLists.txt
index f1e84d73b8..82aecefa70 100644
--- a/src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_isbadreadptr_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/test.c b/src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/test.cpp
index 24b7ceb7e6..24b7ceb7e6 100644
--- a/src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/IsBadReadPtr/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/CMakeLists.txt
index 2b2e6aae2e..e3a08167b3 100644
--- a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_isbadwriteptr_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/test.c b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/test.cpp
index 018d7beae0..018d7beae0 100644
--- a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/CMakeLists.txt
index c033f8054f..718cbaa297 100644
--- a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_isbadwriteptr_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/test2.c b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/test2.cpp
index 2d4d53e3b7..2d4d53e3b7 100644
--- a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/test2.c
+++ b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/CMakeLists.txt
index 32cb901e8d..0efd3179db 100644
--- a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_isbadwriteptr_test3
diff --git a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.c b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp
index 4c058a8987..4c058a8987 100644
--- a/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.c
+++ b/src/pal/tests/palsuite/miscellaneous/IsBadWritePtr/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/CMakeLists.txt
index 5e77e8ba98..bc80853ea1 100644
--- a/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_messageboxw_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/test.cpp
index 8eb8c0eb7e..8eb8c0eb7e 100644
--- a/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/CMakeLists.txt
index 4b0af2e77e..b8993af4cf 100644
--- a/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_messageboxw_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/test.c b/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/test.cpp
index e2ff0cf6d6..e2ff0cf6d6 100644
--- a/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/MessageBoxW/test2/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/CMakeLists.txt
index b66248522b..5d63281eab 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_setenvironmentvariablea_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/test1.c b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/test1.cpp
index 86a44218f1..86a44218f1 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/test1.c
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/CMakeLists.txt
index c062c6df65..fe05887c3e 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_setenvironmentvariablea_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/test2.c b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/test2.cpp
index 984007e6f1..984007e6f1 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/test2.c
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/CMakeLists.txt
index 159f574abe..98c9dc0a63 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_setenvironmentvariablea_test3
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.c b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.c
deleted file mode 100644
index fa24275da7..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.c
+++ /dev/null
@@ -1,144 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-** Source : test3.c
-**
-** Purpose: Test for SetEnvironmentVariableA() function
-** Create environment variables that differ only
-** in case and verify that they return the appropriate
-** value on the BSD environment.
-**
-**
-===========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
-#if WIN32
-
- return PASS;
-
-#else
-
- /* Define some buffers needed for the function */
- char * pResultBuffer = NULL;
-
- char FirstEnvironmentVariable[] = {"PALTEST"};
- char FirstEnvironmentValue[] = {"FIRST"};
-
- char SecondEnvironmentVariable[] = {"paltest"};
- char SecondEnvironmentValue[] = {"SECOND"};
-
- DWORD size = 0;
- BOOL bRc = TRUE;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Set the first environment variable */
- bRc = SetEnvironmentVariableA(FirstEnvironmentVariable,
- FirstEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Set the second environment Variable */
- bRc = SetEnvironmentVariableA(SecondEnvironmentVariable,
- SecondEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n",
- GetLastError());
- }
-
-
- /* Normal case, PATH should fit into this buffer */
- size = GetEnvironmentVariableA(FirstEnvironmentVariable,
- pResultBuffer,
- 0);
-
- /* increase size to account for the null char at the end */
- size = size + 1;
-
- pResultBuffer = malloc(sizeof(char)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
- }
-
- /* Try to retrieve the value of the first environment variable */
- GetEnvironmentVariable(FirstEnvironmentVariable,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- free(pResultBuffer);
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the strings to see that the correct variable was returned */
- if(strcmp(pResultBuffer,FirstEnvironmentValue) != 0)
- {
- Trace("ERROR: The value in the buffer should have been '%s' but "
- "was really '%s'.\n",FirstEnvironmentValue, pResultBuffer);
- free(pResultBuffer);
- Fail("");
- }
-
- free(pResultBuffer);
-
- /* Reallocate the memory for the string */
- pResultBuffer = malloc(sizeof(char)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
- }
-
- /* Try retrieving the value of the first variable, even though the
- second variable has the same spelling and only differs in case */
- GetEnvironmentVariable(SecondEnvironmentVariable,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the two strings to confirm that the right value is returned */
- if(strcmp(pResultBuffer,SecondEnvironmentValue) != 0)
- {
- Trace("ERROR: The value in the buffer should have been '%s' but "
- "was really '%s'.\n",SecondEnvironmentValue,pResultBuffer);
- free(pResultBuffer);
- Fail("");
- }
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-
-#endif
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.cpp b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.cpp
new file mode 100644
index 0000000000..539e33004b
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test3/test3.cpp
@@ -0,0 +1,144 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+** Source : test3.c
+**
+** Purpose: Test for SetEnvironmentVariableA() function
+** Create environment variables that differ only
+** in case and verify that they return the appropriate
+** value on the BSD environment.
+**
+**
+===========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+#if WIN32
+
+ return PASS;
+
+#else
+
+ /* Define some buffers needed for the function */
+ char * pResultBuffer = NULL;
+
+ char FirstEnvironmentVariable[] = {"PALTEST"};
+ char FirstEnvironmentValue[] = {"FIRST"};
+
+ char SecondEnvironmentVariable[] = {"paltest"};
+ char SecondEnvironmentValue[] = {"SECOND"};
+
+ DWORD size = 0;
+ BOOL bRc = TRUE;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Set the first environment variable */
+ bRc = SetEnvironmentVariableA(FirstEnvironmentVariable,
+ FirstEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Set the second environment Variable */
+ bRc = SetEnvironmentVariableA(SecondEnvironmentVariable,
+ SecondEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+
+ /* Normal case, PATH should fit into this buffer */
+ size = GetEnvironmentVariableA(FirstEnvironmentVariable,
+ pResultBuffer,
+ 0);
+
+ /* increase size to account for the null char at the end */
+ size = size + 1;
+
+ pResultBuffer = (char*)malloc(sizeof(char)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
+ }
+
+ /* Try to retrieve the value of the first environment variable */
+ GetEnvironmentVariable(FirstEnvironmentVariable,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ free(pResultBuffer);
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the strings to see that the correct variable was returned */
+ if(strcmp(pResultBuffer,FirstEnvironmentValue) != 0)
+ {
+ Trace("ERROR: The value in the buffer should have been '%s' but "
+ "was really '%s'.\n",FirstEnvironmentValue, pResultBuffer);
+ free(pResultBuffer);
+ Fail("");
+ }
+
+ free(pResultBuffer);
+
+ /* Reallocate the memory for the string */
+ pResultBuffer = (char*)malloc(sizeof(char)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
+ }
+
+ /* Try retrieving the value of the first variable, even though the
+ second variable has the same spelling and only differs in case */
+ GetEnvironmentVariable(SecondEnvironmentVariable,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the two strings to confirm that the right value is returned */
+ if(strcmp(pResultBuffer,SecondEnvironmentValue) != 0)
+ {
+ Trace("ERROR: The value in the buffer should have been '%s' but "
+ "was really '%s'.\n",SecondEnvironmentValue,pResultBuffer);
+ free(pResultBuffer);
+ Fail("");
+ }
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+
+#endif
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/CMakeLists.txt
index 29cca8d7b4..1c53d4b6a1 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_setenvironmentvariablea_test4
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.c b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.c
deleted file mode 100644
index 557cef74c9..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.c
+++ /dev/null
@@ -1,100 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-** Source : test4.c
-**
-** Purpose: Test for SetEnvironmentVariableA() function
-** Create environment variables that differ only
-** in case and verify that they return the appropriate
-** value in the WIN32 Environment
-**
-
-**
-===========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
-#if WIN32
-
- /* Define some buffers needed for the function */
- char * pResultBuffer = NULL;
-
- char FirstEnvironmentVariable[] = {"PALTEST"};
- char FirstEnvironmentValue[] = {"FIRST"};
- char ModifiedEnvVar[] = {"paltest"};
-
- DWORD size = 0;
- BOOL bRc = TRUE;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Set the first environment variable */
- bRc = SetEnvironmentVariableA(FirstEnvironmentVariable,
- FirstEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Normal case, PATH should fit into this buffer */
- size = GetEnvironmentVariableA(ModifiedEnvVar,
- pResultBuffer,
- 0);
-
- /* To account for the null character at the end of the string */
- size = size + 1;
-
- pResultBuffer = malloc(sizeof(char)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
- }
-
- /* Try to retrieve the value of the first environment variable */
- GetEnvironmentVariableA(ModifiedEnvVar,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- free(pResultBuffer);
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the strings to see that the correct variable was returned */
- if(strcmp(pResultBuffer,FirstEnvironmentValue) != 0)
- {
- Trace("ERROR: The value in the buffer should have been '%s' but "
- "was really '%s'.\n",FirstEnvironmentValue, pResultBuffer);
- free(pResultBuffer);
- Fail("");
- }
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-
-
-#else
-
- return PASS;
-#endif
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.cpp b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.cpp
new file mode 100644
index 0000000000..de3059c8d8
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableA/test4/test4.cpp
@@ -0,0 +1,100 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+** Source : test4.c
+**
+** Purpose: Test for SetEnvironmentVariableA() function
+** Create environment variables that differ only
+** in case and verify that they return the appropriate
+** value in the WIN32 Environment
+**
+
+**
+===========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+#if WIN32
+
+ /* Define some buffers needed for the function */
+ char * pResultBuffer = NULL;
+
+ char FirstEnvironmentVariable[] = {"PALTEST"};
+ char FirstEnvironmentValue[] = {"FIRST"};
+ char ModifiedEnvVar[] = {"paltest"};
+
+ DWORD size = 0;
+ BOOL bRc = TRUE;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Set the first environment variable */
+ bRc = SetEnvironmentVariableA(FirstEnvironmentVariable,
+ FirstEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Normal case, PATH should fit into this buffer */
+ size = GetEnvironmentVariableA(ModifiedEnvVar,
+ pResultBuffer,
+ 0);
+
+ /* To account for the null character at the end of the string */
+ size = size + 1;
+
+ pResultBuffer = (char*)malloc(sizeof(char)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
+ }
+
+ /* Try to retrieve the value of the first environment variable */
+ GetEnvironmentVariableA(ModifiedEnvVar,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ free(pResultBuffer);
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the strings to see that the correct variable was returned */
+ if(strcmp(pResultBuffer,FirstEnvironmentValue) != 0)
+ {
+ Trace("ERROR: The value in the buffer should have been '%s' but "
+ "was really '%s'.\n",FirstEnvironmentValue, pResultBuffer);
+ free(pResultBuffer);
+ Fail("");
+ }
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+
+
+#else
+
+ return PASS;
+#endif
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/CMakeLists.txt
index 247dceefd9..6eb52ab92e 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_setenvironmentvariablew_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp
index bddbba7940..bddbba7940 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/CMakeLists.txt
index a69343ccd5..a82d849bde 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_setenvironmentvariablew_test2
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/test.c b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/test.cpp
index 12f4887b6d..12f4887b6d 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test2/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/CMakeLists.txt
index e9072c7143..266231e6e9 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_setenvironmentvariablew_test3
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.c b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.c
deleted file mode 100644
index 02d0a2d6d9..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.c
+++ /dev/null
@@ -1,143 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-** Source : test3.c
-**
-** Purpose: Test for SetEnvironmentVariableW() function
-** Create environment variables that differ only
-** in case and verify that they return the appropriate
-** value on the BSD environment.
-**
-**
-===========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
-#if WIN32
-
- return PASS;
-
-#else
-
- /* Define some buffers needed for the function */
- WCHAR * pResultBuffer = NULL;
-
- WCHAR FirstEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
- WCHAR FirstEnvironmentValue[] = {'F','I','R','S','T','\0'};
-
- WCHAR SecondEnvironmentVariable[] = {'p','a','l','t','e','s','t','\0'};
- WCHAR SecondEnvironmentValue[] = {'S','E','C','O','N','D','\0'};
-
- DWORD size = 0;
- BOOL bRc = TRUE;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Set the first environment variable */
- bRc = SetEnvironmentVariableW(FirstEnvironmentVariable,
- FirstEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Set the second environment Variable */
- bRc = SetEnvironmentVariableW(SecondEnvironmentVariable,
- SecondEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n",
- GetLastError());
- }
-
-
- /* Normal case, PATH should fit into this buffer */
- size = GetEnvironmentVariableW(FirstEnvironmentVariable,
- pResultBuffer,
- 0);
-
- /* Increase size to account for the null char at the end */
- size = size + 1;
-
- pResultBuffer = malloc(sizeof(WCHAR)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
- }
-
- /* Try to retrieve the value of the first environment variable */
- GetEnvironmentVariableW(FirstEnvironmentVariable,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the strings to see that the correct variable was returned */
- if(wcscmp(pResultBuffer,FirstEnvironmentValue) != 0)
- {
- Trace("ERROR: The value in the buffer should have been '%S' but "
- "was really '%S'.\n",FirstEnvironmentValue, pResultBuffer);
- free(pResultBuffer);
- Fail("");
- }
-
- free(pResultBuffer);
-
- /* Reallocate the memory for the string */
- pResultBuffer = malloc(sizeof(WCHAR)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
- }
-
- /* Try retrieving the value of the first variable, even though the
- second variable has the same spelling and only differs in case */
- GetEnvironmentVariableW(SecondEnvironmentVariable,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the two strings to confirm that the right value is returned */
- if(wcscmp(pResultBuffer,SecondEnvironmentValue) != 0)
- {
- Trace("ERROR: The value in the buffer should have been '%S' but "
- "was really '%S'.\n",SecondEnvironmentValue,pResultBuffer);
- free(pResultBuffer);
- Fail("");
- }
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-
-#endif
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.cpp b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.cpp
new file mode 100644
index 0000000000..5c4d4eba42
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test3/test3.cpp
@@ -0,0 +1,143 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+** Source : test3.c
+**
+** Purpose: Test for SetEnvironmentVariableW() function
+** Create environment variables that differ only
+** in case and verify that they return the appropriate
+** value on the BSD environment.
+**
+**
+===========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+#if WIN32
+
+ return PASS;
+
+#else
+
+ /* Define some buffers needed for the function */
+ WCHAR * pResultBuffer = NULL;
+
+ WCHAR FirstEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
+ WCHAR FirstEnvironmentValue[] = {'F','I','R','S','T','\0'};
+
+ WCHAR SecondEnvironmentVariable[] = {'p','a','l','t','e','s','t','\0'};
+ WCHAR SecondEnvironmentValue[] = {'S','E','C','O','N','D','\0'};
+
+ DWORD size = 0;
+ BOOL bRc = TRUE;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Set the first environment variable */
+ bRc = SetEnvironmentVariableW(FirstEnvironmentVariable,
+ FirstEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Set the second environment Variable */
+ bRc = SetEnvironmentVariableW(SecondEnvironmentVariable,
+ SecondEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+
+ /* Normal case, PATH should fit into this buffer */
+ size = GetEnvironmentVariableW(FirstEnvironmentVariable,
+ pResultBuffer,
+ 0);
+
+ /* Increase size to account for the null char at the end */
+ size = size + 1;
+
+ pResultBuffer = (WCHAR*)malloc(sizeof(WCHAR)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
+ }
+
+ /* Try to retrieve the value of the first environment variable */
+ GetEnvironmentVariableW(FirstEnvironmentVariable,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the strings to see that the correct variable was returned */
+ if(wcscmp(pResultBuffer,FirstEnvironmentValue) != 0)
+ {
+ Trace("ERROR: The value in the buffer should have been '%S' but "
+ "was really '%S'.\n",FirstEnvironmentValue, pResultBuffer);
+ free(pResultBuffer);
+ Fail("");
+ }
+
+ free(pResultBuffer);
+
+ /* Reallocate the memory for the string */
+ pResultBuffer = (WCHAR*)malloc(sizeof(WCHAR)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
+ }
+
+ /* Try retrieving the value of the first variable, even though the
+ second variable has the same spelling and only differs in case */
+ GetEnvironmentVariableW(SecondEnvironmentVariable,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the two strings to confirm that the right value is returned */
+ if(wcscmp(pResultBuffer,SecondEnvironmentValue) != 0)
+ {
+ Trace("ERROR: The value in the buffer should have been '%S' but "
+ "was really '%S'.\n",SecondEnvironmentValue,pResultBuffer);
+ free(pResultBuffer);
+ Fail("");
+ }
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+
+#endif
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/CMakeLists.txt
index f5f48bab33..c82e0f0394 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_setenvironmentvariablew_test4
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.c b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.c
deleted file mode 100644
index b8f7734de4..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.c
+++ /dev/null
@@ -1,99 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-** Source : test4.c
-**
-** Purpose: Test for SetEnvironmentVariableW() function
-** Create environment variables that differ only
-** in case and verify that they return the appropriate
-** value on the BSD environment.
-**
-**
-===========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
-#if WIN32
-
- /* Define some buffers needed for the function */
- WCHAR * pResultBuffer = NULL;
-
- WCHAR FirstEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
- WCHAR FirstEnvironmentValue[] = {'F','I','R','S','T','\0'};
-
- WCHAR ModifiedEnvironmentVariable[] = {'p','a','l','t','e','s','t','\0'};
-
- DWORD size = 0;
- BOOL bRc = TRUE;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Set the first environment variable */
- bRc = SetEnvironmentVariableW(FirstEnvironmentVariable,
- FirstEnvironmentValue);
-
- if(!bRc)
- {
- Fail("ERROR: SetEnvironmentVariable failed to set a "
- "proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Normal case, PATH should fit into this buffer */
- size = GetEnvironmentVariableW(ModifiedEnvironmentVariable,
- pResultBuffer,
- 0);
-
- /* To account for the nul character at the end of the string */
- size = size + 1;
-
- pResultBuffer = malloc(sizeof(WCHAR)*size);
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
- }
-
- /* Try to retrieve the value of the first environment variable */
- GetEnvironmentVariableW(ModifiedEnvironmentVariable,
- pResultBuffer,
- size);
-
- if ( pResultBuffer == NULL )
- {
- Fail("ERROR: GetEnvironmentVariable failed to return a value "
- "from a proper environment variable with error %u.\n",
- GetLastError());
- }
-
- /* Compare the strings to see that the correct variable was returned */
- if(wcsncmp(pResultBuffer,FirstEnvironmentValue,wcslen(pResultBuffer)) != 0)
- {
- Trace("ERROR: The value in the buffer should have been '%S' but "
- "was really '%S'.\n",FirstEnvironmentValue, pResultBuffer);
- free(pResultBuffer);
- Fail("");
- }
-
- free(pResultBuffer);
-
- PAL_Terminate();
- return PASS;
-
-
-#else
-
- return PASS;
-#endif
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.cpp b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.cpp
new file mode 100644
index 0000000000..50c59d6e97
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/SetEnvironmentVariableW/test4/test4.cpp
@@ -0,0 +1,99 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+** Source : test4.c
+**
+** Purpose: Test for SetEnvironmentVariableW() function
+** Create environment variables that differ only
+** in case and verify that they return the appropriate
+** value on the BSD environment.
+**
+**
+===========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+
+#if WIN32
+
+ /* Define some buffers needed for the function */
+ WCHAR * pResultBuffer = NULL;
+
+ WCHAR FirstEnvironmentVariable[] = {'P','A','L','T','E','S','T','\0'};
+ WCHAR FirstEnvironmentValue[] = {'F','I','R','S','T','\0'};
+
+ WCHAR ModifiedEnvironmentVariable[] = {'p','a','l','t','e','s','t','\0'};
+
+ DWORD size = 0;
+ BOOL bRc = TRUE;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Set the first environment variable */
+ bRc = SetEnvironmentVariableW(FirstEnvironmentVariable,
+ FirstEnvironmentValue);
+
+ if(!bRc)
+ {
+ Fail("ERROR: SetEnvironmentVariable failed to set a "
+ "proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Normal case, PATH should fit into this buffer */
+ size = GetEnvironmentVariableW(ModifiedEnvironmentVariable,
+ pResultBuffer,
+ 0);
+
+ /* To account for the nul character at the end of the string */
+ size = size + 1;
+
+ pResultBuffer = (WCHAR*)malloc(sizeof(WCHAR)*size);
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: Failed to allocate memory for pResultBuffer pointer.\n");
+ }
+
+ /* Try to retrieve the value of the first environment variable */
+ GetEnvironmentVariableW(ModifiedEnvironmentVariable,
+ pResultBuffer,
+ size);
+
+ if ( pResultBuffer == NULL )
+ {
+ Fail("ERROR: GetEnvironmentVariable failed to return a value "
+ "from a proper environment variable with error %u.\n",
+ GetLastError());
+ }
+
+ /* Compare the strings to see that the correct variable was returned */
+ if(wcsncmp(pResultBuffer,FirstEnvironmentValue,wcslen(pResultBuffer)) != 0)
+ {
+ Trace("ERROR: The value in the buffer should have been '%S' but "
+ "was really '%S'.\n",FirstEnvironmentValue, pResultBuffer);
+ free(pResultBuffer);
+ Fail("");
+ }
+
+ free(pResultBuffer);
+
+ PAL_Terminate();
+ return PASS;
+
+
+#else
+
+ return PASS;
+#endif
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/CMakeLists.txt
index 5248d6ce97..40eb2ff865 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_setlasterror_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/test.c b/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/test.cpp
index d414626dd2..d414626dd2 100644
--- a/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/SetLastError/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/CMakeLists.txt
index 6876d1b24e..c3c4b61999 100644
--- a/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_i64tow_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.c b/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.c
deleted file mode 100644
index 9a87328b0d..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.c
+++ /dev/null
@@ -1,76 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test1.c
-**
-** Purpose: Tests _i64tow with normal values and different radices, negative
-** values, as well as the highest and lowest values.
-**
-**
-**============================================================*/
-
-#include <palsuite.h>
-
-typedef struct
-{
- INT64 value;
- int radix;
- char *result;
-} testCase;
-
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR buffer[256];
- WCHAR *testStr;
- WCHAR *ret;
- int i;
- testCase testCases[] =
- {
- {42, 10, "42"},
- {42, 2, "101010"},
- {29, 32, "t"},
- {-1, 10, "-1"},
- {-1, 8, "1777777777777777777777"},
- {-1, 32, "fvvvvvvvvvvvv"},
- {I64(0x7FFFFFFFFFFFFFFF), 10, "9223372036854775807"},
- {I64(0x8000000000000000), 10, "-9223372036854775808"},
- {0,2,"0"},
- {0,16,"0"},
- {3,16,"3"},
- {15,16,"f"},
- {16,16,"10"},
-
- };
-
-
- if (0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- for (i=0; i<sizeof(testCases) / sizeof(testCase); i++)
- {
- ret = _i64tow(testCases[i].value, buffer, testCases[i].radix);
- if (ret != buffer)
- {
- Fail("_i64tow did not return a pointer to the string.\n"
- "Expected %p, got %p\n", buffer, ret);
- }
-
- testStr = convert(testCases[i].result);
- if (wcscmp(testStr, buffer) != 0)
- {
- Fail("_i64tow did not give the correct string.\n"
- "Expected %S, got %S\n", testStr, buffer);
- }
- free(testStr);
- }
-
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp b/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp
new file mode 100644
index 0000000000..9a8ae07089
--- /dev/null
+++ b/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/test1.cpp
@@ -0,0 +1,76 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: test1.c
+**
+** Purpose: Tests _i64tow_s with normal values and different radices, negative
+** values, as well as the highest and lowest values.
+**
+**
+**============================================================*/
+
+#include <palsuite.h>
+
+typedef struct
+{
+ INT64 value;
+ int radix;
+ char *result;
+} testCase;
+
+
+int __cdecl main(int argc, char *argv[])
+{
+ WCHAR buffer[256];
+ WCHAR *testStr;
+ WCHAR *ret;
+ int i;
+ testCase testCases[] =
+ {
+ {42, 10, "42"},
+ {42, 2, "101010"},
+ {29, 32, "t"},
+ {-1, 10, "-1"},
+ {-1, 8, "1777777777777777777777"},
+ {-1, 32, "fvvvvvvvvvvvv"},
+ {I64(0x7FFFFFFFFFFFFFFF), 10, "9223372036854775807"},
+ {I64(0x8000000000000000), 10, "-9223372036854775808"},
+ {0,2,"0"},
+ {0,16,"0"},
+ {3,16,"3"},
+ {15,16,"f"},
+ {16,16,"10"},
+
+ };
+
+
+ if (0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ for (i=0; i<sizeof(testCases) / sizeof(testCase); i++)
+ {
+ errno_t err = _i64tow_s(testCases[i].value, buffer, sizeof(buffer) / sizeof(buffer[0]), testCases[i].radix);
+
+ if(err != 0)
+ {
+ Fail("ERROR: _i64tow_s didn't return success, error code %d.\n", err);
+ }
+
+ testStr = convert(testCases[i].result);
+ if (wcscmp(testStr, buffer) != 0)
+ {
+ Fail("_i64tow_s did not give the correct string.\n"
+ "Expected %S, got %S\n", testStr, buffer);
+ }
+ free(testStr);
+ }
+
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/testinfo.dat
index a3979e60da..11982050e0 100644
--- a/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/testinfo.dat
+++ b/src/pal/tests/palsuite/miscellaneous/_i64tow/test1/testinfo.dat
@@ -4,10 +4,10 @@
Version = 1.0
Section = miscellaneous
-Function = _i64tow
-Name = Test #1 for _i64tow
+Function = _i64tow_s
+Name = Test #1 for _i64tow_s
TYPE = DEFAULT
EXE1 = test1
Description
-=Tests _i64tow with normal values and different radices, negative
+=Tests _i64tow_s with normal values and different radices, negative
=values, as well as the highest and lowest values.
diff --git a/src/pal/tests/palsuite/miscellaneous/_ui64tow/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/_ui64tow/CMakeLists.txt
deleted file mode 100644
index ef14ea5352..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/_ui64tow/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-add_subdirectory(test2)
-
diff --git a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/CMakeLists.txt
deleted file mode 100644
index f920c4bded..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- _ui64tow.c
-)
-
-add_executable(paltest_ui64tow_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_ui64tow_test1 coreclrpal)
-
-target_link_libraries(paltest_ui64tow_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/_ui64tow.c b/src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/_ui64tow.c
deleted file mode 100644
index fb94f2509f..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/_ui64tow.c
+++ /dev/null
@@ -1,101 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: _ui64tow.c
-**
-** Purpose: Positive test the _ui64tow API.
-** convert an integer to a wide character string
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- int err;
- WCHAR *wpBuffer = NULL;
- char *pChar = NULL;
- unsigned long ul = 1234567890UL;
- char *pChar10 = "1234567890";
- char *pChar2 = "1001001100101100000001011010010";
- char *pChar16 = "499602d2";
-
- /*Initialize the PAL environment*/
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- wpBuffer = malloc(64 * sizeof(WCHAR));
- if(NULL == wpBuffer)
- {
- Fail("\nFail to allocate the buffer to save a converted "
- "wide character string, error code=%d!\n",
- GetLastError());
- }
-
- /*convert to a 10 base string*/
- _ui64tow(ul, wpBuffer, 10);
- pChar = convertC(wpBuffer);
- if(strcmp(pChar10, pChar))
- {
- free(wpBuffer);
- free(pChar);
- Fail("\nFailed to call _ui64tow API to convert an interger "
- "to a 10 base wide character string, error code=%d\n",
- GetLastError());
- }
- free(pChar);
- free(wpBuffer);
-
- wpBuffer = malloc(64 * sizeof(WCHAR));
- if(NULL == wpBuffer)
- {
- Fail("\nFail to allocate the buffer to save a converted "
- "wide character string, error code=%d!\n",
- GetLastError());
- }
-
- /*convert to a 16 base string*/
- _ui64tow(ul, wpBuffer, 16);
- pChar = convertC(wpBuffer);
- if(strcmp(pChar16, pChar))
- {
- free(wpBuffer);
- free(pChar);
- Fail("\nFailed to call _ui64tow API to convert an interger "
- "to a 16 base wide character string, error code = %d\n",
- GetLastError());
- }
- free(pChar);
- free(wpBuffer);
-
- wpBuffer = malloc(64 * sizeof(WCHAR));
- if(NULL == wpBuffer)
- {
- Fail("\nFail to allocate the buffer to save a converted "
- "wide character string, error code=%d!\n",
- GetLastError());
- }
- /*convert to a 2 base string*/
- _ui64tow(ul, wpBuffer, 2);
- pChar = convertC(wpBuffer);
- if(strcmp(pChar2, pChar))
- {
- free(wpBuffer);
- free(pChar);
- Fail("\nFailed to call _ui64tow API to convert an interger "
- "to a 2 base wide character string, error code=%d\n",
- GetLastError());
- }
- free(pChar);
- free(wpBuffer);
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/testinfo.dat
deleted file mode 100644
index a60f27a14a..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test1/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = miscellaneous
-Function = _ui64tow
-Name = Positive test _ui64tow to convert an integer to a wide character string
-TYPE = DEFAULT
-EXE1 = _ui64tow
-Description
-=Test the _ui64tow API to convert an integer to a wide character string
diff --git a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/CMakeLists.txt
deleted file mode 100644
index b4feb4b8fd..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- _ui64tow.c
-)
-
-add_executable(paltest_ui64tow_test2
- ${SOURCES}
-)
-
-add_dependencies(paltest_ui64tow_test2 coreclrpal)
-
-target_link_libraries(paltest_ui64tow_test2
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/_ui64tow.c b/src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/_ui64tow.c
deleted file mode 100644
index f13250578c..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/_ui64tow.c
+++ /dev/null
@@ -1,88 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: _ui64tow.c
-**
-** Purpose: Tests _ui64tow with normal values and different
-** radices,highest and lowest values.
-**
-**
-**============================================================*/
-
-#include <palsuite.h>
-
-typedef struct
-{
- unsigned __int64 value;
- int radix;
- char* result;
-} testCase;
-
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR buffer[256];
- WCHAR *testStr;
- WCHAR *ret;
- int i;
- testCase testCases[] =
- {
- /* test limits */
- {UI64(0xFFFFFFFFFFFFFFFF), 2,
- "1111111111111111111111111111111111111111111111111111111111111111"},
- {UI64(0xFFFFFFFFFFFFFFFF), 8, "1777777777777777777777"},
- {UI64(0xFFFFFFFFFFFFFFFF), 10, "18446744073709551615"},
- {UI64(0xFFFFFFFFFFFFFFFF), 16, "ffffffffffffffff"},
- {47, 2, "101111"},
- {47, 8, "57"},
- {47, 10, "47"},
- {47, 16, "2f"},
- {12, 2, "1100"},
- {12, 8, "14"},
- {12, 10, "12"},
- {12, 16, "c"},
-
- /* test with 0. */
- {0, 2, "0"},
- {0, 8, "0"},
- {0, 10, "0"},
- {0, 16, "0"}
- };
-
- if (0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- for (i=0; i<sizeof(testCases) / sizeof(testCase); i++)
- {
- ret = _ui64tow(testCases[i].value, buffer, testCases[i].radix);
-
- if (ret != buffer)
- {
- Fail("Failed to call _ui64tow API: did not return a pointer "
- "to string. Expected %p, got %p\n", buffer, ret);
- }
-
- testStr = convert(testCases[i].result);
-
- if (wcscmp(testStr, buffer) != 0)
- {
- Trace("ERROR: _ui64tow test#%d. Expected <%S>, got <%S>.\n",
- i,testStr, buffer);
- free(testStr);
- Fail("");
- }
-
- free(testStr);
- }
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/testinfo.dat
deleted file mode 100644
index 0abbca2d11..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/_ui64tow/test2/testinfo.dat
+++ /dev/null
@@ -1,13 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = miscellaneous
-Function = _ui64tow
-Name = Positive test _ui64tow to convert an integer to a wide character string
-TYPE = DEFAULT
-EXE1 = _ui64tow
-Description
-=Test the _ui64tow API to convert an integer to a wide character string
-=Test the limits. and 0.
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrcatW/CMakeLists.txt
deleted file mode 100644
index a3847f8ca9..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-add_subdirectory(test2)
-add_subdirectory(test3)
-add_subdirectory(test4)
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/CMakeLists.txt
deleted file mode 100644
index aa5b0c2646..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_lstrcatw_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_lstrcatw_test1 coreclrpal)
-
-target_link_libraries(paltest_lstrcatw_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/test.c
deleted file mode 100644
index ad1095e014..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/test.c
+++ /dev/null
@@ -1,59 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for lstrcatW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[]) {
-
- WCHAR FirstString[10] = {'T','E','S','T','\0'};
- const WCHAR SecondString[] = {'P','A','L','!','\0'};
- WCHAR CorrectString[] = {'T','E','S','T','P','A','L','!','\0'};
- WCHAR* ReturnedPointer = NULL;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- ReturnedPointer = lstrcat(FirstString,SecondString);
-
- /* Check to see if the pointer returned points to the concat string */
- if(ReturnedPointer != &FirstString[0])
- {
- Fail("ERROR: The function was supposed to return a pointer to "
- "the concatentated string, but it did not.\n");
- }
-
- /* Check to make sure the Concat string is the same as the predetermined
- 'CorrectString' */
- if(memcmp(FirstString,CorrectString,
- wcslen(FirstString)*sizeof(WCHAR)) != 0)
- {
- Fail("ERROR: The concatenated string should be %s but %s was the "
- "result.\n",
- convertC(CorrectString),
- convertC(FirstString));
- }
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/testinfo.dat
deleted file mode 100644
index 006e83b882..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test1/testinfo.dat
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = lstrcatW
-Name = Positive test of lstrcatW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test to see that concatenating two strings works,
-= and also check return values in successful and failing situations.
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/CMakeLists.txt
deleted file mode 100644
index 8a11c8f154..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test2.c
-)
-
-add_executable(paltest_lstrcatw_test2
- ${SOURCES}
-)
-
-add_dependencies(paltest_lstrcatw_test2 coreclrpal)
-
-target_link_libraries(paltest_lstrcatw_test2
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/test2.c b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/test2.c
deleted file mode 100644
index 6c66bc8976..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/test2.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test2.c
-**
-** Purpose: Negative test for lstrcatW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[]) {
-
- WCHAR FirstString[10] = {'T','E','S','T','\0'};
- const WCHAR SecondString[] = {'P','A','L','!','\0'};
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* If either of these is NULL, function should fail and return NULL. */
- if(lstrcat(NULL,SecondString) != NULL)
- {
- Fail("ERROR: When NULL was passed to the first parameter of the "
- "function, it should have returned "
- "NULL as a result, but did not.\n");
- }
-
- if(lstrcat(FirstString,NULL) != NULL)
- {
- Fail("ERROR: When NULL was passed to the second parameter of the "
- "function, it should have returned "
- "NULL as a result, but did not.\n");
- }
-
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/testinfo.dat
deleted file mode 100644
index cc1ee644dc..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test2/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = lstrcatW
-Name = Negtive test of lstrcatW
-TYPE = DEFAULT
-EXE1 = test2
-Description
-= Test to see lstrcat reports error with failing situations.
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/CMakeLists.txt
deleted file mode 100644
index 1cdecedf1a..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test3.c
-)
-
-add_executable(paltest_lstrcatw_test3
- ${SOURCES}
-)
-
-add_dependencies(paltest_lstrcatw_test3 coreclrpal)
-
-target_link_libraries(paltest_lstrcatw_test3
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/test3.c b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/test3.c
deleted file mode 100644
index 49a9c57555..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/test3.c
+++ /dev/null
@@ -1,46 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test3.c
-**
-** Purpose: Testing lstrcatw with two NULL strings passed on
-**
-**
-**=========================================================*/
-
-#define UNICODE
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
-
-
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
-
- /* testing the behaviour of lstrcatW with two NULL strings */
- if( lstrcat(NULL,NULL) != NULL)
- {
-
- Fail("lstrcat:ERROR: the function should returned NULL\n");
-
- }
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/testinfo.dat
deleted file mode 100644
index 794bcdbff7..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test3/testinfo.dat
+++ /dev/null
@@ -1,26 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-
-Section = Miscellaneous
-
-Function = lstrcatW
-
-Name = Negative testing for lstrcatW
-
-TYPE = DEFAULT
-
-EXE1 = test3
-
-Description
-
-= Testing the behaviour after sending two strings contained NULL
-
-
-
-
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/CMakeLists.txt
deleted file mode 100644
index 640c224f83..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test4.c
-)
-
-add_executable(paltest_lstrcatw_test4
- ${SOURCES}
-)
-
-add_dependencies(paltest_lstrcatw_test4 coreclrpal)
-
-target_link_libraries(paltest_lstrcatw_test4
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/test4.c b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/test4.c
deleted file mode 100644
index abc9021518..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/test4.c
+++ /dev/null
@@ -1,101 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test4.c
-**
-** Purpose: Testing the behaviour of lstrcatw when string2 contains
-** special characters, this test case depends on:
-** memcmp
-** wcslen
-** lstrcpyn
-**
-**
-**=========================================================*/
-
-#define UNICODE
-
-#include <palsuite.h>
-
-struct testCase
-{
- WCHAR SecondString[5];
- WCHAR CorrectString[10];
-};
-
-int __cdecl main(int argc, char *argv[])
-{
-
- WCHAR FirstString[10] = {'T','E','S','T','\0'};
- WCHAR TestString[10] = {'T','E','S','T','\0'};
- int i = 0;
-
- /*
- * this structure includes several strings to be tested with
- * lstrcatW function and the expected results
- */
-
- struct testCase testCases[]=
- {
- {{'\t','T','A','B','\0'},
- {'T','E','S','T','\t','T','A','B','\0'}},
- {{'2','T','\?','B','\0'},
- {'T','E','S','T','2','T','\?','B','\0'}},
- {{'\v','T','E','\v','\0'},
- {'T','E','S','T','\v','T','E','\v','\0'}},
- {{'T','\a','E','\a','\0'},
- {'T','E','S','T','T','\a','E','\a','\0'}},
- {{'0','\f','Z','\f','\0'},
- {'T','E','S','T','0','\f','Z','\f','\0'}},
- {{'\r','H','I','\r','\0'},
- {'T','E','S','T','\r','H','I','\r','\0'}},
- {{'H','I','\"','\"','\0'},
- {'T','E','S','T','H','I','\"','\"','\0'}},
- {{'H','\b','I','\b','\0'},
- {'T','E','S','T','H','\b','I','\b','\0'}},
- {{'H','\n','I','\n','\0'},
- {'T','E','S','T','H','\n','I','\n','\0'}}
- };
-
-
-
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
-
- /* Loop through the struct and validate the resulted string */
- for( i = 0; i < sizeof(testCases)/sizeof(struct testCase); i++)
- {
-
- lstrcat(FirstString, testCases[i].SecondString);
-
- if(memcmp(FirstString,testCases[i].CorrectString,
- wcslen(FirstString)*sizeof(WCHAR)))
- {
-
- Fail("ERROR: the function failed with a special character.\n");
- }
-
- /* reinitialize the first string */
- lstrcpyn(FirstString,TestString,10);
-
- }
-
-
-
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/testinfo.dat
deleted file mode 100644
index 96235fb257..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcatW/test4/testinfo.dat
+++ /dev/null
@@ -1,28 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-
-Section = Miscellaneous
-
-Function = lstrcatW
-
-Name = Positive testing for lstrcatW
-
-TYPE = DEFAULT
-
-EXE1 = test4
-
-Description
-
-= Testing the behaviour of lstrcatw when string2 contains
-
-= special characters and validate the resulted string
-
-
-
-
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcpyW/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrcpyW/CMakeLists.txt
deleted file mode 100644
index f6aa0cb2d9..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcpyW/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/CMakeLists.txt
deleted file mode 100644
index e39c9a6098..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_lstrcpyw_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_lstrcpyw_test1 coreclrpal)
-
-target_link_libraries(paltest_lstrcpyw_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/test.c
deleted file mode 100644
index 881ba033e8..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/test.c
+++ /dev/null
@@ -1,66 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for lstrcpyW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- WCHAR FirstString[5] = {'T','E','S','T','\0'};
- WCHAR ResultBuffer[5];
- WCHAR* ResultPointer = NULL;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- ResultPointer = lstrcpy(ResultBuffer,FirstString);
-
- /* Check the return value */
- if(ResultPointer != &ResultBuffer[0])
- {
- Fail("ERROR: The function did not return a pointer to the Result "
- "Buffer after being called.\n");
- }
-
- /* A straight copy, the values should be equal. */
- if(memcmp(ResultBuffer,FirstString,wcslen(ResultBuffer)*2+2) != 0)
- {
- Fail("ERROR: The result of the copy was '%s' when it should have "
- "been '%s'.\n",convertC(ResultBuffer),convertC(FirstString));
- }
-
- /* If either param is NULL, it should return NULL. */
- if(lstrcpy(ResultBuffer,NULL) != NULL)
- {
- Fail("ERROR: The second parameter was NULL, so the function should "
- "fail and return NULL.\n");
- }
- if(lstrcpy(NULL,FirstString) != NULL)
- {
- Fail("ERROR: The first parameter was NULL, so the function should "
- "fail and return NULL.\n");
- }
-
-
- PAL_Terminate();
- return PASS;
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/testinfo.dat
deleted file mode 100644
index 37c9835236..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcpyW/test1/testinfo.dat
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = lstrcpyW
-Name = Positive test of lstrcpyW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Ensure that a copy of a string works, and that the return values
-= are correct for success and failure.
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcpynW/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrcpynW/CMakeLists.txt
deleted file mode 100644
index f6aa0cb2d9..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcpynW/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/CMakeLists.txt
deleted file mode 100644
index 4344b89402..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_lstrcpynw_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_lstrcpynw_test1 coreclrpal)
-
-target_link_libraries(paltest_lstrcpynw_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/test.c
deleted file mode 100644
index 1ae0c51474..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/test.c
+++ /dev/null
@@ -1,73 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for lstrcpynW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[]) {
-
- WCHAR FirstString[5] = {'T','E','S','T','\0'};
- WCHAR CorrectBuffer[3] = {'T','E','\0'};
- WCHAR ResultBuffer[5];
- WCHAR* ResultPointer = NULL;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* A straight copy, the values should be equal. */
- ResultPointer = lstrcpyn(ResultBuffer,FirstString,3);
-
- /* Make sure the returned pointer is to the result buffer */
- if(ResultPointer != &ResultBuffer[0])
- {
- Fail("ERROR: The function didn't return a pointer which points to the "
- "location of the buffer which was copied into.\n");
- }
-
- /* Check to see that values are equal */
- if(memcmp(ResultBuffer,
- CorrectBuffer,
- wcslen(ResultBuffer)*sizeof(WCHAR)) != 0)
- {
- Fail("ERROR: '%s' was the result and it should have been '%s' when "
- "this copy was performed.\n",
- convertC(ResultBuffer),convertC(CorrectBuffer));
- }
-
- /* Null values should get Null results */
- if(lstrcpyn(ResultBuffer,NULL,3) != NULL)
- {
- Fail("ERROR: When the second parameter was set to NULL, the return "
- "value should have been NULL, but it was not.\n");
- }
-
- if(lstrcpyn(NULL,FirstString,3) != NULL)
- {
- Fail("ERROR: When the first parameter was set to NULL, the return "
- "value should have been NULL, but it was not.\n");
- }
-
-
- PAL_Terminate();
- return PASS;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/testinfo.dat
deleted file mode 100644
index 111a57928a..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/lstrcpynW/test1/testinfo.dat
+++ /dev/null
@@ -1,16 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = lstrcpynW
-Name = Positive test of lstrcpynW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Ensure that a copy of a string works, and that the return values
-= are correct for success and failure.
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/CMakeLists.txt
index 807a5d83b9..6bb520100d 100644
--- a/src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_lstrlena_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/test.c b/src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/test.cpp
index 13e935ba50..13e935ba50 100644
--- a/src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/lstrlenA/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/CMakeLists.txt
index fe6fc9691b..4209cbee89 100644
--- a/src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_lstrlenw_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/test.cpp
index 49bc6d8f67..49bc6d8f67 100644
--- a/src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/test.c
+++ b/src/pal/tests/palsuite/miscellaneous/lstrlenW/test1/test.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/CMakeLists.txt
index d76467aeab..ba53f42ccc 100644
--- a/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_queryperformancecounter_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/test1.c b/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/test1.cpp
index 55b173add7..55b173add7 100644
--- a/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/test1.c
+++ b/src/pal/tests/palsuite/miscellaneous/queryperformancecounter/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/CMakeLists.txt
index 352e51342d..bc6bd22d5d 100644
--- a/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_queryperformancefrequency_test1
diff --git a/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/test1.c b/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/test1.cpp
index de08063a74..de08063a74 100644
--- a/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/test1.c
+++ b/src/pal/tests/palsuite/miscellaneous/queryperformancefrequency/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/CMakeLists.txt
deleted file mode 100644
index f40d4151d6..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-add_subdirectory(test11)
-add_subdirectory(test12)
-add_subdirectory(test13)
-add_subdirectory(test2)
-add_subdirectory(test3)
-add_subdirectory(test6)
-add_subdirectory(test7)
-add_subdirectory(test8)
-add_subdirectory(test9)
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/CMakeLists.txt
deleted file mode 100644
index ef589329f0..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfa_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfa_test1 coreclrpal)
-
-target_link_libraries(paltest_wsprintfa_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/test.c
deleted file mode 100644
index 722270965d..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/test.c
+++ /dev/null
@@ -1,58 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfA() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
- char * ErrorMessage;
- char buf[256];
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-int test1()
-{
- char checkstr[] = "hello world";
-
- wsprintf(buf, "hello world");
-
- /* Error message */
- ErrorMessage = "ERROR: (Test 1) Failed on 'hello world' test. The "
- "correct string is 'hello world' and the result returned was ";
-
- return (memcmp(checkstr, buf, strlen(checkstr)+1) != 0);
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,buf);
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/testinfo.dat
deleted file mode 100644
index c06f4c01aa..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test1/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfA
-Name = Positive test of wsprintfA
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the very basic functionality of wsprintf.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/CMakeLists.txt
deleted file mode 100644
index 92c44b9341..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfa_test11
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfa_test11 coreclrpal)
-
-target_link_libraries(paltest_wsprintfa_test11
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/test.c
deleted file mode 100644
index b43299a045..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/test.c
+++ /dev/null
@@ -1,128 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfA() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-char * ErrorMessage;
-char buf[256];
-
-BOOL test1()
-{
- int pos = 42;
-
-
- /* Test 1 */
- wsprintf(buf, "foo %u", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- /* Test 2 */
- wsprintf(buf, "foo %lu", 0xFFFF);
- if (memcmp(buf, "foo 65535", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is "
- "'foo 65535' and the result returned was ";
- return FAIL;
- }
-
- /* Test 3 */
- wsprintf(buf, "foo %hu", 0xFFFF);
- if (memcmp(buf, "foo 65535", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is "
- "'foo 65535' and the result returned was ";
- return FAIL;
- }
-
- /* Test 4 */
- wsprintf(buf, "foo %3u", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- /* Test 5 */
- wsprintf(buf, "foo %-3u", pos);
- if (memcmp(buf, "foo 42 ", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- /* Test 6 */
- wsprintf(buf, "foo %.1u", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- /* Test 7 */
- wsprintf(buf, "foo %.3u", pos);
- if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is "
- "'foo 042' and the result returned was ";
- return FAIL;
- }
-
- /* Test 8 */
- wsprintf(buf, "foo %03u", pos);
- if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is "
- "'foo 042' and the result returned was ";
- return FAIL;
- }
-
- /* Test 9 */
- wsprintf(buf, "foo %#u", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 9) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
- return PASS;
-}
-
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s'%s'\n",ErrorMessage,buf);
- }
-
- PAL_Terminate();
- return PASS;
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/testinfo.dat
deleted file mode 100644
index c5f1ec1975..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test11/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfA
-Name = Positive test of wsprintfA
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the %u formatter.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/CMakeLists.txt
deleted file mode 100644
index e4013ad9e3..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfa_test12
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfa_test12 coreclrpal)
-
-target_link_libraries(paltest_wsprintfa_test12
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/test.c
deleted file mode 100644
index dcc61019d4..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/test.c
+++ /dev/null
@@ -1,119 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfA() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-char * ErrorMessage;
-char buf[256];
-
-BOOL test1()
-{
- int pos = 0x1234ab;
-
- /* Test 1 */
- wsprintf(buf, "foo %x", pos);
- if (memcmp(buf, "foo 1234ab", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct "
- "string is 'foo 1234ab' and the result returned was ";
- return FAIL;
- }
-
- /* Test 2 */
- wsprintf(buf, "foo %lx", pos);
- if (memcmp(buf, "foo 1234ab", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct "
- "string is 'foo 1234ab' and the result returned was ";
- return FAIL;
- }
-
-
- /* Test 3 */
- wsprintf(buf, "foo %7x", pos);
- if (memcmp(buf, "foo 1234ab", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is "
- "'foo 1234ab' and the result returned was ";
- return FAIL;
- }
-
- /* Test 4 */
- wsprintf(buf, "foo %-7x", pos);
- if (memcmp(buf, "foo 1234ab ", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is "
- "'foo 1234ab' and the result returned was ";
- return FAIL;
- }
-
- /* Test 5 */
- wsprintf(buf, "foo %.1x", pos);
- if (memcmp(buf, "foo 1234ab", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is "
- "'foo 1234ab' and the result returned was ";
- return FAIL;
- }
-
- /* Test 6 */
- wsprintf(buf, "foo %.7x", pos);
- if (memcmp(buf, "foo 01234ab", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is "
- "'foo 01234ab' and the result returned was ";
- return FAIL;
- }
-
- /* Test 7 */
- wsprintf(buf, "foo %07x", pos);
- if (memcmp(buf, "foo 01234ab", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is "
- "'foo 01234ab' and the result returned was ";
- return FAIL;
- }
-
- /* Test 8 */
- wsprintf(buf, "foo %#x", pos);
- if (memcmp(buf, "foo 0x1234ab", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is "
- "'foo 0x1234ab' and the result returned was ";
- return FAIL;
- }
-
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,buf);
- }
-
- PAL_Terminate();
- return PASS;
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/testinfo.dat
deleted file mode 100644
index 71c8386f27..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test12/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfA
-Name = Positive test of wsprintfA
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the %x formatter.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/CMakeLists.txt
deleted file mode 100644
index 423b05d8d9..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfa_test13
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfa_test13 coreclrpal)
-
-target_link_libraries(paltest_wsprintfa_test13
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/test.c
deleted file mode 100644
index e1f7d80a0f..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/test.c
+++ /dev/null
@@ -1,120 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfA() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-char * ErrorMessage;
-char buf[256];
-
-BOOL test1()
-{
- int pos = 0x1234ab;
-
- /* Test 1 */
- wsprintf(buf, "foo %X", pos);
- if (memcmp(buf, "foo 1234AB", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is "
- " 'foo 1234AB' and the result returned was ";
- return FAIL;
- }
-
- /* Test 2 */
- wsprintf(buf, "foo %lX", pos);
- if (memcmp(buf, "foo 1234AB", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is "
- "'foo 1234AB' and the result returned was ";
- return FAIL;
- }
-
-
- /* Test 3 */
- wsprintf(buf, "foo %7X", pos);
- if (memcmp(buf, "foo 1234AB", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is "
- "'foo 1234AB' and the result returned was ";
- return FAIL;
- }
-
- /* Test 4 */
- wsprintf(buf, "foo %-7X", pos);
- if (memcmp(buf, "foo 1234AB ", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is "
- "'foo 1234AB' and the result returned was ";
- return FAIL;
- }
-
- /* Test 5 */
- wsprintf(buf, "foo %.1X", pos);
- if (memcmp(buf, "foo 1234AB", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is "
- "'foo 1234AB' and the result returned was ";
- return FAIL;
- }
-
- /* Test 6 */
- wsprintf(buf, "foo %.7X", pos);
- if (memcmp(buf, "foo 01234AB", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is "
- "'foo 01234AB' and the result returned was ";
- return FAIL;
- }
-
- /* Test 7 */
- wsprintf(buf, "foo %07X", pos);
- if (memcmp(buf, "foo 01234AB", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is "
- "'foo 01234AB' and the result returned was ";
- return FAIL;
- }
-
- /* Test 8 */
- wsprintf(buf, "foo %#X", pos);
- if (memcmp(buf, "foo 0X1234AB", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is "
- "'foo 0X1234AB' and the result returned was ";
- return FAIL;
- }
-
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,buf);
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/testinfo.dat
deleted file mode 100644
index 0e0d1b4633..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test13/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfA
-Name = Positive test of wsprintfA
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the %X formatter.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/CMakeLists.txt
deleted file mode 100644
index 546a1daa38..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfa_test2
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfa_test2 coreclrpal)
-
-target_link_libraries(paltest_wsprintfa_test2
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/test.c
deleted file mode 100644
index b879e54043..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/test.c
+++ /dev/null
@@ -1,123 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfA() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-char * ErrorMessage;
-char * BadResult;
-char buf[256];
-
-BOOL test1()
-{
-
-
- /* Test 1 */
- wsprintf(buf, "foo %s", "bar");
- if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is "
- "'foo bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- /* Test 2 */
- wsprintf(buf, "foo %hs", "bar");
- if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is "
- "'foo bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
-
- /* Test 3 */
- wsprintf(buf, "foo %5s", "bar");
- if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is "
- "'foo bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- /* Test 4 */
- wsprintf(buf, "foo %.2s", "bar");
- if (memcmp(buf, "foo ba", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is "
- "'foo ba' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- /* Test 5 */
- wsprintf(buf, "foo %5.2s", "bar");
- if (memcmp(buf, "foo ba", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is "
- "'foo ba' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- /* Test 6 */
- wsprintf(buf, "foo %-5s", "bar");
- if (memcmp(buf, "foo bar ", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is "
- "'foo bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- /* Test 7 */
- wsprintf(buf, "foo %05s", "bar");
- if (memcmp(buf, "foo 00bar", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is "
- "'foo 00bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
- return PASS;
-}
-
-
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,BadResult);
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/testinfo.dat
deleted file mode 100644
index 32e51df28b..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test2/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfA
-Name = Positive test of wsprintfA
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the %s and %ls formatters with various flags.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/CMakeLists.txt
deleted file mode 100644
index 8043ccd60b..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfa_test3
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfa_test3 coreclrpal)
-
-target_link_libraries(paltest_wsprintfa_test3
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/test.c
deleted file mode 100644
index bb598d9d63..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/test.c
+++ /dev/null
@@ -1,121 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfA() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-char * ErrorMessage;
-char buf[256];
-
-BOOL test1()
-{
-
- /* Test 1 */
- wsprintf(buf, "foo %S", convert("bar"));
- if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is "
- "'foo bar' and the result returned was ";
- return FAIL;
- }
-
- /* Test 2 */
- wsprintf(buf, "foo %hS", "bar");
- if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is "
- "'foo bar' and the result returned was ";
- return FAIL;
- }
-
- /* Test 3 */
- wsprintf(buf, "foo %lS", convert("bar"));
- if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is '"
- "foo bar' and the result returned was ";
- return FAIL;
- }
-
-
- /* Test 4 */
- wsprintf(buf, "foo %5S", convert("bar"));
- if (memcmp(buf, "foo bar", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is "
- "'foo bar' and the result returned was ";
- return FAIL;
- }
-
- /* Test 5 */
- wsprintf(buf, "foo %.2S", convert("bar"));
- if (memcmp(buf, "foo ba", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is "
- "'foo ba' and the result returned was ";
- return FAIL;
- }
-
- /* Test 6 */
- wsprintf(buf, "foo %5.2S", convert("bar"));
- if (memcmp(buf, "foo ba", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is "
- "'foo ba' and the result returned was ";
- return FAIL;
- }
-
- /* Test 7 */
- wsprintf(buf, "foo %-5S", convert("bar"));
- if (memcmp(buf, "foo bar ", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is "
- "'foo bar ' and the result returned was ";
- return FAIL;
- }
-
- /* Test 8 */
- wsprintf(buf, "foo %05S", convert("bar"));
- if (memcmp(buf, "foo 00bar", strlen(buf) + 1) != 0) {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is "
- "'foo 00bar' and the result returned was ";
- return FAIL;
- }
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1()) {
- Fail("%s '%s'\n",ErrorMessage,buf);
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/testinfo.dat
deleted file mode 100644
index 0660aa17a3..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test3/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfA
-Name = Positive test of wsprintfA
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the %S and wide characters in general.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/CMakeLists.txt
deleted file mode 100644
index 6a5caf95c2..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfa_test6
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfa_test6 coreclrpal)
-
-target_link_libraries(paltest_wsprintfa_test6
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/test.c
deleted file mode 100644
index 08d97f467a..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/test.c
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfA() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-char * ErrorMessage;
-char buf[256];
-
-BOOL test1()
-{
- WCHAR wc = 'c';
-
- /* Test 1 */
- wsprintf(buf, "foo %c", 'b');
- if (memcmp(buf, "foo b", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is "
- "'foo b' and the result returned was ";
- return FAIL;
- }
-
- /* Test 2 */
- wsprintf(buf, "foo %hc", 'b');
- if (memcmp(buf, "foo b", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is "
- "'foo b' and the result returned was ";
- return FAIL;
- }
-
- /* Test 3 */
- wsprintf(buf, "foo %lc", wc);
- if (memcmp(buf, "foo c", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is "
- "'foo c' and the result returned was ";
- return FAIL;
- }
-
-
- /* Test 4 */
- wsprintf(buf, "foo %5c", 'b');
- if (memcmp(buf, "foo b", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is "
- "'foo bar' and the result returned was ";
- return FAIL;
- }
-
- /* Test 5 */
- wsprintf(buf, "foo %-5c", 'b');
- if (memcmp(buf, "foo b ", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is "
- "'foo b ' and the result returned was ";
- return FAIL;
- }
-
- /* Test 6 */
- wsprintf(buf, "foo %05c", 'b');
- if (memcmp(buf, "foo 0000b", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is "
- "'foo 0000b' and the result returned was ";
- return FAIL;
- }
-
- /* Test 7 */
- wsprintf(buf, "foo %#c", 'b');
- if (memcmp(buf, "foo b", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is "
- "'foo b' and the result returned was ";
- return FAIL;
- }
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,buf);
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/testinfo.dat
deleted file mode 100644
index 31b0f667b6..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test6/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfA
-Name = Positive test of wsprintfA
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the %c formatter.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/CMakeLists.txt
deleted file mode 100644
index 0885f0f21e..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfa_test7
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfa_test7 coreclrpal)
-
-target_link_libraries(paltest_wsprintfa_test7
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/test.c
deleted file mode 100644
index 6d380efaa9..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/test.c
+++ /dev/null
@@ -1,112 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfA() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-char * ErrorMessage;
-char buf[256];
-
-BOOL test1()
-{
- WCHAR wb = 'b';
-
- /* Test 1 */
- wsprintf(buf, "foo %C", wb);
- if (memcmp(buf, "foo b", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is "
- "'foo b' and the result returned was ";
- return FAIL;
- }
-
- /* Test 2 */
- wsprintf(buf, "foo %hC", wb);
- if (memcmp(buf, "foo b", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is "
- "'foo b' and the result returned was ";
- return FAIL;
- }
-
- /* Test 3 */
- wsprintf(buf, "foo %lC", 'c');
- if (memcmp(buf, "foo c", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is "
- "'foo c' and the result returned was ";
- return FAIL;
- }
-
-
- /* Test 4 */
- wsprintf(buf, "foo %5C", wb);
- if (memcmp(buf, "foo b", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is "
- "'foo b' and the result returned was ";
- return FAIL;
- }
-
- /* Test 5 */
- wsprintf(buf, "foo %-5C", wb);
- if (memcmp(buf, "foo b ", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is "
- "'foo b ' and the result returned was ";
- return FAIL;
- }
-
- /* Test 6 */
- wsprintf(buf, "foo %05C", wb);
- if (memcmp(buf, "foo 0000b", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is "
- "'foo 0000b' and the result returned was ";
- return FAIL;
- }
-
- /* Test 7 */
- wsprintf(buf, "foo %#C", wb);
- if (memcmp(buf, "foo b", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is "
- "'foo b' and the result returned was ";
- return FAIL;
- }
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,buf);
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/testinfo.dat
deleted file mode 100644
index 31b0f667b6..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test7/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfA
-Name = Positive test of wsprintfA
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the %c formatter.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/CMakeLists.txt
deleted file mode 100644
index 3c4b5ed36e..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfa_test8
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfa_test8 coreclrpal)
-
-target_link_libraries(paltest_wsprintfa_test8
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/test.c
deleted file mode 100644
index 7367461544..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/test.c
+++ /dev/null
@@ -1,120 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfA() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-char * ErrorMessage;
-char buf[256];
-
-BOOL test1()
-{
- int pos = 42;
-
- /* Test 1 */
- wsprintf(buf, "foo %d", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- /* Test 2 */
- wsprintf(buf, "foo %ld", 0xFFFF);
- if (memcmp(buf, "foo 65535", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is "
- "'foo 65535' and the result returned was ";
- return FAIL;
- }
-
- /* Test 3 */
- wsprintf(buf, "foo %3d", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- /* Test 4 */
- wsprintf(buf, "foo %-3d", pos);
- if (memcmp(buf, "foo 42 ", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is "
- "'foo 42 ' and the result returned was ";
- return FAIL;
- }
-
- /* Test 5 */
- wsprintf(buf, "foo %.1d", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- /* Test 6 */
- wsprintf(buf, "foo %.3d", pos);
- if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is "
- "'foo 042' and the result returned was ";
- return FAIL;
- }
-
- /* Test 7 */
- wsprintf(buf, "foo %03d", pos);
- if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is "
- "'foo 042' and the result returned was ";
- return FAIL;
- }
-
- /* Test 8 */
- wsprintf(buf, "foo %#d", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,buf);
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/testinfo.dat
deleted file mode 100644
index 75f4fbf121..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test8/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfA
-Name = Positive test of wsprintfA
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the %d formatter.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/CMakeLists.txt
deleted file mode 100644
index dcbb22ebb5..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfa_test9
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfa_test9 coreclrpal)
-
-target_link_libraries(paltest_wsprintfa_test9
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/test.c
deleted file mode 100644
index 9f123bcc6d..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/test.c
+++ /dev/null
@@ -1,122 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfA() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-char * ErrorMessage;
-char buf[256];
-
-BOOL test1()
-{
-
- int pos = 42;
-
-
- /* Test 1 */
- wsprintf(buf, "foo %i", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- /* Test 2 */
- wsprintf(buf, "foo %li", 0xFFFF);
- if (memcmp(buf, "foo 65535", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is "
- "'foo 65535' and the result returned was ";
- return FAIL;
- }
-
-
- /* Test 3 */
- wsprintf(buf, "foo %3i", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- /* Test 4 */
- wsprintf(buf, "foo %-3i", pos);
- if (memcmp(buf, "foo 42 ", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is "
- "'foo 42 ' and the result returned was ";
- return FAIL;
- }
-
- /* Test 5 */
- wsprintf(buf, "foo %.1i", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- /* Test 6 */
- wsprintf(buf, "foo %.3i", pos);
- if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is "
- "'foo 042' and the result returned was ";
- return FAIL;
- }
-
- /* Test 7 */
- wsprintf(buf, "foo %03i", pos);
- if (memcmp(buf, "foo 042", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is "
- "'foo 042' and the result returned was ";
- return FAIL;
- }
-
- /* Test 8 */
- wsprintf(buf, "foo %#i", pos);
- if (memcmp(buf, "foo 42", strlen(buf) + 1) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is "
- "'foo 42' and the result returned was ";
- return FAIL;
- }
-
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,buf);
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/testinfo.dat
deleted file mode 100644
index 2a3689e4dd..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfA/test9/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfA
-Name = Positive test of wsprintfA
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the %i formatter.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/CMakeLists.txt
deleted file mode 100644
index f40d4151d6..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-add_subdirectory(test1)
-add_subdirectory(test11)
-add_subdirectory(test12)
-add_subdirectory(test13)
-add_subdirectory(test2)
-add_subdirectory(test3)
-add_subdirectory(test6)
-add_subdirectory(test7)
-add_subdirectory(test8)
-add_subdirectory(test9)
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/CMakeLists.txt
deleted file mode 100644
index b1c0fb3d0b..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfw_test1
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfw_test1 coreclrpal)
-
-target_link_libraries(paltest_wsprintfw_test1
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/test.c
deleted file mode 100644
index 700cb134bd..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/test.c
+++ /dev/null
@@ -1,64 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-#include <palsuite.h>
-
-
-char * ErrorMessage = NULL;
-WCHAR * BadResult = NULL;
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-
-BOOL test1()
-{
- char checkstr[] = "hello world";
-
- WCHAR buf[256];
-
- /* Test a simple string */
- wsprintf(buf, convert("hello world"));
-
- /* Error message */
- ErrorMessage = "ERROR: (Test 1) Failed on 'hello world' test. "
- "The correct string is 'hello world' and the result returned was ";
- BadResult = buf;
-
- return (memcmp(convert(checkstr), buf, wcslen(buf)*2+2) != 0);
-}
-
-int __cdecl main(int argc, char *argv[]) {
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1()) {
- Fail("%s '%s'\n",ErrorMessage,convertC(BadResult));
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/testinfo.dat
deleted file mode 100644
index f36aced027..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test1/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfW
-Name = Positive test of wsprintfW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test the very basic functionality of wsprintfW.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/CMakeLists.txt
deleted file mode 100644
index a5d73ed413..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfw_test11
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfw_test11 coreclrpal)
-
-target_link_libraries(paltest_wsprintfw_test11
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/test.c
deleted file mode 100644
index dc1e7a7758..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/test.c
+++ /dev/null
@@ -1,139 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-#include <palsuite.h>
-
-
-
-char * ErrorMessage = NULL;
-WCHAR * BadResult = NULL;
-WCHAR buf[256];
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-
-BOOL test1()
-{
-
- int pos = 42;
-
- wsprintf(buf, convert("foo %u"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %lu"), 0xFFFF);
- if (memcmp(buf, convert("foo 65535"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is"
- " 'foo 65535' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %hu"), 0xFFFF);
- if (memcmp(buf, convert("foo 65535"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is"
- " 'foo 65535' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %3u"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %-3u"), pos);
- if (memcmp(buf, convert("foo 42 "), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is"
- " 'foo 42 ' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.1u"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.3u"), pos);
- if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is"
- " 'foo 042' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %03u"), pos);
- if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is"
- " 'foo 042' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %#u"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 9) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,convertC(BadResult));
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/testinfo.dat
deleted file mode 100644
index bb85d63f1b..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test11/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfW
-Name = Positive test of wsprintfW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test %u formatter with wsprintfW.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/CMakeLists.txt
deleted file mode 100644
index 3811fb07c9..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfw_test12
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfw_test12 coreclrpal)
-
-target_link_libraries(paltest_wsprintfw_test12
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/test.c
deleted file mode 100644
index 6ba456b3bc..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/test.c
+++ /dev/null
@@ -1,128 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-#include <palsuite.h>
-
-
-char * ErrorMessage = NULL;
-WCHAR * BadResult = NULL;
-WCHAR buf[256];
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-BOOL test1()
-{
- int pos = 0x1234ab;
-
- wsprintf(buf, convert("foo %x"), pos);
- if (memcmp(buf, convert("foo 1234ab"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is"
- " 'foo 1234ab' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %lx"), pos);
- if (memcmp(buf, convert("foo 1234ab"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is"
- " 'foo 1234ab' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %7x"), pos);
- if (memcmp(buf, convert("foo 1234ab"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is"
- " 'foo 1234ab' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %-7x"), pos);
- if (memcmp(buf, convert("foo 1234ab "), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is"
- " 'foo 1234ab ' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.1x"), pos);
- if (memcmp(buf, convert("foo 1234ab"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is"
- " 'foo 1234ab' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.7x"), pos);
- if (memcmp(buf, convert("foo 01234ab"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is"
- " 'foo 01234ab' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %07x"), pos);
- if (memcmp(buf, convert("foo 01234ab"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is"
- " 'foo 01234ab' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %#x"), pos);
- if (memcmp(buf, convert("foo 0x1234ab"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is"
- " 'foo 0x1234ab' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,convertC(BadResult));
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/testinfo.dat
deleted file mode 100644
index 0d38a20bcc..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test12/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfW
-Name = Positive test of wsprintfW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test %x formatter with wsprintfW.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/CMakeLists.txt
deleted file mode 100644
index 617abb854c..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfw_test13
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfw_test13 coreclrpal)
-
-target_link_libraries(paltest_wsprintfw_test13
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/test.c
deleted file mode 100644
index dd0daae0a0..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/test.c
+++ /dev/null
@@ -1,126 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-#include <palsuite.h>
-
-char * ErrorMessage = NULL;
-WCHAR * BadResult = NULL;
-WCHAR buf[256];
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-BOOL test1()
-{
- int pos = 0x1234ab;
-
- wsprintf(buf, convert("foo %X"), pos);
- if (memcmp(buf, convert("foo 1234AB"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is"
- " 'foo 1234AB' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %lX"), pos);
- if (memcmp(buf, convert("foo 1234AB"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is"
- " 'foo 1234AB' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %7X"), pos);
- if (memcmp(buf, convert("foo 1234AB"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is"
- " 'foo 1234AB' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %-7X"), pos);
- if (memcmp(buf, convert("foo 1234AB "), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is"
- " 'foo 1234AB ' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.1X"), pos);
- if (memcmp(buf, convert("foo 1234AB"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is"
- " 'foo 1234AB' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.7X"), pos);
- if (memcmp(buf, convert("foo 01234AB"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is"
- " 'foo 01234AB' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %07X"), pos);
- if (memcmp(buf, convert("foo 01234AB"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is"
- " 'foo 01234AB' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %#X"), pos);
- if (memcmp(buf, convert("foo 0X1234AB"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is"
- " 'foo 0X1234AB' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,convertC(BadResult));
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/testinfo.dat
deleted file mode 100644
index c16a43f7b7..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test13/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfW
-Name = Positive test of wsprintfW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test %X formatter with wsprintfW.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/CMakeLists.txt
deleted file mode 100644
index 00b26da2e6..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfw_test2
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfw_test2 coreclrpal)
-
-target_link_libraries(paltest_wsprintfw_test2
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/test.c
deleted file mode 100644
index f25ab6c2f4..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/test.c
+++ /dev/null
@@ -1,108 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfW() function
-**
-**
-**=========================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-
-char * ErrorMessage = NULL;
-WCHAR * BadResult = NULL;
-WCHAR buf[256];
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-
-BOOL test1()
-{
-
- wsprintf(buf, convert("foo %s"), convert("bar"));
- if (memcmp(buf, convert("foo bar"), wcslen(buf)*2+2) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is 'foo bar'"
- " and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %ls"), convert("bar"));
- if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0){
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is 'foo bar'"
- " and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %5s"), convert("bar"));
- if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is"
- " 'foo bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
- wsprintf(buf, convert("foo %.2s"), convert("bar"));
- if (memcmp(buf, convert("foo ba"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is 'foo ba'"
- " and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
- wsprintf(buf, convert("foo %5.2s"), convert("bar"));
- if (memcmp(buf, convert("foo ba"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is"
- " 'foo ba' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
- wsprintf(buf, convert("foo %-5s"), convert("bar"));
- if (memcmp(buf, convert("foo bar "), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is"
- " 'foo bar ' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
- wsprintf(buf, convert("foo %05s"), convert("bar"));
- if (memcmp(buf, convert("foo 00bar"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is"
- " 'foo 00bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,convertC(BadResult));
- }
-
- PAL_Terminate();
- return PASS;
-
-}
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/testinfo.dat
deleted file mode 100644
index a2a7bb2d39..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test2/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfW
-Name = Positive test of wsprintfW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test %s formatter with wsprintfW.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/CMakeLists.txt
deleted file mode 100644
index 25c6185d12..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfw_test3
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfw_test3 coreclrpal)
-
-target_link_libraries(paltest_wsprintfw_test3
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/test.c
deleted file mode 100644
index a52d617e47..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/test.c
+++ /dev/null
@@ -1,127 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfW() function
-**
-**
-**=========================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-
-
-char * ErrorMessage = NULL;
-WCHAR * BadResult = NULL;
-WCHAR buf[256];
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-
-BOOL test1()
-{
-
- wsprintf(buf, convert("foo %S"), "bar");
- if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is"
- " 'foo bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %hS"), "bar");
- if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is"
- " 'foo bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %lS"), convert("bar"));
- if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is"
- " 'foo bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %5S"), "bar");
- if (memcmp(buf, convert("foo bar"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is"
- " 'foo bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.2S"), "bar");
- if (memcmp(buf, convert("foo ba"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is"
- " 'foo ba' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %5.2S"), "bar");
- if (memcmp(buf, convert("foo ba"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is"
- " 'foo ba' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %-5S"), "bar");
- if (memcmp(buf, convert("foo bar "), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is"
- " 'foo bar ' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %05S"), "bar");
- if (memcmp(buf, convert("foo 00bar"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is"
- " 'foo 00bar' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,convertC(BadResult));
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/testinfo.dat
deleted file mode 100644
index 46b7b7459d..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test3/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfW
-Name = Positive test of wsprintfW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test %S formatter with wsprintfW.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/CMakeLists.txt
deleted file mode 100644
index c63a4d5c82..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfw_test6
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfw_test6 coreclrpal)
-
-target_link_libraries(paltest_wsprintfw_test6
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/test.c
deleted file mode 100644
index 513f1f7941..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/test.c
+++ /dev/null
@@ -1,115 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfW() function
-**
-**
-**=========================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-
-char * ErrorMessage = NULL;
-WCHAR * BadResult = NULL;
-WCHAR buf[256];
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-BOOL test1()
-{
- WCHAR wc = 'b';
-
- wsprintf(buf, convert("foo %c"), wc);
- if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is"
- " 'foo b' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %hc"), wc);
- if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is 'foo b'"
- " and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %lc"), wc);
- if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is 'foo b'"
- " and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %5c"), wc);
- if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is"
- " 'foo b' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %-5c"), wc);
- if (memcmp(buf, convert("foo b "), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is"
- " 'foo b ' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %05c"), wc);
- if (memcmp(buf, convert("foo 0000b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is"
- " 'foo 0000b' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %#c"), wc);
- if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is 'foo b'"
- " and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
- return PASS;
-}
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,convertC(BadResult));
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/testinfo.dat
deleted file mode 100644
index 627b76f602..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test6/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfW
-Name = Positive test of wsprintfW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test %c formatter with wsprintfW.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/CMakeLists.txt
deleted file mode 100644
index 25e43107ff..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfw_test7
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfw_test7 coreclrpal)
-
-target_link_libraries(paltest_wsprintfw_test7
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/test.c
deleted file mode 100644
index 99e73b13ce..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/test.c
+++ /dev/null
@@ -1,117 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfW() function
-**
-**
-**=========================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-
-
-char * ErrorMessage = NULL;
-WCHAR * BadResult = NULL;
-WCHAR buf[256];
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-
-BOOL test1()
-{
- WCHAR wb = 'b';
-
- wsprintf(buf, convert("foo %C"), 'b');
- if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is"
- " 'foo b' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %hC"), 'b');
- if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is"
- " 'foo b' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %lC"), wb);
- if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is"
- " 'foo b' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %5C"), 'b');
- if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is"
- " 'foo b' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %-5C"), 'b');
- if (memcmp(buf, convert("foo b "), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is"
- " 'foo b ' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %05C"), 'b');
- if (memcmp(buf, convert("foo 0000b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is"
- " 'foo 0000b' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %#C"), 'b');
- if (memcmp(buf, convert("foo b"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is"
- " 'foo b' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
- return PASS;
-}
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,convertC(BadResult));
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/testinfo.dat
deleted file mode 100644
index ffcb47a37f..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test7/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfW
-Name = Positive test of wsprintfW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test %C formatter with wsprintfW.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/CMakeLists.txt
deleted file mode 100644
index a6478a2af0..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfw_test8
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfw_test8 coreclrpal)
-
-target_link_libraries(paltest_wsprintfw_test8
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/test.c
deleted file mode 100644
index 63c296eb22..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/test.c
+++ /dev/null
@@ -1,128 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfW() function
-**
-**
-**=========================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-
-
-char * ErrorMessage = NULL;
-WCHAR * BadResult = NULL;
-WCHAR buf[256];
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-
-BOOL test1()
-{
- int pos = 42;
-
- wsprintf(buf, convert("foo %d"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %ld"), 0xFFFF);
- if (memcmp(buf, convert("foo 65535"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is"
- " 'foo 65535' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %3d"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %-3d"), pos);
- if (memcmp(buf, convert("foo 42 "), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is"
- " 'foo 42 ' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.1d"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.3d"), pos);
- if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is"
- " 'foo 042' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %03d"), pos);
- if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is"
- " 'foo 042' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %#d"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- return PASS;
-}
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,convertC(BadResult));
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/testinfo.dat
deleted file mode 100644
index 4238671918..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test8/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfW
-Name = Positive test of wsprintfW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test %d formatter with wsprintfW.
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/CMakeLists.txt b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/CMakeLists.txt
deleted file mode 100644
index e09867b1a7..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test.c
-)
-
-add_executable(paltest_wsprintfw_test9
- ${SOURCES}
-)
-
-add_dependencies(paltest_wsprintfw_test9 coreclrpal)
-
-target_link_libraries(paltest_wsprintfw_test9
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/test.c b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/test.c
deleted file mode 100644
index 0a49d9c2c5..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/test.c
+++ /dev/null
@@ -1,128 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test.c
-**
-** Purpose: Test for wsprintfW() function
-**
-**
-**=========================================================*/
-
-#define UNICODE
-#include <palsuite.h>
-
-
-char * ErrorMessage = NULL;
-WCHAR * BadResult = NULL;
-WCHAR buf[256];
-
-/* memcmp is used to verify the results, so this test is dependent on it. */
-/* ditto with strlen */
-
-
-BOOL test1()
-{
- int pos = 42;
-
- wsprintf(buf, convert("foo %i"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 1) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %li"), 0xFFFF);
- if (memcmp(buf, convert("foo 65535"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 2) Failed. The correct string is"
- " 'foo 65535' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %3i"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 3) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %-3i"), pos);
- if (memcmp(buf, convert("foo 42 "), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 4) Failed. The correct string is"
- " 'foo 42 ' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.1i"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 5) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %.3i"), pos);
- if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 6) Failed. The correct string is"
- " 'foo 042' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %03i"), pos);
- if (memcmp(buf, convert("foo 042"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 7) Failed. The correct string is"
- " 'foo 042' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- wsprintf(buf, convert("foo %#i"), pos);
- if (memcmp(buf, convert("foo 42"), wcslen(buf)*2 + 2) != 0)
- {
- ErrorMessage = "ERROR: (Test 8) Failed. The correct string is"
- " 'foo 42' and the result returned was ";
- BadResult = buf;
- return FAIL;
- }
-
- return PASS;
-}
-
-int __cdecl main(int argc, char *argv[])
-{
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- if(test1())
- {
- Fail("%s '%s'\n",ErrorMessage,convertC(BadResult));
-
- }
-
- PAL_Terminate();
- return PASS;
-
-}
-
-
diff --git a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/testinfo.dat b/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/testinfo.dat
deleted file mode 100644
index 3006aa87bc..0000000000
--- a/src/pal/tests/palsuite/miscellaneous/wsprintfW/test9/testinfo.dat
+++ /dev/null
@@ -1,14 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = Miscellaneous
-Function = wsprintfW
-Name = Positive test of wsprintfW
-TYPE = DEFAULT
-EXE1 = test
-Description
-= Test %i formatter with wsprintfW.
-
-
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/CMakeLists.txt
index bf1d3a91e7..515815f9d2 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_GetPALDirectoryW.c
+ PAL_GetPALDirectoryW.cpp
)
add_executable(paltest_pal_getpaldirectoryw_test1
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.c b/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.c
deleted file mode 100644
index 2c67aa4954..0000000000
--- a/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.c
+++ /dev/null
@@ -1,78 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: pal_getpaldirectoryw.c
-**
-** Purpose: Positive test the PAL_GetPALDirectoryW API.
-** Call this API to retrieve a fully-qualified
-** directory name where the PAL DLL is loaded from.
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- int err;
- BOOL bValue;
- DWORD dwFileAttribute;
- WCHAR *wpDirectoryName = NULL;
- char *pDirectoryName = NULL;
-
- /*Initialize the PAL environment*/
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- /*allocate momory to store the directory name*/
- wpDirectoryName = malloc(MAX_PATH*sizeof(WCHAR));
- if(NULL == wpDirectoryName)
- {
- Fail("\nFailed to allocate memory for storing directory name!\n");
- }
-
- UINT size = MAX_PATH;
- /*retrieve the machine configuration directory*/
- bValue = PAL_GetPALDirectoryW(wpDirectoryName, &size);
- if(FALSE == bValue)
- {
- free(wpDirectoryName);
- Fail("Failed to call PAL_GetPALDirectoryW API, "
- "error code =%u\n", GetLastError());
- }
-
-
- /*convert wide char string to a standard one*/
- pDirectoryName = convertC(wpDirectoryName);
- if(0 == strlen(pDirectoryName))
- {
- free(wpDirectoryName);
- free(pDirectoryName);
- Fail("The retrieved directory name string is empty!\n");
- }
-
- /*free the memory*/
- free(pDirectoryName);
-
- /*retrieve the attribute of a file or directory*/
- dwFileAttribute = GetFileAttributesW(wpDirectoryName);
-
- /*free the memory*/
- free(wpDirectoryName);
-
- /*check if the attribute indicates a directory*/
- if(FILE_ATTRIBUTE_DIRECTORY !=
- (dwFileAttribute & FILE_ATTRIBUTE_DIRECTORY))
- {
- Fail("The retrieved directory name is not a valid directory!\n");
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp b/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp
new file mode 100644
index 0000000000..856bfe8659
--- /dev/null
+++ b/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp
@@ -0,0 +1,78 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: pal_getpaldirectoryw.c
+**
+** Purpose: Positive test the PAL_GetPALDirectoryW API.
+** Call this API to retrieve a fully-qualified
+** directory name where the PAL DLL is loaded from.
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ int err;
+ BOOL bValue;
+ DWORD dwFileAttribute;
+ WCHAR *wpDirectoryName = NULL;
+ char *pDirectoryName = NULL;
+
+ /*Initialize the PAL environment*/
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ /*allocate momory to store the directory name*/
+ wpDirectoryName = (WCHAR*)malloc(MAX_PATH*sizeof(WCHAR));
+ if(NULL == wpDirectoryName)
+ {
+ Fail("\nFailed to allocate memory for storing directory name!\n");
+ }
+
+ UINT size = MAX_PATH;
+ /*retrieve the machine configuration directory*/
+ bValue = PAL_GetPALDirectoryW(wpDirectoryName, &size);
+ if(FALSE == bValue)
+ {
+ free(wpDirectoryName);
+ Fail("Failed to call PAL_GetPALDirectoryW API, "
+ "error code =%u\n", GetLastError());
+ }
+
+
+ /*convert wide char string to a standard one*/
+ pDirectoryName = convertC(wpDirectoryName);
+ if(0 == strlen(pDirectoryName))
+ {
+ free(wpDirectoryName);
+ free(pDirectoryName);
+ Fail("The retrieved directory name string is empty!\n");
+ }
+
+ /*free the memory*/
+ free(pDirectoryName);
+
+ /*retrieve the attribute of a file or directory*/
+ dwFileAttribute = GetFileAttributesW(wpDirectoryName);
+
+ /*free the memory*/
+ free(wpDirectoryName);
+
+ /*check if the attribute indicates a directory*/
+ if(FILE_ATTRIBUTE_DIRECTORY !=
+ (dwFileAttribute & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ Fail("The retrieved directory name is not a valid directory!\n");
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/CMakeLists.txt
index e8d3c40565..26eb1a860b 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_GetUserTempDirectoryW.c
+ PAL_GetUserTempDirectoryW.cpp
)
add_executable(paltest_pal_getusertempdirectoryw_test1
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.c b/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.cpp
index 65cc426c74..65cc426c74 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.c
+++ b/src/pal/tests/palsuite/pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.cpp
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/CMakeLists.txt
index 416439d650..281efcd8be 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_Initialize_Terminate.c
+ PAL_Initialize_Terminate.cpp
)
add_executable(paltest_pal_initialize_terminate_test1
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.c b/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.cpp
index 29bb2c3b4f..29bb2c3b4f 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.c
+++ b/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test1/PAL_Initialize_Terminate.cpp
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/CMakeLists.txt
index b7661fd240..46b42aa714 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- pal_initialize_twice.c
+ pal_initialize_twice.cpp
)
add_executable(paltest_pal_initialize_terminate_test2
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.c b/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.cpp
index fc460bc1ad..fc460bc1ad 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.c
+++ b/src/pal/tests/palsuite/pal_specific/PAL_Initialize_Terminate/test2/pal_initialize_twice.cpp
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/CMakeLists.txt
index 2379694b24..573ab3834a 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_RegisterLibraryW_UnregisterLibraryW.c
+ PAL_RegisterLibraryW_UnregisterLibraryW.cpp
)
add_executable(paltest_pal_registerlibraryw_unregisterlibraryw_test1
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.c b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.c
deleted file mode 100644
index ff0d33879c..0000000000
--- a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.c
+++ /dev/null
@@ -1,64 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: pal_registerlibrary_unregisterlibrary
-**
-** Purpose: Positive test the PAL_RegisterLibrary API and
-** PAL_UnRegisterLibrary.
-** Call PAL_RegisterLibrary to map a module into the calling
-** process address space and call PAL_UnRegisterLibrary
-** to unmap this module.
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- HMODULE ModuleHandle;
- char ModuleName[64];
- WCHAR *wpModuleName = NULL;
- int err;
-
- /*Initialize the PAL environment*/
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- /*zero the buffer*/
- memset(ModuleName,0,64);
- sprintf(ModuleName, "%s", "rotor_pal");
-
- /*convert a normal string to a wide one*/
- wpModuleName = convert(ModuleName);
-
- /*load a module*/
- ModuleHandle = PAL_RegisterLibrary(wpModuleName);
-
- /*free the memory*/
- free(wpModuleName);
-
- if(!ModuleHandle)
- {
- Fail("Failed to call PAL_RegisterLibrary API to map a module "
- "into calling process, error code=%u!\n", GetLastError());
- }
-
- /*decrement the reference count of the loaded DLL*/
- err = PAL_UnregisterLibrary(ModuleHandle);
- if(0 == err)
- {
- Fail("\nFailed to call PAL_UnregisterLibrary API to "
- "decrement the count of the loaded DLL module, "
- "error code=%u!\n", GetLastError());
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp
new file mode 100644
index 0000000000..8eb8776107
--- /dev/null
+++ b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp
@@ -0,0 +1,64 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: pal_registerlibrary_unregisterlibrary
+**
+** Purpose: Positive test the PAL_RegisterLibrary API and
+** PAL_UnRegisterLibrary.
+** Call PAL_RegisterLibrary to map a module into the calling
+** process address space and call PAL_UnRegisterLibrary
+** to unmap this module.
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ HMODULE ModuleHandle;
+ char ModuleName[64];
+ WCHAR *wpModuleName = NULL;
+ int err;
+
+ /*Initialize the PAL environment*/
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ /*zero the buffer*/
+ memset(ModuleName,0,64);
+ sprintf_s(ModuleName, _countof(ModuleName), "%s", "rotor_pal");
+
+ /*convert a normal string to a wide one*/
+ wpModuleName = convert(ModuleName);
+
+ /*load a module*/
+ ModuleHandle = PAL_RegisterLibrary(wpModuleName);
+
+ /*free the memory*/
+ free(wpModuleName);
+
+ if(!ModuleHandle)
+ {
+ Fail("Failed to call PAL_RegisterLibrary API to map a module "
+ "into calling process, error code=%u!\n", GetLastError());
+ }
+
+ /*decrement the reference count of the loaded DLL*/
+ err = PAL_UnregisterLibrary(ModuleHandle);
+ if(0 == err)
+ {
+ Fail("\nFailed to call PAL_UnregisterLibrary API to "
+ "decrement the count of the loaded DLL module, "
+ "error code=%u!\n", GetLastError());
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/CMakeLists.txt
index bbcb35933e..ef5c0479b7 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- reg_unreg_libraryw_neg.c
+ reg_unreg_libraryw_neg.cpp
)
add_executable(paltest_reg_unreg_libraryw_neg
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.c b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.c
deleted file mode 100644
index a15ff5745b..0000000000
--- a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.c
+++ /dev/null
@@ -1,62 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: pal_registerlibraryw_unregisterlibraryw_neg.c
-**
-** Purpose: Negative test the PAL_RegisterLibrary API.
-** Call PAL_RegisterLibrary to map a non-existant module
-** into the calling process address space.
-**
-**
-**============================================================*/
-#define UNICODE
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[])
-{
- HMODULE ModuleHandle;
- char ModuleName[64];
- WCHAR *wpModuleName = NULL;
- int err;
-
- /*Initialize the PAL environment*/
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- memset(ModuleName, 0, 64);
- sprintf(ModuleName, "%s", "not_exist_module_name");
-
- /*convert a normal string to a wide one*/
- wpModuleName = convert(ModuleName);
-
- /*load a not exist module*/
- ModuleHandle = PAL_RegisterLibrary(wpModuleName);
-
- /*free the memory*/
- free(wpModuleName);
-
- if(NULL != ModuleHandle)
- {
- Trace("ERROR: PAL_RegisterLibrary successfully mapped "
- "a module that does not exist into the calling process\n");
-
- /*decrement the reference count of the loaded DLL*/
- err = PAL_UnregisterLibrary(ModuleHandle);
- if(0 == err)
- {
- Trace("\nFailed to call PAL_UnregisterLibrary API to decrement the "
- "count of the loaded DLL module!\n");
- }
- Fail("");
-
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp
new file mode 100644
index 0000000000..c6fa4ad074
--- /dev/null
+++ b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp
@@ -0,0 +1,62 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: pal_registerlibraryw_unregisterlibraryw_neg.c
+**
+** Purpose: Negative test the PAL_RegisterLibrary API.
+** Call PAL_RegisterLibrary to map a non-existant module
+** into the calling process address space.
+**
+**
+**============================================================*/
+#define UNICODE
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[])
+{
+ HMODULE ModuleHandle;
+ char ModuleName[64];
+ WCHAR *wpModuleName = NULL;
+ int err;
+
+ /*Initialize the PAL environment*/
+ err = PAL_Initialize(argc, argv);
+ if(0 != err)
+ {
+ return FAIL;
+ }
+
+ memset(ModuleName, 0, 64);
+ sprintf_s(ModuleName, _countof(ModuleName), "%s", "not_exist_module_name");
+
+ /*convert a normal string to a wide one*/
+ wpModuleName = convert(ModuleName);
+
+ /*load a not exist module*/
+ ModuleHandle = PAL_RegisterLibrary(wpModuleName);
+
+ /*free the memory*/
+ free(wpModuleName);
+
+ if(NULL != ModuleHandle)
+ {
+ Trace("ERROR: PAL_RegisterLibrary successfully mapped "
+ "a module that does not exist into the calling process\n");
+
+ /*decrement the reference count of the loaded DLL*/
+ err = PAL_UnregisterLibrary(ModuleHandle);
+ if(0 == err)
+ {
+ Trace("\nFailed to call PAL_UnregisterLibrary API to decrement the "
+ "count of the loaded DLL module!\n");
+ }
+ Fail("");
+
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/CMakeLists.txt
index 59922b194b..d20ddd9a43 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_errno.c
+ PAL_errno.cpp
)
add_executable(paltest_pal_errno_test1
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/PAL_errno.c b/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/PAL_errno.cpp
index 32e8487d07..32e8487d07 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/PAL_errno.c
+++ b/src/pal/tests/palsuite/pal_specific/PAL_errno/test1/PAL_errno.cpp
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/CMakeLists.txt
index 3436a2dfdb..dbedac95f5 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_get_stderr.c
+ PAL_get_stderr.cpp
)
add_executable(paltest_pal_get_stderr_test1
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/PAL_get_stderr.c b/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/PAL_get_stderr.cpp
index da53460101..da53460101 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/PAL_get_stderr.c
+++ b/src/pal/tests/palsuite/pal_specific/PAL_get_stderr/test1/PAL_get_stderr.cpp
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/CMakeLists.txt
index 592895b18c..4d714a3735 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_get_stdin.c
+ PAL_get_stdin.cpp
)
add_executable(paltest_pal_get_stdin_test1
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/PAL_get_stdin.c b/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/PAL_get_stdin.cpp
index 5d1fd23f92..5d1fd23f92 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/PAL_get_stdin.c
+++ b/src/pal/tests/palsuite/pal_specific/PAL_get_stdin/test1/PAL_get_stdin.cpp
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/CMakeLists.txt
index 865dd52f16..4c2f51b50d 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- PAL_get_stdout.c
+ PAL_get_stdout.cpp
)
add_executable(paltest_pal_get_stdout_test1
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/PAL_get_stdout.c b/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/PAL_get_stdout.cpp
index ebfee47ae9..ebfee47ae9 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/PAL_get_stdout.c
+++ b/src/pal/tests/palsuite/pal_specific/PAL_get_stdout/test1/PAL_get_stdout.cpp
diff --git a/src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/CMakeLists.txt
index cd18b76958..82ff9225de 100644
--- a/src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- pal_entrypoint.c
+ pal_entrypoint.cpp
)
add_executable(paltest_pal_entrypoint_test1
diff --git a/src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/pal_entrypoint.c b/src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/pal_entrypoint.cpp
index c1b66944aa..c1b66944aa 100644
--- a/src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/pal_entrypoint.c
+++ b/src/pal/tests/palsuite/pal_specific/pal_entrypoint/test1/pal_entrypoint.cpp
diff --git a/src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/CMakeLists.txt b/src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/CMakeLists.txt
index f6e243d0c4..56c9d02eaa 100644
--- a/src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- pal_initializedebug.c
+ pal_initializedebug.cpp
)
add_executable(paltest_pal_initializedebug_test1
diff --git a/src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/pal_initializedebug.c b/src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/pal_initializedebug.cpp
index d14c316013..d14c316013 100644
--- a/src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/pal_initializedebug.c
+++ b/src/pal/tests/palsuite/pal_specific/pal_initializedebug/test1/pal_initializedebug.cpp
diff --git a/src/pal/tests/palsuite/paltestlist.txt b/src/pal/tests/palsuite/paltestlist.txt
index d0a76e9573..2cedca2b97 100644
--- a/src/pal/tests/palsuite/paltestlist.txt
+++ b/src/pal/tests/palsuite/paltestlist.txt
@@ -1,20 +1,28 @@
c_runtime/abs/test1/paltest_abs_test1
c_runtime/acos/test1/paltest_acos_test1
+c_runtime/acosf/test1/paltest_acosf_test1
c_runtime/asin/test1/paltest_asin_test1
+c_runtime/asinf/test1/paltest_asinf_test1
c_runtime/atan/test1/paltest_atan_test1
c_runtime/atan2/test1/paltest_atan2_test1
+c_runtime/atan2f/test1/paltest_atan2f_test1
+c_runtime/atanf/test1/paltest_atanf_test1
c_runtime/atof/test1/paltest_atof_test1
c_runtime/atoi/test1/paltest_atoi_test1
c_runtime/atol/test1/paltest_atol_test1
c_runtime/bsearch/test1/paltest_bsearch_test1
c_runtime/bsearch/test2/paltest_bsearch_test2
c_runtime/ceil/test1/paltest_ceil_test1
+c_runtime/ceilf/test1/paltest_ceilf_test1
c_runtime/cos/test1/paltest_cos_test1
+c_runtime/cosf/test1/paltest_cosf_test1
c_runtime/cosh/test1/paltest_cosh_test1
+c_runtime/coshf/test1/paltest_coshf_test1
c_runtime/errno/test1/paltest_errno_test1
c_runtime/errno/test2/paltest_errno_test2
c_runtime/exit/test1/paltest_exit_test1
c_runtime/exp/test1/paltest_exp_test1
+c_runtime/expf/test1/paltest_expf_test1
c_runtime/fabs/test1/paltest_fabs_test1
c_runtime/fabsf/test1/paltest_fabsf_test1
c_runtime/fclose/test1/paltest_fclose_test1
@@ -24,6 +32,7 @@ c_runtime/fgets/test1/paltest_fgets_test1
c_runtime/fgets/test2/paltest_fgets_test2
c_runtime/fgets/test3/paltest_fgets_test3
c_runtime/floor/test1/paltest_floor_test1
+c_runtime/floorf/test1/paltest_floorf_test1
c_runtime/fmod/test1/paltest_fmod_test1
c_runtime/fmodf/test1/paltest_fmodf_test1
c_runtime/fopen/test1/paltest_fopen_test1
@@ -94,6 +103,8 @@ c_runtime/llabs/test1/paltest_llabs_test1
c_runtime/localtime/test1/paltest_localtime_test1
c_runtime/log/test1/paltest_log_test1
c_runtime/log10/test1/paltest_log10_test1
+c_runtime/log10f/test1/paltest_log10f_test1
+c_runtime/logf/test1/paltest_logf_test1
c_runtime/malloc/test1/paltest_malloc_test1
c_runtime/malloc/test2/paltest_malloc_test2
c_runtime/memchr/test1/paltest_memchr_test1
@@ -104,6 +115,7 @@ c_runtime/memset/test1/paltest_memset_test1
c_runtime/modf/test1/paltest_modf_test1
c_runtime/modff/test1/paltest_modff_test1
c_runtime/pow/test1/paltest_pow_test1
+c_runtime/powf/test1/paltest_powf_test1
c_runtime/printf/test1/paltest_printf_test1
c_runtime/printf/test10/paltest_printf_test10
c_runtime/printf/test11/paltest_printf_test11
@@ -128,44 +140,46 @@ c_runtime/qsort/test2/paltest_qsort_test2
c_runtime/rand_srand/test1/paltest_rand_srand_test1
c_runtime/realloc/test1/paltest_realloc_test1
c_runtime/sin/test1/paltest_sin_test1
+c_runtime/sinf/test1/paltest_sinf_test1
c_runtime/sinh/test1/paltest_sinh_test1
-c_runtime/sprintf/test1/paltest_sprintf_test1
-c_runtime/sprintf/test10/paltest_sprintf_test10
-c_runtime/sprintf/test11/paltest_sprintf_test11
-c_runtime/sprintf/test12/paltest_sprintf_test12
-c_runtime/sprintf/test13/paltest_sprintf_test13
-c_runtime/sprintf/test14/paltest_sprintf_test14
-c_runtime/sprintf/test15/paltest_sprintf_test15
-c_runtime/sprintf/test16/paltest_sprintf_test16
-c_runtime/sprintf/test17/paltest_sprintf_test17
-c_runtime/sprintf/test18/paltest_sprintf_test18
-c_runtime/sprintf/test19/paltest_sprintf_test19
-c_runtime/sprintf/test2/paltest_sprintf_test2
-c_runtime/sprintf/test3/paltest_sprintf_test3
-c_runtime/sprintf/test4/paltest_sprintf_test4
-c_runtime/sprintf/test5/paltest_sprintf_test5
-c_runtime/sprintf/test6/paltest_sprintf_test6
-c_runtime/sprintf/test7/paltest_sprintf_test7
-c_runtime/sprintf/test8/paltest_sprintf_test8
-c_runtime/sprintf/test9/paltest_sprintf_test9
+c_runtime/sinhf/test1/paltest_sinhf_test1
+c_runtime/sprintf_s/test1/paltest_sprintf_test1
+c_runtime/sprintf_s/test10/paltest_sprintf_test10
+c_runtime/sprintf_s/test11/paltest_sprintf_test11
+c_runtime/sprintf_s/test12/paltest_sprintf_test12
+c_runtime/sprintf_s/test13/paltest_sprintf_test13
+c_runtime/sprintf_s/test14/paltest_sprintf_test14
+c_runtime/sprintf_s/test15/paltest_sprintf_test15
+c_runtime/sprintf_s/test16/paltest_sprintf_test16
+c_runtime/sprintf_s/test17/paltest_sprintf_test17
+c_runtime/sprintf_s/test18/paltest_sprintf_test18
+c_runtime/sprintf_s/test19/paltest_sprintf_test19
+c_runtime/sprintf_s/test2/paltest_sprintf_test2
+c_runtime/sprintf_s/test3/paltest_sprintf_test3
+c_runtime/sprintf_s/test4/paltest_sprintf_test4
+c_runtime/sprintf_s/test6/paltest_sprintf_test6
+c_runtime/sprintf_s/test7/paltest_sprintf_test7
+c_runtime/sprintf_s/test8/paltest_sprintf_test8
+c_runtime/sprintf_s/test9/paltest_sprintf_test9
c_runtime/sqrt/test1/paltest_sqrt_test1
-c_runtime/sscanf/test1/paltest_sscanf_test1
-c_runtime/sscanf/test10/paltest_sscanf_test10
-c_runtime/sscanf/test11/paltest_sscanf_test11
-c_runtime/sscanf/test12/paltest_sscanf_test12
-c_runtime/sscanf/test13/paltest_sscanf_test13
-c_runtime/sscanf/test14/paltest_sscanf_test14
-c_runtime/sscanf/test15/paltest_sscanf_test15
-c_runtime/sscanf/test16/paltest_sscanf_test16
-c_runtime/sscanf/test17/paltest_sscanf_test17
-c_runtime/sscanf/test2/paltest_sscanf_test2
-c_runtime/sscanf/test3/paltest_sscanf_test3
-c_runtime/sscanf/test4/paltest_sscanf_test4
-c_runtime/sscanf/test5/paltest_sscanf_test5
-c_runtime/sscanf/test6/paltest_sscanf_test6
-c_runtime/sscanf/test7/paltest_sscanf_test7
-c_runtime/sscanf/test8/paltest_sscanf_test8
-c_runtime/sscanf/test9/paltest_sscanf_test9
+c_runtime/sqrtf/test1/paltest_sqrtf_test1
+c_runtime/sscanf_s/test1/paltest_sscanf_test1
+c_runtime/sscanf_s/test10/paltest_sscanf_test10
+c_runtime/sscanf_s/test11/paltest_sscanf_test11
+c_runtime/sscanf_s/test12/paltest_sscanf_test12
+c_runtime/sscanf_s/test13/paltest_sscanf_test13
+c_runtime/sscanf_s/test14/paltest_sscanf_test14
+c_runtime/sscanf_s/test15/paltest_sscanf_test15
+c_runtime/sscanf_s/test16/paltest_sscanf_test16
+c_runtime/sscanf_s/test17/paltest_sscanf_test17
+c_runtime/sscanf_s/test2/paltest_sscanf_test2
+c_runtime/sscanf_s/test3/paltest_sscanf_test3
+c_runtime/sscanf_s/test4/paltest_sscanf_test4
+c_runtime/sscanf_s/test5/paltest_sscanf_test5
+c_runtime/sscanf_s/test6/paltest_sscanf_test6
+c_runtime/sscanf_s/test7/paltest_sscanf_test7
+c_runtime/sscanf_s/test8/paltest_sscanf_test8
+c_runtime/sscanf_s/test9/paltest_sscanf_test9
c_runtime/strcat/test1/paltest_strcat_test1
c_runtime/strchr/test1/paltest_strchr_test1
c_runtime/strcmp/test1/paltest_strcmp_test1
@@ -218,7 +232,9 @@ c_runtime/swscanf/test7/paltest_swscanf_test7
c_runtime/swscanf/test8/paltest_swscanf_test8
c_runtime/swscanf/test9/paltest_swscanf_test9
c_runtime/tan/test1/paltest_tan_test1
+c_runtime/tanf/test1/paltest_tanf_test1
c_runtime/tanh/test1/paltest_tanh_test1
+c_runtime/tanhf/test1/paltest_tanhf_test1
c_runtime/time/test1/paltest_time_test1
c_runtime/tolower/test1/paltest_tolower_test1
c_runtime/toupper/test1/paltest_toupper_test1
@@ -328,13 +344,13 @@ c_runtime/wprintf/test1/paltest_wprintf_test1
c_runtime/_alloca/test1/paltest_alloca_test1
c_runtime/_fdopen/test1/paltest_fdopen_test1
c_runtime/_finite/test1/paltest_finite_test1
+c_runtime/_finitef/test1/paltest_finitef_test1
c_runtime/_fullpath/test1/paltest_fullpath_test1
c_runtime/_isnan/test1/paltest_isnan_test1
+c_runtime/_isnanf/test1/paltest_isnanf_test1
c_runtime/_itow/test1/paltest_itow_test1
-c_runtime/_makepath/test1/paltest_makepath_test1
c_runtime/_mbsdec/test1/paltest_mbsdec_test1
c_runtime/_mbsinc/test1/paltest_mbsinc_test1
-c_runtime/_mbslen/test1/paltest_mbslen_test1
c_runtime/_mbsninc/test1/paltest_mbsninc_test1
c_runtime/_open_osfhandle/test1/paltest_open_osfhandle_test1
c_runtime/_open_osfhandle/test2/paltest_open_osfhandle_test2
@@ -345,47 +361,43 @@ c_runtime/_putenv/test4/paltest_putenv_test4
c_runtime/_putw/test1/paltest_putw_test1
c_runtime/_rotl/test1/paltest_rotl_test1
c_runtime/_rotr/test1/paltest_rotr_test1
-c_runtime/_snprintf/test1/paltest_snprintf_test1
-c_runtime/_snprintf/test10/paltest_snprintf_test10
-c_runtime/_snprintf/test11/paltest_snprintf_test11
-c_runtime/_snprintf/test12/paltest_snprintf_test12
-c_runtime/_snprintf/test13/paltest_snprintf_test13
-c_runtime/_snprintf/test14/paltest_snprintf_test14
-c_runtime/_snprintf/test15/paltest_snprintf_test15
-c_runtime/_snprintf/test16/paltest_snprintf_test16
-c_runtime/_snprintf/test17/paltest_snprintf_test17
-c_runtime/_snprintf/test18/paltest_snprintf_test18
-c_runtime/_snprintf/test19/paltest_snprintf_test19
-c_runtime/_snprintf/test2/paltest_snprintf_test2
-c_runtime/_snprintf/test3/paltest_snprintf_test3
-c_runtime/_snprintf/test4/paltest_snprintf_test4
-c_runtime/_snprintf/test5/paltest_snprintf_test5
-c_runtime/_snprintf/test6/paltest_snprintf_test6
-c_runtime/_snprintf/test7/paltest_snprintf_test7
-c_runtime/_snprintf/test8/paltest_snprintf_test8
-c_runtime/_snprintf/test9/paltest_snprintf_test9
-c_runtime/_snwprintf/test1/paltest_snwprintf_test1
-c_runtime/_snwprintf/test10/paltest_snwprintf_test10
-c_runtime/_snwprintf/test11/paltest_snwprintf_test11
-c_runtime/_snwprintf/test12/paltest_snwprintf_test12
-c_runtime/_snwprintf/test13/paltest_snwprintf_test13
-c_runtime/_snwprintf/test14/paltest_snwprintf_test14
-c_runtime/_snwprintf/test15/paltest_snwprintf_test15
-c_runtime/_snwprintf/test16/paltest_snwprintf_test16
-c_runtime/_snwprintf/test17/paltest_snwprintf_test17
-c_runtime/_snwprintf/test18/paltest_snwprintf_test18
-c_runtime/_snwprintf/test19/paltest_snwprintf_test19
-c_runtime/_snwprintf/test3/paltest_snwprintf_test3
-c_runtime/_snwprintf/test4/paltest_snwprintf_test4
-c_runtime/_snwprintf/test5/paltest_snwprintf_test5
-c_runtime/_snwprintf/test6/paltest_snwprintf_test6
-c_runtime/_snwprintf/test8/paltest_snwprintf_test8
-c_runtime/_snwprintf/test9/paltest_snwprintf_test9
-c_runtime/_splitpath/test1/paltest_splitpath_test1
+c_runtime/_snprintf_s/test1/paltest_snprintf_test1
+c_runtime/_snprintf_s/test10/paltest_snprintf_test10
+c_runtime/_snprintf_s/test11/paltest_snprintf_test11
+c_runtime/_snprintf_s/test12/paltest_snprintf_test12
+c_runtime/_snprintf_s/test13/paltest_snprintf_test13
+c_runtime/_snprintf_s/test14/paltest_snprintf_test14
+c_runtime/_snprintf_s/test15/paltest_snprintf_test15
+c_runtime/_snprintf_s/test16/paltest_snprintf_test16
+c_runtime/_snprintf_s/test17/paltest_snprintf_test17
+c_runtime/_snprintf_s/test18/paltest_snprintf_test18
+c_runtime/_snprintf_s/test19/paltest_snprintf_test19
+c_runtime/_snprintf_s/test2/paltest_snprintf_test2
+c_runtime/_snprintf_s/test3/paltest_snprintf_test3
+c_runtime/_snprintf_s/test4/paltest_snprintf_test4
+c_runtime/_snprintf_s/test6/paltest_snprintf_test6
+c_runtime/_snprintf_s/test7/paltest_snprintf_test7
+c_runtime/_snprintf_s/test8/paltest_snprintf_test8
+c_runtime/_snprintf_s/test9/paltest_snprintf_test9
+c_runtime/_snwprintf_s/test1/paltest_snwprintf_test1
+c_runtime/_snwprintf_s/test10/paltest_snwprintf_test10
+c_runtime/_snwprintf_s/test11/paltest_snwprintf_test11
+c_runtime/_snwprintf_s/test12/paltest_snwprintf_test12
+c_runtime/_snwprintf_s/test13/paltest_snwprintf_test13
+c_runtime/_snwprintf_s/test14/paltest_snwprintf_test14
+c_runtime/_snwprintf_s/test15/paltest_snwprintf_test15
+c_runtime/_snwprintf_s/test16/paltest_snwprintf_test16
+c_runtime/_snwprintf_s/test17/paltest_snwprintf_test17
+c_runtime/_snwprintf_s/test18/paltest_snwprintf_test18
+c_runtime/_snwprintf_s/test19/paltest_snwprintf_test19
+c_runtime/_snwprintf_s/test3/paltest_snwprintf_test3
+c_runtime/_snwprintf_s/test4/paltest_snwprintf_test4
+c_runtime/_snwprintf_s/test6/paltest_snwprintf_test6
+c_runtime/_snwprintf_s/test8/paltest_snwprintf_test8
+c_runtime/_snwprintf_s/test9/paltest_snwprintf_test9
c_runtime/_stricmp/test1/paltest_stricmp_test1
c_runtime/_strlwr/test1/paltest_strlwr_test1
c_runtime/_strnicmp/test1/paltest_strnicmp_test1
-c_runtime/_swab/test1/paltest_swab_test1
c_runtime/_vsnprintf/test1/paltest_vsnprintf_test1
c_runtime/_vsnprintf/test10/paltest_vsnprintf_test10
c_runtime/_vsnprintf/test11/paltest_vsnprintf_test11
@@ -405,23 +417,22 @@ c_runtime/_vsnprintf/test6/paltest_vsnprintf_test6
c_runtime/_vsnprintf/test7/paltest_vsnprintf_test7
c_runtime/_vsnprintf/test8/paltest_vsnprintf_test8
c_runtime/_vsnprintf/test9/paltest_vsnprintf_test9
-c_runtime/_vsnwprintf/test1/paltest_vsnwprintf_test1
-c_runtime/_vsnwprintf/test10/paltest_vsnwprintf_test10
-c_runtime/_vsnwprintf/test11/paltest_vsnwprintf_test11
-c_runtime/_vsnwprintf/test12/paltest_vsnwprintf_test12
-c_runtime/_vsnwprintf/test13/paltest_vsnwprintf_test13
-c_runtime/_vsnwprintf/test14/paltest_vsnwprintf_test14
-c_runtime/_vsnwprintf/test15/paltest_vsnwprintf_test15
-c_runtime/_vsnwprintf/test16/paltest_vsnwprintf_test16
-c_runtime/_vsnwprintf/test17/paltest_vsnwprintf_test17
-c_runtime/_vsnwprintf/test18/paltest_vsnwprintf_test18
-c_runtime/_vsnwprintf/test19/paltest_vsnwprintf_test19
-c_runtime/_vsnwprintf/test3/paltest_vsnwprintf_test3
-c_runtime/_vsnwprintf/test4/paltest_vsnwprintf_test4
-c_runtime/_vsnwprintf/test5/paltest_vsnwprintf_test5
-c_runtime/_vsnwprintf/test6/paltest_vsnwprintf_test6
-c_runtime/_vsnwprintf/test8/paltest_vsnwprintf_test8
-c_runtime/_vsnwprintf/test9/paltest_vsnwprintf_test9
+c_runtime/_vsnwprintf_s/test1/paltest_vsnwprintf_test1
+c_runtime/_vsnwprintf_s/test10/paltest_vsnwprintf_test10
+c_runtime/_vsnwprintf_s/test11/paltest_vsnwprintf_test11
+c_runtime/_vsnwprintf_s/test12/paltest_vsnwprintf_test12
+c_runtime/_vsnwprintf_s/test13/paltest_vsnwprintf_test13
+c_runtime/_vsnwprintf_s/test14/paltest_vsnwprintf_test14
+c_runtime/_vsnwprintf_s/test15/paltest_vsnwprintf_test15
+c_runtime/_vsnwprintf_s/test16/paltest_vsnwprintf_test16
+c_runtime/_vsnwprintf_s/test17/paltest_vsnwprintf_test17
+c_runtime/_vsnwprintf_s/test18/paltest_vsnwprintf_test18
+c_runtime/_vsnwprintf_s/test19/paltest_vsnwprintf_test19
+c_runtime/_vsnwprintf_s/test3/paltest_vsnwprintf_test3
+c_runtime/_vsnwprintf_s/test4/paltest_vsnwprintf_test4
+c_runtime/_vsnwprintf_s/test6/paltest_vsnwprintf_test6
+c_runtime/_vsnwprintf_s/test8/paltest_vsnwprintf_test8
+c_runtime/_vsnwprintf_s/test9/paltest_vsnwprintf_test9
c_runtime/_wcsicmp/test1/paltest_wcsicmp_test1
c_runtime/_wcslwr/test1/paltest_wcslwr_test1
c_runtime/_wcsnicmp/test1/paltest_wcsnicmp_test1
@@ -432,7 +443,6 @@ c_runtime/_wfopen/test4/paltest_wfopen_test4
c_runtime/_wfopen/test5/paltest_wfopen_test5
c_runtime/_wfopen/test6/paltest_wfopen_test6
c_runtime/_wfopen/test7/paltest_wfopen_test7
-c_runtime/_wsplitpath/test1/paltest_wsplitpath_test1
c_runtime/_wtoi/test1/paltest_wtoi_test1
c_runtime/__iscsym/test1/paltest_iscsym_test1
debug_api/OutputDebugStringW/test1/paltest_outputdebugstringw_test1
@@ -473,6 +483,8 @@ filemapping_memmgt/MapViewOfFile/test3/paltest_mapviewoffile_test3
filemapping_memmgt/MapViewOfFile/test4/paltest_mapviewoffile_test4
filemapping_memmgt/MapViewOfFile/test5/paltest_mapviewoffile_test5
filemapping_memmgt/MapViewOfFile/test6/paltest_mapviewoffile_test6
+filemapping_memmgt/ProbeMemory/test1/paltest_probememory_test1
+filemapping_memmgt/ProbeMemory/ProbeMemory_neg1/paltest_probememory_probememory_neg1
filemapping_memmgt/RtlMoveMemory/test1/paltest_rtlmovememory_test1
filemapping_memmgt/RtlMoveMemory/test3/paltest_rtlmovememory_test3
filemapping_memmgt/RtlMoveMemory/test4/paltest_rtlmovememory_test4
@@ -678,12 +690,6 @@ miscellaneous/InterlockedIncrement/test1/paltest_interlockedincrement_test1
miscellaneous/InterlockedIncrement/test2/paltest_interlockedincrement_test2
miscellaneous/InterlockedIncrement64/test1/paltest_interlockedincrement64_test1
miscellaneous/InterlockedIncrement64/test2/paltest_interlockedincrement64_test2
-miscellaneous/lstrcatW/test1/paltest_lstrcatw_test1
-miscellaneous/lstrcatW/test2/paltest_lstrcatw_test2
-miscellaneous/lstrcatW/test3/paltest_lstrcatw_test3
-miscellaneous/lstrcatW/test4/paltest_lstrcatw_test4
-miscellaneous/lstrcpynW/test1/paltest_lstrcpynw_test1
-miscellaneous/lstrcpyW/test1/paltest_lstrcpyw_test1
miscellaneous/lstrlenA/test1/paltest_lstrlena_test1
miscellaneous/lstrlenW/test1/paltest_lstrlenw_test1
miscellaneous/queryperformancecounter/test1/paltest_queryperformancecounter_test1
@@ -697,27 +703,7 @@ miscellaneous/SetEnvironmentVariableW/test2/paltest_setenvironmentvariablew_test
miscellaneous/SetEnvironmentVariableW/test3/paltest_setenvironmentvariablew_test3
miscellaneous/SetEnvironmentVariableW/test4/paltest_setenvironmentvariablew_test4
miscellaneous/SetLastError/test1/paltest_setlasterror_test1
-miscellaneous/wsprintfA/test1/paltest_wsprintfa_test1
-miscellaneous/wsprintfA/test11/paltest_wsprintfa_test11
-miscellaneous/wsprintfA/test12/paltest_wsprintfa_test12
-miscellaneous/wsprintfA/test13/paltest_wsprintfa_test13
-miscellaneous/wsprintfA/test2/paltest_wsprintfa_test2
-miscellaneous/wsprintfA/test3/paltest_wsprintfa_test3
-miscellaneous/wsprintfA/test6/paltest_wsprintfa_test6
-miscellaneous/wsprintfA/test7/paltest_wsprintfa_test7
-miscellaneous/wsprintfA/test8/paltest_wsprintfa_test8
-miscellaneous/wsprintfA/test9/paltest_wsprintfa_test9
-miscellaneous/wsprintfW/test1/paltest_wsprintfw_test1
-miscellaneous/wsprintfW/test11/paltest_wsprintfw_test11
-miscellaneous/wsprintfW/test12/paltest_wsprintfw_test12
-miscellaneous/wsprintfW/test13/paltest_wsprintfw_test13
-miscellaneous/wsprintfW/test3/paltest_wsprintfw_test3
-miscellaneous/wsprintfW/test6/paltest_wsprintfw_test6
-miscellaneous/wsprintfW/test8/paltest_wsprintfw_test8
-miscellaneous/wsprintfW/test9/paltest_wsprintfw_test9
miscellaneous/_i64tow/test1/paltest_i64tow_test1
-miscellaneous/_ui64tow/test1/paltest_ui64tow_test1
-miscellaneous/_ui64tow/test2/paltest_ui64tow_test2
pal_specific/pal_entrypoint/test1/paltest_pal_entrypoint_test1
pal_specific/PAL_errno/test1/paltest_pal_errno_test1
pal_specific/pal_initializedebug/test1/paltest_pal_initializedebug_test1
diff --git a/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt b/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt
index ac0a2ee4eb..0e12ccbf55 100644
--- a/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt
+++ b/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt
@@ -26,11 +26,10 @@ c_runtime/_ecvt/test1/paltest_ecvt_test1
c_runtime/_gcvt/test1/paltest_gcvt_test1
c_runtime/_gcvt/test2/paltest_gcvt_test2
c_runtime/_getw/test1/paltest_getw_test1
-c_runtime/_snwprintf/test2/paltest_snwprintf_test2
-c_runtime/_snwprintf/test7/paltest_snwprintf_test7
-c_runtime/_vsnwprintf/test2/paltest_vsnwprintf_test2
-c_runtime/_vsnwprintf/test7/paltest_vsnwprintf_test7
-c_runtime/_wmakepath/test1/paltest_wmakepath_test1
+c_runtime/_snwprintf_s/test2/paltest_snwprintf_test2
+c_runtime/_snwprintf_s/test7/paltest_snwprintf_test7
+c_runtime/_vsnwprintf_s/test2/paltest_vsnwprintf_test2
+c_runtime/_vsnwprintf_s/test7/paltest_vsnwprintf_test7
debug_api/DebugBreak/test1/paltest_debugbreak_test1
debug_api/OutputDebugStringA/test1/paltest_outputdebugstringa_test1
debug_api/WriteProcessMemory/test1/paltest_writeprocessmemory_test1
diff --git a/src/pal/tests/palsuite/palverify.dat b/src/pal/tests/palsuite/palverify.dat
index 36b48d66e8..d6e113b670 100644
--- a/src/pal/tests/palsuite/palverify.dat
+++ b/src/pal/tests/palsuite/palverify.dat
@@ -7,16 +7,16 @@ c_runtime/_alloca/test1,1
c_runtime/_ecvt/test1,1
c_runtime/_fdopen/test1,1
c_runtime/_finite/test1,1
+c_runtime/_finitef/test1,1
c_runtime/_fullpath/test1,1
c_runtime/_gcvt/test1,1
c_runtime/_gcvt/test2,1
c_runtime/_getw/test1,1
c_runtime/_isnan/test1,1
+c_runtime/_isnanf/test1,1
c_runtime/_itow/test1,1
-c_runtime/_makepath/test1,1
c_runtime/_mbsdec/test1,1
c_runtime/_mbsinc/test1,1
-c_runtime/_mbslen/test1,1
c_runtime/_mbsninc/test1,1
c_runtime/_open_osfhandle/test1,1
c_runtime/_open_osfhandle/test2,1
@@ -27,49 +27,45 @@ c_runtime/_putenv/test4,1
c_runtime/_putw/test1,1
c_runtime/_rotl/test1,1
c_runtime/_rotr/test1,1
-c_runtime/_snprintf/test1,1
-c_runtime/_snprintf/test2,1
-c_runtime/_snprintf/test3,1
-c_runtime/_snprintf/test4,1
-c_runtime/_snprintf/test5,1
-c_runtime/_snprintf/test6,1
-c_runtime/_snprintf/test7,1
-c_runtime/_snprintf/test8,1
-c_runtime/_snprintf/test9,1
-c_runtime/_snprintf/test10,1
-c_runtime/_snprintf/test11,1
-c_runtime/_snprintf/test12,1
-c_runtime/_snprintf/test13,1
-c_runtime/_snprintf/test14,1
-c_runtime/_snprintf/test15,1
-c_runtime/_snprintf/test16,1
-c_runtime/_snprintf/test17,1
-c_runtime/_snprintf/test18,1
-c_runtime/_snprintf/test19,1
-c_runtime/_snwprintf/test1,1
-c_runtime/_snwprintf/test2,1
-c_runtime/_snwprintf/test3,1
-c_runtime/_snwprintf/test4,1
-c_runtime/_snwprintf/test5,1
-c_runtime/_snwprintf/test6,1
-c_runtime/_snwprintf/test7,1
-c_runtime/_snwprintf/test8,1
-c_runtime/_snwprintf/test9,1
-c_runtime/_snwprintf/test10,1
-c_runtime/_snwprintf/test11,1
-c_runtime/_snwprintf/test12,1
-c_runtime/_snwprintf/test13,1
-c_runtime/_snwprintf/test14,1
-c_runtime/_snwprintf/test15,1
-c_runtime/_snwprintf/test16,1
-c_runtime/_snwprintf/test17,1
-c_runtime/_snwprintf/test18,1
-c_runtime/_snwprintf/test19,1
-c_runtime/_splitpath/test1,1
+c_runtime/_snprintf_s/test1,1
+c_runtime/_snprintf_s/test2,1
+c_runtime/_snprintf_s/test3,1
+c_runtime/_snprintf_s/test4,1
+c_runtime/_snprintf_s/test6,1
+c_runtime/_snprintf_s/test7,1
+c_runtime/_snprintf_s/test8,1
+c_runtime/_snprintf_s/test9,1
+c_runtime/_snprintf_s/test10,1
+c_runtime/_snprintf_s/test11,1
+c_runtime/_snprintf_s/test12,1
+c_runtime/_snprintf_s/test13,1
+c_runtime/_snprintf_s/test14,1
+c_runtime/_snprintf_s/test15,1
+c_runtime/_snprintf_s/test16,1
+c_runtime/_snprintf_s/test17,1
+c_runtime/_snprintf_s/test18,1
+c_runtime/_snprintf_s/test19,1
+c_runtime/_snwprintf_s/test1,1
+c_runtime/_snwprintf_s/test2,1
+c_runtime/_snwprintf_s/test3,1
+c_runtime/_snwprintf_s/test4,1
+c_runtime/_snwprintf_s/test6,1
+c_runtime/_snwprintf_s/test7,1
+c_runtime/_snwprintf_s/test8,1
+c_runtime/_snwprintf_s/test9,1
+c_runtime/_snwprintf_s/test10,1
+c_runtime/_snwprintf_s/test11,1
+c_runtime/_snwprintf_s/test12,1
+c_runtime/_snwprintf_s/test13,1
+c_runtime/_snwprintf_s/test14,1
+c_runtime/_snwprintf_s/test15,1
+c_runtime/_snwprintf_s/test16,1
+c_runtime/_snwprintf_s/test17,1
+c_runtime/_snwprintf_s/test18,1
+c_runtime/_snwprintf_s/test19,1
c_runtime/_stricmp/test1,1
c_runtime/_strlwr/test1,1
c_runtime/_strnicmp/test1,1
-c_runtime/_swab/test1,1
c_runtime/_vsnprintf/test1,1
c_runtime/_vsnprintf/test2,1
c_runtime/_vsnprintf/test3,1
@@ -89,25 +85,25 @@ c_runtime/_vsnprintf/test16,1
c_runtime/_vsnprintf/test17,1
c_runtime/_vsnprintf/test18,1
c_runtime/_vsnprintf/test19,1
-c_runtime/_vsnwprintf/test1,1
-c_runtime/_vsnwprintf/test2,1
-c_runtime/_vsnwprintf/test3,1
-c_runtime/_vsnwprintf/test4,1
-c_runtime/_vsnwprintf/test5,1
-c_runtime/_vsnwprintf/test6,1
-c_runtime/_vsnwprintf/test7,1
-c_runtime/_vsnwprintf/test8,1
-c_runtime/_vsnwprintf/test9,1
-c_runtime/_vsnwprintf/test10,1
-c_runtime/_vsnwprintf/test11,1
-c_runtime/_vsnwprintf/test12,1
-c_runtime/_vsnwprintf/test13,1
-c_runtime/_vsnwprintf/test14,1
-c_runtime/_vsnwprintf/test15,1
-c_runtime/_vsnwprintf/test16,1
-c_runtime/_vsnwprintf/test17,1
-c_runtime/_vsnwprintf/test18,1
-c_runtime/_vsnwprintf/test19,1
+c_runtime/_vsnwprintf_s/test1,1
+c_runtime/_vsnwprintf_s/test2,1
+c_runtime/_vsnwprintf_s/test3,1
+c_runtime/_vsnwprintf_s/test4,1
+c_runtime/_vsnwprintf_s/test5,1
+c_runtime/_vsnwprintf_s/test6,1
+c_runtime/_vsnwprintf_s/test7,1
+c_runtime/_vsnwprintf_s/test8,1
+c_runtime/_vsnwprintf_s/test9,1
+c_runtime/_vsnwprintf_s/test10,1
+c_runtime/_vsnwprintf_s/test11,1
+c_runtime/_vsnwprintf_s/test12,1
+c_runtime/_vsnwprintf_s/test13,1
+c_runtime/_vsnwprintf_s/test14,1
+c_runtime/_vsnwprintf_s/test15,1
+c_runtime/_vsnwprintf_s/test16,1
+c_runtime/_vsnwprintf_s/test17,1
+c_runtime/_vsnwprintf_s/test18,1
+c_runtime/_vsnwprintf_s/test19,1
c_runtime/_wcsicmp/test1,1
c_runtime/_wcslwr/test1,1
c_runtime/_wcsnicmp/test1,1
@@ -118,27 +114,33 @@ c_runtime/_wfopen/test4,1
c_runtime/_wfopen/test5,1
c_runtime/_wfopen/test6,1
c_runtime/_wfopen/test7,1
-c_runtime/_wmakepath/test1,1
-c_runtime/_wsplitpath/test1,1
c_runtime/_wtoi/test1,1
c_runtime/abs/test1,1
c_runtime/acos/test1,1
+c_runtime/acosf/test1,1
c_runtime/asin/test1,1
+c_runtime/asinf/test1,1
c_runtime/atan/test1,1
c_runtime/atan2/test1,1
+c_runtime/atan2f/test1,1
+c_runtime/atanf/test1,1
c_runtime/atof/test1,1
c_runtime/atoi/test1,1
c_runtime/atol/test1,1
c_runtime/bsearch/test1,1
c_runtime/bsearch/test2,1
c_runtime/ceil/test1,1
+c_runtime/ceilf/test1,1
c_runtime/cos/test1,1
+c_runtime/cosf/test1,1
c_runtime/cosh/test1,1
+c_runtime/coshf/test1,1
c_runtime/ctime/test1,1
c_runtime/errno/test1,1
c_runtime/errno/test2,1
c_runtime/exit/test1,1
c_runtime/exp/test1,1
+c_runtime/expf/test1,1
c_runtime/fabs/test1,1
c_runtime/fabsf/test1,1
c_runtime/fclose/test1,1
@@ -151,6 +153,7 @@ c_runtime/fgets/test1,1
c_runtime/fgets/test2,1
c_runtime/fgets/test3,1
c_runtime/floor/test1,1
+c_runtime/floorf/test1,1
c_runtime/fmod/test1,1
c_runtime/fmodf/test1,1
c_runtime/fopen/test1,1
@@ -230,6 +233,8 @@ c_runtime/llabs/test1,1
c_runtime/localtime/test1,1
c_runtime/log/test1,1
c_runtime/log10/test1,1
+c_runtime/log10f/test1,1
+c_runtime/logf/test1,1
c_runtime/malloc/test1,1
c_runtime/memchr/test1,1
c_runtime/memcmp/test1,1
@@ -238,6 +243,7 @@ c_runtime/memmove/test1,1
c_runtime/memset/test1,1
c_runtime/modf/test1,1
c_runtime/pow/test1,1
+c_runtime/powf/test1,1
c_runtime/printf/test1,1
c_runtime/printf/test2,1
c_runtime/printf/test3,1
@@ -262,44 +268,46 @@ c_runtime/qsort/test2,1
c_runtime/rand_srand/test1,1
c_runtime/realloc/test1,1
c_runtime/sin/test1,1
+c_runtime/sinf/test1,1
c_runtime/sinh/test1,1
-c_runtime/sprintf/test1,1
-c_runtime/sprintf/test2,1
-c_runtime/sprintf/test3,1
-c_runtime/sprintf/test4,1
-c_runtime/sprintf/test5,1
-c_runtime/sprintf/test6,1
-c_runtime/sprintf/test7,1
-c_runtime/sprintf/test8,1
-c_runtime/sprintf/test9,1
-c_runtime/sprintf/test10,1
-c_runtime/sprintf/test11,1
-c_runtime/sprintf/test12,1
-c_runtime/sprintf/test13,1
-c_runtime/sprintf/test14,1
-c_runtime/sprintf/test15,1
-c_runtime/sprintf/test16,1
-c_runtime/sprintf/test17,1
-c_runtime/sprintf/test18,1
-c_runtime/sprintf/test19,1
+c_runtime/sinhf/test1,1
+c_runtime/sprintf_s/test1,1
+c_runtime/sprintf_s/test2,1
+c_runtime/sprintf_s/test3,1
+c_runtime/sprintf_s/test4,1
+c_runtime/sprintf_s/test6,1
+c_runtime/sprintf_s/test7,1
+c_runtime/sprintf_s/test8,1
+c_runtime/sprintf_s/test9,1
+c_runtime/sprintf_s/test10,1
+c_runtime/sprintf_s/test11,1
+c_runtime/sprintf_s/test12,1
+c_runtime/sprintf_s/test13,1
+c_runtime/sprintf_s/test14,1
+c_runtime/sprintf_s/test15,1
+c_runtime/sprintf_s/test16,1
+c_runtime/sprintf_s/test17,1
+c_runtime/sprintf_s/test18,1
+c_runtime/sprintf_s/test19,1
c_runtime/sqrt/test1,1
-c_runtime/sscanf/test1,1
-c_runtime/sscanf/test2,1
-c_runtime/sscanf/test3,1
-c_runtime/sscanf/test4,1
-c_runtime/sscanf/test5,1
-c_runtime/sscanf/test6,1
-c_runtime/sscanf/test7,1
-c_runtime/sscanf/test8,1
-c_runtime/sscanf/test9,1
-c_runtime/sscanf/test10,1
-c_runtime/sscanf/test11,1
-c_runtime/sscanf/test12,1
-c_runtime/sscanf/test13,1
-c_runtime/sscanf/test14,1
-c_runtime/sscanf/test15,1
-c_runtime/sscanf/test16,1
-c_runtime/sscanf/test17,1
+c_runtime/sqrtf/test1,1
+c_runtime/sscanf_s/test1,1
+c_runtime/sscanf_s/test2,1
+c_runtime/sscanf_s/test3,1
+c_runtime/sscanf_s/test4,1
+c_runtime/sscanf_s/test5,1
+c_runtime/sscanf_s/test6,1
+c_runtime/sscanf_s/test7,1
+c_runtime/sscanf_s/test8,1
+c_runtime/sscanf_s/test9,1
+c_runtime/sscanf_s/test10,1
+c_runtime/sscanf_s/test11,1
+c_runtime/sscanf_s/test12,1
+c_runtime/sscanf_s/test13,1
+c_runtime/sscanf_s/test14,1
+c_runtime/sscanf_s/test15,1
+c_runtime/sscanf_s/test16,1
+c_runtime/sscanf_s/test17,1
c_runtime/strcat/test1,1
c_runtime/strchr/test1,1
c_runtime/strcmp/test1,1
@@ -354,7 +362,9 @@ c_runtime/swscanf/test15,1
c_runtime/swscanf/test16,1
c_runtime/swscanf/test17,1
c_runtime/tan/test1,1
+c_runtime/tanf/test1,1
c_runtime/tanh/test1,1
+c_runtime/tanhf/test1,1
c_runtime/time/test1,1
c_runtime/tolower/test1,1
c_runtime/toupper/test1,1
@@ -715,8 +725,6 @@ locale_info/widechartomultibyte/test1,1
locale_info/widechartomultibyte/test2,1
locale_info/widechartomultibyte/test3,1
miscellaneous/_i64tow/test1,1
-miscellaneous/_ui64tow/test1,1
-miscellaneous/_ui64tow/test2,1
miscellaneous/charnexta/test1,1
miscellaneous/charnexta/test2,1
miscellaneous/charnextexa/test1,1
diff --git a/src/pal/tests/palsuite/samples/test1/CMakeLists.txt b/src/pal/tests/palsuite/samples/test1/CMakeLists.txt
index da5892cfa6..42f2ebdcdd 100644
--- a/src/pal/tests/palsuite/samples/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/samples/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_samples_test1
diff --git a/src/pal/tests/palsuite/samples/test1/test.c b/src/pal/tests/palsuite/samples/test1/test.cpp
index 2eed6f6f44..2eed6f6f44 100644
--- a/src/pal/tests/palsuite/samples/test1/test.c
+++ b/src/pal/tests/palsuite/samples/test1/test.cpp
diff --git a/src/pal/tests/palsuite/samples/test2/CMakeLists.txt b/src/pal/tests/palsuite/samples/test2/CMakeLists.txt
index fdef2aac6b..1a7ce2918e 100644
--- a/src/pal/tests/palsuite/samples/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/samples/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_samples_test2
diff --git a/src/pal/tests/palsuite/samples/test2/test.c b/src/pal/tests/palsuite/samples/test2/test.cpp
index 53d4158b9d..53d4158b9d 100644
--- a/src/pal/tests/palsuite/samples/test2/test.c
+++ b/src/pal/tests/palsuite/samples/test2/test.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateEventA/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateEventA/test1/CMakeLists.txt
index da1232eea4..7be9481150 100644
--- a/src/pal/tests/palsuite/threading/CreateEventA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateEventA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_createeventa_test1
diff --git a/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.c b/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.cpp
index d8ef0f58a3..d8ef0f58a3 100644
--- a/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/CreateEventA/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateEventA/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateEventA/test2/CMakeLists.txt
index f87e5bea87..9725c89721 100644
--- a/src/pal/tests/palsuite/threading/CreateEventA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateEventA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_createeventa_test2
diff --git a/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.c b/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.cpp
index a24d20eeea..a24d20eeea 100644
--- a/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/CreateEventA/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateEventA/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateEventA/test3/CMakeLists.txt
index e33c404a79..b596a881d5 100644
--- a/src/pal/tests/palsuite/threading/CreateEventA/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateEventA/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_createeventa_test3
diff --git a/src/pal/tests/palsuite/threading/CreateEventA/test3/test3.c b/src/pal/tests/palsuite/threading/CreateEventA/test3/test3.cpp
index 56d107b22d..56d107b22d 100644
--- a/src/pal/tests/palsuite/threading/CreateEventA/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/CreateEventA/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateEventW/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateEventW/test1/CMakeLists.txt
index 0e8ba5bc2a..ef18312cda 100644
--- a/src/pal/tests/palsuite/threading/CreateEventW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateEventW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_createeventw_test1
diff --git a/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.c b/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.cpp
index 8d99e41934..8d99e41934 100644
--- a/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/CreateEventW/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateEventW/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateEventW/test2/CMakeLists.txt
index f624377474..7f9543e0cb 100644
--- a/src/pal/tests/palsuite/threading/CreateEventW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateEventW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_createeventw_test2
diff --git a/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.c b/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.cpp
index 4df218995a..4df218995a 100644
--- a/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/CreateEventW/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateEventW/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateEventW/test3/CMakeLists.txt
index 4493ba3872..6778740f7e 100644
--- a/src/pal/tests/palsuite/threading/CreateEventW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateEventW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_createeventw_test3
diff --git a/src/pal/tests/palsuite/threading/CreateEventW/test3/test3.c b/src/pal/tests/palsuite/threading/CreateEventW/test3/test3.cpp
index 22f0fcfc49..22f0fcfc49 100644
--- a/src/pal/tests/palsuite/threading/CreateEventW/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/CreateEventW/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CMakeLists.txt
index ffdf13228e..782c671b84 100644
--- a/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateMutexA.c
+ CreateMutexA.cpp
)
add_executable(paltest_createmutexa_releasemutex_test1
diff --git a/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CreateMutexA.c b/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CreateMutexA.cpp
index 52bab351fb..52bab351fb 100644
--- a/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CreateMutexA.c
+++ b/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test1/CreateMutexA.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CMakeLists.txt
index 925c5d41f6..3540cb2b8c 100644
--- a/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateMutexA.c
+ CreateMutexA.cpp
)
add_executable(paltest_createmutexa_releasemutex_test2
diff --git a/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CreateMutexA.c b/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CreateMutexA.c
deleted file mode 100644
index 3b83ba9674..0000000000
--- a/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CreateMutexA.c
+++ /dev/null
@@ -1,331 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: CreateMutexA_ReleaseMutex/test2/CreateMutexA.c
-**
-** Purpose: This test case tests the following things
-** - Creation of named Mutexes
-** - Creating multiple handles to a single named Mutex
-** - Ensuring that these handles work interchangeably
-** - Setting bInitialOwnerFlag to TRUE will cause the
-** initial call to a Wait function on the same Mutex
-** to actually wait.
-** - Waiting on a Mutex that a thread already owns does
-** not block.
-** - Create Named mutex with empty string ("")
-** - Create Named mutex with string of MAX_LONGPATH length
-** - Calling RelaseMutex with invalid Mutex handles and
-** valid but unowned Mutexes.
-**
-** Dependencies: CreateThread
-** ReleaseMutex
-** WaitForSingleObject
-** CloseHandle
-** Sleep
-** memset
-**
-
-**
-**=========================================================*/
-
-#define UNICODE
-#include <palsuite.h>
-
-const char *szMutex = "MyMutex";
-const char *szEmpty = "";
-
-/* Function Prototypes */
-BOOL TestNamedMutex(const char *szMutexName);
-DWORD NamedMutexThread(LPVOID lpParam);
-BOOL NegativeReleaseMutexTests();
-
-struct ThreadData
-{
- HANDLE hMutex;
- BOOL bReturnCode;
-};
-typedef struct ThreadData THREADDATA;
-
-
-int __cdecl main (int argc, char **argv)
-{
- BOOL bFailures = FALSE;
- char *szMaxPath;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return ( FAIL );
- }
-
-
- /*
- * Test named Mutexes with ordinary string
- */
-
- if (!TestNamedMutex(szMutex))
- {
- bFailures = TRUE;
- }
-
-
- /*
- * Test named Mutexes with empty ("") string
- */
-
- if (!TestNamedMutex(szEmpty))
- {
- bFailures = TRUE;
- }
-
-
- /*
- * Test named Mutexes with string of length MAX_LONGPATHPATH
- */
-
- szMaxPath = (char *)malloc(MAX_LONGPATH+2);
- memset(szMaxPath, 'A', MAX_LONGPATH-60);
- szMaxPath[MAX_LONGPATH-60] = 0;
-
- if (!TestNamedMutex(szMaxPath))
- {
- bFailures = TRUE;
- }
-
- free(szMaxPath);
-
-
- /*
- * Run some negative tests on ReleaseMutex
- */
-
- if (!NegativeReleaseMutexTests())
- {
- bFailures = TRUE;
- }
-
-
- /*
- * If there were any failures, then abort with a call to Fail
- */
-
- if (bFailures == TRUE)
- {
- Fail("ERROR: There some failures in the Mutex tests.\n");
- }
-
- PAL_Terminate();
- return ( PASS );
-}
-
-
-/*
- * Testing Function
- *
- * Try to get multiple handles to a named Mutex and test
- * to make sure they actually refer to same Mutex object.
- */
-BOOL TestNamedMutex(const char *szMutexName)
-{
- DWORD dwData;
- HANDLE hMutex1;
- HANDLE hMutex2;
- HANDLE hThread;
- THREADDATA threadData;
-
- /* Create a mutex and take ownership immediately */
- hMutex1 = CreateMutexA (NULL, TRUE, szMutexName);
-
- if (NULL == hMutex1)
- {
- Trace("ERROR: CreateMutexA #1 failed. GetLastError returned %u\n",
- GetLastError());
- return FALSE;
- }
-
- /* Try to wait on the Mutex we just created. We should not block. */
- if (WaitForSingleObject(hMutex1, 1000) == WAIT_TIMEOUT)
- {
- Trace("WaitForSingleObject blocked on a Mutex that we owned.\n");
- return FALSE;
- }
- /* We have to call ReleaseMutex here because of the Wait */
- if (ReleaseMutex(hMutex1) == FALSE)
- {
- Trace("ReleaseMutex Failed.\n");
- return FALSE;
- }
-
- /* Get a second handle to the same mutex */
- hMutex2 = CreateMutexA (NULL, FALSE, szMutexName);
-
- if (NULL == hMutex2)
- {
- Trace("ERROR: CreateMutex #2 failed. GetLastError returned %u\n",
- GetLastError());
- free(szMutexName);
- return FALSE;
- }
-
- /*
- * Create a thread that will Wait on the second handle.
- */
- threadData.hMutex = hMutex2;
- hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)NamedMutexThread,
- (LPVOID)&threadData, 0, &dwData);
-
- if (NULL == hThread)
- {
- Trace("ERROR: CreateThread failed. GetLastError returned %u\n",
- GetLastError());
- return FALSE;
- }
-
- /* Give the thread a little time to execute & wait*/
- Sleep(500);
-
- /* Signal the the first handle */
- if (ReleaseMutex(hMutex1) == FALSE)
- {
- Trace("ReleaseMutex Failed.\n");
- return FALSE;
- }
-
- /* Give the thread some time to finish */
- Sleep(2000);
-
- /* Clean Up */
- if (CloseHandle(hMutex1) == FALSE ||
- CloseHandle(hMutex2) == FALSE ||
- CloseHandle(hThread) == FALSE)
- {
- Trace("ERROR: CloseHandle failed.\n");
- return FALSE;
- }
-
- /* Check the return code to see if signalling the first */
- /* Mutex handle woke up the thread which was Waiting on */
- /* the second handle. */
- if (threadData.bReturnCode != FALSE)
- {
- Trace("ERROR: The handles did not refer to the same Mutex object.\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
- * Thread function used with above testing function.
- */
-DWORD NamedMutexThread(LPVOID lpParam)
-{
- BOOL bTimedOut = FALSE;
- THREADDATA *lpThreadData = (THREADDATA *)lpParam;
-
- /* Wait on the Mutex that was passed to us */
- if (WaitForSingleObject(lpThreadData->hMutex, 10000) == WAIT_TIMEOUT)
- {
- /* The Mutex was not signaled in the allotted time */
- bTimedOut = TRUE;
- }
- if (ReleaseMutex(lpThreadData->hMutex) == FALSE)
- {
- Trace("ERROR: ReleaseMutex failed.\n");
- lpThreadData->bReturnCode = FALSE;
- return 0;
- }
-
- /* Indicate whether we timed out Waiting on the Mutex */
- lpThreadData->bReturnCode = bTimedOut;
-
- return 0;
-}
-
-
-/*
- * Testing Function
- *
- * Try some negative tests on ReleaseMutex
- */
-BOOL NegativeReleaseMutexTests()
-{
- HANDLE hMutex;
- BOOL bRet;
- BOOL bResults = TRUE;
-
-
- /*
- * Try calling ReleaseMutex on a null handle
- */
- hMutex = 0;
- bRet = ReleaseMutex(hMutex);
-
- if (bRet != 0)
- {
- Trace("Error: ReleaseMutex accepted null handle.\n");
- bResults = FALSE;
- }
-
-
- /*
- * Try calling ReleaseMutex on an handle that we don't own
- */
- hMutex = CreateMutexA (NULL, TRUE, NULL);
- if (hMutex == 0)
- {
- Trace("Error: CreateMutex failed.\n");
- bResults = FALSE;
- }
-
- bRet = ReleaseMutex(hMutex);
- bRet = ReleaseMutex(hMutex);
-
- if (bRet != FALSE)
- {
- Trace("Error: ReleaseMutex accepted unowned handle.\n");
- bResults = FALSE;
- }
-
- if (CloseHandle(hMutex) == FALSE)
- {
- Trace("Error: CloseHandle failed.\n");
- bResults = FALSE;
- }
-
-
-
- /*
- * Try calling ReleaseMutex on an handle that has been closed
- */
- hMutex = CreateMutexA (NULL, TRUE, NULL);
- if (hMutex == 0)
- {
- Trace("Error: CreateMutex failed.\n");
- bResults = FALSE;
- }
-
- if (ReleaseMutex(hMutex) == FALSE)
- {
- Trace("Error: ReleaseMutex failed.\n");
- bResults = FALSE;
- }
- if (CloseHandle(hMutex) == FALSE)
- {
- Trace("Error: CloseHandle failed.\n");
- bResults = FALSE;
- }
-
- bRet = ReleaseMutex(hMutex);
-
- if (bRet != FALSE)
- {
- Trace("Error: ReleaseMutex accepted invalid handle.\n");
- bResults = FALSE;
- }
-
- return bResults;
-}
diff --git a/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CreateMutexA.cpp b/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CreateMutexA.cpp
new file mode 100644
index 0000000000..36295855e0
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/CreateMutexA_ReleaseMutex/test2/CreateMutexA.cpp
@@ -0,0 +1,331 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: CreateMutexA_ReleaseMutex/test2/CreateMutexA.c
+**
+** Purpose: This test case tests the following things
+** - Creation of named Mutexes
+** - Creating multiple handles to a single named Mutex
+** - Ensuring that these handles work interchangeably
+** - Setting bInitialOwnerFlag to TRUE will cause the
+** initial call to a Wait function on the same Mutex
+** to actually wait.
+** - Waiting on a Mutex that a thread already owns does
+** not block.
+** - Create Named mutex with empty string ("")
+** - Create Named mutex with string of MAX_LONGPATH length
+** - Calling RelaseMutex with invalid Mutex handles and
+** valid but unowned Mutexes.
+**
+** Dependencies: CreateThread
+** ReleaseMutex
+** WaitForSingleObject
+** CloseHandle
+** Sleep
+** memset
+**
+
+**
+**=========================================================*/
+
+#define UNICODE
+#include <palsuite.h>
+
+const char *szMutex = "MyMutex";
+const char *szEmpty = "";
+
+/* Function Prototypes */
+BOOL TestNamedMutex(const char *szMutexName);
+DWORD NamedMutexThread(LPVOID lpParam);
+BOOL NegativeReleaseMutexTests();
+
+struct ThreadData
+{
+ HANDLE hMutex;
+ BOOL bReturnCode;
+};
+typedef struct ThreadData THREADDATA;
+
+
+int __cdecl main (int argc, char **argv)
+{
+ BOOL bFailures = FALSE;
+ char *szMaxPath;
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return ( FAIL );
+ }
+
+
+ /*
+ * Test named Mutexes with ordinary string
+ */
+
+ if (!TestNamedMutex(szMutex))
+ {
+ bFailures = TRUE;
+ }
+
+
+ /*
+ * Test named Mutexes with empty ("") string
+ */
+
+ if (!TestNamedMutex(szEmpty))
+ {
+ bFailures = TRUE;
+ }
+
+
+ /*
+ * Test named Mutexes with string of length MAX_LONGPATHPATH
+ */
+
+ szMaxPath = (char *)malloc(MAX_LONGPATH+2);
+ memset(szMaxPath, 'A', MAX_LONGPATH-60);
+ szMaxPath[MAX_LONGPATH-60] = 0;
+
+ if (!TestNamedMutex(szMaxPath))
+ {
+ bFailures = TRUE;
+ }
+
+ free((void*)szMaxPath);
+
+
+ /*
+ * Run some negative tests on ReleaseMutex
+ */
+
+ if (!NegativeReleaseMutexTests())
+ {
+ bFailures = TRUE;
+ }
+
+
+ /*
+ * If there were any failures, then abort with a call to Fail
+ */
+
+ if (bFailures == TRUE)
+ {
+ Fail("ERROR: There some failures in the Mutex tests.\n");
+ }
+
+ PAL_Terminate();
+ return ( PASS );
+}
+
+
+/*
+ * Testing Function
+ *
+ * Try to get multiple handles to a named Mutex and test
+ * to make sure they actually refer to same Mutex object.
+ */
+BOOL TestNamedMutex(const char *szMutexName)
+{
+ DWORD dwData;
+ HANDLE hMutex1;
+ HANDLE hMutex2;
+ HANDLE hThread;
+ THREADDATA threadData;
+
+ /* Create a mutex and take ownership immediately */
+ hMutex1 = CreateMutexA (NULL, TRUE, szMutexName);
+
+ if (NULL == hMutex1)
+ {
+ Trace("ERROR: CreateMutexA #1 failed. GetLastError returned %u\n",
+ GetLastError());
+ return FALSE;
+ }
+
+ /* Try to wait on the Mutex we just created. We should not block. */
+ if (WaitForSingleObject(hMutex1, 1000) == WAIT_TIMEOUT)
+ {
+ Trace("WaitForSingleObject blocked on a Mutex that we owned.\n");
+ return FALSE;
+ }
+ /* We have to call ReleaseMutex here because of the Wait */
+ if (ReleaseMutex(hMutex1) == FALSE)
+ {
+ Trace("ReleaseMutex Failed.\n");
+ return FALSE;
+ }
+
+ /* Get a second handle to the same mutex */
+ hMutex2 = CreateMutexA (NULL, FALSE, szMutexName);
+
+ if (NULL == hMutex2)
+ {
+ Trace("ERROR: CreateMutex #2 failed. GetLastError returned %u\n",
+ GetLastError());
+ free((void*)szMutexName);
+ return FALSE;
+ }
+
+ /*
+ * Create a thread that will Wait on the second handle.
+ */
+ threadData.hMutex = hMutex2;
+ hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)NamedMutexThread,
+ (LPVOID)&threadData, 0, &dwData);
+
+ if (NULL == hThread)
+ {
+ Trace("ERROR: CreateThread failed. GetLastError returned %u\n",
+ GetLastError());
+ return FALSE;
+ }
+
+ /* Give the thread a little time to execute & wait*/
+ Sleep(500);
+
+ /* Signal the the first handle */
+ if (ReleaseMutex(hMutex1) == FALSE)
+ {
+ Trace("ReleaseMutex Failed.\n");
+ return FALSE;
+ }
+
+ /* Give the thread some time to finish */
+ Sleep(2000);
+
+ /* Clean Up */
+ if (CloseHandle(hMutex1) == FALSE ||
+ CloseHandle(hMutex2) == FALSE ||
+ CloseHandle(hThread) == FALSE)
+ {
+ Trace("ERROR: CloseHandle failed.\n");
+ return FALSE;
+ }
+
+ /* Check the return code to see if signalling the first */
+ /* Mutex handle woke up the thread which was Waiting on */
+ /* the second handle. */
+ if (threadData.bReturnCode != FALSE)
+ {
+ Trace("ERROR: The handles did not refer to the same Mutex object.\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+/*
+ * Thread function used with above testing function.
+ */
+DWORD NamedMutexThread(LPVOID lpParam)
+{
+ BOOL bTimedOut = FALSE;
+ THREADDATA *lpThreadData = (THREADDATA *)lpParam;
+
+ /* Wait on the Mutex that was passed to us */
+ if (WaitForSingleObject(lpThreadData->hMutex, 10000) == WAIT_TIMEOUT)
+ {
+ /* The Mutex was not signaled in the allotted time */
+ bTimedOut = TRUE;
+ }
+ if (ReleaseMutex(lpThreadData->hMutex) == FALSE)
+ {
+ Trace("ERROR: ReleaseMutex failed.\n");
+ lpThreadData->bReturnCode = FALSE;
+ return 0;
+ }
+
+ /* Indicate whether we timed out Waiting on the Mutex */
+ lpThreadData->bReturnCode = bTimedOut;
+
+ return 0;
+}
+
+
+/*
+ * Testing Function
+ *
+ * Try some negative tests on ReleaseMutex
+ */
+BOOL NegativeReleaseMutexTests()
+{
+ HANDLE hMutex;
+ BOOL bRet;
+ BOOL bResults = TRUE;
+
+
+ /*
+ * Try calling ReleaseMutex on a null handle
+ */
+ hMutex = 0;
+ bRet = ReleaseMutex(hMutex);
+
+ if (bRet != 0)
+ {
+ Trace("Error: ReleaseMutex accepted null handle.\n");
+ bResults = FALSE;
+ }
+
+
+ /*
+ * Try calling ReleaseMutex on an handle that we don't own
+ */
+ hMutex = CreateMutexA (NULL, TRUE, NULL);
+ if (hMutex == 0)
+ {
+ Trace("Error: CreateMutex failed.\n");
+ bResults = FALSE;
+ }
+
+ bRet = ReleaseMutex(hMutex);
+ bRet = ReleaseMutex(hMutex);
+
+ if (bRet != FALSE)
+ {
+ Trace("Error: ReleaseMutex accepted unowned handle.\n");
+ bResults = FALSE;
+ }
+
+ if (CloseHandle(hMutex) == FALSE)
+ {
+ Trace("Error: CloseHandle failed.\n");
+ bResults = FALSE;
+ }
+
+
+
+ /*
+ * Try calling ReleaseMutex on an handle that has been closed
+ */
+ hMutex = CreateMutexA (NULL, TRUE, NULL);
+ if (hMutex == 0)
+ {
+ Trace("Error: CreateMutex failed.\n");
+ bResults = FALSE;
+ }
+
+ if (ReleaseMutex(hMutex) == FALSE)
+ {
+ Trace("Error: ReleaseMutex failed.\n");
+ bResults = FALSE;
+ }
+ if (CloseHandle(hMutex) == FALSE)
+ {
+ Trace("Error: CloseHandle failed.\n");
+ bResults = FALSE;
+ }
+
+ bRet = ReleaseMutex(hMutex);
+
+ if (bRet != FALSE)
+ {
+ Trace("Error: ReleaseMutex accepted invalid handle.\n");
+ bResults = FALSE;
+ }
+
+ return bResults;
+}
diff --git a/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CMakeLists.txt
index a73ee045a3..aa1f7831c0 100644
--- a/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateMutexW.c
+ CreateMutexW.cpp
)
add_executable(paltest_createmutexw_releasemutex_test1
diff --git a/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.c b/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.cpp
index c21bfb6a50..c21bfb6a50 100644
--- a/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.c
+++ b/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test1/CreateMutexW.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CMakeLists.txt
index b40569b3f5..5a9095cb1b 100644
--- a/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateMutexW.c
+ CreateMutexW.cpp
)
add_executable(paltest_createmutexw_releasemutex_test2
diff --git a/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.c b/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.cpp
index 41b7798a6e..41b7798a6e 100644
--- a/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.c
+++ b/src/pal/tests/palsuite/threading/CreateMutexW_ReleaseMutex/test2/CreateMutexW.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateProcessA/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateProcessA/test1/CMakeLists.txt
index 67e53edccd..9cd0aa5dfd 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessA/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateProcessA/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- parentProcess.c
+ parentProcess.cpp
)
add_executable(paltest_createprocessa_test1
@@ -20,7 +20,7 @@ target_link_libraries(paltest_createprocessa_test1
set(HELPERSOURCES
- childProcess.c
+ childProcess.cpp
)
add_executable(paltest_createprocessa_test1_child
diff --git a/src/pal/tests/palsuite/threading/CreateProcessA/test1/childProcess.c b/src/pal/tests/palsuite/threading/CreateProcessA/test1/childProcess.cpp
index ccbb050c04..ccbb050c04 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessA/test1/childProcess.c
+++ b/src/pal/tests/palsuite/threading/CreateProcessA/test1/childProcess.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateProcessA/test1/parentProcess.c b/src/pal/tests/palsuite/threading/CreateProcessA/test1/parentProcess.cpp
index b0c5808a7e..b0c5808a7e 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessA/test1/parentProcess.c
+++ b/src/pal/tests/palsuite/threading/CreateProcessA/test1/parentProcess.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateProcessA/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateProcessA/test2/CMakeLists.txt
index b81ea2e978..f035f0a888 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessA/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateProcessA/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- parentprocess.c
+ parentprocess.cpp
)
add_executable(paltest_createprocessa_test2
@@ -20,7 +20,7 @@ target_link_libraries(paltest_createprocessa_test2
set(HELPERSOURCES
- childprocess.c
+ childprocess.cpp
)
add_executable(paltest_createprocessa_test2_child
diff --git a/src/pal/tests/palsuite/threading/CreateProcessA/test2/childprocess.c b/src/pal/tests/palsuite/threading/CreateProcessA/test2/childprocess.cpp
index baa20c2d3c..baa20c2d3c 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessA/test2/childprocess.c
+++ b/src/pal/tests/palsuite/threading/CreateProcessA/test2/childprocess.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateProcessA/test2/parentprocess.c b/src/pal/tests/palsuite/threading/CreateProcessA/test2/parentprocess.cpp
index ef3340c5d9..ef3340c5d9 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessA/test2/parentprocess.c
+++ b/src/pal/tests/palsuite/threading/CreateProcessA/test2/parentprocess.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateProcessW/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateProcessW/test1/CMakeLists.txt
index 394b124526..174d6fe3c7 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateProcessW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- parentProcess.c
+ parentProcess.cpp
)
add_executable(paltest_createprocessw_test1
@@ -20,7 +20,7 @@ target_link_libraries(paltest_createprocessw_test1
set(HELPERSOURCES
- childProcess.c
+ childProcess.cpp
)
add_executable(paltest_createprocessw_test1_child
diff --git a/src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.c b/src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.c
deleted file mode 100644
index c71f967b65..0000000000
--- a/src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.c
+++ /dev/null
@@ -1,150 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: CreateProcessW/test1/childprocess.c
-**
-** Purpose: Test to ensure CreateProcessW starts a new process. This test
-** launches a child process, and examines a file written by the child.
-** This code is the child code.
-**
-** Dependencies: GetCurrentDirectory
-** MultiByteToWideChar
-** wcslen
-** strlen
-** WideCharToMultiByte
-** fopen
-** fclose
-** fprintf
-**
-
-**
-**=========================================================*/
-
-#define UNICODE
-#include <palsuite.h>
-
-const WCHAR szCommonFileW[] =
- {'c','h','i','l','d','d','a','t','a','.','t','m','p','\0'};
-
-const WCHAR szPathDelimW[] = {'\\','\0'};
-
-const char *szCommonStringA = "058d2d057111a313aa82401c2e856002\0";
-
-/*
- * Take two wide strings representing file and directory names
- * (dirName, fileName), join the strings with the appropriate path
- * delimiter and populate a wide character buffer (absPathName) with
- * the resulting string.
- *
- * Returns: The number of wide characters in the resulting string.
- * 0 is returned on Error.
- */
-int
-mkAbsoluteFilenameW (
- LPWSTR dirName,
- DWORD dwDirLength,
- LPCWSTR fileName,
- DWORD dwFileLength,
- LPWSTR absPathName )
-{
- extern const WCHAR szPathDelimW[];
-
- DWORD sizeDN, sizeFN, sizeAPN;
-
- sizeDN = wcslen( dirName );
- sizeFN = wcslen( fileName );
- sizeAPN = (sizeDN + 1 + sizeFN + 1);
-
- /* insure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */
- if ( sizeAPN > _MAX_PATH )
- {
- return ( 0 );
- }
-
- wcsncpy(absPathName, dirName, dwDirLength +1);
- wcsncpy(absPathName, szPathDelimW, 2);
- wcsncpy(absPathName, fileName, dwFileLength +1);
-
- return (sizeAPN);
-
-}
-
-int __cdecl main( int argc, char **argv )
-{
-
- static FILE * fp;
-
- DWORD dwFileLength;
- DWORD dwDirLength;
- DWORD dwSize;
-
- char *szAbsPathNameA;
- WCHAR szDirNameW[_MAX_DIR];
- WCHAR szAbsPathNameW[_MAX_PATH];
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return ( FAIL );
- }
-
- dwDirLength = GetCurrentDirectory( _MAX_PATH, szDirNameW );
-
- if (0 == dwDirLength)
- {
- Fail ("GetCurrentDirectory call failed. Could not get "
- "current working directory\n. Exiting.\n");
- }
-
- dwFileLength = wcslen( szCommonFileW );
-
- dwSize = mkAbsoluteFilenameW( szDirNameW, dwDirLength, szCommonFileW,
- dwFileLength, szAbsPathNameW );
-
- if (0 == dwSize)
- {
- Fail ("Palsuite Code: mkAbsoluteFilename() call failed. Could "
- "not build absolute path name to file\n. Exiting.\n");
- }
-
- /* set the string length for the open call */
- szAbsPathNameA = malloc (dwSize +1);
-
- if (NULL == szAbsPathNameA)
- {
- Fail ("Unable to malloc (%d) bytes. Exiting\n", (dwSize +1) );
- }
-
- WideCharToMultiByte (CP_ACP, 0, szAbsPathNameW, -1, szAbsPathNameA,
- (dwSize + 1), NULL, NULL);
-
- if ( NULL == ( fp = fopen ( szAbsPathNameA , "w+" ) ) )
- {
- /*
- * A return value of NULL indicates an error condition or an
- * EOF condition
- */
- Fail ("%s unable to open %s for writing. Exiting.\n", argv[0]
- , szAbsPathNameA );
- }
-
- free (szAbsPathNameA);
-
- if ( 0 >= ( fprintf ( fp, "%s", szCommonStringA )))
- {
- Fail("%s unable to write to %s. Exiting.\n", argv[0]
- , szAbsPathNameA );
- }
-
- if (0 != (fclose ( fp )))
- {
- Fail ("%s unable to close file %s. Pid may not be "
- "written to file. Exiting.\n", argv[0], szAbsPathNameA );
- }
-
- PAL_Terminate();
- return ( PASS );
-
-}
diff --git a/src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.cpp b/src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.cpp
new file mode 100644
index 0000000000..a7730c6d51
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/CreateProcessW/test1/childProcess.cpp
@@ -0,0 +1,150 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: CreateProcessW/test1/childprocess.c
+**
+** Purpose: Test to ensure CreateProcessW starts a new process. This test
+** launches a child process, and examines a file written by the child.
+** This code is the child code.
+**
+** Dependencies: GetCurrentDirectory
+** MultiByteToWideChar
+** wcslen
+** strlen
+** WideCharToMultiByte
+** fopen
+** fclose
+** fprintf
+**
+
+**
+**=========================================================*/
+
+#define UNICODE
+#include <palsuite.h>
+
+const WCHAR szCommonFileW[] =
+ {'c','h','i','l','d','d','a','t','a','.','t','m','p','\0'};
+
+const WCHAR szPathDelimW[] = {'\\','\0'};
+
+const char *szCommonStringA = "058d2d057111a313aa82401c2e856002\0";
+
+/*
+ * Take two wide strings representing file and directory names
+ * (dirName, fileName), join the strings with the appropriate path
+ * delimiter and populate a wide character buffer (absPathName) with
+ * the resulting string.
+ *
+ * Returns: The number of wide characters in the resulting string.
+ * 0 is returned on Error.
+ */
+int
+mkAbsoluteFilenameW (
+ LPWSTR dirName,
+ DWORD dwDirLength,
+ LPCWSTR fileName,
+ DWORD dwFileLength,
+ LPWSTR absPathName )
+{
+ extern const WCHAR szPathDelimW[];
+
+ DWORD sizeDN, sizeFN, sizeAPN;
+
+ sizeDN = wcslen( dirName );
+ sizeFN = wcslen( fileName );
+ sizeAPN = (sizeDN + 1 + sizeFN + 1);
+
+ /* insure ((dirName + DELIM + fileName + \0) =< _MAX_PATH ) */
+ if ( sizeAPN > _MAX_PATH )
+ {
+ return ( 0 );
+ }
+
+ wcsncpy(absPathName, dirName, dwDirLength +1);
+ wcsncpy(absPathName, szPathDelimW, 2);
+ wcsncpy(absPathName, fileName, dwFileLength +1);
+
+ return (sizeAPN);
+
+}
+
+int __cdecl main( int argc, char **argv )
+{
+
+ static FILE * fp;
+
+ DWORD dwFileLength;
+ DWORD dwDirLength;
+ DWORD dwSize;
+
+ char *szAbsPathNameA;
+ WCHAR szDirNameW[_MAX_DIR];
+ WCHAR szAbsPathNameW[_MAX_PATH];
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return ( FAIL );
+ }
+
+ dwDirLength = GetCurrentDirectory( _MAX_PATH, szDirNameW );
+
+ if (0 == dwDirLength)
+ {
+ Fail ("GetCurrentDirectory call failed. Could not get "
+ "current working directory\n. Exiting.\n");
+ }
+
+ dwFileLength = wcslen( szCommonFileW );
+
+ dwSize = mkAbsoluteFilenameW( szDirNameW, dwDirLength, szCommonFileW,
+ dwFileLength, szAbsPathNameW );
+
+ if (0 == dwSize)
+ {
+ Fail ("Palsuite Code: mkAbsoluteFilename() call failed. Could "
+ "not build absolute path name to file\n. Exiting.\n");
+ }
+
+ /* set the string length for the open call */
+ szAbsPathNameA = (char*)malloc(dwSize +1);
+
+ if (NULL == szAbsPathNameA)
+ {
+ Fail ("Unable to malloc (%d) bytes. Exiting\n", (dwSize +1) );
+ }
+
+ WideCharToMultiByte (CP_ACP, 0, szAbsPathNameW, -1, szAbsPathNameA,
+ (dwSize + 1), NULL, NULL);
+
+ if ( NULL == ( fp = fopen ( szAbsPathNameA , "w+" ) ) )
+ {
+ /*
+ * A return value of NULL indicates an error condition or an
+ * EOF condition
+ */
+ Fail ("%s unable to open %s for writing. Exiting.\n", argv[0]
+ , szAbsPathNameA );
+ }
+
+ free (szAbsPathNameA);
+
+ if ( 0 >= ( fprintf ( fp, "%s", szCommonStringA )))
+ {
+ Fail("%s unable to write to %s. Exiting.\n", argv[0]
+ , szAbsPathNameA );
+ }
+
+ if (0 != (fclose ( fp )))
+ {
+ Fail ("%s unable to close file %s. Pid may not be "
+ "written to file. Exiting.\n", argv[0], szAbsPathNameA );
+ }
+
+ PAL_Terminate();
+ return ( PASS );
+
+}
diff --git a/src/pal/tests/palsuite/threading/CreateProcessW/test1/parentProcess.c b/src/pal/tests/palsuite/threading/CreateProcessW/test1/parentProcess.cpp
index db1fb6356d..db1fb6356d 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessW/test1/parentProcess.c
+++ b/src/pal/tests/palsuite/threading/CreateProcessW/test1/parentProcess.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateProcessW/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateProcessW/test2/CMakeLists.txt
index 3feef213c4..021a0d2da2 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateProcessW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- parentprocess.c
+ parentprocess.cpp
)
add_executable(paltest_createprocessw_test2
@@ -20,7 +20,7 @@ target_link_libraries(paltest_createprocessw_test2
set(HELPERSOURCES
- childprocess.c
+ childprocess.cpp
)
add_executable(paltest_createprocessw_test2_child
diff --git a/src/pal/tests/palsuite/threading/CreateProcessW/test2/childprocess.c b/src/pal/tests/palsuite/threading/CreateProcessW/test2/childprocess.cpp
index b4ab9366d9..b4ab9366d9 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessW/test2/childprocess.c
+++ b/src/pal/tests/palsuite/threading/CreateProcessW/test2/childprocess.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.c b/src/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp
index 439b7b5eef..439b7b5eef 100644
--- a/src/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.c
+++ b/src/pal/tests/palsuite/threading/CreateProcessW/test2/parentprocess.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CMakeLists.txt
index f89e150a32..8a9255ce7a 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateSemaphore.c
+ CreateSemaphore.cpp
)
add_executable(paltest_createsemaphorea_releasesemaphore_test1
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CreateSemaphore.c b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CreateSemaphore.cpp
index 342b15ec29..342b15ec29 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CreateSemaphore.c
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test1/CreateSemaphore.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CMakeLists.txt
index f3e01749b8..6d1249bf05 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateSemaphore.c
+ CreateSemaphore.cpp
)
add_executable(paltest_createsemaphorea_releasesemaphore_test2
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CreateSemaphore.c b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CreateSemaphore.cpp
index bff5b51c33..bff5b51c33 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CreateSemaphore.c
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test2/CreateSemaphore.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/CMakeLists.txt
index 0c604d6ced..94998f59a9 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- createsemaphore.c
+ createsemaphore.cpp
)
add_executable(paltest_createsemaphorea_releasesemaphore_test3
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/createsemaphore.c b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/createsemaphore.cpp
index 7c6db6b055..7c6db6b055 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/createsemaphore.c
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreA_ReleaseSemaphore/test3/createsemaphore.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CMakeLists.txt
index b40f2695bc..32902cf914 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateSemaphore.c
+ CreateSemaphore.cpp
)
add_executable(paltest_createsemaphorew_releasesemaphore_test1
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.c b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.cpp
index 854d16d0ef..854d16d0ef 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.c
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test1/CreateSemaphore.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CMakeLists.txt
index b14284d08f..bd0a5a6e53 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- CreateSemaphore.c
+ CreateSemaphore.cpp
)
add_executable(paltest_createsemaphorew_releasesemaphore_test2
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.c b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.cpp
index 62532737ac..62532737ac 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.c
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test2/CreateSemaphore.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/CMakeLists.txt
index f7f0905761..d0340c64cb 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- createsemaphore.c
+ createsemaphore.cpp
)
add_executable(paltest_createsemaphorew_releasesemaphore_test3
diff --git a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.c b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.cpp
index ea0a5e0846..ea0a5e0846 100644
--- a/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.c
+++ b/src/pal/tests/palsuite/threading/CreateSemaphoreW_ReleaseSemaphore/test3/createsemaphore.cpp
diff --git a/src/pal/tests/palsuite/threading/CreateThread/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateThread/test1/CMakeLists.txt
index d3921c4409..b47afe498a 100644
--- a/src/pal/tests/palsuite/threading/CreateThread/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateThread/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_createthread_test1
diff --git a/src/pal/tests/palsuite/threading/CreateThread/test1/test1.c b/src/pal/tests/palsuite/threading/CreateThread/test1/test1.c
deleted file mode 100644
index 2dd2f6acb6..0000000000
--- a/src/pal/tests/palsuite/threading/CreateThread/test1/test1.c
+++ /dev/null
@@ -1,119 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test1.c
-**
-** Purpose: Test for CreateThread. Call CreateThread and ensure
-** that it succeeds. Also check to ensure the paramater is passed
-** properly.
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-#ifndef PLATFORM_UNIX
-#define LLFORMAT "%I64u"
-#else
-#define LLFORMAT "%llu"
-#endif
-
-ULONGLONG dwCreateThreadTestParameter = 0;
-
-DWORD PALAPI CreateThreadTestThread( LPVOID lpParameter)
-{
- DWORD dwRet = 0;
-
- /* save parameter for test */
- dwCreateThreadTestParameter = (ULONGLONG)lpParameter;
-
- return dwRet;
-}
-
-BOOL CreateThreadTest()
-{
- BOOL bRet = FALSE;
- DWORD dwRet = 0;
-
- LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL;
- DWORD dwStackSize = 0;
- LPTHREAD_START_ROUTINE lpStartAddress = &CreateThreadTestThread;
- LPVOID lpParameter = lpStartAddress;
- DWORD dwCreationFlags = 0; /* run immediately */
- DWORD dwThreadId = 0;
-
- HANDLE hThread = 0;
-
- dwCreateThreadTestParameter = 0;
-
- /* Create a thread, passing the appropriate paramaters as declared
- above.
- */
-
- hThread = CreateThread( lpThreadAttributes,
- dwStackSize,
- lpStartAddress,
- lpParameter,
- dwCreationFlags,
- &dwThreadId );
-
- /* Ensure that the HANDLE is not invalid! */
- if (hThread != INVALID_HANDLE_VALUE)
- {
- dwRet = WaitForSingleObject(hThread,INFINITE);
-
- if (dwRet != WAIT_OBJECT_0)
- {
- Trace("CreateThreadTest:WaitForSingleObject "
- "failed (%x)\n",GetLastError());
- }
- else
- {
- /* Check to ensure that the parameter passed to the thread
- function is the same in the function as what we passed.
- */
-
- if (dwCreateThreadTestParameter != (ULONGLONG)lpParameter)
- {
- Trace("CreateThreadTest:parameter error. The "
- "parameter passed should have been " LLFORMAT " but when "
- "passed to the Thread function it was " LLFORMAT " . GetLastError[%x]\n",
- dwCreateThreadTestParameter,lpParameter, GetLastError());
- }
- else
- {
- bRet = TRUE;
- }
-
- }
- CloseHandle(hThread);
- }
- else
- {
- Trace("CreateThreadTest:CreateThread failed (%x)\n",GetLastError());
- }
-
- return bRet;
-}
-
-
-int __cdecl main(int argc, char **argv)
-{
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return ( FAIL );
- }
-
- if(!CreateThreadTest())
- {
- Fail ("Test failed\n");
- }
-
- Trace("Test Passed\n");
- PAL_Terminate();
- return ( PASS );
-
-}
diff --git a/src/pal/tests/palsuite/threading/CreateThread/test1/test1.cpp b/src/pal/tests/palsuite/threading/CreateThread/test1/test1.cpp
new file mode 100644
index 0000000000..dda25f1f4b
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/CreateThread/test1/test1.cpp
@@ -0,0 +1,119 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: test1.c
+**
+** Purpose: Test for CreateThread. Call CreateThread and ensure
+** that it succeeds. Also check to ensure the paramater is passed
+** properly.
+**
+**
+**=========================================================*/
+
+#include <palsuite.h>
+
+#ifndef PLATFORM_UNIX
+#define LLFORMAT "%I64u"
+#else
+#define LLFORMAT "%llu"
+#endif
+
+ULONGLONG dwCreateThreadTestParameter = 0;
+
+DWORD PALAPI CreateThreadTestThread( LPVOID lpParameter)
+{
+ DWORD dwRet = 0;
+
+ /* save parameter for test */
+ dwCreateThreadTestParameter = (ULONGLONG)lpParameter;
+
+ return dwRet;
+}
+
+BOOL CreateThreadTest()
+{
+ BOOL bRet = FALSE;
+ DWORD dwRet = 0;
+
+ LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL;
+ DWORD dwStackSize = 0;
+ LPTHREAD_START_ROUTINE lpStartAddress = &CreateThreadTestThread;
+ LPVOID lpParameter = (LPVOID)lpStartAddress;
+ DWORD dwCreationFlags = 0; /* run immediately */
+ DWORD dwThreadId = 0;
+
+ HANDLE hThread = 0;
+
+ dwCreateThreadTestParameter = 0;
+
+ /* Create a thread, passing the appropriate paramaters as declared
+ above.
+ */
+
+ hThread = CreateThread( lpThreadAttributes,
+ dwStackSize,
+ lpStartAddress,
+ lpParameter,
+ dwCreationFlags,
+ &dwThreadId );
+
+ /* Ensure that the HANDLE is not invalid! */
+ if (hThread != INVALID_HANDLE_VALUE)
+ {
+ dwRet = WaitForSingleObject(hThread,INFINITE);
+
+ if (dwRet != WAIT_OBJECT_0)
+ {
+ Trace("CreateThreadTest:WaitForSingleObject "
+ "failed (%x)\n",GetLastError());
+ }
+ else
+ {
+ /* Check to ensure that the parameter passed to the thread
+ function is the same in the function as what we passed.
+ */
+
+ if (dwCreateThreadTestParameter != (ULONGLONG)lpParameter)
+ {
+ Trace("CreateThreadTest:parameter error. The "
+ "parameter passed should have been " LLFORMAT " but when "
+ "passed to the Thread function it was " LLFORMAT " . GetLastError[%x]\n",
+ dwCreateThreadTestParameter,lpParameter, GetLastError());
+ }
+ else
+ {
+ bRet = TRUE;
+ }
+
+ }
+ CloseHandle(hThread);
+ }
+ else
+ {
+ Trace("CreateThreadTest:CreateThread failed (%x)\n",GetLastError());
+ }
+
+ return bRet;
+}
+
+
+int __cdecl main(int argc, char **argv)
+{
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return ( FAIL );
+ }
+
+ if(!CreateThreadTest())
+ {
+ Fail ("Test failed\n");
+ }
+
+ Trace("Test Passed\n");
+ PAL_Terminate();
+ return ( PASS );
+
+}
diff --git a/src/pal/tests/palsuite/threading/CreateThread/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateThread/test2/CMakeLists.txt
index 350cf66e9b..47877607b9 100644
--- a/src/pal/tests/palsuite/threading/CreateThread/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateThread/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_createthread_test2
diff --git a/src/pal/tests/palsuite/threading/CreateThread/test2/test2.c b/src/pal/tests/palsuite/threading/CreateThread/test2/test2.c
deleted file mode 100644
index f64c32ea87..0000000000
--- a/src/pal/tests/palsuite/threading/CreateThread/test2/test2.c
+++ /dev/null
@@ -1,184 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*===========================================================
-**
-** Source: test2.c
-**
-** Purpose: Test that lpThreadId is assigned the correct
-** threadId value and that lpThreadId can be NULL.
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-#define NUM_TESTS 3
-
-HANDLE hThread[NUM_TESTS];
-DWORD dwThreadId[NUM_TESTS];
-volatile BOOL bResult[NUM_TESTS];
-volatile DWORD dwThreadId1[NUM_TESTS];
-
-DWORD PALAPI Thread( LPVOID lpParameter)
-{
- dwThreadId1[(DWORD) lpParameter] = GetCurrentThreadId();
- bResult[(DWORD) lpParameter] = TRUE;
- return (DWORD) lpParameter;
-}
-
-struct testCase
-{
- LPSECURITY_ATTRIBUTES lpThreadAttributes;
- DWORD dwStackSize;
- LPTHREAD_START_ROUTINE lpStartAddress;
- DWORD dwCreationFlags;
- LPVOID lpThreadId;
-};
-
-struct testCase testCases[]=
-{
- {NULL, 0, &Thread, 0, NULL},
- {NULL, 0, &Thread, CREATE_SUSPENDED, NULL},
- {NULL, 0, &Thread, 0, (LPVOID) 1}
-};
-
-/*
- * close handles
- */
-BOOL cleanup(int index)
-{
- int i;
- BOOL bRet = TRUE;
-
- for (i = 0; i < index; i++)
- {
- if (!CloseHandle(hThread[i]))
- {
- bRet = FALSE;
- Trace("PALSUITE ERROR: CloseHandle(%p) call failed for index %d\n",
- hThread[i], i);
- }
- }
-
- return(bRet);
-}
-
-int __cdecl main(int argc, char **argv)
-{
- SIZE_T i;
- DWORD dwRetWFSO;
- DWORD dwRetRT;
- BOOL bRet = TRUE;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return (FAIL);
- }
-
- /* set results array to FALSE */
- for (i = 0; i < NUM_TESTS; i++)
- {
- bResult[i]=FALSE;
- dwThreadId[i]=0;
- }
-
- for (i = 0; i < NUM_TESTS; i++)
- {
- if (NULL != testCases[i].lpThreadId)
- {
- testCases[i].lpThreadId = &dwThreadId[i];
- }
- /* pass the index as the thread argument */
- hThread[i] = CreateThread( testCases[i].lpThreadAttributes,
- testCases[i].dwStackSize,
- testCases[i].lpStartAddress,
- (LPVOID) i,
- testCases[i].dwCreationFlags,
- testCases[i].lpThreadId);
- if (hThread[i] == NULL)
- {
- Trace("PALSUITE ERROR: CreateThread('%p' '%d' '%p' '%p' '%d' "
- "'%p') call failed.\nGetLastError returned '%u'.\n",
- testCases[i].lpThreadAttributes, testCases[i].dwStackSize,
- testCases[i].lpStartAddress, (LPVOID) i,
- testCases[i].dwCreationFlags,
- testCases[i].lpThreadId, GetLastError());
- cleanup(i - 1);
- Fail("");
- }
-
- /* Resume suspended threads */
- if (testCases[i].dwCreationFlags == CREATE_SUSPENDED)
- {
- dwRetRT = ResumeThread (hThread[i]);
- if (dwRetRT != 1)
- {
- Trace ("PALSUITE ERROR: ResumeThread(%p) "
- "call returned %d it should have returned %d.\n"
- "GetLastError returned %u.\n", hThread[i], dwRetRT,
- 1, GetLastError());
- cleanup(i);
- Fail("");
- }
- }
- }
-
- /* cleanup */
- for (i = 0; i < NUM_TESTS; i++)
- {
- dwRetWFSO = WaitForSingleObject(hThread[i], 10000);
- if (dwRetWFSO != WAIT_OBJECT_0)
- {
- Trace ("PALSUITE ERROR: WaitForSingleObject('%p' '%d') "
- "call returned %d instead of WAIT_OBJECT_0 ('%d').\n"
- "GetLastError returned %u.\n", hThread[i], 10000,
- dwRetWFSO, WAIT_OBJECT_0, GetLastError());
- cleanup(i);
- Fail("");
- }
- }
- if(!cleanup(NUM_TESTS))
- {
- Fail("");
- }
-
- for (i = 0; i < NUM_TESTS; i++)
- {
- /*
- * check to see that all threads were created and were passed
- * the array index as an argument.
- */
- if (FALSE == bResult[i])
- {
- bRet = FALSE;
- Trace("PALSUITE ERROR: result[%d]=%d. It should be %d\n", i,
- FALSE, TRUE);
- }
- /*
- * check to see that lpThreadId received the correct value.
- */
- if (0 != dwThreadId[i])
- {
- if (dwThreadId[i] != dwThreadId1[i])
- {
- bRet = FALSE;
- Trace("PALSUITE ERROR: dwThreadId[%d]=%p and dwThreadId1[%d]"
- "=%p\nThese values should be identical.\n", i,
- dwThreadId[i], i, dwThreadId1[i]);
- }
- }
- }
- if (!bRet)
- {
- cleanup(NUM_TESTS);
- Fail("");
- }
-
- PAL_Terminate();
- return (PASS);
-}
-
-
-
diff --git a/src/pal/tests/palsuite/threading/CreateThread/test2/test2.cpp b/src/pal/tests/palsuite/threading/CreateThread/test2/test2.cpp
new file mode 100644
index 0000000000..1ee410a6c5
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/CreateThread/test2/test2.cpp
@@ -0,0 +1,184 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*===========================================================
+**
+** Source: test2.c
+**
+** Purpose: Test that lpThreadId is assigned the correct
+** threadId value and that lpThreadId can be NULL.
+**
+**
+**=========================================================*/
+
+#include <palsuite.h>
+
+#define NUM_TESTS 3
+
+HANDLE hThread[NUM_TESTS];
+DWORD dwThreadId[NUM_TESTS];
+volatile BOOL bResult[NUM_TESTS];
+volatile DWORD dwThreadId1[NUM_TESTS];
+
+DWORD PALAPI Thread( LPVOID lpParameter)
+{
+ dwThreadId1[(DWORD) lpParameter] = GetCurrentThreadId();
+ bResult[(DWORD) lpParameter] = TRUE;
+ return (DWORD) lpParameter;
+}
+
+struct testCase
+{
+ LPSECURITY_ATTRIBUTES lpThreadAttributes;
+ DWORD dwStackSize;
+ LPTHREAD_START_ROUTINE lpStartAddress;
+ DWORD dwCreationFlags;
+ LPDWORD lpThreadId;
+};
+
+struct testCase testCases[]=
+{
+ {NULL, 0, &Thread, 0, NULL},
+ {NULL, 0, &Thread, CREATE_SUSPENDED, NULL},
+ {NULL, 0, &Thread, 0, (LPDWORD) 1}
+};
+
+/*
+ * close handles
+ */
+BOOL cleanup(int index)
+{
+ int i;
+ BOOL bRet = TRUE;
+
+ for (i = 0; i < index; i++)
+ {
+ if (!CloseHandle(hThread[i]))
+ {
+ bRet = FALSE;
+ Trace("PALSUITE ERROR: CloseHandle(%p) call failed for index %d\n",
+ hThread[i], i);
+ }
+ }
+
+ return(bRet);
+}
+
+int __cdecl main(int argc, char **argv)
+{
+ SIZE_T i;
+ DWORD dwRetWFSO;
+ DWORD dwRetRT;
+ BOOL bRet = TRUE;
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return (FAIL);
+ }
+
+ /* set results array to FALSE */
+ for (i = 0; i < NUM_TESTS; i++)
+ {
+ bResult[i]=FALSE;
+ dwThreadId[i]=0;
+ }
+
+ for (i = 0; i < NUM_TESTS; i++)
+ {
+ if (NULL != testCases[i].lpThreadId)
+ {
+ testCases[i].lpThreadId = &dwThreadId[i];
+ }
+ /* pass the index as the thread argument */
+ hThread[i] = CreateThread( testCases[i].lpThreadAttributes,
+ testCases[i].dwStackSize,
+ testCases[i].lpStartAddress,
+ (LPVOID)i,
+ testCases[i].dwCreationFlags,
+ testCases[i].lpThreadId);
+ if (hThread[i] == NULL)
+ {
+ Trace("PALSUITE ERROR: CreateThread('%p' '%d' '%p' '%p' '%d' "
+ "'%p') call failed.\nGetLastError returned '%u'.\n",
+ testCases[i].lpThreadAttributes, testCases[i].dwStackSize,
+ testCases[i].lpStartAddress, (LPVOID)i,
+ testCases[i].dwCreationFlags,
+ testCases[i].lpThreadId, GetLastError());
+ cleanup(i - 1);
+ Fail("");
+ }
+
+ /* Resume suspended threads */
+ if (testCases[i].dwCreationFlags == CREATE_SUSPENDED)
+ {
+ dwRetRT = ResumeThread (hThread[i]);
+ if (dwRetRT != 1)
+ {
+ Trace ("PALSUITE ERROR: ResumeThread(%p) "
+ "call returned %d it should have returned %d.\n"
+ "GetLastError returned %u.\n", hThread[i], dwRetRT,
+ 1, GetLastError());
+ cleanup(i);
+ Fail("");
+ }
+ }
+ }
+
+ /* cleanup */
+ for (i = 0; i < NUM_TESTS; i++)
+ {
+ dwRetWFSO = WaitForSingleObject(hThread[i], 10000);
+ if (dwRetWFSO != WAIT_OBJECT_0)
+ {
+ Trace ("PALSUITE ERROR: WaitForSingleObject('%p' '%d') "
+ "call returned %d instead of WAIT_OBJECT_0 ('%d').\n"
+ "GetLastError returned %u.\n", hThread[i], 10000,
+ dwRetWFSO, WAIT_OBJECT_0, GetLastError());
+ cleanup(i);
+ Fail("");
+ }
+ }
+ if(!cleanup(NUM_TESTS))
+ {
+ Fail("");
+ }
+
+ for (i = 0; i < NUM_TESTS; i++)
+ {
+ /*
+ * check to see that all threads were created and were passed
+ * the array index as an argument.
+ */
+ if (FALSE == bResult[i])
+ {
+ bRet = FALSE;
+ Trace("PALSUITE ERROR: result[%d]=%d. It should be %d\n", i,
+ FALSE, TRUE);
+ }
+ /*
+ * check to see that lpThreadId received the correct value.
+ */
+ if (0 != dwThreadId[i])
+ {
+ if (dwThreadId[i] != dwThreadId1[i])
+ {
+ bRet = FALSE;
+ Trace("PALSUITE ERROR: dwThreadId[%d]=%p and dwThreadId1[%d]"
+ "=%p\nThese values should be identical.\n", i,
+ dwThreadId[i], i, dwThreadId1[i]);
+ }
+ }
+ }
+ if (!bRet)
+ {
+ cleanup(NUM_TESTS);
+ Fail("");
+ }
+
+ PAL_Terminate();
+ return (PASS);
+}
+
+
+
diff --git a/src/pal/tests/palsuite/threading/CreateThread/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/CreateThread/test3/CMakeLists.txt
index 923d7a72ab..d454992e59 100644
--- a/src/pal/tests/palsuite/threading/CreateThread/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CreateThread/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_createthread_test3
diff --git a/src/pal/tests/palsuite/threading/CreateThread/test3/test3.c b/src/pal/tests/palsuite/threading/CreateThread/test3/test3.cpp
index 0c44d1fdd0..0c44d1fdd0 100644
--- a/src/pal/tests/palsuite/threading/CreateThread/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/CreateThread/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/CMakeLists.txt
index 5ba04fd801..8d2c1441c4 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- InitializeCriticalSection.c
+ InitializeCriticalSection.cpp
)
add_executable(paltest_criticalsectionfunctions_test1
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/InitializeCriticalSection.c b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/InitializeCriticalSection.cpp
index f294cea472..f294cea472 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/InitializeCriticalSection.c
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test1/InitializeCriticalSection.cpp
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/CMakeLists.txt
index d26658cf5d..e0f59f4207 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_criticalsectionfunctions_test2
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/test2.c b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/test2.cpp
index 47659a1c18..47659a1c18 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/CMakeLists.txt
index 8bd2a72878..11555ec484 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_criticalsectionfunctions_test3
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/test3.c b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/test3.cpp
index d5911267b2..d5911267b2 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/CMakeLists.txt b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/CMakeLists.txt
index 0626631640..8aa18854b3 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_criticalsectionfunctions_test4
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/test4.c b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/test4.cpp
index 8a245a4776..8a245a4776 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/test4.c
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/CMakeLists.txt b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/CMakeLists.txt
index 37d709f121..9474bcc6c9 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_criticalsectionfunctions_test5
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/test5.c b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/test5.cpp
index 8dfa4f5f3d..8dfa4f5f3d 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/test5.c
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/CMakeLists.txt b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/CMakeLists.txt
index c580fdbd6b..f4887ad67d 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_criticalsectionfunctions_test6
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/test6.c b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/test6.cpp
index c27db86e5b..c27db86e5b 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/test6.c
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/CMakeLists.txt b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/CMakeLists.txt
index 0a12bfe3ef..ceb78a0512 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_criticalsectionfunctions_test7
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/test7.c b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/test7.cpp
index 1c030d3c03..1c030d3c03 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/test7.c
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/CMakeLists.txt b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/CMakeLists.txt
index 0d95a95410..d3f271d677 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_criticalsectionfunctions_test8
diff --git a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/test8.c b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/test8.cpp
index 7f0c58cd26..7f0c58cd26 100644
--- a/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/test8.c
+++ b/src/pal/tests/palsuite/threading/CriticalSectionFunctions/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/test1.c b/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/test1.cpp
index b64fd0c7d2..b64fd0c7d2 100644
--- a/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/testlib.c b/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/testlib.cpp
index 53b66d1357..53b66d1357 100644
--- a/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/testlib.c
+++ b/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test1/testlib.cpp
diff --git a/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain1.c b/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain1.cpp
index 5010a27665..5010a27665 100644
--- a/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain1.c
+++ b/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain1.cpp
diff --git a/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain2.c b/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain2.cpp
index 4e3f8862a4..4e3f8862a4 100644
--- a/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain2.c
+++ b/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/dllmain2.cpp
diff --git a/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/test2.c b/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/test2.cpp
index 5fb694ea14..5fb694ea14 100644
--- a/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/DisableThreadLibraryCalls/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/CMakeLists.txt
index b908c1246b..9d5fc53a2d 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/CMakeLists.txt
@@ -11,5 +11,4 @@ add_subdirectory(test5)
add_subdirectory(test6)
add_subdirectory(test7)
add_subdirectory(test8)
-add_subdirectory(test9)
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test1/CMakeLists.txt
index 04588b75fe..18b1927a4e 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_duplicatehandle_test1
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test1/test1.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test1/test1.cpp
index e080e98ae8..e080e98ae8 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test10/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test10/CMakeLists.txt
index ba16252cb4..98c7a273dc 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test10/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test10.c
+ test10.cpp
)
add_executable(paltest_duplicatehandle_test10
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test10/test10.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test10/test10.cpp
index 108d748de6..108d748de6 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test10/test10.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test10/test10.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test11/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test11/CMakeLists.txt
index 68ce7b23fb..f47f9bc350 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test11/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test11.c
+ test11.cpp
)
add_executable(paltest_duplicatehandle_test11
@@ -20,7 +20,7 @@ target_link_libraries(paltest_duplicatehandle_test11
set(HELPERSOURCES
- childprocess.c
+ childprocess.cpp
)
add_executable(paltest_duplicatehandle_test11_child
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test11/childprocess.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test11/childprocess.cpp
index d5b310e46c..d5b310e46c 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test11/childprocess.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test11/childprocess.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test11/test11.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test11/test11.cpp
index b05244c4b8..b05244c4b8 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test11/test11.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test11/test11.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test12/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test12/CMakeLists.txt
index 961a9c64e6..6a50a13265 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test12/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test12.c
+ test12.cpp
)
add_executable(paltest_duplicatehandle_test12
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test12/test12.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test12/test12.cpp
index 519194bc3a..519194bc3a 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test12/test12.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test12/test12.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test2/CMakeLists.txt
index 06529a6204..9faa58a271 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_duplicatehandle_test2
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test2/test2.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test2/test2.cpp
index d1411e62d9..d1411e62d9 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test3/CMakeLists.txt
index 7f961c2213..b161b928d3 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_duplicatehandle_test3
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test3/test3.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test3/test3.cpp
index fc91b5ec22..fc91b5ec22 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test4/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test4/CMakeLists.txt
index c3040d09ec..901151f4eb 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_duplicatehandle_test4
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test4/test4.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test4/test4.cpp
index 14a72db461..14a72db461 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test4/test4.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test5/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test5/CMakeLists.txt
index bc468a4a75..94cd07f96f 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_duplicatehandle_test5
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test5/test5.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test5/test5.cpp
index a588928f00..a588928f00 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test5/test5.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test6/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test6/CMakeLists.txt
index 20f7822b1e..a0dcae843c 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_duplicatehandle_test6
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test6/test6.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test6/test6.cpp
index 026f315a44..026f315a44 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test6/test6.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test7/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test7/CMakeLists.txt
index df3fdf9ae0..a222331fe7 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_duplicatehandle_test7
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.cpp
index 0477291922..0477291922 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test8/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test8/CMakeLists.txt
index 15ec23d272..18ed969cb7 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test8/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test8.c
+ test8.cpp
)
add_executable(paltest_duplicatehandle_test8
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test8/test8.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test8/test8.cpp
index 6748c5dffd..6748c5dffd 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test8/test8.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test8/test8.cpp
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test9/CMakeLists.txt b/src/pal/tests/palsuite/threading/DuplicateHandle/test9/CMakeLists.txt
index e4442e327c..0383a010ac 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test9/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test9.c
+ test9.cpp
)
add_executable(paltest_duplicatehandle_test9
diff --git a/src/pal/tests/palsuite/threading/DuplicateHandle/test9/test9.c b/src/pal/tests/palsuite/threading/DuplicateHandle/test9/test9.cpp
index f15871c57d..f15871c57d 100644
--- a/src/pal/tests/palsuite/threading/DuplicateHandle/test9/test9.c
+++ b/src/pal/tests/palsuite/threading/DuplicateHandle/test9/test9.cpp
diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt
index decddb8512..f2d28e06ca 100644
--- a/src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ExitProcess/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- ExitProcess.c
+ ExitProcess.cpp
)
add_executable(paltest_exitprocess_test1
diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.c b/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.cpp
index 2b089a0b83..2b089a0b83 100644
--- a/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.c
+++ b/src/pal/tests/palsuite/threading/ExitProcess/test1/ExitProcess.cpp
diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt
index 881c7d0eee..5281a02aa4 100644
--- a/src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ExitProcess/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_exitprocess_test2
diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.c b/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.cpp
index 8023ad7bab..8023ad7bab 100644
--- a/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/ExitProcess/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt
index 638408e986..3fca087d05 100644
--- a/src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ExitProcess/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_exitprocess_test3
diff --git a/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.c b/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.cpp
index aea485e5e3..aea485e5e3 100644
--- a/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/ExitProcess/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/ExitThread/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/ExitThread/test1/CMakeLists.txt
index 15e0c1b62d..c34b5257ab 100644
--- a/src/pal/tests/palsuite/threading/ExitThread/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ExitThread/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_exitthread_test1
diff --git a/src/pal/tests/palsuite/threading/ExitThread/test1/test1.c b/src/pal/tests/palsuite/threading/ExitThread/test1/test1.c
deleted file mode 100644
index 2963745bef..0000000000
--- a/src/pal/tests/palsuite/threading/ExitThread/test1/test1.c
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test1.c
-**
-** Purpose: Test for ExitThread. Create a thread and then call
-** exit thread within the threading function. Ensure that it exits
-** immediatly.
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-DWORD dwExitThreadTestParameter = 0;
-
-DWORD PALAPI ExitThreadTestThread( LPVOID lpParameter)
-{
- DWORD dwRet = 0;
-
- /* Save parameter for test */
- dwExitThreadTestParameter = (DWORD)lpParameter;
-
- /* Call the ExitThread function */
- ExitThread(dwRet);
-
- /* If we didn't exit, get caught in this loop. But, the
- program will exit.
- */
- while (!dwRet)
- {
- Fail("ERROR: Entered an infinite loop because ExitThread "
- "failed to exit from the thread. Forcing exit from "
- "the test now.");
- }
-
- return dwRet;
-}
-
-BOOL ExitThreadTest()
-{
- BOOL bRet = FALSE;
- DWORD dwRet = 0;
-
- LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL;
- DWORD dwStackSize = 0;
- LPTHREAD_START_ROUTINE lpStartAddress = &ExitThreadTestThread;
- LPVOID lpParameter = lpStartAddress;
- DWORD dwCreationFlags = 0; //run immediately
- DWORD dwThreadId = 0;
-
- HANDLE hThread = 0;
-
- dwExitThreadTestParameter = 0;
-
- /* Create a Thread. We'll need this to test that we're able
- to exit the thread.
- */
- hThread = CreateThread( lpThreadAttributes,
- dwStackSize, lpStartAddress, lpParameter,
- dwCreationFlags, &dwThreadId );
-
- if (hThread != INVALID_HANDLE_VALUE)
- {
- dwRet = WaitForSingleObject(hThread,INFINITE);
-
- if (dwRet != WAIT_OBJECT_0)
- {
- Trace("ExitThreadTest:WaitForSingleObject failed "
- "(%x)\n",GetLastError());
- }
- else
- {
- /* Check to ensure that the parameter set in the Thread
- function is correct.
- */
- if (dwExitThreadTestParameter != (DWORD)lpParameter)
- {
- Trace("ERROR: The paramater passed should have been "
- "%d but turned up as %d.",
- dwExitThreadTestParameter, lpParameter);
- }
- else
- {
- bRet = TRUE;
- }
- }
- }
- else
- {
- Trace("ExitThreadTest:CreateThread failed (%x)\n",GetLastError());
- }
-
- return bRet;
-}
-
-int __cdecl main(int argc, char **argv)
-{
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return ( FAIL );
- }
-
- if(!ExitThreadTest())
- {
- Fail ("Test failed\n");
- }
-
- PAL_Terminate();
- return ( PASS );
-}
diff --git a/src/pal/tests/palsuite/threading/ExitThread/test1/test1.cpp b/src/pal/tests/palsuite/threading/ExitThread/test1/test1.cpp
new file mode 100644
index 0000000000..caf1409406
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/ExitThread/test1/test1.cpp
@@ -0,0 +1,114 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: test1.c
+**
+** Purpose: Test for ExitThread. Create a thread and then call
+** exit thread within the threading function. Ensure that it exits
+** immediatly.
+**
+**
+**=========================================================*/
+
+#include <palsuite.h>
+
+DWORD dwExitThreadTestParameter = 0;
+
+DWORD PALAPI ExitThreadTestThread( LPVOID lpParameter)
+{
+ DWORD dwRet = 0;
+
+ /* Save parameter for test */
+ dwExitThreadTestParameter = (DWORD)lpParameter;
+
+ /* Call the ExitThread function */
+ ExitThread(dwRet);
+
+ /* If we didn't exit, get caught in this loop. But, the
+ program will exit.
+ */
+ while (!dwRet)
+ {
+ Fail("ERROR: Entered an infinite loop because ExitThread "
+ "failed to exit from the thread. Forcing exit from "
+ "the test now.");
+ }
+
+ return dwRet;
+}
+
+BOOL ExitThreadTest()
+{
+ BOOL bRet = FALSE;
+ DWORD dwRet = 0;
+
+ LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL;
+ DWORD dwStackSize = 0;
+ LPTHREAD_START_ROUTINE lpStartAddress = &ExitThreadTestThread;
+ LPVOID lpParameter = (LPVOID)lpStartAddress;
+ DWORD dwCreationFlags = 0; //run immediately
+ DWORD dwThreadId = 0;
+
+ HANDLE hThread = 0;
+
+ dwExitThreadTestParameter = 0;
+
+ /* Create a Thread. We'll need this to test that we're able
+ to exit the thread.
+ */
+ hThread = CreateThread( lpThreadAttributes,
+ dwStackSize, lpStartAddress, lpParameter,
+ dwCreationFlags, &dwThreadId );
+
+ if (hThread != INVALID_HANDLE_VALUE)
+ {
+ dwRet = WaitForSingleObject(hThread,INFINITE);
+
+ if (dwRet != WAIT_OBJECT_0)
+ {
+ Trace("ExitThreadTest:WaitForSingleObject failed "
+ "(%x)\n",GetLastError());
+ }
+ else
+ {
+ /* Check to ensure that the parameter set in the Thread
+ function is correct.
+ */
+ if (dwExitThreadTestParameter != (DWORD)lpParameter)
+ {
+ Trace("ERROR: The paramater passed should have been "
+ "%d but turned up as %d.",
+ dwExitThreadTestParameter, lpParameter);
+ }
+ else
+ {
+ bRet = TRUE;
+ }
+ }
+ }
+ else
+ {
+ Trace("ExitThreadTest:CreateThread failed (%x)\n",GetLastError());
+ }
+
+ return bRet;
+}
+
+int __cdecl main(int argc, char **argv)
+{
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return ( FAIL );
+ }
+
+ if(!ExitThreadTest())
+ {
+ Fail ("Test failed\n");
+ }
+
+ PAL_Terminate();
+ return ( PASS );
+}
diff --git a/src/pal/tests/palsuite/threading/ExitThread/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/ExitThread/test2/CMakeLists.txt
index aa05382feb..5e16d36082 100644
--- a/src/pal/tests/palsuite/threading/ExitThread/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ExitThread/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_exitthread_test2
@@ -20,7 +20,7 @@ target_link_libraries(paltest_exitthread_test2
set(HELPERSOURCES
- childprocess.c
+ childprocess.cpp
)
add_executable(paltest_exitthread_test2_child
diff --git a/src/pal/tests/palsuite/threading/ExitThread/test2/childprocess.c b/src/pal/tests/palsuite/threading/ExitThread/test2/childprocess.cpp
index 7fbe208f91..7fbe208f91 100644
--- a/src/pal/tests/palsuite/threading/ExitThread/test2/childprocess.c
+++ b/src/pal/tests/palsuite/threading/ExitThread/test2/childprocess.cpp
diff --git a/src/pal/tests/palsuite/threading/ExitThread/test2/test2.c b/src/pal/tests/palsuite/threading/ExitThread/test2/test2.cpp
index c31af8a079..c31af8a079 100644
--- a/src/pal/tests/palsuite/threading/ExitThread/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/ExitThread/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/ExitThread/test3/dllmain.c b/src/pal/tests/palsuite/threading/ExitThread/test3/dllmain.cpp
index 923650d1d3..923650d1d3 100644
--- a/src/pal/tests/palsuite/threading/ExitThread/test3/dllmain.c
+++ b/src/pal/tests/palsuite/threading/ExitThread/test3/dllmain.cpp
diff --git a/src/pal/tests/palsuite/threading/ExitThread/test3/test3.c b/src/pal/tests/palsuite/threading/ExitThread/test3/test3.cpp
index 8a71c7cc99..8a71c7cc99 100644
--- a/src/pal/tests/palsuite/threading/ExitThread/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/ExitThread/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt
index 44105348be..af4746bcb4 100644
--- a/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- process.c
+ process.cpp
)
add_executable(paltest_getcurrentprocess_test1
diff --git a/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.c b/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.cpp
index 17d9af6282..17d9af6282 100644
--- a/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.c
+++ b/src/pal/tests/palsuite/threading/GetCurrentProcess/test1/process.cpp
diff --git a/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/CMakeLists.txt
index e5c31e6af2..523320a53c 100644
--- a/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- processId.c
+ processId.cpp
)
add_executable(paltest_getcurrentprocessid_test1
diff --git a/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/processId.c b/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/processId.cpp
index cc689b3f8b..cc689b3f8b 100644
--- a/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/processId.c
+++ b/src/pal/tests/palsuite/threading/GetCurrentProcessId/test1/processId.cpp
diff --git a/src/pal/tests/palsuite/threading/GetCurrentThread/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/GetCurrentThread/test1/CMakeLists.txt
index 84cbccbca0..23af2edbca 100644
--- a/src/pal/tests/palsuite/threading/GetCurrentThread/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/GetCurrentThread/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- thread.c
+ thread.cpp
)
add_executable(paltest_getcurrentthread_test1
diff --git a/src/pal/tests/palsuite/threading/GetCurrentThread/test1/thread.c b/src/pal/tests/palsuite/threading/GetCurrentThread/test1/thread.cpp
index b2bb97fd67..b2bb97fd67 100644
--- a/src/pal/tests/palsuite/threading/GetCurrentThread/test1/thread.c
+++ b/src/pal/tests/palsuite/threading/GetCurrentThread/test1/thread.cpp
diff --git a/src/pal/tests/palsuite/threading/GetCurrentThread/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/GetCurrentThread/test2/CMakeLists.txt
index 3fc3c3e7c6..9da2d075b2 100644
--- a/src/pal/tests/palsuite/threading/GetCurrentThread/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/GetCurrentThread/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_getcurrentthread_test2
diff --git a/src/pal/tests/palsuite/threading/GetCurrentThread/test2/test2.c b/src/pal/tests/palsuite/threading/GetCurrentThread/test2/test2.cpp
index beeb5ec241..beeb5ec241 100644
--- a/src/pal/tests/palsuite/threading/GetCurrentThread/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/GetCurrentThread/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/CMakeLists.txt
index 490bff8f5f..a0824ab9a2 100644
--- a/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- threadId.c
+ threadId.cpp
)
add_executable(paltest_getcurrentthreadid_test1
diff --git a/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/threadId.c b/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/threadId.cpp
index acbb1ff373..acbb1ff373 100644
--- a/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/threadId.c
+++ b/src/pal/tests/palsuite/threading/GetCurrentThreadId/test1/threadId.cpp
diff --git a/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/CMakeLists.txt
index adddd97e6d..1ef9db2299 100644
--- a/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getexitcodeprocess_test1
@@ -20,7 +20,7 @@ target_link_libraries(paltest_getexitcodeprocess_test1
set(HELPERSOURCES
- childProcess.c
+ childProcess.cpp
)
add_executable(paltest_getexitcodeprocess_test1_child
diff --git a/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/childProcess.c b/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/childProcess.cpp
index fe1b38fb31..fe1b38fb31 100644
--- a/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/childProcess.c
+++ b/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/childProcess.cpp
diff --git a/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/test1.c b/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/test1.cpp
index 0f98cf8f57..0f98cf8f57 100644
--- a/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/GetExitCodeProcess/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/GetProcessTimes/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/GetProcessTimes/test2/CMakeLists.txt
index 0ef7260204..8e905873e9 100644
--- a/src/pal/tests/palsuite/threading/GetProcessTimes/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/GetProcessTimes/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_getprocesstimes_test2
diff --git a/src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.c b/src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.c
deleted file mode 100644
index 687facc584..0000000000
--- a/src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.c
+++ /dev/null
@@ -1,122 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================================
-**
-** Source: test2.c
-**
-** Purpose: Test to ensure GetProcessTimes works properly.
-**
-** Dependencies: PAL_Initialize
-** PAL_Terminate
-** Fail
-** ZeroMemory
-** CompareFileTime
-** GetLastError
-**
-
-**
-**===========================================================================*/
-#include <palsuite.h>
-
-
-int __cdecl main( int argc, char **argv )
-
-{
- int i, j, k;
- int *total;
-
- HANDLE hProcess;
- FILETIME createTime;
- FILETIME exitTime;
- FILETIME kernelTime1;
- FILETIME userTime1;
- FILETIME kernelTime2;
- FILETIME userTime2;
-
- DWORD dwError;
-
- /* initialize the PAL */
- if( PAL_Initialize(argc, argv) != 0 )
- {
- return( FAIL );
- }
-
- /* get our own process handle */
- hProcess = GetCurrentProcess();
- if( hProcess == NULL )
- {
- Fail( "GetCurrentProcess() returned a NULL handle.\n" );
- }
-
- /* zero our time structures */
- ZeroMemory( &createTime, sizeof(createTime) );
- ZeroMemory( &exitTime, sizeof(exitTime) );
- ZeroMemory( &kernelTime1, sizeof(kernelTime1) );
- ZeroMemory( &userTime1, sizeof(userTime1) );
- ZeroMemory( &kernelTime2, sizeof(kernelTime2) );
- ZeroMemory( &userTime2, sizeof(userTime2) );
-
- /* check the process times for the child process */
- if( ! GetProcessTimes( hProcess,
- &createTime,
- &exitTime,
- &kernelTime1,
- &userTime1 ) )
- {
- dwError = GetLastError();
- Fail( "GetProcessTimes() call failed with error code %d\n",
- dwError );
- }
-
-
- /* simulate some activity */
- for( i=0; i<1000; i++ )
- {
- for( j=0; j<1000; j++ )
- {
- /* do kernel work to increase system usage counters */
- total = malloc(1024 * 1024);
-
- *total = j * i;
- for( k=0; k<1000; k++ )
- {
- *total += k + i;
- }
-
- free(total);
- }
- }
-
- /* check the process times for the child process */
- if( ! GetProcessTimes( hProcess,
- &createTime,
- &exitTime,
- &kernelTime2,
- &userTime2 ) )
- {
- dwError = GetLastError();
- Fail( "GetProcessTimes() call failed with error code %d\n",
- dwError );
- }
-
-
- /* very simple logical checking of the results */
- if( CompareFileTime( &kernelTime1, &kernelTime2 ) > 0 )
- {
- Fail( "Unexpected kernel time value reported.\n" );
- }
-
- if( CompareFileTime( &userTime1, &userTime2 ) > 0 )
- {
- Fail( "Unexpected user time value reported.\n" );
- }
-
-
- /* terminate the PAL */
- PAL_Terminate();
-
- /* return success */
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.cpp b/src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.cpp
new file mode 100644
index 0000000000..cc39de609b
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/GetProcessTimes/test2/test2.cpp
@@ -0,0 +1,122 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test2.c
+**
+** Purpose: Test to ensure GetProcessTimes works properly.
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** ZeroMemory
+** CompareFileTime
+** GetLastError
+**
+
+**
+**===========================================================================*/
+#include <palsuite.h>
+
+
+int __cdecl main( int argc, char **argv )
+
+{
+ int i, j, k;
+ int *total;
+
+ HANDLE hProcess;
+ FILETIME createTime;
+ FILETIME exitTime;
+ FILETIME kernelTime1;
+ FILETIME userTime1;
+ FILETIME kernelTime2;
+ FILETIME userTime2;
+
+ DWORD dwError;
+
+ /* initialize the PAL */
+ if( PAL_Initialize(argc, argv) != 0 )
+ {
+ return( FAIL );
+ }
+
+ /* get our own process handle */
+ hProcess = GetCurrentProcess();
+ if( hProcess == NULL )
+ {
+ Fail( "GetCurrentProcess() returned a NULL handle.\n" );
+ }
+
+ /* zero our time structures */
+ ZeroMemory( &createTime, sizeof(createTime) );
+ ZeroMemory( &exitTime, sizeof(exitTime) );
+ ZeroMemory( &kernelTime1, sizeof(kernelTime1) );
+ ZeroMemory( &userTime1, sizeof(userTime1) );
+ ZeroMemory( &kernelTime2, sizeof(kernelTime2) );
+ ZeroMemory( &userTime2, sizeof(userTime2) );
+
+ /* check the process times for the child process */
+ if( ! GetProcessTimes( hProcess,
+ &createTime,
+ &exitTime,
+ &kernelTime1,
+ &userTime1 ) )
+ {
+ dwError = GetLastError();
+ Fail( "GetProcessTimes() call failed with error code %d\n",
+ dwError );
+ }
+
+
+ /* simulate some activity */
+ for( i=0; i<1000; i++ )
+ {
+ for( j=0; j<1000; j++ )
+ {
+ /* do kernel work to increase system usage counters */
+ total = (int*)malloc(1024 * 1024);
+
+ *total = j * i;
+ for( k=0; k<1000; k++ )
+ {
+ *total += k + i;
+ }
+
+ free(total);
+ }
+ }
+
+ /* check the process times for the child process */
+ if( ! GetProcessTimes( hProcess,
+ &createTime,
+ &exitTime,
+ &kernelTime2,
+ &userTime2 ) )
+ {
+ dwError = GetLastError();
+ Fail( "GetProcessTimes() call failed with error code %d\n",
+ dwError );
+ }
+
+
+ /* very simple logical checking of the results */
+ if( CompareFileTime( &kernelTime1, &kernelTime2 ) > 0 )
+ {
+ Fail( "Unexpected kernel time value reported.\n" );
+ }
+
+ if( CompareFileTime( &userTime1, &userTime2 ) > 0 )
+ {
+ Fail( "Unexpected user time value reported.\n" );
+ }
+
+
+ /* terminate the PAL */
+ PAL_Terminate();
+
+ /* return success */
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/threading/GetThreadTimes/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/GetThreadTimes/test1/CMakeLists.txt
index d7e2eb2a88..aa4dad11ce 100644
--- a/src/pal/tests/palsuite/threading/GetThreadTimes/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/GetThreadTimes/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_getthreadtimes_test1
diff --git a/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.c b/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.c
deleted file mode 100644
index 6b62c05ec7..0000000000
--- a/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.c
+++ /dev/null
@@ -1,102 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source:
-**
-** Source : test1.c
-**
-** Purpose: Test for GetThreadTimes() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[]) {
- int ret = FAIL;
-
- //Test is failing unreliably, so for now we always return pass.
- if (TRUE){
- ret = PASS;
- goto EXIT;
- }
-
- FILETIME kernelTime1, userTime1, kernelTime2, userTime2;
- /* Delta = .01 sec */
- LONG64 Actual, Expected, Delta = 850000000;
- Actual = 0;
- Expected = 0;
- const ULONG64 MSEC_TO_NSEC = 1000000;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- HANDLE cThread = GetCurrentThread();
-
- int i;
- /* Take 2000 tiny measurements */
- for (i = 0; i < 2000; i++){
- ULONG64 Time1, Time2;
-
- Sleep(1);
-
- /* Grab a FirstCount, then loop for a bit to make the clock increase */
- if (!GetThreadTimes(cThread, NULL, NULL, &kernelTime1, &userTime1))
- {
- Fail("ERROR: GetThreadTimes returned failure.\n");
- }
- LONG64 x, Init;
- /* Init is in milliseconds, so we will convert later */
- Init = (ULONG64)GetTickCount();
- /* Spin for < 1 Quantum so we don't get interrupted */
- x = Init + 3;
- volatile int counter;
- do {
- for (counter = 0; counter < 100000; counter++)
- {
- // spin to consume CPU time
- }
-
- } while (x > GetTickCount());
- Expected += (GetTickCount() - Init) * MSEC_TO_NSEC;
- /* Get a second count */
- if (!GetThreadTimes(cThread, NULL, NULL, &kernelTime2, &userTime2))
- {
- Fail("ERROR: GetThreadTimes returned failure.\n");
- }
-
- Time1 = ((ULONG64)kernelTime1.dwHighDateTime << 32);
- Time1 += (ULONG64)kernelTime1.dwLowDateTime;
- Time1 += ((ULONG64)userTime1.dwHighDateTime << 32);
- Time1 += (ULONG64)userTime1.dwLowDateTime;
-
- Time2 = ((ULONG64)kernelTime2.dwHighDateTime << 32);
- Time2 += (ULONG64)kernelTime2.dwLowDateTime;
- Time2 += ((ULONG64)userTime2.dwHighDateTime << 32);
- Time2 += (ULONG64)userTime2.dwLowDateTime;
-
- Actual += (Time2 - Time1) * 100;
- }
-
- if(labs(Expected - Actual) > Delta)
- {
- Fail("ERROR: The measured time (%llu millisecs) was not within Delta %llu "
- "of the expected time (%llu millisecs).\n",
- (Actual / MSEC_TO_NSEC), (Delta / MSEC_TO_NSEC), (Expected / MSEC_TO_NSEC));
- }
- //printf("%llu, %llu\n", Expected, Actual);
- PAL_Terminate();
- ret = PASS;
-
-EXIT:
- return ret;
-}
diff --git a/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.cpp b/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.cpp
new file mode 100644
index 0000000000..e57a7d08ba
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/GetThreadTimes/test1/test1.cpp
@@ -0,0 +1,102 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source:
+**
+** Source : test1.c
+**
+** Purpose: Test for GetThreadTimes() function
+**
+**
+**=========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[]) {
+ int ret = FAIL;
+
+ //Test is failing unreliably, so for now we always return pass.
+ if (TRUE){
+ ret = PASS;
+ goto EXIT;
+ }
+ {
+ FILETIME kernelTime1, userTime1, kernelTime2, userTime2;
+ /* Delta = .01 sec */
+ LONG64 Actual, Expected, Delta = 850000000;
+ Actual = 0;
+ Expected = 0;
+ const ULONG64 MSEC_TO_NSEC = 1000000;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ HANDLE cThread = GetCurrentThread();
+
+ int i;
+ /* Take 2000 tiny measurements */
+ for (i = 0; i < 2000; i++){
+ ULONG64 Time1, Time2;
+
+ Sleep(1);
+
+ /* Grab a FirstCount, then loop for a bit to make the clock increase */
+ if (!GetThreadTimes(cThread, NULL, NULL, &kernelTime1, &userTime1))
+ {
+ Fail("ERROR: GetThreadTimes returned failure.\n");
+ }
+ LONG64 x, Init;
+ /* Init is in milliseconds, so we will convert later */
+ Init = (ULONG64)GetTickCount();
+ /* Spin for < 1 Quantum so we don't get interrupted */
+ x = Init + 3;
+ volatile int counter;
+ do {
+ for (counter = 0; counter < 100000; counter++)
+ {
+ // spin to consume CPU time
+ }
+
+ } while (x > GetTickCount());
+ Expected += (GetTickCount() - Init) * MSEC_TO_NSEC;
+ /* Get a second count */
+ if (!GetThreadTimes(cThread, NULL, NULL, &kernelTime2, &userTime2))
+ {
+ Fail("ERROR: GetThreadTimes returned failure.\n");
+ }
+
+ Time1 = ((ULONG64)kernelTime1.dwHighDateTime << 32);
+ Time1 += (ULONG64)kernelTime1.dwLowDateTime;
+ Time1 += ((ULONG64)userTime1.dwHighDateTime << 32);
+ Time1 += (ULONG64)userTime1.dwLowDateTime;
+
+ Time2 = ((ULONG64)kernelTime2.dwHighDateTime << 32);
+ Time2 += (ULONG64)kernelTime2.dwLowDateTime;
+ Time2 += ((ULONG64)userTime2.dwHighDateTime << 32);
+ Time2 += (ULONG64)userTime2.dwLowDateTime;
+
+ Actual += (Time2 - Time1) * 100;
+ }
+
+ if(labs(Expected - Actual) > Delta)
+ {
+ Fail("ERROR: The measured time (%llu millisecs) was not within Delta %llu "
+ "of the expected time (%llu millisecs).\n",
+ (Actual / MSEC_TO_NSEC), (Delta / MSEC_TO_NSEC), (Expected / MSEC_TO_NSEC));
+ }
+ //printf("%llu, %llu\n", Expected, Actual);
+ PAL_Terminate();
+ ret = PASS;
+ }
+EXIT:
+ return ret;
+}
diff --git a/src/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp b/src/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp
index 3726214701..a9d46b3d73 100644
--- a/src/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp
+++ b/src/pal/tests/palsuite/threading/NamedMutex/test1/namedmutex.cpp
@@ -520,7 +520,7 @@ bool MutualExclusionTests_Parent()
return true;
}
-DWORD MutualExclusionTests_Child(void *arg = nullptr)
+DWORD PALAPI MutualExclusionTests_Child(void *arg = nullptr)
{
const char *testName = "MutualExclusionTests";
@@ -626,7 +626,7 @@ bool LifetimeTests_Parent()
return true;
}
-DWORD LifetimeTests_Child(void *arg = nullptr)
+DWORD PALAPI LifetimeTests_Child(void *arg = nullptr)
{
const char *testName = "LifetimeTests";
@@ -682,7 +682,7 @@ bool LifetimeTests()
return true;
}
-DWORD AbandonTests_Child_TryLock(void *arg = nullptr);
+DWORD PALAPI AbandonTests_Child_TryLock(void *arg = nullptr);
bool AbandonTests_Parent()
{
@@ -751,7 +751,7 @@ bool AbandonTests_Parent()
return true;
}
-DWORD AbandonTests_Child_GracefulExit_Close(void *arg = nullptr)
+DWORD PALAPI AbandonTests_Child_GracefulExit_Close(void *arg = nullptr)
{
const char *testName = "AbandonTests";
@@ -837,7 +837,7 @@ DWORD AbandonTests_Child_AbruptExit(void *arg = nullptr)
return 0;
}
-DWORD AbandonTests_Child_TryLock(void *arg)
+DWORD PALAPI AbandonTests_Child_TryLock(void *arg)
{
const char *testName = "AbandonTests";
@@ -910,7 +910,7 @@ DWORD g_stressDurationMilliseconds = 0;
LONG g_stressTestCounts[_countof(TestList)] = {0};
LONG g_stressResult = true;
-DWORD StressTest(void *arg)
+DWORD PALAPI StressTest(void *arg)
{
// Run the specified test continuously for the stress duration
SIZE_T testIndex = reinterpret_cast<SIZE_T>(arg);
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/OpenEventW/test1/CMakeLists.txt
index 2bb61e3044..2d5698b153 100644
--- a/src/pal/tests/palsuite/threading/OpenEventW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_openeventw_test1
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test1/test1.c b/src/pal/tests/palsuite/threading/OpenEventW/test1/test1.cpp
index 9dcb3a4a68..9dcb3a4a68 100644
--- a/src/pal/tests/palsuite/threading/OpenEventW/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/OpenEventW/test2/CMakeLists.txt
index 48fa1f2c4b..bedf83b487 100644
--- a/src/pal/tests/palsuite/threading/OpenEventW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_openeventw_test2
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test2/test2.c b/src/pal/tests/palsuite/threading/OpenEventW/test2/test2.cpp
index 9cbf872b95..9cbf872b95 100644
--- a/src/pal/tests/palsuite/threading/OpenEventW/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/OpenEventW/test3/CMakeLists.txt
index 433a3a255c..7f7622dca0 100644
--- a/src/pal/tests/palsuite/threading/OpenEventW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_openeventw_test3
@@ -20,7 +20,7 @@ target_link_libraries(paltest_openeventw_test3
set(HELPERSOURCES
- childprocess.c
+ childprocess.cpp
)
add_executable(paltest_openeventw_test3_child
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test3/childprocess.c b/src/pal/tests/palsuite/threading/OpenEventW/test3/childprocess.cpp
index b5149e006f..b5149e006f 100644
--- a/src/pal/tests/palsuite/threading/OpenEventW/test3/childprocess.c
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test3/childprocess.cpp
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test3/test3.c b/src/pal/tests/palsuite/threading/OpenEventW/test3/test3.c
deleted file mode 100644
index 10a678a107..0000000000
--- a/src/pal/tests/palsuite/threading/OpenEventW/test3/test3.c
+++ /dev/null
@@ -1,187 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================================
-**
-** Source: test3.c
-**
-** Purpose: Test to ensure that OpenEventW() works when
-** opening an event created by another process. This test
-** program launches a child process which creates a
-** named, initially-unset event. The child waits up to
-** 10 seconds for the parent process to open that event
-** and set it, and returns PASS if the event was set or FAIL
-** otherwise. The parent process checks the return value
-** from the child to verify that the opened event was
-** properly used across processes.
-**
-** Dependencies: PAL_Initialize
-** PAL_Terminate
-** Fail
-** ZeroMemory
-** GetCurrentDirectoryW
-** CreateProcessW
-** WaitForSingleObject
-** GetExitCodeProcess
-** GetLastError
-** strlen
-** strncpy
-**
-**
-**===========================================================================*/
-#include <palsuite.h>
-
-#define TIMEOUT 60000
-
-int __cdecl main( int argc, char **argv )
-{
- BOOL ret = FAIL;
- LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
-
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
-
- DWORD dwExitCode;
-
- DWORD dwRet = 0;
- HANDLE hEvent = NULL;
- WCHAR wcName[] = {'P','A','L','R','o','c','k','s','\0'};
- LPWSTR lpName = wcName;
- char lpCommandLine[MAX_PATH] = "";
-
- /* initialize the PAL */
- if( PAL_Initialize(argc, argv) != 0 )
- {
- return( FAIL );
- }
-
- /* zero our process and startup info structures */
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof( si );
- ZeroMemory( &pi, sizeof(pi) );
-
- /* create an event which we can use with SetEvent */
- hEvent = CreateEventW( lpEventAttributes,
- TRUE, /* manual reset */
- FALSE, /* unsignalled */
- lpName );
-
- if( hEvent == NULL )
- {
- /* ERROR */
- Fail( "ERROR:%lu:CreateEventW() call failed in child\n",
- GetLastError());
- }
-
- ZeroMemory( lpCommandLine, MAX_PATH );
- if ( _snprintf( lpCommandLine, MAX_PATH-1, "childprocess ") < 0 )
- {
- Fail ("Error: Insufficient lpCommandline for\n");
- }
-
- /* launch the child process */
- if( !CreateProcess( NULL, /* module name to execute */
- lpCommandLine, /* command line */
- NULL, /* process handle not */
- /* inheritable */
- NULL, /* thread handle not */
- /* inheritable */
- FALSE, /* handle inheritance */
- CREATE_NEW_CONSOLE, /* dwCreationFlags */
- NULL, /* use parent's environment */
- NULL, /* use parent's starting */
- /* directory */
- &si, /* startup info struct */
- &pi ) /* process info struct */
- )
- {
- Fail( "ERROR:%lu:CreateProcess call failed\n",
- GetLastError() );
- }
-
- /* verify that the event is signalled by the child process */
- dwRet = WaitForSingleObject( hEvent, TIMEOUT );
- if( dwRet != WAIT_OBJECT_0 )
- {
- ret = FAIL;
- /* ERROR */
- Trace( "ERROR:WaitForSingleObject() call returned %lu, "
- "expected WAIT_TIMEOUT\n",
- "expected WAIT_OBJECT_0\n",
- dwRet );
-
- goto cleanup;
-
- if( !CloseHandle( hEvent ) )
- {
- Trace( "ERROR:%lu:CloseHandle() call failed in child\n",
- GetLastError());
- }
- goto cleanup;
- }
-
- /* wait for the child process to complete */
- dwRet = WaitForSingleObject ( pi.hProcess, TIMEOUT );
- if( dwRet != WAIT_OBJECT_0 )
- {
- ret = FAIL;
- Trace( "ERROR:WaitForSingleObject() returned %lu, "
- "expected %lu\n",
- dwRet,
- WAIT_OBJECT_0 );
- goto cleanup;
- }
-
- /* check the exit code from the process */
- if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) )
- {
- ret = FAIL;
- Trace( "ERROR:%lu:GetExitCodeProcess call failed\n",
- GetLastError() );
- goto cleanup;
- }
-
- /* check for success */
- ret = (dwExitCode == PASS) ? PASS : FAIL;
-
-cleanup:
- if( hEvent != NULL )
- {
- if( ! CloseHandle ( hEvent ) )
- {
- Trace( "ERROR:%lu:CloseHandle call failed on event handle\n",
- GetLastError() );
- ret = FAIL;
- }
- }
-
-
- /* close process and thread handle */
- if( ! CloseHandle ( pi.hProcess ) )
- {
- Trace( "ERROR:%lu:CloseHandle call failed on process handle\n",
- GetLastError() );
- ret = FAIL;
- }
-
- if( ! CloseHandle ( pi.hThread ) )
- {
- Trace( "ERROR:%lu:CloseHandle call failed on thread handle\n",
- GetLastError() );
- ret = FAIL;
- }
-
- /* output a convenient error message and exit if we failed */
- if( ret == FAIL )
- {
- Fail( "test failed\n" );
- }
-
-
- /* terminate the PAL */
- PAL_Terminate();
-
- /* return success */
- return ret;
-}
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test3/test3.cpp b/src/pal/tests/palsuite/threading/OpenEventW/test3/test3.cpp
new file mode 100644
index 0000000000..c4edf22a76
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test3/test3.cpp
@@ -0,0 +1,187 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================================
+**
+** Source: test3.c
+**
+** Purpose: Test to ensure that OpenEventW() works when
+** opening an event created by another process. This test
+** program launches a child process which creates a
+** named, initially-unset event. The child waits up to
+** 10 seconds for the parent process to open that event
+** and set it, and returns PASS if the event was set or FAIL
+** otherwise. The parent process checks the return value
+** from the child to verify that the opened event was
+** properly used across processes.
+**
+** Dependencies: PAL_Initialize
+** PAL_Terminate
+** Fail
+** ZeroMemory
+** GetCurrentDirectoryW
+** CreateProcessW
+** WaitForSingleObject
+** GetExitCodeProcess
+** GetLastError
+** strlen
+** strncpy
+**
+**
+**===========================================================================*/
+#include <palsuite.h>
+
+#define TIMEOUT 60000
+
+int __cdecl main( int argc, char **argv )
+{
+ BOOL ret = FAIL;
+ LPSECURITY_ATTRIBUTES lpEventAttributes = NULL;
+
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+
+ DWORD dwExitCode;
+
+ DWORD dwRet = 0;
+ HANDLE hEvent = NULL;
+ WCHAR wcName[] = {'P','A','L','R','o','c','k','s','\0'};
+ LPWSTR lpName = wcName;
+ char lpCommandLine[MAX_PATH] = "";
+
+ /* initialize the PAL */
+ if( PAL_Initialize(argc, argv) != 0 )
+ {
+ return( FAIL );
+ }
+
+ /* zero our process and startup info structures */
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof( si );
+ ZeroMemory( &pi, sizeof(pi) );
+
+ /* create an event which we can use with SetEvent */
+ hEvent = CreateEventW( lpEventAttributes,
+ TRUE, /* manual reset */
+ FALSE, /* unsignalled */
+ lpName );
+
+ if( hEvent == NULL )
+ {
+ /* ERROR */
+ Fail( "ERROR:%lu:CreateEventW() call failed in child\n",
+ GetLastError());
+ }
+
+ ZeroMemory( lpCommandLine, MAX_PATH );
+ if ( sprintf_s( lpCommandLine, MAX_PATH-1, "childprocess ") < 0 )
+ {
+ Fail ("Error: Insufficient lpCommandline for\n");
+ }
+
+ /* launch the child process */
+ if( !CreateProcess( NULL, /* module name to execute */
+ lpCommandLine, /* command line */
+ NULL, /* process handle not */
+ /* inheritable */
+ NULL, /* thread handle not */
+ /* inheritable */
+ FALSE, /* handle inheritance */
+ CREATE_NEW_CONSOLE, /* dwCreationFlags */
+ NULL, /* use parent's environment */
+ NULL, /* use parent's starting */
+ /* directory */
+ &si, /* startup info struct */
+ &pi ) /* process info struct */
+ )
+ {
+ Fail( "ERROR:%lu:CreateProcess call failed\n",
+ GetLastError() );
+ }
+
+ /* verify that the event is signalled by the child process */
+ dwRet = WaitForSingleObject( hEvent, TIMEOUT );
+ if( dwRet != WAIT_OBJECT_0 )
+ {
+ ret = FAIL;
+ /* ERROR */
+ Trace( "ERROR:WaitForSingleObject() call returned %lu, "
+ "expected WAIT_TIMEOUT\n",
+ "expected WAIT_OBJECT_0\n",
+ dwRet );
+
+ goto cleanup;
+
+ if( !CloseHandle( hEvent ) )
+ {
+ Trace( "ERROR:%lu:CloseHandle() call failed in child\n",
+ GetLastError());
+ }
+ goto cleanup;
+ }
+
+ /* wait for the child process to complete */
+ dwRet = WaitForSingleObject ( pi.hProcess, TIMEOUT );
+ if( dwRet != WAIT_OBJECT_0 )
+ {
+ ret = FAIL;
+ Trace( "ERROR:WaitForSingleObject() returned %lu, "
+ "expected %lu\n",
+ dwRet,
+ WAIT_OBJECT_0 );
+ goto cleanup;
+ }
+
+ /* check the exit code from the process */
+ if( ! GetExitCodeProcess( pi.hProcess, &dwExitCode ) )
+ {
+ ret = FAIL;
+ Trace( "ERROR:%lu:GetExitCodeProcess call failed\n",
+ GetLastError() );
+ goto cleanup;
+ }
+
+ /* check for success */
+ ret = (dwExitCode == PASS) ? PASS : FAIL;
+
+cleanup:
+ if( hEvent != NULL )
+ {
+ if( ! CloseHandle ( hEvent ) )
+ {
+ Trace( "ERROR:%lu:CloseHandle call failed on event handle\n",
+ GetLastError() );
+ ret = FAIL;
+ }
+ }
+
+
+ /* close process and thread handle */
+ if( ! CloseHandle ( pi.hProcess ) )
+ {
+ Trace( "ERROR:%lu:CloseHandle call failed on process handle\n",
+ GetLastError() );
+ ret = FAIL;
+ }
+
+ if( ! CloseHandle ( pi.hThread ) )
+ {
+ Trace( "ERROR:%lu:CloseHandle call failed on thread handle\n",
+ GetLastError() );
+ ret = FAIL;
+ }
+
+ /* output a convenient error message and exit if we failed */
+ if( ret == FAIL )
+ {
+ Fail( "test failed\n" );
+ }
+
+
+ /* terminate the PAL */
+ PAL_Terminate();
+
+ /* return success */
+ return ret;
+}
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test4/CMakeLists.txt b/src/pal/tests/palsuite/threading/OpenEventW/test4/CMakeLists.txt
index ff17fea23b..73b8904993 100644
--- a/src/pal/tests/palsuite/threading/OpenEventW/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_openeventw_test4
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test4/test4.c b/src/pal/tests/palsuite/threading/OpenEventW/test4/test4.cpp
index ae657a0511..ae657a0511 100644
--- a/src/pal/tests/palsuite/threading/OpenEventW/test4/test4.c
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test5/CMakeLists.txt b/src/pal/tests/palsuite/threading/OpenEventW/test5/CMakeLists.txt
index b78d7fbfc0..3bad4d9cc5 100644
--- a/src/pal/tests/palsuite/threading/OpenEventW/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_openeventw_test5
diff --git a/src/pal/tests/palsuite/threading/OpenEventW/test5/test5.c b/src/pal/tests/palsuite/threading/OpenEventW/test5/test5.cpp
index 43b585765c..43b585765c 100644
--- a/src/pal/tests/palsuite/threading/OpenEventW/test5/test5.c
+++ b/src/pal/tests/palsuite/threading/OpenEventW/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/threading/OpenProcess/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/OpenProcess/test1/CMakeLists.txt
index 26d30547a9..dd2e30516c 100644
--- a/src/pal/tests/palsuite/threading/OpenProcess/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/OpenProcess/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_openprocess_test1
@@ -20,7 +20,7 @@ target_link_libraries(paltest_openprocess_test1
set(HELPERSOURCES
- childProcess.c
+ childProcess.cpp
)
add_executable(paltest_openprocess_test1_child
diff --git a/src/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.c b/src/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.cpp
index 9ef07433fd..9ef07433fd 100644
--- a/src/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.c
+++ b/src/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.cpp
diff --git a/src/pal/tests/palsuite/threading/OpenProcess/test1/test1.c b/src/pal/tests/palsuite/threading/OpenProcess/test1/test1.cpp
index d0f9019646..d0f9019646 100644
--- a/src/pal/tests/palsuite/threading/OpenProcess/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/OpenProcess/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/CMakeLists.txt
index ad3eec1a45..9a54ad15b6 100644
--- a/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_querythreadcycletime_test1
diff --git a/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.c b/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.c
deleted file mode 100644
index 54f0116bd0..0000000000
--- a/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.c
+++ /dev/null
@@ -1,98 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source:
-**
-** Source : test1.c
-**
-** Purpose: Test for QueryThreadCycleTime() function
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char *argv[]) {
- int ret = FAIL;
-
- //Test is failing unreliably, so for now we always return pass.
- if (TRUE){
- ret = PASS;
- goto EXIT;
- }
-
- LONG64 Actual, Expected, Delta = 850000000;
- Actual = 0;
- Expected = 0;
- const LONG64 MSEC_TO_NSEC = 1000000;
-
- /*
- * Initialize the PAL and return FAILURE if this fails
- */
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- HANDLE cThread = GetCurrentThread();
-
- int i;
- /* Take 2000 tiny measurements */
- for (i = 0; i < 2000; i++){
- ULONG64 FirstCount, SecondCount;
- LONG64 Init;
-
- Sleep(1);
-
- /* Grab a FirstCount, then loop for a bit to make the clock increase */
- if (!QueryThreadCycleTime(cThread, (PULONG64)&FirstCount))
- {
- Fail("ERROR: QueryThreadCycleTime returned failure.\n");
- }
-
- LONG64 x;
- /* Init is in milliseconds, so we will convert later */
- Init = (LONG64)GetTickCount();
- x = Init + 3;
- volatile int counter;
- do {
- for (counter = 0; counter < 100000; counter++)
- {
- // spin to consume CPU time
- }
-
- } while (x > GetTickCount());
- Expected += (GetTickCount() - Init) * MSEC_TO_NSEC;
- /* Get a second count */
- if (!QueryThreadCycleTime(cThread, (PULONG64)&SecondCount))
- {
- Fail("ERROR: QueryThreadCycleTime returned failure.\n");
- }
-
- LONG64 trial = (LONG64)SecondCount - (LONG64)FirstCount;
- if (trial < 0){
- printf("Negative value %llu measured", trial);
- }
- Actual += (trial);
-
- }
-
-
-
- if(labs(Expected - Actual) > Delta)
- {
- Fail("ERROR: The measured time (%llu millisecs) was not within Delta %llu "
- "of the expected time (%llu millisecs).\n",
- (Actual / MSEC_TO_NSEC), (Delta / MSEC_TO_NSEC), (Expected / MSEC_TO_NSEC));
- }
- //printf("%llu, %llu\n", Expected, Actual);
- PAL_Terminate();
- ret = PASS;
-
-EXIT:
- return ret;
-}
diff --git a/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.cpp b/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.cpp
new file mode 100644
index 0000000000..026243c81a
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/QueryThreadCycleTime/test1/test1.cpp
@@ -0,0 +1,98 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source:
+**
+** Source : test1.c
+**
+** Purpose: Test for QueryThreadCycleTime() function
+**
+**
+**=========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char *argv[]) {
+ int ret = FAIL;
+
+ //Test is failing unreliably, so for now we always return pass.
+ if (TRUE){
+ ret = PASS;
+ goto EXIT;
+ }
+ {
+ LONG64 Actual, Expected, Delta = 850000000;
+ Actual = 0;
+ Expected = 0;
+ const LONG64 MSEC_TO_NSEC = 1000000;
+
+ /*
+ * Initialize the PAL and return FAILURE if this fails
+ */
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ HANDLE cThread = GetCurrentThread();
+
+ int i;
+ /* Take 2000 tiny measurements */
+ for (i = 0; i < 2000; i++){
+ ULONG64 FirstCount, SecondCount;
+ LONG64 Init;
+
+ Sleep(1);
+
+ /* Grab a FirstCount, then loop for a bit to make the clock increase */
+ if (!QueryThreadCycleTime(cThread, (PULONG64)&FirstCount))
+ {
+ Fail("ERROR: QueryThreadCycleTime returned failure.\n");
+ }
+
+ LONG64 x;
+ /* Init is in milliseconds, so we will convert later */
+ Init = (LONG64)GetTickCount();
+ x = Init + 3;
+ volatile int counter;
+ do {
+ for (counter = 0; counter < 100000; counter++)
+ {
+ // spin to consume CPU time
+ }
+
+ } while (x > GetTickCount());
+ Expected += (GetTickCount() - Init) * MSEC_TO_NSEC;
+ /* Get a second count */
+ if (!QueryThreadCycleTime(cThread, (PULONG64)&SecondCount))
+ {
+ Fail("ERROR: QueryThreadCycleTime returned failure.\n");
+ }
+
+ LONG64 trial = (LONG64)SecondCount - (LONG64)FirstCount;
+ if (trial < 0){
+ printf("Negative value %llu measured", trial);
+ }
+ Actual += (trial);
+
+ }
+
+
+
+ if(labs(Expected - Actual) > Delta)
+ {
+ Fail("ERROR: The measured time (%llu millisecs) was not within Delta %llu "
+ "of the expected time (%llu millisecs).\n",
+ (Actual / MSEC_TO_NSEC), (Delta / MSEC_TO_NSEC), (Expected / MSEC_TO_NSEC));
+ }
+ //printf("%llu, %llu\n", Expected, Actual);
+ PAL_Terminate();
+ ret = PASS;
+ }
+EXIT:
+ return ret;
+}
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/QueueUserAPC/test1/CMakeLists.txt
index 54a4d03719..a99b0a69cc 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_queueuserapc_test1
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test1/test1.c b/src/pal/tests/palsuite/threading/QueueUserAPC/test1/test1.cpp
index 3637897ba7..3637897ba7 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/QueueUserAPC/test2/CMakeLists.txt
index 88cda5f7b1..5d86efdddd 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_queueuserapc_test2
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test2/test2.c b/src/pal/tests/palsuite/threading/QueueUserAPC/test2/test2.cpp
index dc2bfdb173..dc2bfdb173 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/QueueUserAPC/test3/CMakeLists.txt
index 8475dcb03e..e07ab67070 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_queueuserapc_test3
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test3/test3.c b/src/pal/tests/palsuite/threading/QueueUserAPC/test3/test3.cpp
index 933f41a5b4..933f41a5b4 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test4/CMakeLists.txt b/src/pal/tests/palsuite/threading/QueueUserAPC/test4/CMakeLists.txt
index 2552738b50..08a5cc763b 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_queueuserapc_test4
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test4/test4.c b/src/pal/tests/palsuite/threading/QueueUserAPC/test4/test4.cpp
index c28709db81..c28709db81 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test4/test4.c
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test5/CMakeLists.txt b/src/pal/tests/palsuite/threading/QueueUserAPC/test5/CMakeLists.txt
index c2fa10de12..0ef65ce583 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_queueuserapc_test5
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test5/test5.c b/src/pal/tests/palsuite/threading/QueueUserAPC/test5/test5.cpp
index 3d26a55f59..3d26a55f59 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test5/test5.c
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test6/CMakeLists.txt b/src/pal/tests/palsuite/threading/QueueUserAPC/test6/CMakeLists.txt
index 3fd1b1a08e..2e7198358c 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_queueuserapc_test6
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test6/test6.c b/src/pal/tests/palsuite/threading/QueueUserAPC/test6/test6.cpp
index e2e2464726..e2e2464726 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test6/test6.c
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test6/test6.cpp
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test7/CMakeLists.txt b/src/pal/tests/palsuite/threading/QueueUserAPC/test7/CMakeLists.txt
index 751f3894f4..c27cd7e67c 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test7/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test7.c
+ test7.cpp
)
add_executable(paltest_queueuserapc_test7
diff --git a/src/pal/tests/palsuite/threading/QueueUserAPC/test7/test7.c b/src/pal/tests/palsuite/threading/QueueUserAPC/test7/test7.cpp
index 54a63982fe..54a63982fe 100644
--- a/src/pal/tests/palsuite/threading/QueueUserAPC/test7/test7.c
+++ b/src/pal/tests/palsuite/threading/QueueUserAPC/test7/test7.cpp
diff --git a/src/pal/tests/palsuite/threading/ReleaseMutex/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/ReleaseMutex/test3/CMakeLists.txt
index 8e64c28242..6bb3a79db4 100644
--- a/src/pal/tests/palsuite/threading/ReleaseMutex/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ReleaseMutex/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- ReleaseMutex.c
+ ReleaseMutex.cpp
)
add_executable(paltest_releasemutex_test3
diff --git a/src/pal/tests/palsuite/threading/ReleaseMutex/test3/ReleaseMutex.c b/src/pal/tests/palsuite/threading/ReleaseMutex/test3/ReleaseMutex.cpp
index 5f6adb0419..5f6adb0419 100644
--- a/src/pal/tests/palsuite/threading/ReleaseMutex/test3/ReleaseMutex.c
+++ b/src/pal/tests/palsuite/threading/ReleaseMutex/test3/ReleaseMutex.cpp
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/ResetEvent/test1/CMakeLists.txt
index 78e84da2b9..12c83119d8 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_resetevent_test1
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.c b/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.cpp
index 20a0d5dffa..20a0d5dffa 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/ResetEvent/test2/CMakeLists.txt
index ad0fe9b4a1..1f67b5d884 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_resetevent_test2
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.c b/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.cpp
index 8117f44353..8117f44353 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/ResetEvent/test3/CMakeLists.txt
index 3c4ea1f249..fd0d6e8b16 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_resetevent_test3
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.c b/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.cpp
index 9bc068ea72..9bc068ea72 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test4/CMakeLists.txt b/src/pal/tests/palsuite/threading/ResetEvent/test4/CMakeLists.txt
index 68ee20bc95..ca2a918775 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_resetevent_test4
diff --git a/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.c b/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.cpp
index 0cc68fd9aa..0cc68fd9aa 100644
--- a/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.c
+++ b/src/pal/tests/palsuite/threading/ResetEvent/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/threading/ResumeThread/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/ResumeThread/test1/CMakeLists.txt
index 2c83dfd3d5..96d7edcbba 100644
--- a/src/pal/tests/palsuite/threading/ResumeThread/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ResumeThread/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_resumethread_test1
diff --git a/src/pal/tests/palsuite/threading/ResumeThread/test1/test1.c b/src/pal/tests/palsuite/threading/ResumeThread/test1/test1.c
deleted file mode 100644
index 037f79f7a3..0000000000
--- a/src/pal/tests/palsuite/threading/ResumeThread/test1/test1.c
+++ /dev/null
@@ -1,141 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test1.c
-**
-** Purpose: Test for ResumeThread. Create a suspended Thread.
-** First, ensure that it is indeed suspended. Then call resumethread
-** and check to ensure that the function has now run.
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-DWORD dwResumeThreadTestParameter = 0;
-
-DWORD PALAPI ResumeThreadTestThread( LPVOID lpParameter)
-{
- DWORD dwRet = 0;
-
- /* Save parameter so we can check and ensure this function ran
- properly.
- */
-
- dwResumeThreadTestParameter = (DWORD)lpParameter;
-
- return dwRet;
-}
-
-BOOL ResumeThreadTest()
-{
- BOOL bRet = FALSE;
- DWORD dwRet = 0;
-
- LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL;
- DWORD dwStackSize = 0;
- LPTHREAD_START_ROUTINE lpStartAddress = &ResumeThreadTestThread;
- LPVOID lpParameter = lpStartAddress;
- DWORD dwCreationFlags = CREATE_SUSPENDED;
- DWORD dwThreadId = 0;
-
- HANDLE hThread = 0;
-
- dwResumeThreadTestParameter = 0;
-
- /* Create a thread, with CREATE_SUSPENDED, so we can resume it! */
-
- hThread = CreateThread( lpThreadAttributes,
- dwStackSize, lpStartAddress, lpParameter,
- dwCreationFlags, &dwThreadId );
-
- if (hThread != INVALID_HANDLE_VALUE)
- {
- /* Wait for one second. This should return WAIT_TIMEOUT */
- dwRet = WaitForSingleObject(hThread,1000);
-
- if (dwRet != WAIT_TIMEOUT)
- {
- Trace("ResumeThreadTest:WaitForSingleObject "
- "failed (%x)\n",GetLastError());
- }
- else
- {
- /* Check to ensure the parameter hasn't changed. The
- function shouldn't have occurred yet.
- */
- if (dwResumeThreadTestParameter != 0)
- {
- Trace("ResumeThreadTest:parameter error\n");
- }
- else
- {
- /* Call ResumeThread and ensure the return value is
- correct.
- */
-
- dwRet = ResumeThread(hThread);
-
- if (dwRet != 1)
- {
- Trace("ResumeThreadTest:ResumeThread "
- "failed (%x)\n",GetLastError());
- }
- else
- {
- /* Wait again, now that the thread has been
- resumed, and the return should be WAIT_OBJECT_0
- */
- dwRet = WaitForSingleObject(hThread,INFINITE);
-
- if (dwRet != WAIT_OBJECT_0)
- {
- Trace("ResumeThreadTest:WaitForSingleObject "
- "failed (%x)\n",GetLastError());
- }
- else
- {
- /* Check the param now and it should have been
- set.
- */
- if (dwResumeThreadTestParameter != (DWORD)lpParameter)
- {
- Trace("ResumeThreadTest:parameter error\n");
- }
- else
- {
- bRet = TRUE;
- }
- }
- }
- }
- }
- }
- else
- {
- Trace("ResumeThreadTest:CreateThread failed (%x)\n",GetLastError());
- }
-
- return bRet;
-}
-
-int __cdecl main(int argc, char **argv)
-{
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return ( FAIL );
- }
-
- if(!ResumeThreadTest())
- {
- Fail("Test Failed\n");
- }
-
- PAL_Terminate();
- return (PASS);
-
-}
diff --git a/src/pal/tests/palsuite/threading/ResumeThread/test1/test1.cpp b/src/pal/tests/palsuite/threading/ResumeThread/test1/test1.cpp
new file mode 100644
index 0000000000..d2be262e4d
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/ResumeThread/test1/test1.cpp
@@ -0,0 +1,141 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: test1.c
+**
+** Purpose: Test for ResumeThread. Create a suspended Thread.
+** First, ensure that it is indeed suspended. Then call resumethread
+** and check to ensure that the function has now run.
+**
+**
+**=========================================================*/
+
+#include <palsuite.h>
+
+DWORD dwResumeThreadTestParameter = 0;
+
+DWORD PALAPI ResumeThreadTestThread( LPVOID lpParameter)
+{
+ DWORD dwRet = 0;
+
+ /* Save parameter so we can check and ensure this function ran
+ properly.
+ */
+
+ dwResumeThreadTestParameter = (DWORD)lpParameter;
+
+ return dwRet;
+}
+
+BOOL ResumeThreadTest()
+{
+ BOOL bRet = FALSE;
+ DWORD dwRet = 0;
+
+ LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL;
+ DWORD dwStackSize = 0;
+ LPTHREAD_START_ROUTINE lpStartAddress = &ResumeThreadTestThread;
+ LPVOID lpParameter = (LPVOID)lpStartAddress;
+ DWORD dwCreationFlags = CREATE_SUSPENDED;
+ DWORD dwThreadId = 0;
+
+ HANDLE hThread = 0;
+
+ dwResumeThreadTestParameter = 0;
+
+ /* Create a thread, with CREATE_SUSPENDED, so we can resume it! */
+
+ hThread = CreateThread( lpThreadAttributes,
+ dwStackSize, lpStartAddress, lpParameter,
+ dwCreationFlags, &dwThreadId );
+
+ if (hThread != INVALID_HANDLE_VALUE)
+ {
+ /* Wait for one second. This should return WAIT_TIMEOUT */
+ dwRet = WaitForSingleObject(hThread,1000);
+
+ if (dwRet != WAIT_TIMEOUT)
+ {
+ Trace("ResumeThreadTest:WaitForSingleObject "
+ "failed (%x)\n",GetLastError());
+ }
+ else
+ {
+ /* Check to ensure the parameter hasn't changed. The
+ function shouldn't have occurred yet.
+ */
+ if (dwResumeThreadTestParameter != 0)
+ {
+ Trace("ResumeThreadTest:parameter error\n");
+ }
+ else
+ {
+ /* Call ResumeThread and ensure the return value is
+ correct.
+ */
+
+ dwRet = ResumeThread(hThread);
+
+ if (dwRet != 1)
+ {
+ Trace("ResumeThreadTest:ResumeThread "
+ "failed (%x)\n",GetLastError());
+ }
+ else
+ {
+ /* Wait again, now that the thread has been
+ resumed, and the return should be WAIT_OBJECT_0
+ */
+ dwRet = WaitForSingleObject(hThread,INFINITE);
+
+ if (dwRet != WAIT_OBJECT_0)
+ {
+ Trace("ResumeThreadTest:WaitForSingleObject "
+ "failed (%x)\n",GetLastError());
+ }
+ else
+ {
+ /* Check the param now and it should have been
+ set.
+ */
+ if (dwResumeThreadTestParameter != (DWORD)lpParameter)
+ {
+ Trace("ResumeThreadTest:parameter error\n");
+ }
+ else
+ {
+ bRet = TRUE;
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ Trace("ResumeThreadTest:CreateThread failed (%x)\n",GetLastError());
+ }
+
+ return bRet;
+}
+
+int __cdecl main(int argc, char **argv)
+{
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return ( FAIL );
+ }
+
+ if(!ResumeThreadTest())
+ {
+ Fail("Test Failed\n");
+ }
+
+ PAL_Terminate();
+ return (PASS);
+
+}
diff --git a/src/pal/tests/palsuite/threading/SetErrorMode/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/SetErrorMode/test1/CMakeLists.txt
index cfdeb31950..7c145a8528 100644
--- a/src/pal/tests/palsuite/threading/SetErrorMode/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/SetErrorMode/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_seterrormode_test1
diff --git a/src/pal/tests/palsuite/threading/SetErrorMode/test1/test1.c b/src/pal/tests/palsuite/threading/SetErrorMode/test1/test1.cpp
index 238cec4421..238cec4421 100644
--- a/src/pal/tests/palsuite/threading/SetErrorMode/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/SetErrorMode/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/SetEvent/test1/CMakeLists.txt
index 9be8d5a421..8d9d729554 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/SetEvent/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_setevent_test1
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test1/test1.c b/src/pal/tests/palsuite/threading/SetEvent/test1/test1.cpp
index d5a29ce3f3..d5a29ce3f3 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/SetEvent/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/SetEvent/test2/CMakeLists.txt
index 87522b3ffc..7d33b56058 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/SetEvent/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_setevent_test2
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test2/test2.c b/src/pal/tests/palsuite/threading/SetEvent/test2/test2.cpp
index 5fd2833957..5fd2833957 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/SetEvent/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/SetEvent/test3/CMakeLists.txt
index d09239b3e4..1c66460ea0 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/SetEvent/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_setevent_test3
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test3/test3.c b/src/pal/tests/palsuite/threading/SetEvent/test3/test3.cpp
index 21601f00b8..21601f00b8 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/SetEvent/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test4/CMakeLists.txt b/src/pal/tests/palsuite/threading/SetEvent/test4/CMakeLists.txt
index 3f1d344292..04f1815259 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/SetEvent/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_setevent_test4
diff --git a/src/pal/tests/palsuite/threading/SetEvent/test4/test4.c b/src/pal/tests/palsuite/threading/SetEvent/test4/test4.cpp
index 7a79a9d708..7a79a9d708 100644
--- a/src/pal/tests/palsuite/threading/SetEvent/test4/test4.c
+++ b/src/pal/tests/palsuite/threading/SetEvent/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/threading/Sleep/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/Sleep/test1/CMakeLists.txt
index b0d8db28a2..601789600b 100644
--- a/src/pal/tests/palsuite/threading/Sleep/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/Sleep/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- Sleep.c
+ Sleep.cpp
)
add_executable(paltest_sleep_test1
diff --git a/src/pal/tests/palsuite/threading/Sleep/test1/Sleep.c b/src/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp
index f7f7c91730..f7f7c91730 100644
--- a/src/pal/tests/palsuite/threading/Sleep/test1/Sleep.c
+++ b/src/pal/tests/palsuite/threading/Sleep/test1/Sleep.cpp
diff --git a/src/pal/tests/palsuite/threading/Sleep/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/Sleep/test2/CMakeLists.txt
index 832e8ab42d..b8bc3ed7d7 100644
--- a/src/pal/tests/palsuite/threading/Sleep/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/Sleep/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- sleep.c
+ sleep.cpp
)
add_executable(paltest_sleep_test2
diff --git a/src/pal/tests/palsuite/threading/Sleep/test2/sleep.c b/src/pal/tests/palsuite/threading/Sleep/test2/sleep.cpp
index eb30e34f2f..eb30e34f2f 100644
--- a/src/pal/tests/palsuite/threading/Sleep/test2/sleep.c
+++ b/src/pal/tests/palsuite/threading/Sleep/test2/sleep.cpp
diff --git a/src/pal/tests/palsuite/threading/SleepEx/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/SleepEx/test1/CMakeLists.txt
index de562755fc..b2aed8333b 100644
--- a/src/pal/tests/palsuite/threading/SleepEx/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/SleepEx/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_sleepex_test1
diff --git a/src/pal/tests/palsuite/threading/SleepEx/test1/test1.c b/src/pal/tests/palsuite/threading/SleepEx/test1/test1.cpp
index 7ccfe0ce87..7ccfe0ce87 100644
--- a/src/pal/tests/palsuite/threading/SleepEx/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/SleepEx/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/SleepEx/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/SleepEx/test2/CMakeLists.txt
index 0ea4a44449..991e9b40e2 100644
--- a/src/pal/tests/palsuite/threading/SleepEx/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/SleepEx/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_sleepex_test2
diff --git a/src/pal/tests/palsuite/threading/SleepEx/test2/test2.c b/src/pal/tests/palsuite/threading/SleepEx/test2/test2.cpp
index c2ba4e704d..c2ba4e704d 100644
--- a/src/pal/tests/palsuite/threading/SleepEx/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/SleepEx/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/SwitchToThread/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/SwitchToThread/test1/CMakeLists.txt
index 40ecc910b0..b9008c486f 100644
--- a/src/pal/tests/palsuite/threading/SwitchToThread/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/SwitchToThread/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_switchtothread_test1
diff --git a/src/pal/tests/palsuite/threading/SwitchToThread/test1/test1.c b/src/pal/tests/palsuite/threading/SwitchToThread/test1/test1.cpp
index 76ecdd3572..76ecdd3572 100644
--- a/src/pal/tests/palsuite/threading/SwitchToThread/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/SwitchToThread/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/TLS/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/TLS/test1/CMakeLists.txt
index ff1a866eb9..fef741272f 100644
--- a/src/pal/tests/palsuite/threading/TLS/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/TLS/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- TLS.c
+ TLS.cpp
)
add_executable(paltest_tls_test1
diff --git a/src/pal/tests/palsuite/threading/TLS/test1/TLS.c b/src/pal/tests/palsuite/threading/TLS/test1/TLS.cpp
index 4300c3f98b..4300c3f98b 100644
--- a/src/pal/tests/palsuite/threading/TLS/test1/TLS.c
+++ b/src/pal/tests/palsuite/threading/TLS/test1/TLS.cpp
diff --git a/src/pal/tests/palsuite/threading/TLS/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/TLS/test2/CMakeLists.txt
index 5afe82b4a6..10c5034589 100644
--- a/src/pal/tests/palsuite/threading/TLS/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/TLS/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- TLS.c
+ TLS.cpp
)
add_executable(paltest_tls_test2
diff --git a/src/pal/tests/palsuite/threading/TLS/test2/TLS.c b/src/pal/tests/palsuite/threading/TLS/test2/TLS.cpp
index 96a6011f96..96a6011f96 100644
--- a/src/pal/tests/palsuite/threading/TLS/test2/TLS.c
+++ b/src/pal/tests/palsuite/threading/TLS/test2/TLS.cpp
diff --git a/src/pal/tests/palsuite/threading/TLS/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/TLS/test3/CMakeLists.txt
index 0964d33d2c..6bd76d3fdf 100644
--- a/src/pal/tests/palsuite/threading/TLS/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/TLS/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- TLS.c
+ TLS.cpp
)
add_executable(paltest_tls_test3
diff --git a/src/pal/tests/palsuite/threading/TLS/test3/TLS.c b/src/pal/tests/palsuite/threading/TLS/test3/TLS.cpp
index 4acaef5020..4acaef5020 100644
--- a/src/pal/tests/palsuite/threading/TLS/test3/TLS.c
+++ b/src/pal/tests/palsuite/threading/TLS/test3/TLS.cpp
diff --git a/src/pal/tests/palsuite/threading/TLS/test4/CMakeLists.txt b/src/pal/tests/palsuite/threading/TLS/test4/CMakeLists.txt
index 7e7b47786a..73ba496f1d 100644
--- a/src/pal/tests/palsuite/threading/TLS/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/TLS/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_tls_test4
diff --git a/src/pal/tests/palsuite/threading/TLS/test4/test4.c b/src/pal/tests/palsuite/threading/TLS/test4/test4.cpp
index 8c3603cdb0..8c3603cdb0 100644
--- a/src/pal/tests/palsuite/threading/TLS/test4/test4.c
+++ b/src/pal/tests/palsuite/threading/TLS/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/threading/TLS/test5/CMakeLists.txt b/src/pal/tests/palsuite/threading/TLS/test5/CMakeLists.txt
index 5fb5c9ddfd..e26fcfff26 100644
--- a/src/pal/tests/palsuite/threading/TLS/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/TLS/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_tls_test5
diff --git a/src/pal/tests/palsuite/threading/TLS/test5/test5.c b/src/pal/tests/palsuite/threading/TLS/test5/test5.cpp
index c1cd132937..c1cd132937 100644
--- a/src/pal/tests/palsuite/threading/TLS/test5/test5.c
+++ b/src/pal/tests/palsuite/threading/TLS/test5/test5.cpp
diff --git a/src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/CMakeLists.txt b/src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/CMakeLists.txt
index 8b3a4ed64a..bfc7b75e0b 100644
--- a/src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_tls_test6_optimizedtls
diff --git a/src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/test.c b/src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/test.cpp
index 02419dc90c..02419dc90c 100644
--- a/src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/test.c
+++ b/src/pal/tests/palsuite/threading/TLS/test6_optimizedtls/test.cpp
diff --git a/src/pal/tests/palsuite/threading/TerminateProcess/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/TerminateProcess/test1/CMakeLists.txt
index 37d575952f..382e801e29 100644
--- a/src/pal/tests/palsuite/threading/TerminateProcess/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/TerminateProcess/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- TerminateProcess.c
+ TerminateProcess.cpp
)
add_executable(paltest_terminateprocess_test1
diff --git a/src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.c b/src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.cpp
index 6feedfce76..6feedfce76 100644
--- a/src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.c
+++ b/src/pal/tests/palsuite/threading/TerminateProcess/test1/TerminateProcess.cpp
diff --git a/src/pal/tests/palsuite/threading/ThreadPriority/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/ThreadPriority/test1/CMakeLists.txt
index e341ca7435..026f4ed043 100644
--- a/src/pal/tests/palsuite/threading/ThreadPriority/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/ThreadPriority/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- ThreadPriority.c
+ ThreadPriority.cpp
)
add_executable(paltest_threadpriority_test1
diff --git a/src/pal/tests/palsuite/threading/ThreadPriority/test1/ThreadPriority.c b/src/pal/tests/palsuite/threading/ThreadPriority/test1/ThreadPriority.cpp
index 95bcdac52a..95bcdac52a 100644
--- a/src/pal/tests/palsuite/threading/ThreadPriority/test1/ThreadPriority.c
+++ b/src/pal/tests/palsuite/threading/ThreadPriority/test1/ThreadPriority.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/CMakeLists.txt
index 2b1f946b26..ea13c7de4c 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_waitformultipleobjects_test1
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp
index 8249c38d9d..8249c38d9d 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjects/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/CMakeLists.txt
index d035021bb9..59d4cd8cd4 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_waitformultipleobjectsex_test1
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp
index df3233fa50..df3233fa50 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/CMakeLists.txt
index ab47c6f2e7..e970ec526e 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test2.c
+ test2.cpp
)
add_executable(paltest_waitformultipleobjectsex_test2
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.cpp
index b2bc301128..b2bc301128 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.c
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test2/test2.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/CMakeLists.txt
index 645b86719d..f1b76fb819 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test3.c
+ test3.cpp
)
add_executable(paltest_waitformultipleobjectsex_test3
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/test3.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/test3.cpp
index b78b0540dc..b78b0540dc 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/test3.c
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test3/test3.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/CMakeLists.txt
index 3cd7f72b98..815b2b069c 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test4.c
+ test4.cpp
)
add_executable(paltest_waitformultipleobjectsex_test4
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/test4.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/test4.cpp
index 15d0a386d1..15d0a386d1 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/test4.c
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test4/test4.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/CMakeLists.txt
index 50147e9bf3..730ec60649 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test5.c
+ test5.cpp
)
add_executable(paltest_waitformultipleobjectsex_test5
@@ -20,7 +20,7 @@ target_link_libraries(paltest_waitformultipleobjectsex_test5
set(HELPERSOURCES
- helper.c
+ helper.cpp
)
add_executable(paltest_waitformultipleobjectsex_test5_helper
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.c
deleted file mode 100644
index 274780a216..0000000000
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.c
+++ /dev/null
@@ -1,122 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: helper.c
-**
-** Purpose: This helper process sets up signals to communicate
-** with the test thread in the parent process, and let the test
-** thread signal this process when to exit.
-**
-**
-**============================================================*/
-
-#include "commonconsts.h"
-
-#include <palsuite.h>
-
-HANDLE hProcessStartEvent;
-HANDLE hProcessReadyEvent;
-HANDLE hProcessFinishEvent;
-HANDLE hProcessCleanupEvent;
-
-
-int __cdecl main(int argc, char *argv[])
-{
-
- BOOL success = TRUE; /* assume success */
- DWORD dwRet;
- DWORD dwProcessId;
- char szEventName[MAX_LONGPATH];
- PWCHAR uniString;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- /* Open the event to let test thread tell us to get started. */
- uniString = convert(szcHelperProcessStartEvName);
- hProcessStartEvent = OpenEventW(EVENT_ALL_ACCESS, 0, uniString);
- free(uniString);
- if (!hProcessStartEvent)
- {
- Fail("helper.main: OpenEvent of '%S' failed (%u). "
- "(the event should already exist!)\n",
- szcHelperProcessStartEvName, GetLastError());
- }
-
- /* Wait for signal from test thread. */
- dwRet = WaitForSingleObject(hProcessStartEvent, TIMEOUT);
- if (dwRet != WAIT_OBJECT_0)
- {
- Fail("helper.main: WaitForSingleObject '%s' failed\n"
- "LastError:(%u)\n", szcHelperProcessStartEvName, GetLastError());
- }
-
- dwProcessId = GetCurrentProcessId();
-
- if ( 0 >= dwProcessId )
- {
- Fail ("helper.main: %s has invalid pid %d\n", argv[0], dwProcessId );
- }
-
- /* Open the event to tell test thread we are ready. */
- if (_snprintf(szEventName, MAX_LONGPATH-1, "%s%d", szcHelperProcessReadyEvName, dwProcessId) < 0)
- {
- Fail ("helper.main: Insufficient event name string length for pid=%d\n", dwProcessId);
- }
-
- uniString = convert(szEventName);
-
- hProcessReadyEvent = OpenEventW(EVENT_ALL_ACCESS, 0, uniString);
- free(uniString);
- if (!hProcessReadyEvent)
- {
- Fail("helper.main: OpenEvent of '%s' failed (%u). "
- "(the event should already exist!)\n",
- szEventName, GetLastError());
- }
-
- /* Open the event to let test thread tell us to exit. */
- if (_snprintf(szEventName, MAX_LONGPATH-1, "%s%d", szcHelperProcessFinishEvName, dwProcessId) < 0)
- {
- Fail ("helper.main: Insufficient event name string length for pid=%d\n", dwProcessId);
- }
-
- uniString = convert(szEventName);
-
- hProcessFinishEvent = OpenEventW(EVENT_ALL_ACCESS, 0, uniString);
- free(uniString);
- if (!hProcessFinishEvent)
- {
- Fail("helper.main: OpenEvent of '%s' failed LastError:(%u).\n",
- szEventName, GetLastError());
- }
-
- /* Tell the test thread we are ready. */
- if (!SetEvent(hProcessReadyEvent))
- {
- Fail("helper.main: SetEvent '%s' failed LastError:(%u)\n",
- hProcessReadyEvent, GetLastError());
- }
-
- /* Wait for signal from test thread before exit. */
- dwRet = WaitForSingleObject(hProcessFinishEvent, TIMEOUT);
- if (WAIT_OBJECT_0 != dwRet)
- {
- Fail("helper.main: WaitForSingleObject '%s' failed pid=%d\n"
- "LastError:(%u)\n",
- szcHelperProcessFinishEvName, dwProcessId, GetLastError());
- }
-
- PEDANTIC(CloseHandle, (hProcessStartEvent));
- PEDANTIC(CloseHandle, (hProcessReadyEvent));
- PEDANTIC(CloseHandle, (hProcessFinishEvent));
-
- PAL_Terminate();
-
- return success ? PASS : FAIL;
-}
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.cpp b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.cpp
new file mode 100644
index 0000000000..caa0206a11
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/helper.cpp
@@ -0,0 +1,122 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: helper.c
+**
+** Purpose: This helper process sets up signals to communicate
+** with the test thread in the parent process, and let the test
+** thread signal this process when to exit.
+**
+**
+**============================================================*/
+
+#include "commonconsts.h"
+
+#include <palsuite.h>
+
+HANDLE hProcessStartEvent;
+HANDLE hProcessReadyEvent;
+HANDLE hProcessFinishEvent;
+HANDLE hProcessCleanupEvent;
+
+
+int __cdecl main(int argc, char *argv[])
+{
+
+ BOOL success = TRUE; /* assume success */
+ DWORD dwRet;
+ DWORD dwProcessId;
+ char szEventName[MAX_LONGPATH];
+ PWCHAR uniString;
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ /* Open the event to let test thread tell us to get started. */
+ uniString = convert(szcHelperProcessStartEvName);
+ hProcessStartEvent = OpenEventW(EVENT_ALL_ACCESS, 0, uniString);
+ free(uniString);
+ if (!hProcessStartEvent)
+ {
+ Fail("helper.main: OpenEvent of '%S' failed (%u). "
+ "(the event should already exist!)\n",
+ szcHelperProcessStartEvName, GetLastError());
+ }
+
+ /* Wait for signal from test thread. */
+ dwRet = WaitForSingleObject(hProcessStartEvent, TIMEOUT);
+ if (dwRet != WAIT_OBJECT_0)
+ {
+ Fail("helper.main: WaitForSingleObject '%s' failed\n"
+ "LastError:(%u)\n", szcHelperProcessStartEvName, GetLastError());
+ }
+
+ dwProcessId = GetCurrentProcessId();
+
+ if ( 0 >= dwProcessId )
+ {
+ Fail ("helper.main: %s has invalid pid %d\n", argv[0], dwProcessId );
+ }
+
+ /* Open the event to tell test thread we are ready. */
+ if (sprintf_s(szEventName, MAX_LONGPATH-1, "%s%d", szcHelperProcessReadyEvName, dwProcessId) < 0)
+ {
+ Fail ("helper.main: Insufficient event name string length for pid=%d\n", dwProcessId);
+ }
+
+ uniString = convert(szEventName);
+
+ hProcessReadyEvent = OpenEventW(EVENT_ALL_ACCESS, 0, uniString);
+ free(uniString);
+ if (!hProcessReadyEvent)
+ {
+ Fail("helper.main: OpenEvent of '%s' failed (%u). "
+ "(the event should already exist!)\n",
+ szEventName, GetLastError());
+ }
+
+ /* Open the event to let test thread tell us to exit. */
+ if (sprintf_s(szEventName, MAX_LONGPATH-1, "%s%d", szcHelperProcessFinishEvName, dwProcessId) < 0)
+ {
+ Fail ("helper.main: Insufficient event name string length for pid=%d\n", dwProcessId);
+ }
+
+ uniString = convert(szEventName);
+
+ hProcessFinishEvent = OpenEventW(EVENT_ALL_ACCESS, 0, uniString);
+ free(uniString);
+ if (!hProcessFinishEvent)
+ {
+ Fail("helper.main: OpenEvent of '%s' failed LastError:(%u).\n",
+ szEventName, GetLastError());
+ }
+
+ /* Tell the test thread we are ready. */
+ if (!SetEvent(hProcessReadyEvent))
+ {
+ Fail("helper.main: SetEvent '%s' failed LastError:(%u)\n",
+ hProcessReadyEvent, GetLastError());
+ }
+
+ /* Wait for signal from test thread before exit. */
+ dwRet = WaitForSingleObject(hProcessFinishEvent, TIMEOUT);
+ if (WAIT_OBJECT_0 != dwRet)
+ {
+ Fail("helper.main: WaitForSingleObject '%s' failed pid=%d\n"
+ "LastError:(%u)\n",
+ szcHelperProcessFinishEvName, dwProcessId, GetLastError());
+ }
+
+ PEDANTIC(CloseHandle, (hProcessStartEvent));
+ PEDANTIC(CloseHandle, (hProcessReadyEvent));
+ PEDANTIC(CloseHandle, (hProcessFinishEvent));
+
+ PAL_Terminate();
+
+ return success ? PASS : FAIL;
+}
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.c
deleted file mode 100644
index d19978c103..0000000000
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.c
+++ /dev/null
@@ -1,506 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*=============================================================
-**
-** Source: test5.c
-**
-** Purpose: Test the functionality of simultaneously waiting
-** on multiple processes. Create the same number of helper
-** processes and helper threads.
-** Helper threads wait on helper processes to finish.
-** Helper processes wait on the event signal from test
-** thread before exit.
-** The test thread can wake up one helper
-** thread at a time by signaling the corresponding helper
-** process to finish.
-** The test thread can also wake up all helper threads at once
-** by signaling help process 0 to exit.
-**
-**
-**============================================================*/
-
-#define UNICODE
-
-#include "commonconsts.h"
-
-#include <palsuite.h>
-
-/* The maximum number of objects a thread can wait is MAXIMUM_WAIT_OBJECTS.
- The last helper thread in this test case will wait on all helper processes
- plus a thread finish event so the maximum number of helper processes
- can be created in this test case is (MAXIMUM_WAIT_OBJECTS-1). */
-#define MAX_HELPER_PROCESS (MAXIMUM_WAIT_OBJECTS-1)
-
-int MaxNumHelperProcess = MAX_HELPER_PROCESS;
-
-/* indicate how the test thread wake up helper thread. */
-typedef enum _TestCaseType {
- WakeUpOneThread, /* wake up one helper thread at a time. */
- WakeUpAllThread /* wake up all helper threads at once */
-} TestCaseType;
-
-TestCaseType TestCase = WakeUpOneThread;
-
-/* When the test thread wakes up one thread at a time,
- ThreadIndexOfThreadFinishEvent specifies the index of the thread that
- should be waked up using hThreadFinishEvent instead of helper process. */
-DWORD ThreadIndexOfThreadFinishEvent = 0;
-
-struct helper_process_t
-{
- PROCESS_INFORMATION pi;
- HANDLE hProcessReadyEvent;
- HANDLE hProcessFinishEvent;
-} helper_process[MAX_HELPER_PROCESS];
-
-HANDLE hProcessStartEvent;
-
-struct helper_thread_t
-{
- HANDLE hThread;
- DWORD dwThreadId;
- HANDLE hThreadReadyEvent;
- HANDLE hThreadFinishEvent;
-} helper_thread[MAX_HELPER_PROCESS];
-
-/*
- * Entry Point for helper thread.
- */
-DWORD PALAPI WaitForProcess(LPVOID lpParameter)
-{
- DWORD index, i;
- DWORD dwRet;
- HANDLE handles[MAX_HELPER_PROCESS+1];
-
- index = (DWORD) lpParameter;
-
- /* The helper thread 0 will wait for helper process 0, helper thread 1 will
- wait for helper process 0 and 1, helper thread 2 will wait for helper
- process 0, 1, and 2, and so on ..., and the last helper thread will wait
- on all helper processes.
- Each helper thread also waits on hThreadFinishEvent so that
- it can exit without waiting on any process to finish. */
-
- for (i = 0; i <= index; i++)
- {
- handles[i] = helper_process[i].pi.hProcess;
- }
-
- handles[index+1] = helper_thread[index].hThreadFinishEvent;
-
- if(!SetEvent(helper_thread[index].hThreadReadyEvent))
- {
- Fail("test5.WaitProcess: SetEvent of hThreadReadyEvent failed for thread %d. "
- "GetLastError() returned %d.\n", index,
- GetLastError());
- }
-
- dwRet = WaitForMultipleObjectsEx(index+2, &handles[0], FALSE, TIMEOUT, TRUE);
- if (WakeUpAllThread == TestCase)
- {
- /* If the test thread signals helper process 0 to exit, all threads will be waked up,
- and the return value must be (WAIT_OBJECT_0+0) because the handle of helper process 0
- is in handle[0]. */
- if (dwRet != (WAIT_OBJECT_0+0))
- {
- Fail("test5.WaitForProcess: invalid return value %d for WakupAllThread from WaitForMultipleObjectsEx for thread %d\n"
- "LastError:(%u)\n",
- dwRet, index,
- GetLastError());
- }
- }
- else if (WakeUpOneThread == TestCase)
- {
- /* If the test thread wakes up one helper thread at a time,
- the return value must be either (WAIT_OBJECT_0+index) if the helper thread
- wakes up because the corresponding help process exits,
- or (index+1) if the helper thread wakes up because of hThreadReadyEvent. */
- if ((index != ThreadIndexOfThreadFinishEvent && dwRet != (WAIT_OBJECT_0+index)) ||
- (index == ThreadIndexOfThreadFinishEvent && dwRet != (index+1)))
- {
- Fail("test5.WaitForProcess: invalid return value %d for WakupOneThread from WaitForMultipleObjectsEx for thread %d\n"
- "LastError:(%u)\n",
- dwRet, index,
- GetLastError());
- }
- }
- else
- {
- Fail("Unknown TestCase %d\n", TestCase);
- }
- return 0;
-}
-
-/*
- * Setup the helper processes and helper threads.
- */
-void
-Setup()
-{
-
- STARTUPINFO si;
- DWORD dwRet;
- int i;
-
- char szEventName[MAX_PATH];
- PWCHAR uniStringHelper;
- PWCHAR uniString;
-
- /* Create the event to start helper process after it was created. */
- uniString = convert(szcHelperProcessStartEvName);
- hProcessStartEvent = CreateEvent(NULL, TRUE, FALSE, uniString);
- free(uniString);
- if (!hProcessStartEvent)
- {
- Fail("test5.Setup: CreateEvent of '%s' failed. "
- "GetLastError() returned %d.\n", szcHelperProcessStartEvName,
- GetLastError());
- }
-
- /* Create the helper processes. */
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- uniStringHelper = convert("helper");
- for (i = 0; i < MaxNumHelperProcess; i++)
- {
- ZeroMemory( &helper_process[i].pi, sizeof(PROCESS_INFORMATION));
-
- if(!CreateProcess( NULL, uniStringHelper, NULL, NULL,
- FALSE, 0, NULL, NULL, &si, &helper_process[i].pi))
- {
- Fail("test5.Setup: CreateProcess failed to load executable for helper process %d. "
- "GetLastError() returned %u.\n",
- i, GetLastError());
- }
-
- /* Create the event to let helper process tell us it is ready. */
- if (_snprintf(szEventName, MAX_PATH-1, "%s%d",
- szcHelperProcessReadyEvName, helper_process[i].pi.dwProcessId) < 0)
- {
- Fail ("test5.Setup: Insufficient event name string length for %s\n", szcHelperProcessReadyEvName);
- }
-
- uniString = convert(szEventName);
-
- helper_process[i].hProcessReadyEvent = CreateEvent(NULL, FALSE, FALSE, uniString);
- free(uniString);
- if (!helper_process[i].hProcessReadyEvent)
- {
- Fail("test5.Setup: CreateEvent of '%s' failed. "
- "GetLastError() returned %d.\n", szEventName,
- GetLastError());
- }
-
- /* Create the event to tell helper process to exit. */
- if (_snprintf(szEventName, MAX_PATH-1, "%s%d",
- szcHelperProcessFinishEvName, helper_process[i].pi.dwProcessId) < 0)
- {
- Fail ("test5.Setup: Insufficient event name string length for %s\n", szcHelperProcessFinishEvName);
- }
-
- uniString = convert(szEventName);
-
- helper_process[i].hProcessFinishEvent = CreateEvent(NULL, TRUE, FALSE, uniString);
- free(uniString);
- if (!helper_process[i].hProcessFinishEvent)
- {
- Fail("test5.Setup: CreateEvent of '%s' failed. "
- "GetLastError() returned %d.\n", szEventName,
- GetLastError());
- }
-
- }
- free(uniStringHelper);
-
- /* Signal all helper processes to start. */
- if (!SetEvent(hProcessStartEvent))
- {
- Fail("test5.Setup: SetEvent '%s' failed\n",
- "LastError:(%u)\n",
- szcHelperProcessStartEvName, GetLastError());
- }
-
- /* Wait for ready signals from all helper processes. */
- for (i = 0; i < MaxNumHelperProcess; i++)
- {
- dwRet = WaitForSingleObject(helper_process[i].hProcessReadyEvent, TIMEOUT);
- if (dwRet != WAIT_OBJECT_0)
- {
- Fail("test5.Setup: WaitForSingleObject %s failed for helper process %d\n"
- "LastError:(%u)\n",
- szcHelperProcessReadyEvName, i, GetLastError());
- }
- }
-
- /* Create the same number of helper threads as helper processes. */
- for (i = 0; i < MaxNumHelperProcess; i++)
- {
- /* Create the event to let helper thread tell us it is ready. */
- helper_thread[i].hThreadReadyEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (!helper_thread[i].hThreadReadyEvent)
- {
- Fail("test5.Setup: CreateEvent of hThreadReadyEvent failed for thread %d\n"
- "LastError:(%u)\n", i, GetLastError());
- }
-
- /* Create the event to tell helper thread to exit without waiting for helper process. */
- helper_thread[i].hThreadFinishEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (!helper_thread[i].hThreadFinishEvent)
- {
- Fail("test5.Setup: CreateEvent of hThreadFinishEvent failed for thread %d\n"
- "LastError:(%u)\n", i, GetLastError());
- }
-
- /* Create the helper thread. */
- helper_thread[i].hThread = CreateThread( NULL,
- 0,
- (LPTHREAD_START_ROUTINE)WaitForProcess,
- (LPVOID)i,
- 0,
- &helper_thread[i].dwThreadId);
- if (NULL == helper_thread[i].hThread)
- {
- Fail("test5.Setup: Unable to create the helper thread %d\n"
- "LastError:(%u)\n", i, GetLastError());
- }
- }
-
- /* Wait for ready signals from all helper threads. */
- for (i = 0; i < MaxNumHelperProcess; i++)
- {
- dwRet = WaitForSingleObject(helper_thread[i].hThreadReadyEvent, TIMEOUT);
- if (dwRet != WAIT_OBJECT_0)
- {
- Fail("test5.Setup: WaitForSingleObject hThreadReadyEvent for thread %d\n"
- "LastError:(%u)\n", i, GetLastError());
- }
- }
-}
-
-/*
- * Cleanup the helper processes and helper threads.
- */
-DWORD
-Cleanup()
-{
- DWORD dwExitCode;
- DWORD dwRet;
- int i;
-
- /* Wait for all helper process to finish and close their handles
- and associated events. */
- for (i = 0; i < MaxNumHelperProcess; i++)
- {
-
- /* wait for the child process to complete */
- dwRet = WaitForSingleObject ( helper_process[i].pi.hProcess, TIMEOUT );
- if (WAIT_OBJECT_0 != dwRet)
- {
- Fail("test5.Cleanup: WaitForSingleObject hThreadReadyEvent failed for thread %d\n"
- "LastError:(%u)\n", i, GetLastError());
- }
-
- /* check the exit code from the process */
- if (!GetExitCodeProcess(helper_process[i].pi.hProcess, &dwExitCode))
- {
- Trace( "test5.Cleanup: GetExitCodeProcess %d call failed LastError:(%u)\n",
- i, GetLastError());
- dwExitCode = FAIL;
- }
- PEDANTIC(CloseHandle, (helper_process[i].pi.hThread));
- PEDANTIC(CloseHandle, (helper_process[i].pi.hProcess));
- PEDANTIC(CloseHandle, (helper_process[i].hProcessReadyEvent));
- PEDANTIC(CloseHandle, (helper_process[i].hProcessFinishEvent));
- }
-
- /* Close all helper threads' handles */
- for (i = 0; i < MaxNumHelperProcess; i++)
- {
- PEDANTIC(CloseHandle, (helper_thread[i].hThread));
- PEDANTIC(CloseHandle, (helper_thread[i].hThreadReadyEvent));
- PEDANTIC(CloseHandle, (helper_thread[i].hThreadFinishEvent));
- }
-
- /* Close all process start event. */
- PEDANTIC(CloseHandle, (hProcessStartEvent));
-
- return dwExitCode;
-}
-
-/*
- * In this test case, the test thread will signal one helper
- * process to exit at a time starting from the last helper
- * process and then wait for the corresponding helper thread to exit.
- * The ThreadIndexOfThreadFinishEvent specifies the index of the thread that
- * should be waked up using hThreadFinishEvent instead of helper process.
- */
-void
-TestWakeupOneThread()
-{
- DWORD dwRet;
- int i;
-
- TestCase = WakeUpOneThread;
-
- if (((LONG)ThreadIndexOfThreadFinishEvent) < 0 ||
- ThreadIndexOfThreadFinishEvent >= MAX_HELPER_PROCESS)
- Fail("test5.TestWaitOnOneThread: Invalid ThreadIndexOfThreadFinishEvent %d\n", ThreadIndexOfThreadFinishEvent);
-
- /* Since helper thread 0 waits on helper process 0,
- thread 1 waits on on process 0, and 1,
- thread 2 waits on process 0, 1, and 2, and so on ...,
- and the last helper thread will wait on all helper processes,
- the helper thread can be waked up one at a time by
- waking up the help process one at a time starting from the
- last helper process. */
- for (i = MaxNumHelperProcess-1; i >= 0; i--)
- {
- /* make sure the helper thread has not exited yet. */
- dwRet = WaitForSingleObject(helper_thread[i].hThread, 0);
- if (WAIT_TIMEOUT != dwRet)
- {
- Fail("test5.TestWaitOnOneThread: helper thread %d already exited %d\n", i);
- }
-
- /* Decide how to wakeup the helper thread:
- using event or using helper process. */
- if (i == ThreadIndexOfThreadFinishEvent)
- {
- if (!SetEvent(helper_thread[i].hThreadFinishEvent))
- {
- Fail("test5.TestWaitOnOneThread: SetEvent hThreadFinishEvent failed for thread %d\n",
- "LastError:(%u)\n", i, GetLastError());
- }
- }
- else
- {
- if (!SetEvent(helper_process[i].hProcessFinishEvent))
- {
- Fail("test5.TestWaitOnOneThread: SetEvent %s%d failed for helper process %d\n",
- "LastError:(%u)\n",
- szcHelperProcessFinishEvName, helper_process[i].pi.dwProcessId, i,
- GetLastError());
- }
- }
-
- dwRet = WaitForSingleObject(helper_thread[i].hThread, TIMEOUT);
- if (WAIT_OBJECT_0 != dwRet)
- {
- Fail("test5.TestWaitOnOneThread: WaitForSingleObject helper thread %d"
- "LastError:(%u)\n",
- i, GetLastError());
- }
- }
-
- /* Finally, need to wake up the helper process which the test thread
- skips waking up in the last loop. */
- if (!SetEvent(helper_process[ThreadIndexOfThreadFinishEvent].hProcessFinishEvent))
- {
- Fail("test5.TestWaitOnOneThread: SetEvent %s%d failed\n",
- "LastError:(%u)\n",
- szcHelperProcessFinishEvName, helper_process[ThreadIndexOfThreadFinishEvent].pi.dwProcessId,
- GetLastError());
- }
-}
-
-/*
- * In this test case, the test thread will signal the helper
- * process 0 to exit. Since all helper threads wait on process 0,
- * all helper threads will wake up and exit, and the test thread
- * will wait for all of them to exit.
- */
-void
-TestWakeupAllThread()
-{
- DWORD dwRet;
- int i;
-
- TestCase = WakeUpAllThread;
-
- /* make sure none of the helper thread exits. */
- for (i = 0; i < MaxNumHelperProcess; i++)
- {
- dwRet = WaitForSingleObject(helper_thread[i].hThread, 0);
- if (WAIT_TIMEOUT != dwRet)
- {
- Fail("test5.TestWaitOnAllThread: helper thread %d already exited %d\n", i);
- }
- }
-
- /* Signal helper process 0 to exit. */
- if (!SetEvent(helper_process[0].hProcessFinishEvent))
- {
- Fail("test5.TestWaitOnAllThread: SetEvent %s%d failed\n",
- "LastError:(%u)\n",
- szcHelperProcessFinishEvName, helper_process[0].pi.dwProcessId,
- GetLastError());
- }
-
- /* Wait for all helper threads to exit. */
- for (i = 0; i < MaxNumHelperProcess; i++)
- {
-
- dwRet = WaitForSingleObject(helper_thread[i].hThread, TIMEOUT);
- if (WAIT_OBJECT_0 != dwRet)
- {
- Fail("test5.TestWaitOnAllThread: WaitForSingleObject failed for helper thread %d\n"
- "LastError:(%u)\n",
- i, GetLastError());
- }
- }
-
- /* Signal the rest of helper processes to exit. */
- for (i = 1; i < MaxNumHelperProcess; i++)
- {
- if (!SetEvent(helper_process[i].hProcessFinishEvent))
- {
- Fail("test5.TestWaitOnAllThread: SetEvent %s%d failed\n",
- "LastError:(%u)\n",
- szcHelperProcessFinishEvName, helper_process[i].pi.dwProcessId,
- GetLastError());
- }
- }
-}
-
-int __cdecl main(int argc, char *argv[])
-{
- DWORD dwExitCode;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return FAIL;
- }
-
- switch (argc)
- {
- case 1:
- MaxNumHelperProcess = MAX_HELPER_PROCESS;
- break;
- case 2:
- MaxNumHelperProcess = atol(argv[1]);
- break;
- default:
- Fail("Invalid number of arguments\n");
- }
-
- if (MaxNumHelperProcess < 1 ||
- MaxNumHelperProcess > MAX_HELPER_PROCESS)
- Fail("test5.main: Invalid MaxNumHelperProcess %d\n", MaxNumHelperProcess);
-
- Setup();
- ThreadIndexOfThreadFinishEvent = 3;
- TestWakeupOneThread();
- dwExitCode = Cleanup();
-
- if (PASS == dwExitCode)
- {
- Setup();
- TestWakeupAllThread();
- dwExitCode = Cleanup();
- }
-
- PAL_TerminateEx(dwExitCode);
- return dwExitCode;
-}
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.cpp b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.cpp
new file mode 100644
index 0000000000..a0216494ba
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test5/test5.cpp
@@ -0,0 +1,506 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*=============================================================
+**
+** Source: test5.c
+**
+** Purpose: Test the functionality of simultaneously waiting
+** on multiple processes. Create the same number of helper
+** processes and helper threads.
+** Helper threads wait on helper processes to finish.
+** Helper processes wait on the event signal from test
+** thread before exit.
+** The test thread can wake up one helper
+** thread at a time by signaling the corresponding helper
+** process to finish.
+** The test thread can also wake up all helper threads at once
+** by signaling help process 0 to exit.
+**
+**
+**============================================================*/
+
+#define UNICODE
+
+#include "commonconsts.h"
+
+#include <palsuite.h>
+
+/* The maximum number of objects a thread can wait is MAXIMUM_WAIT_OBJECTS.
+ The last helper thread in this test case will wait on all helper processes
+ plus a thread finish event so the maximum number of helper processes
+ can be created in this test case is (MAXIMUM_WAIT_OBJECTS-1). */
+#define MAX_HELPER_PROCESS (MAXIMUM_WAIT_OBJECTS-1)
+
+int MaxNumHelperProcess = MAX_HELPER_PROCESS;
+
+/* indicate how the test thread wake up helper thread. */
+typedef enum _TestCaseType {
+ WakeUpOneThread, /* wake up one helper thread at a time. */
+ WakeUpAllThread /* wake up all helper threads at once */
+} TestCaseType;
+
+TestCaseType TestCase = WakeUpOneThread;
+
+/* When the test thread wakes up one thread at a time,
+ ThreadIndexOfThreadFinishEvent specifies the index of the thread that
+ should be waked up using hThreadFinishEvent instead of helper process. */
+DWORD ThreadIndexOfThreadFinishEvent = 0;
+
+struct helper_process_t
+{
+ PROCESS_INFORMATION pi;
+ HANDLE hProcessReadyEvent;
+ HANDLE hProcessFinishEvent;
+} helper_process[MAX_HELPER_PROCESS];
+
+HANDLE hProcessStartEvent;
+
+struct helper_thread_t
+{
+ HANDLE hThread;
+ DWORD dwThreadId;
+ HANDLE hThreadReadyEvent;
+ HANDLE hThreadFinishEvent;
+} helper_thread[MAX_HELPER_PROCESS];
+
+/*
+ * Entry Point for helper thread.
+ */
+DWORD PALAPI WaitForProcess(LPVOID lpParameter)
+{
+ DWORD index, i;
+ DWORD dwRet;
+ HANDLE handles[MAX_HELPER_PROCESS+1];
+
+ index = (DWORD) lpParameter;
+
+ /* The helper thread 0 will wait for helper process 0, helper thread 1 will
+ wait for helper process 0 and 1, helper thread 2 will wait for helper
+ process 0, 1, and 2, and so on ..., and the last helper thread will wait
+ on all helper processes.
+ Each helper thread also waits on hThreadFinishEvent so that
+ it can exit without waiting on any process to finish. */
+
+ for (i = 0; i <= index; i++)
+ {
+ handles[i] = helper_process[i].pi.hProcess;
+ }
+
+ handles[index+1] = helper_thread[index].hThreadFinishEvent;
+
+ if(!SetEvent(helper_thread[index].hThreadReadyEvent))
+ {
+ Fail("test5.WaitProcess: SetEvent of hThreadReadyEvent failed for thread %d. "
+ "GetLastError() returned %d.\n", index,
+ GetLastError());
+ }
+
+ dwRet = WaitForMultipleObjectsEx(index+2, &handles[0], FALSE, TIMEOUT, TRUE);
+ if (WakeUpAllThread == TestCase)
+ {
+ /* If the test thread signals helper process 0 to exit, all threads will be waked up,
+ and the return value must be (WAIT_OBJECT_0+0) because the handle of helper process 0
+ is in handle[0]. */
+ if (dwRet != (WAIT_OBJECT_0+0))
+ {
+ Fail("test5.WaitForProcess: invalid return value %d for WakupAllThread from WaitForMultipleObjectsEx for thread %d\n"
+ "LastError:(%u)\n",
+ dwRet, index,
+ GetLastError());
+ }
+ }
+ else if (WakeUpOneThread == TestCase)
+ {
+ /* If the test thread wakes up one helper thread at a time,
+ the return value must be either (WAIT_OBJECT_0+index) if the helper thread
+ wakes up because the corresponding help process exits,
+ or (index+1) if the helper thread wakes up because of hThreadReadyEvent. */
+ if ((index != ThreadIndexOfThreadFinishEvent && dwRet != (WAIT_OBJECT_0+index)) ||
+ (index == ThreadIndexOfThreadFinishEvent && dwRet != (index+1)))
+ {
+ Fail("test5.WaitForProcess: invalid return value %d for WakupOneThread from WaitForMultipleObjectsEx for thread %d\n"
+ "LastError:(%u)\n",
+ dwRet, index,
+ GetLastError());
+ }
+ }
+ else
+ {
+ Fail("Unknown TestCase %d\n", TestCase);
+ }
+ return 0;
+}
+
+/*
+ * Setup the helper processes and helper threads.
+ */
+void
+Setup()
+{
+
+ STARTUPINFO si;
+ DWORD dwRet;
+ int i;
+
+ char szEventName[MAX_PATH];
+ PWCHAR uniStringHelper;
+ PWCHAR uniString;
+
+ /* Create the event to start helper process after it was created. */
+ uniString = convert(szcHelperProcessStartEvName);
+ hProcessStartEvent = CreateEvent(NULL, TRUE, FALSE, uniString);
+ free(uniString);
+ if (!hProcessStartEvent)
+ {
+ Fail("test5.Setup: CreateEvent of '%s' failed. "
+ "GetLastError() returned %d.\n", szcHelperProcessStartEvName,
+ GetLastError());
+ }
+
+ /* Create the helper processes. */
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ uniStringHelper = convert("helper");
+ for (i = 0; i < MaxNumHelperProcess; i++)
+ {
+ ZeroMemory( &helper_process[i].pi, sizeof(PROCESS_INFORMATION));
+
+ if(!CreateProcess( NULL, uniStringHelper, NULL, NULL,
+ FALSE, 0, NULL, NULL, &si, &helper_process[i].pi))
+ {
+ Fail("test5.Setup: CreateProcess failed to load executable for helper process %d. "
+ "GetLastError() returned %u.\n",
+ i, GetLastError());
+ }
+
+ /* Create the event to let helper process tell us it is ready. */
+ if (sprintf_s(szEventName, MAX_PATH-1, "%s%d",
+ szcHelperProcessReadyEvName, helper_process[i].pi.dwProcessId) < 0)
+ {
+ Fail ("test5.Setup: Insufficient event name string length for %s\n", szcHelperProcessReadyEvName);
+ }
+
+ uniString = convert(szEventName);
+
+ helper_process[i].hProcessReadyEvent = CreateEvent(NULL, FALSE, FALSE, uniString);
+ free(uniString);
+ if (!helper_process[i].hProcessReadyEvent)
+ {
+ Fail("test5.Setup: CreateEvent of '%s' failed. "
+ "GetLastError() returned %d.\n", szEventName,
+ GetLastError());
+ }
+
+ /* Create the event to tell helper process to exit. */
+ if (sprintf_s(szEventName, MAX_PATH-1, "%s%d",
+ szcHelperProcessFinishEvName, helper_process[i].pi.dwProcessId) < 0)
+ {
+ Fail ("test5.Setup: Insufficient event name string length for %s\n", szcHelperProcessFinishEvName);
+ }
+
+ uniString = convert(szEventName);
+
+ helper_process[i].hProcessFinishEvent = CreateEvent(NULL, TRUE, FALSE, uniString);
+ free(uniString);
+ if (!helper_process[i].hProcessFinishEvent)
+ {
+ Fail("test5.Setup: CreateEvent of '%s' failed. "
+ "GetLastError() returned %d.\n", szEventName,
+ GetLastError());
+ }
+
+ }
+ free(uniStringHelper);
+
+ /* Signal all helper processes to start. */
+ if (!SetEvent(hProcessStartEvent))
+ {
+ Fail("test5.Setup: SetEvent '%s' failed\n",
+ "LastError:(%u)\n",
+ szcHelperProcessStartEvName, GetLastError());
+ }
+
+ /* Wait for ready signals from all helper processes. */
+ for (i = 0; i < MaxNumHelperProcess; i++)
+ {
+ dwRet = WaitForSingleObject(helper_process[i].hProcessReadyEvent, TIMEOUT);
+ if (dwRet != WAIT_OBJECT_0)
+ {
+ Fail("test5.Setup: WaitForSingleObject %s failed for helper process %d\n"
+ "LastError:(%u)\n",
+ szcHelperProcessReadyEvName, i, GetLastError());
+ }
+ }
+
+ /* Create the same number of helper threads as helper processes. */
+ for (i = 0; i < MaxNumHelperProcess; i++)
+ {
+ /* Create the event to let helper thread tell us it is ready. */
+ helper_thread[i].hThreadReadyEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (!helper_thread[i].hThreadReadyEvent)
+ {
+ Fail("test5.Setup: CreateEvent of hThreadReadyEvent failed for thread %d\n"
+ "LastError:(%u)\n", i, GetLastError());
+ }
+
+ /* Create the event to tell helper thread to exit without waiting for helper process. */
+ helper_thread[i].hThreadFinishEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (!helper_thread[i].hThreadFinishEvent)
+ {
+ Fail("test5.Setup: CreateEvent of hThreadFinishEvent failed for thread %d\n"
+ "LastError:(%u)\n", i, GetLastError());
+ }
+
+ /* Create the helper thread. */
+ helper_thread[i].hThread = CreateThread( NULL,
+ 0,
+ (LPTHREAD_START_ROUTINE)WaitForProcess,
+ (LPVOID)i,
+ 0,
+ &helper_thread[i].dwThreadId);
+ if (NULL == helper_thread[i].hThread)
+ {
+ Fail("test5.Setup: Unable to create the helper thread %d\n"
+ "LastError:(%u)\n", i, GetLastError());
+ }
+ }
+
+ /* Wait for ready signals from all helper threads. */
+ for (i = 0; i < MaxNumHelperProcess; i++)
+ {
+ dwRet = WaitForSingleObject(helper_thread[i].hThreadReadyEvent, TIMEOUT);
+ if (dwRet != WAIT_OBJECT_0)
+ {
+ Fail("test5.Setup: WaitForSingleObject hThreadReadyEvent for thread %d\n"
+ "LastError:(%u)\n", i, GetLastError());
+ }
+ }
+}
+
+/*
+ * Cleanup the helper processes and helper threads.
+ */
+DWORD
+Cleanup()
+{
+ DWORD dwExitCode;
+ DWORD dwRet;
+ int i;
+
+ /* Wait for all helper process to finish and close their handles
+ and associated events. */
+ for (i = 0; i < MaxNumHelperProcess; i++)
+ {
+
+ /* wait for the child process to complete */
+ dwRet = WaitForSingleObject ( helper_process[i].pi.hProcess, TIMEOUT );
+ if (WAIT_OBJECT_0 != dwRet)
+ {
+ Fail("test5.Cleanup: WaitForSingleObject hThreadReadyEvent failed for thread %d\n"
+ "LastError:(%u)\n", i, GetLastError());
+ }
+
+ /* check the exit code from the process */
+ if (!GetExitCodeProcess(helper_process[i].pi.hProcess, &dwExitCode))
+ {
+ Trace( "test5.Cleanup: GetExitCodeProcess %d call failed LastError:(%u)\n",
+ i, GetLastError());
+ dwExitCode = FAIL;
+ }
+ PEDANTIC(CloseHandle, (helper_process[i].pi.hThread));
+ PEDANTIC(CloseHandle, (helper_process[i].pi.hProcess));
+ PEDANTIC(CloseHandle, (helper_process[i].hProcessReadyEvent));
+ PEDANTIC(CloseHandle, (helper_process[i].hProcessFinishEvent));
+ }
+
+ /* Close all helper threads' handles */
+ for (i = 0; i < MaxNumHelperProcess; i++)
+ {
+ PEDANTIC(CloseHandle, (helper_thread[i].hThread));
+ PEDANTIC(CloseHandle, (helper_thread[i].hThreadReadyEvent));
+ PEDANTIC(CloseHandle, (helper_thread[i].hThreadFinishEvent));
+ }
+
+ /* Close all process start event. */
+ PEDANTIC(CloseHandle, (hProcessStartEvent));
+
+ return dwExitCode;
+}
+
+/*
+ * In this test case, the test thread will signal one helper
+ * process to exit at a time starting from the last helper
+ * process and then wait for the corresponding helper thread to exit.
+ * The ThreadIndexOfThreadFinishEvent specifies the index of the thread that
+ * should be waked up using hThreadFinishEvent instead of helper process.
+ */
+void
+TestWakeupOneThread()
+{
+ DWORD dwRet;
+ int i;
+
+ TestCase = WakeUpOneThread;
+
+ if (((LONG)ThreadIndexOfThreadFinishEvent) < 0 ||
+ ThreadIndexOfThreadFinishEvent >= MAX_HELPER_PROCESS)
+ Fail("test5.TestWaitOnOneThread: Invalid ThreadIndexOfThreadFinishEvent %d\n", ThreadIndexOfThreadFinishEvent);
+
+ /* Since helper thread 0 waits on helper process 0,
+ thread 1 waits on on process 0, and 1,
+ thread 2 waits on process 0, 1, and 2, and so on ...,
+ and the last helper thread will wait on all helper processes,
+ the helper thread can be waked up one at a time by
+ waking up the help process one at a time starting from the
+ last helper process. */
+ for (i = MaxNumHelperProcess-1; i >= 0; i--)
+ {
+ /* make sure the helper thread has not exited yet. */
+ dwRet = WaitForSingleObject(helper_thread[i].hThread, 0);
+ if (WAIT_TIMEOUT != dwRet)
+ {
+ Fail("test5.TestWaitOnOneThread: helper thread %d already exited %d\n", i);
+ }
+
+ /* Decide how to wakeup the helper thread:
+ using event or using helper process. */
+ if (i == ThreadIndexOfThreadFinishEvent)
+ {
+ if (!SetEvent(helper_thread[i].hThreadFinishEvent))
+ {
+ Fail("test5.TestWaitOnOneThread: SetEvent hThreadFinishEvent failed for thread %d\n",
+ "LastError:(%u)\n", i, GetLastError());
+ }
+ }
+ else
+ {
+ if (!SetEvent(helper_process[i].hProcessFinishEvent))
+ {
+ Fail("test5.TestWaitOnOneThread: SetEvent %s%d failed for helper process %d\n",
+ "LastError:(%u)\n",
+ szcHelperProcessFinishEvName, helper_process[i].pi.dwProcessId, i,
+ GetLastError());
+ }
+ }
+
+ dwRet = WaitForSingleObject(helper_thread[i].hThread, TIMEOUT);
+ if (WAIT_OBJECT_0 != dwRet)
+ {
+ Fail("test5.TestWaitOnOneThread: WaitForSingleObject helper thread %d"
+ "LastError:(%u)\n",
+ i, GetLastError());
+ }
+ }
+
+ /* Finally, need to wake up the helper process which the test thread
+ skips waking up in the last loop. */
+ if (!SetEvent(helper_process[ThreadIndexOfThreadFinishEvent].hProcessFinishEvent))
+ {
+ Fail("test5.TestWaitOnOneThread: SetEvent %s%d failed\n",
+ "LastError:(%u)\n",
+ szcHelperProcessFinishEvName, helper_process[ThreadIndexOfThreadFinishEvent].pi.dwProcessId,
+ GetLastError());
+ }
+}
+
+/*
+ * In this test case, the test thread will signal the helper
+ * process 0 to exit. Since all helper threads wait on process 0,
+ * all helper threads will wake up and exit, and the test thread
+ * will wait for all of them to exit.
+ */
+void
+TestWakeupAllThread()
+{
+ DWORD dwRet;
+ int i;
+
+ TestCase = WakeUpAllThread;
+
+ /* make sure none of the helper thread exits. */
+ for (i = 0; i < MaxNumHelperProcess; i++)
+ {
+ dwRet = WaitForSingleObject(helper_thread[i].hThread, 0);
+ if (WAIT_TIMEOUT != dwRet)
+ {
+ Fail("test5.TestWaitOnAllThread: helper thread %d already exited %d\n", i);
+ }
+ }
+
+ /* Signal helper process 0 to exit. */
+ if (!SetEvent(helper_process[0].hProcessFinishEvent))
+ {
+ Fail("test5.TestWaitOnAllThread: SetEvent %s%d failed\n",
+ "LastError:(%u)\n",
+ szcHelperProcessFinishEvName, helper_process[0].pi.dwProcessId,
+ GetLastError());
+ }
+
+ /* Wait for all helper threads to exit. */
+ for (i = 0; i < MaxNumHelperProcess; i++)
+ {
+
+ dwRet = WaitForSingleObject(helper_thread[i].hThread, TIMEOUT);
+ if (WAIT_OBJECT_0 != dwRet)
+ {
+ Fail("test5.TestWaitOnAllThread: WaitForSingleObject failed for helper thread %d\n"
+ "LastError:(%u)\n",
+ i, GetLastError());
+ }
+ }
+
+ /* Signal the rest of helper processes to exit. */
+ for (i = 1; i < MaxNumHelperProcess; i++)
+ {
+ if (!SetEvent(helper_process[i].hProcessFinishEvent))
+ {
+ Fail("test5.TestWaitOnAllThread: SetEvent %s%d failed\n",
+ "LastError:(%u)\n",
+ szcHelperProcessFinishEvName, helper_process[i].pi.dwProcessId,
+ GetLastError());
+ }
+ }
+}
+
+int __cdecl main(int argc, char *argv[])
+{
+ DWORD dwExitCode;
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return FAIL;
+ }
+
+ switch (argc)
+ {
+ case 1:
+ MaxNumHelperProcess = MAX_HELPER_PROCESS;
+ break;
+ case 2:
+ MaxNumHelperProcess = atol(argv[1]);
+ break;
+ default:
+ Fail("Invalid number of arguments\n");
+ }
+
+ if (MaxNumHelperProcess < 1 ||
+ MaxNumHelperProcess > MAX_HELPER_PROCESS)
+ Fail("test5.main: Invalid MaxNumHelperProcess %d\n", MaxNumHelperProcess);
+
+ Setup();
+ ThreadIndexOfThreadFinishEvent = 3;
+ TestWakeupOneThread();
+ dwExitCode = Cleanup();
+
+ if (PASS == dwExitCode)
+ {
+ Setup();
+ TestWakeupAllThread();
+ dwExitCode = Cleanup();
+ }
+
+ PAL_TerminateEx(dwExitCode);
+ return dwExitCode;
+}
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/CMakeLists.txt
index ce75cadbff..01331821a8 100644
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- test6.c
+ test6.cpp
)
add_executable(paltest_waitformultipleobjectsex_test6
@@ -20,7 +20,7 @@ target_link_libraries(paltest_waitformultipleobjectsex_test6
set(HELPERSOURCES
- child6.c
+ child6.cpp
)
add_executable(paltest_waitformultipleobjectsex_test6_child
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.c
deleted file mode 100644
index 1a95815ddf..0000000000
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.c
+++ /dev/null
@@ -1,211 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: child6.c
-**
-** Purpose: Test for WaitForMultipleObjectsEx in multiple
-** scenarios - child process
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-int __cdecl main(int argc, char **argv)
-{
- int i, iRet;
- BOOL bRet;
- BOOL bNamedEvent = 0;
- BOOL bMutex = 0;
- BOOL bMutexAndNamedEvent = 0;
- BOOL bSemaphore = 0;
- DWORD dwRet;
- HANDLE hNamedEvent;
- HANDLE hMutex;
- char szTestName[256];
- WCHAR wszTestName[256] = { 0 };
- char szEventName[128] = { 0 };
- char szMutexName[128] = { 0 };
- char szSemName[128] = { 0 };
- WCHAR wszEventName[128];
- WCHAR wszMutexName[128];
- WCHAR wszSemName[128];
- DWORD iExitCode = 0;
- HANDLE hSemaphore;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return ( FAIL );
- }
-
- Trace("[child] Starting\n");
-
- for (i=1; i<argc; i++)
- {
- if (0 == strcmp(argv[i],"-event"))
- {
- bNamedEvent = 1;
- }
- else if (0 == strcmp(argv[i],"-mutex"))
- {
- bMutex = 1;
- }
- else if (0 == strcmp(argv[i],"-mutex_and_named_event"))
- {
- bMutexAndNamedEvent = 1;
- }
- else if (0 == strcmp(argv[i],"-semaphore"))
- {
- bSemaphore = 1;
- }
- else if (0 == strcmp(argv[i],"-exitcode") && i < argc-1 )
- {
- i++;
- iExitCode = atoi(argv[i]);
- Trace("[child] My exit code is %d\n", iExitCode);
- }
-
- else if ('-' != *argv[i])
- {
- strncpy(szTestName, argv[i], 256);
- szTestName[255] = 0;
- iRet = MultiByteToWideChar(CP_ACP, 0, szTestName, strlen(szTestName)+1, wszTestName, 256);
- if (0 == iRet)
- {
- Fail("Failed to convert test string\n");
- }
- }
- }
-
- _snprintf(szEventName, 128, "%s_Event", szTestName);
- szEventName[127] = 0;
- _snprintf(szMutexName, 128, "%s_Mutex", szTestName);
- szMutexName[127] = 0;
- _snprintf(szSemName, 128, "%s_Semaphore", szTestName);
- szSemName[127] = 0;
-
- iRet = MultiByteToWideChar(CP_ACP, 0, szEventName, strlen(szEventName)+1, wszEventName, 128);
- iRet &= MultiByteToWideChar(CP_ACP, 0, szMutexName, strlen(szMutexName)+1, wszMutexName, 128);
- iRet &= MultiByteToWideChar(CP_ACP, 0, szSemName, strlen(szSemName)+1, wszSemName, 128);
- if (0 == iRet)
- {
- Fail("[child] Failed to convert strings\n");
- }
-
- Trace("[child] TestName=%s Event: %S, Mutex: %S, Semaphore = %S\n",
- szTestName, wszEventName, wszMutexName, wszSemName);
-
- hNamedEvent = OpenEventW(0, FALSE, wszEventName);
- if (NULL == hNamedEvent)
- {
- Fail("[child] OpenEventW failed [szEventName=%s GetLastError()=%u]\n",
- szEventName, GetLastError());
- }
- hMutex = OpenMutexW(0, FALSE, wszMutexName);
- if (NULL == hMutex)
- {
- Fail("[child] OpenMutexW failed [GetLastError()=%u]\n",
- GetLastError());
- }
- hSemaphore = CreateSemaphoreW(NULL, 0, 256, wszSemName);
- if (NULL == hSemaphore)
- {
- Fail("[child] CreateSemaphore failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
-
- if (bMutex)
- {
- Trace("[child] Going to wait on mutex %s\n", szMutexName);
- dwRet = WaitForSingleObject(hMutex, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("[child] WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Trace("[child] Setting event %s\n", szEventName);
- bRet = SetEvent(hNamedEvent);
- if (FALSE == bRet)
- {
- Fail("[child] SetEvent failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- // mutex will be abandoned
- }
- else if (bMutexAndNamedEvent)
- {
- dwRet = WaitForSingleObject(hMutex, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("[child] WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Sleep(2000);
-
- bRet = ReleaseMutex(hMutex);
- if (FALSE == bRet)
- {
- Fail("[child] ReleaseMutex failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Sleep(1000);
-
- bRet = SetEvent(hNamedEvent);
- if (FALSE == bRet)
- {
- Fail("[child] SetEvent failed [GetLastError()=%u]\n",
- GetLastError());
- }
- }
- else if (bSemaphore)
- {
- LONG lPrevCount = 42;
-
-
- Trace("[child] Going to wait on event %s\n", szEventName);
- dwRet = WaitForSingleObject(hNamedEvent, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("[child] WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Trace("[child] Releasing semaphore %s\n", szSemName);
- bRet = ReleaseSemaphore(hSemaphore, 10, &lPrevCount);
- if (FALSE == bRet)
- {
- Fail("ReleaseMutex failed [GetLastError()=%u]\n",
- GetLastError());
- }
- if (0 != lPrevCount)
- {
- Fail("Previous count from semaphore=%d, expected 0\n", lPrevCount);
- }
- }
- else if (bNamedEvent)
- {
- Sleep(1000);
-
- bRet = SetEvent(hNamedEvent);
- if (FALSE == bRet)
- {
- Fail("[child] SetEvent failed [GetLastError()=%u]\n",
- GetLastError());
- }
- }
-
- Sleep(1000);
-
- Trace("[child] Done\n");
-
- PAL_TerminateEx(iExitCode);
- return iExitCode;
-}
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.cpp b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.cpp
new file mode 100644
index 0000000000..a53b6c9727
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/child6.cpp
@@ -0,0 +1,211 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: child6.c
+**
+** Purpose: Test for WaitForMultipleObjectsEx in multiple
+** scenarios - child process
+**
+**
+**=========================================================*/
+
+#include <palsuite.h>
+
+int __cdecl main(int argc, char **argv)
+{
+ int i, iRet;
+ BOOL bRet;
+ BOOL bNamedEvent = 0;
+ BOOL bMutex = 0;
+ BOOL bMutexAndNamedEvent = 0;
+ BOOL bSemaphore = 0;
+ DWORD dwRet;
+ HANDLE hNamedEvent;
+ HANDLE hMutex;
+ char szTestName[256];
+ WCHAR wszTestName[256] = { 0 };
+ char szEventName[128] = { 0 };
+ char szMutexName[128] = { 0 };
+ char szSemName[128] = { 0 };
+ WCHAR wszEventName[128];
+ WCHAR wszMutexName[128];
+ WCHAR wszSemName[128];
+ DWORD iExitCode = 0;
+ HANDLE hSemaphore;
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return ( FAIL );
+ }
+
+ Trace("[child] Starting\n");
+
+ for (i=1; i<argc; i++)
+ {
+ if (0 == strcmp(argv[i],"-event"))
+ {
+ bNamedEvent = 1;
+ }
+ else if (0 == strcmp(argv[i],"-mutex"))
+ {
+ bMutex = 1;
+ }
+ else if (0 == strcmp(argv[i],"-mutex_and_named_event"))
+ {
+ bMutexAndNamedEvent = 1;
+ }
+ else if (0 == strcmp(argv[i],"-semaphore"))
+ {
+ bSemaphore = 1;
+ }
+ else if (0 == strcmp(argv[i],"-exitcode") && i < argc-1 )
+ {
+ i++;
+ iExitCode = atoi(argv[i]);
+ Trace("[child] My exit code is %d\n", iExitCode);
+ }
+
+ else if ('-' != *argv[i])
+ {
+ strncpy(szTestName, argv[i], 256);
+ szTestName[255] = 0;
+ iRet = MultiByteToWideChar(CP_ACP, 0, szTestName, strlen(szTestName)+1, wszTestName, 256);
+ if (0 == iRet)
+ {
+ Fail("Failed to convert test string\n");
+ }
+ }
+ }
+
+ sprintf_s(szEventName, 128, "%s_Event", szTestName);
+ szEventName[127] = 0;
+ sprintf_s(szMutexName, 128, "%s_Mutex", szTestName);
+ szMutexName[127] = 0;
+ sprintf_s(szSemName, 128, "%s_Semaphore", szTestName);
+ szSemName[127] = 0;
+
+ iRet = MultiByteToWideChar(CP_ACP, 0, szEventName, strlen(szEventName)+1, wszEventName, 128);
+ iRet &= MultiByteToWideChar(CP_ACP, 0, szMutexName, strlen(szMutexName)+1, wszMutexName, 128);
+ iRet &= MultiByteToWideChar(CP_ACP, 0, szSemName, strlen(szSemName)+1, wszSemName, 128);
+ if (0 == iRet)
+ {
+ Fail("[child] Failed to convert strings\n");
+ }
+
+ Trace("[child] TestName=%s Event: %S, Mutex: %S, Semaphore = %S\n",
+ szTestName, wszEventName, wszMutexName, wszSemName);
+
+ hNamedEvent = OpenEventW(0, FALSE, wszEventName);
+ if (NULL == hNamedEvent)
+ {
+ Fail("[child] OpenEventW failed [szEventName=%s GetLastError()=%u]\n",
+ szEventName, GetLastError());
+ }
+ hMutex = OpenMutexW(0, FALSE, wszMutexName);
+ if (NULL == hMutex)
+ {
+ Fail("[child] OpenMutexW failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+ hSemaphore = CreateSemaphoreW(NULL, 0, 256, wszSemName);
+ if (NULL == hSemaphore)
+ {
+ Fail("[child] CreateSemaphore failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+
+ if (bMutex)
+ {
+ Trace("[child] Going to wait on mutex %s\n", szMutexName);
+ dwRet = WaitForSingleObject(hMutex, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("[child] WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Trace("[child] Setting event %s\n", szEventName);
+ bRet = SetEvent(hNamedEvent);
+ if (FALSE == bRet)
+ {
+ Fail("[child] SetEvent failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ // mutex will be abandoned
+ }
+ else if (bMutexAndNamedEvent)
+ {
+ dwRet = WaitForSingleObject(hMutex, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("[child] WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Sleep(2000);
+
+ bRet = ReleaseMutex(hMutex);
+ if (FALSE == bRet)
+ {
+ Fail("[child] ReleaseMutex failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Sleep(1000);
+
+ bRet = SetEvent(hNamedEvent);
+ if (FALSE == bRet)
+ {
+ Fail("[child] SetEvent failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+ }
+ else if (bSemaphore)
+ {
+ LONG lPrevCount = 42;
+
+
+ Trace("[child] Going to wait on event %s\n", szEventName);
+ dwRet = WaitForSingleObject(hNamedEvent, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("[child] WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Trace("[child] Releasing semaphore %s\n", szSemName);
+ bRet = ReleaseSemaphore(hSemaphore, 10, &lPrevCount);
+ if (FALSE == bRet)
+ {
+ Fail("ReleaseMutex failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+ if (0 != lPrevCount)
+ {
+ Fail("Previous count from semaphore=%d, expected 0\n", lPrevCount);
+ }
+ }
+ else if (bNamedEvent)
+ {
+ Sleep(1000);
+
+ bRet = SetEvent(hNamedEvent);
+ if (FALSE == bRet)
+ {
+ Fail("[child] SetEvent failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+ }
+
+ Sleep(1000);
+
+ Trace("[child] Done\n");
+
+ PAL_TerminateEx(iExitCode);
+ return iExitCode;
+}
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.c b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.c
deleted file mode 100644
index 399d2c3bff..0000000000
--- a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.c
+++ /dev/null
@@ -1,709 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: test6.c
-**
-** Purpose: Test for WaitForMultipleObjectsEx in multiple
-** scenarios
-**
-**
-**=========================================================*/
-
-#include <palsuite.h>
-
-#define MAX_COUNT 10000
-#define MAX_THREADS 256
-
-BOOL g_bMutex = 0;
-BOOL g_bEvent = 0;
-BOOL g_bNamedEvent = 0;
-BOOL g_bSemaphore = 0;
-BOOL g_bProcess = 0;
-BOOL g_bLocalWaitAll = 0;
-BOOL g_bRemoteWaitAll = 0;
-BOOL g_bRandom = 0;
-
-int iCount = 1;
-int iThreads = 1;
-HANDLE hThreads[MAX_THREADS];
-
-#ifndef MIN
-#define MIN(a,b) (((a)<(b)) ? (a) : (b))
-#endif
-
-DWORD PALAPI EventTestThread(PVOID pArg)
-{
- BOOL bRet;
- DWORD dwRet;
- HANDLE hEvent[2];
- HANDLE (*prgHandles)[] = (HANDLE (*)[])pArg;
-
- Trace("[EventTestThread] Starting\n");
-
- bRet = DuplicateHandle(GetCurrentProcess(), (*prgHandles)[0], GetCurrentProcess(),
- &hEvent[0], 0, FALSE, DUPLICATE_SAME_ACCESS);
- bRet &= DuplicateHandle(GetCurrentProcess(), (*prgHandles)[1], GetCurrentProcess(),
- &hEvent[1], 0, FALSE, DUPLICATE_SAME_ACCESS);
- if (FALSE == bRet)
- {
- Fail("[EventTestThread] Failed to duplicate handles\n");
- }
-
- Sleep(1000);
- bRet = SetEvent(hEvent[1]);
- if (FALSE == bRet)
- {
- Fail("SetEvent failed\n");
- Fail("[EventTestThread] SetEvent failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- dwRet = WaitForSingleObject(hEvent[1], INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("[EventTestThread] WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Sleep(1000);
- bRet = SetEvent(hEvent[0]);
- if (FALSE == bRet)
- {
- Fail("[EventTestThread] SetEvent failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Sleep(1000);
- bRet = SetEvent(hEvent[1]);
- if (FALSE == bRet)
- {
- Fail("[EventTestThread] SetEvent failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- CloseHandle(hEvent[0]);
- CloseHandle(hEvent[1]);
-
- Trace("[EventTestThread] Done\n");
- return 0;
-}
-
-DWORD PALAPI MutexTestThread(PVOID pArg)
-{
- BOOL bRet;
- DWORD dwRet;
- HANDLE hMutex;
-
- Trace("[MutexTestThread] Starting\n");
-
- bRet = DuplicateHandle(GetCurrentProcess(), (HANDLE)pArg, GetCurrentProcess(), &hMutex,
- 0, FALSE, DUPLICATE_SAME_ACCESS);
- if (FALSE == bRet)
- {
- Fail("[EventTestThread] DuplicateHandle failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- dwRet = WaitForSingleObject(hMutex, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("[EventTestThread] WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Sleep(1000);
- CloseHandle(hMutex);
-
- Trace("[MutexTestThread] Done\n");
-
- return 0;
-}
-
-DWORD PALAPI TestThread(PVOID pArg)
-{
- BOOL bRet;
- DWORD dwRet;
- PROCESS_INFORMATION pi;
- STARTUPINFO si;
- HANDLE hNamedEvent;
- HANDLE hEvent[2] = { 0, 0 };
- HANDLE hMutex = 0;
- HANDLE hSemaphore = 0;
- HANDLE hObjs[2];
- DWORD dwThreadNum;
- DWORD dwSlaveThreadTid = 0;
- HANDLE hThread;
- int i, iCnt, iRet;
- char szTestName[128];
- char szCmd[128];
- char szEventName[128] = { 0 };
- char szMutexName[128] = { 0 };
- char szSemName[128] = { 0 };
- WCHAR wszEventName[128] = { 0 };
- WCHAR wszMutexName[128] = { 0 };
- WCHAR wszSemName[128] = { 0 };
- BOOL bMutex = g_bMutex;
- BOOL bEvent = g_bEvent;
- BOOL bNamedEvent = g_bNamedEvent;
- BOOL bSemaphore = g_bSemaphore;
- BOOL bProcess = g_bProcess;
- BOOL bLocalWaitAll = g_bLocalWaitAll;
- BOOL bRemoteWaitAll = g_bRemoteWaitAll;
- int iDesiredExitCode;
-
- dwThreadNum = (DWORD)pArg;
-
- _snprintf (szTestName, 128, "Test6_%u", dwThreadNum);
- szTestName[127] = 0;
-
- _snprintf(szEventName, 128, "%s_Event", szTestName);
- szEventName[127] = 0;
- _snprintf(szMutexName, 128, "%s_Mutex", szTestName);
- szMutexName[127] = 0;
- _snprintf(szSemName, 128, "%s_Semaphore", szTestName);
- szSemName[127] = 0;
-
- iRet = MultiByteToWideChar(CP_ACP, 0, szEventName, strlen(szEventName)+1, wszEventName, 128);
- iRet &= MultiByteToWideChar(CP_ACP, 0, szMutexName, strlen(szMutexName)+1, wszMutexName, 128);
- iRet &= MultiByteToWideChar(CP_ACP, 0, szSemName, strlen(szSemName)+1, wszSemName, 128);
-
- if (0 == iRet)
- {
- Fail("[TestThread] Failed to convert strings\n");
- }
-
- Trace("[TestThread] TestName=%s Event: %S, Mutex: %S, Semaphore = %S\n",
- szTestName, wszEventName, wszMutexName, wszSemName);
-
- hEvent[0] = CreateEventA(NULL, FALSE, FALSE, NULL);
- hEvent[1] = CreateEventA(NULL, FALSE, FALSE, NULL);
-
- hNamedEvent = CreateEventW(NULL, FALSE, FALSE, wszEventName);
- hMutex = CreateMutexW(NULL, FALSE, wszMutexName);
- hSemaphore = CreateSemaphoreW(NULL, 0, 256, wszSemName);
-
- if (NULL == hEvent[0] || NULL == hEvent[1] || NULL == hMutex ||
- NULL == hNamedEvent || NULL == hSemaphore)
- {
- Fail("[TestThread] Failed to create objects "
- "[hNamedEvent=%p hMutex=%p hSemaphore=%p]\n",
- (VOID*)hNamedEvent, (VOID*)hMutex, (VOID*)hSemaphore);
- }
-
- for (iCnt=0; iCnt<iCount; iCnt++)
- {
- if (g_bRandom)
- {
- int iRnd;
-
- bMutex = 0;
- bEvent = 0;
- bNamedEvent = 0;
- bSemaphore = 0;
- bProcess = 0;
- bLocalWaitAll = 0;
- bRemoteWaitAll = 0;
-
- iRnd = rand() % 7;
- switch(iRnd)
- {
- case 0:
- bMutex = 1;
- break;
- case 1:
- bEvent = 1;
- break;
- case 2:
- bNamedEvent = 1;
- break;
- case 3:
- bSemaphore = 1;
- break;
- case 4:
- bProcess = 1;
- break;
- case 5:
- bLocalWaitAll = 1;
- break;
- case 6:
- bRemoteWaitAll = 1;
- break;
- }
- }
-
- if (bEvent)
- {
- Trace("======================================================================\n");
- Trace("Local unnamed event test\n");
- Trace("----------------------------------------\n");
- hThread = CreateThread(NULL, 0, EventTestThread, (PVOID)hEvent, 0, &dwSlaveThreadTid);
- if (NULL == hThread)
- {
- Fail("Failed to create thread\n");
- }
-
- hObjs[0] = hEvent[0];
- dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed\n");
- }
-
- hObjs[0] = hThread;
- dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed\n");
- }
-
- CloseHandle(hThread);
- Trace("Local unnamed event test done \n");
- Trace("======================================================================\n");
- }
-
- if (bMutex)
- {
- Trace("======================================================================\n");
- Trace("Mutex with remote thread awakening test\n");
- Trace("----------------------------------------\n");
-
- hThread = CreateThread(NULL, 0, MutexTestThread, (PVOID)hMutex, 0, &dwSlaveThreadTid);
- if (NULL == hThread)
- {
- Fail("Failed to create thread\n");
- }
-
- Sleep(1000);
-
- hObjs[0] = hMutex;
-
- for (i=0;i<10;i++)
- {
- dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [dwRet=%x GetLastError()=%d\n",
- dwRet, GetLastError());
- }
- }
-
- hObjs[0] = hThread;
- dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- for (i=0;i<10;i++)
- {
- bRet = ReleaseMutex(hMutex);
- if (FALSE == bRet)
- {
- Fail("ReleaseMutex failed [GetLastError()=%u]\n",
- GetLastError());
- }
- }
-
- CloseHandle(hThread);
- Trace("Mutex with remote thread awakening test done\n");
- Trace("======================================================================\n");
- }
-
- if (bNamedEvent)
- {
- Trace("======================================================================\n");
- Trace("Named event with remote thread awakening test\n");
- Trace("----------------------------------------\n");
-
- ZeroMemory ( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory ( &pi, sizeof(pi) );
-
- _snprintf (szCmd, 128, "child6 -event %s", szTestName);
- szCmd[127] = 0;
-
- bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
- if (FALSE == bRet)
- {
- Fail("CreateProcess failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- hObjs[0] = pi.hProcess;
- hObjs[1] = hNamedEvent;
-
- dwRet = WaitForMultipleObjects(2, hObjs, FALSE, INFINITE);
- if (1 != dwRet)
- {
- Fail("WaitForMultipleObjects failed [dwRet=%u GetLastError()=%u]\n",
- dwRet, GetLastError());
- }
-
- dwRet = WaitForSingleObject(pi.hProcess, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
- Trace("Named event with remote thread awakening test done\n");
- Trace("======================================================================\n");
- }
-
- if (bSemaphore)
- {
- Trace("======================================================================\n");
- Trace("Semaphore with remote thread awakening test\n");
- Trace("----------------------------------------\n");
-
- ZeroMemory ( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory ( &pi, sizeof(pi) );
-
- _snprintf (szCmd, 128, "child6 -semaphore %s", szTestName);
- szCmd[127] = 0;
-
- bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE,
- 0, NULL, NULL, &si, &pi);
- if (FALSE == bRet)
- {
- Fail("CreateProcessA failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Trace("Setting event %s\n", szEventName);
- bRet = SetEvent(hNamedEvent);
- if (FALSE == bRet)
- {
- Fail("[child] SetEvent failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Trace("Going to wait on semaphore %s\n", szSemName);
-
-
- hObjs[0] = pi.hProcess;
- hObjs[0] = hEvent[0];
- hObjs[1] = hSemaphore;
- for (i=0;i<10;i++)
- {
- dwRet = WaitForMultipleObjects(2, hObjs, FALSE, INFINITE);
- if (1 != dwRet)
- {
- Trace("WaitForMultipleObjects failed [tid=%u dwRet=%u GetLastError()=%u]\n",
- GetCurrentThreadId(), dwRet, GetLastError());
- DebugBreak();
- }
- }
-
- dwRet = WaitForSingleObject(pi.hProcess, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
- Trace("Semaphore with remote thread awakening test done\n");
- Trace("======================================================================\n");
- }
-
- if (bProcess)
- {
- DWORD dwExitCode;
-
- Trace("======================================================================\n");
- Trace("Process wait test\n");
- Trace("----------------------------------------\n");
-
- iDesiredExitCode = rand() % 0xFF;
-
- ZeroMemory ( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory ( &pi, sizeof(pi) );
-
- _snprintf (szCmd, 128, "child6 -mutex %s -exitcode %d", szTestName, iDesiredExitCode);
- szCmd[127] = 0;
-
- bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
- if (FALSE == bRet)
- {
- Fail("CreateProcess failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Trace("Going to wait on event %s\n", szEventName);
- dwRet = WaitForSingleObject(hNamedEvent, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- hObjs[0] = hEvent[0]; // dummy, this is a local event
- hObjs[1] = hMutex;
-
- dwRet = WaitForMultipleObjects(2, hObjs, FALSE, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
- if (1 == dwRet || (1 + WAIT_ABANDONED_0) == dwRet)
- {
- bRet = ReleaseMutex(hMutex);
- if (FALSE == bRet)
- {
- Fail("ReleaseMutex failed [GetLastError()=%u]\n",
- GetLastError());
- }
- }
-
- dwRet = WaitForSingleObject(pi.hProcess, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- if (!GetExitCodeProcess(pi.hProcess, &dwExitCode))
- {
- Trace("GetExitCodeProcess call failed LastError:(%u)\n",
- GetLastError());
- dwExitCode = FAIL;
- }
-
- if (iDesiredExitCode != dwExitCode)
- {
- Fail("Wrong return code: %u [%d]\n", dwExitCode, iDesiredExitCode);
- }
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
- Trace("Process wait test done\n");
- Trace("======================================================================\n");
- }
-
- if (bLocalWaitAll)
- {
- Trace("======================================================================\n");
- Trace("WaitAll with local thread awakening test\n");
- Trace("----------------------------------------\n");
-
- hThread = CreateThread(NULL, 0, EventTestThread, (PVOID)hEvent, 0, &dwSlaveThreadTid);
- if (NULL == hThread)
- {
- Fail("CreateThread failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- dwRet = WaitForMultipleObjects(2, hEvent, TRUE, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- hObjs[0] = hThread;
- dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- CloseHandle(hThread);
- Trace("WaitAll with local thread awakening test done\n");
- Trace("======================================================================\n");
- }
-
- if (bRemoteWaitAll)
- {
- Trace("======================================================================\n");
- Trace("WaitAll with remote thread awakening test\n");
- Trace("----------------------------------------\n");
-
- ZeroMemory ( &si, sizeof(si) );
- si.cb = sizeof(si);
- ZeroMemory ( &pi, sizeof(pi) );
-
- _snprintf (szCmd, 128, "child6 -mutex_and_named_event %s", szTestName);
- szCmd[127] = 0;
-
- bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE,
- 0, NULL, NULL, &si, &pi);
- if (FALSE == bRet)
- {
- Fail("CreateProcess failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- Sleep(1000);
-
- hObjs[0] = hMutex;
- hObjs[1] = hNamedEvent;
-
- dwRet = WaitForMultipleObjects(2, hObjs, TRUE, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- bRet = ReleaseMutex(hMutex);
- if (FALSE == bRet)
- {
- Fail("ReleaseMutex failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- dwRet = WaitForSingleObject(pi.hProcess, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
- GetLastError());
- }
-
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
- Trace("WaitAll with remote thread awakening test done\n");
- Trace("======================================================================\n");
- }
- }
-
- return 0;
-}
-
-int __cdecl main(int argc, char **argv)
-{
- DWORD dwRet;
- DWORD dwSlaveThreadTid = 0;
- int i, iCnt;
-
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return ( FAIL );
- }
-
- srand(time(NULL) * GetCurrentProcessId());
-
- if (argc == 1)
- {
- g_bMutex = 1;
- g_bEvent = 1;
- g_bNamedEvent = 1;
- g_bSemaphore = 1;
- g_bProcess = 1;
- g_bLocalWaitAll = 1;
- g_bRemoteWaitAll = 1;
- }
- else
- {
- for (i=1;i<argc;i++)
- {
- if (0 == strcmp(argv[i], "-mutex"))
- {
- g_bMutex = 1;
- }
- else if (0 == strcmp(argv[i], "-event"))
- {
- g_bEvent = 1;
- }
- else if (0 == strcmp(argv[i], "-namedevent"))
- {
- g_bNamedEvent = 1;
- }
- else if (0 == strcmp(argv[i], "-semaphore"))
- {
- g_bSemaphore = 1;
- }
- else if (0 == strcmp(argv[i], "-process"))
- {
- g_bProcess = 1;
- }
- else if (0 == strcmp(argv[i], "-localwaitall"))
- {
- g_bLocalWaitAll = 1;
- }
- else if (0 == strcmp(argv[i], "-remotewaitall"))
- {
- g_bRemoteWaitAll = 1;
- }
- else if (0 == strcmp(argv[i], "-all"))
- {
- g_bMutex = 1;
- g_bEvent = 1;
- g_bNamedEvent = 1;
- g_bSemaphore = 1;
- g_bProcess = 1;
- g_bLocalWaitAll = 1;
- g_bRemoteWaitAll = 1;
- }
- else if (0 == strcmp(argv[i], "-random"))
- {
- g_bRandom = 1;
- }
- else if ((0 == strcmp(argv[i], "-count")) && (argc > i+1))
- {
- i++;
- iCnt = atoi(argv[i]);
- if (iCnt > 0 && iCnt < MAX_COUNT)
- {
- iCount = iCnt;
- }
- }
- else if ((0 == strcmp(argv[i], "-threads")) && (argc > i+1))
- {
- i++;
- iCnt = atoi(argv[i]);
- if (iCnt > 0 && iCnt <= MAX_THREADS)
- {
- iThreads = iCnt;
- }
- }
- else
- {
- Trace("Unknown option %s ignored\n", argv[i]);
- }
- }
- }
-
-
- iCnt = 0;
- for (i=0;i<iThreads;i++)
- {
- hThreads[iCnt] = CreateThread(NULL, 0, TestThread, (VOID*)iCnt, 0, &dwSlaveThreadTid);
- if (NULL == hThreads[iCnt])
- {
- Trace("Failed to create thread\n");
- }
- else
- {
- iCnt++;
- }
- }
-
- if (0 == iCnt)
- {
- Fail("Can't create any thread\n");
- }
-
- for (i=0; i<iCnt; i+=64)
- {
- dwRet = WaitForMultipleObjects(MIN(64, iCnt-i), &hThreads[i], TRUE, INFINITE);
- if (WAIT_FAILED == dwRet)
- {
- Fail("WaitForMultipleObjects failed [dwRet=%u GetLastError()=%u iCnt=%d i=%d]\n",
- dwRet, GetLastError(), iCnt, i);
- }
- }
-
-
- for (i=0; i<iCnt; i++)
- {
- CloseHandle(hThreads[i]);
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.cpp b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.cpp
new file mode 100644
index 0000000000..d5e3137899
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/WaitForMultipleObjectsEx/test6/test6.cpp
@@ -0,0 +1,709 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: test6.c
+**
+** Purpose: Test for WaitForMultipleObjectsEx in multiple
+** scenarios
+**
+**
+**=========================================================*/
+
+#include <palsuite.h>
+
+#define MAX_COUNT 10000
+#define MAX_THREADS 256
+
+BOOL g_bMutex = 0;
+BOOL g_bEvent = 0;
+BOOL g_bNamedEvent = 0;
+BOOL g_bSemaphore = 0;
+BOOL g_bProcess = 0;
+BOOL g_bLocalWaitAll = 0;
+BOOL g_bRemoteWaitAll = 0;
+BOOL g_bRandom = 0;
+
+int iCount = 1;
+int iThreads = 1;
+HANDLE hThreads[MAX_THREADS];
+
+#ifndef MIN
+#define MIN(a,b) (((a)<(b)) ? (a) : (b))
+#endif
+
+DWORD PALAPI EventTestThread(PVOID pArg)
+{
+ BOOL bRet;
+ DWORD dwRet;
+ HANDLE hEvent[2];
+ HANDLE (*prgHandles)[] = (HANDLE (*)[])pArg;
+
+ Trace("[EventTestThread] Starting\n");
+
+ bRet = DuplicateHandle(GetCurrentProcess(), (*prgHandles)[0], GetCurrentProcess(),
+ &hEvent[0], 0, FALSE, DUPLICATE_SAME_ACCESS);
+ bRet &= DuplicateHandle(GetCurrentProcess(), (*prgHandles)[1], GetCurrentProcess(),
+ &hEvent[1], 0, FALSE, DUPLICATE_SAME_ACCESS);
+ if (FALSE == bRet)
+ {
+ Fail("[EventTestThread] Failed to duplicate handles\n");
+ }
+
+ Sleep(1000);
+ bRet = SetEvent(hEvent[1]);
+ if (FALSE == bRet)
+ {
+ Fail("SetEvent failed\n");
+ Fail("[EventTestThread] SetEvent failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ dwRet = WaitForSingleObject(hEvent[1], INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("[EventTestThread] WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Sleep(1000);
+ bRet = SetEvent(hEvent[0]);
+ if (FALSE == bRet)
+ {
+ Fail("[EventTestThread] SetEvent failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Sleep(1000);
+ bRet = SetEvent(hEvent[1]);
+ if (FALSE == bRet)
+ {
+ Fail("[EventTestThread] SetEvent failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ CloseHandle(hEvent[0]);
+ CloseHandle(hEvent[1]);
+
+ Trace("[EventTestThread] Done\n");
+ return 0;
+}
+
+DWORD PALAPI MutexTestThread(PVOID pArg)
+{
+ BOOL bRet;
+ DWORD dwRet;
+ HANDLE hMutex;
+
+ Trace("[MutexTestThread] Starting\n");
+
+ bRet = DuplicateHandle(GetCurrentProcess(), (HANDLE)pArg, GetCurrentProcess(), &hMutex,
+ 0, FALSE, DUPLICATE_SAME_ACCESS);
+ if (FALSE == bRet)
+ {
+ Fail("[EventTestThread] DuplicateHandle failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ dwRet = WaitForSingleObject(hMutex, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("[EventTestThread] WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Sleep(1000);
+ CloseHandle(hMutex);
+
+ Trace("[MutexTestThread] Done\n");
+
+ return 0;
+}
+
+DWORD PALAPI TestThread(PVOID pArg)
+{
+ BOOL bRet;
+ DWORD dwRet;
+ PROCESS_INFORMATION pi;
+ STARTUPINFO si;
+ HANDLE hNamedEvent;
+ HANDLE hEvent[2] = { 0, 0 };
+ HANDLE hMutex = 0;
+ HANDLE hSemaphore = 0;
+ HANDLE hObjs[2];
+ DWORD dwThreadNum;
+ DWORD dwSlaveThreadTid = 0;
+ HANDLE hThread;
+ int i, iCnt, iRet;
+ char szTestName[128];
+ char szCmd[128];
+ char szEventName[128] = { 0 };
+ char szMutexName[128] = { 0 };
+ char szSemName[128] = { 0 };
+ WCHAR wszEventName[128] = { 0 };
+ WCHAR wszMutexName[128] = { 0 };
+ WCHAR wszSemName[128] = { 0 };
+ BOOL bMutex = g_bMutex;
+ BOOL bEvent = g_bEvent;
+ BOOL bNamedEvent = g_bNamedEvent;
+ BOOL bSemaphore = g_bSemaphore;
+ BOOL bProcess = g_bProcess;
+ BOOL bLocalWaitAll = g_bLocalWaitAll;
+ BOOL bRemoteWaitAll = g_bRemoteWaitAll;
+ int iDesiredExitCode;
+
+ dwThreadNum = (DWORD)pArg;
+
+ sprintf_s (szTestName, 128, "Test6_%u", dwThreadNum);
+ szTestName[127] = 0;
+
+ sprintf_s(szEventName, 128, "%s_Event", szTestName);
+ szEventName[127] = 0;
+ sprintf_s(szMutexName, 128, "%s_Mutex", szTestName);
+ szMutexName[127] = 0;
+ sprintf_s(szSemName, 128, "%s_Semaphore", szTestName);
+ szSemName[127] = 0;
+
+ iRet = MultiByteToWideChar(CP_ACP, 0, szEventName, strlen(szEventName)+1, wszEventName, 128);
+ iRet &= MultiByteToWideChar(CP_ACP, 0, szMutexName, strlen(szMutexName)+1, wszMutexName, 128);
+ iRet &= MultiByteToWideChar(CP_ACP, 0, szSemName, strlen(szSemName)+1, wszSemName, 128);
+
+ if (0 == iRet)
+ {
+ Fail("[TestThread] Failed to convert strings\n");
+ }
+
+ Trace("[TestThread] TestName=%s Event: %S, Mutex: %S, Semaphore = %S\n",
+ szTestName, wszEventName, wszMutexName, wszSemName);
+
+ hEvent[0] = CreateEventA(NULL, FALSE, FALSE, NULL);
+ hEvent[1] = CreateEventA(NULL, FALSE, FALSE, NULL);
+
+ hNamedEvent = CreateEventW(NULL, FALSE, FALSE, wszEventName);
+ hMutex = CreateMutexW(NULL, FALSE, wszMutexName);
+ hSemaphore = CreateSemaphoreW(NULL, 0, 256, wszSemName);
+
+ if (NULL == hEvent[0] || NULL == hEvent[1] || NULL == hMutex ||
+ NULL == hNamedEvent || NULL == hSemaphore)
+ {
+ Fail("[TestThread] Failed to create objects "
+ "[hNamedEvent=%p hMutex=%p hSemaphore=%p]\n",
+ (VOID*)hNamedEvent, (VOID*)hMutex, (VOID*)hSemaphore);
+ }
+
+ for (iCnt=0; iCnt<iCount; iCnt++)
+ {
+ if (g_bRandom)
+ {
+ int iRnd;
+
+ bMutex = 0;
+ bEvent = 0;
+ bNamedEvent = 0;
+ bSemaphore = 0;
+ bProcess = 0;
+ bLocalWaitAll = 0;
+ bRemoteWaitAll = 0;
+
+ iRnd = rand() % 7;
+ switch(iRnd)
+ {
+ case 0:
+ bMutex = 1;
+ break;
+ case 1:
+ bEvent = 1;
+ break;
+ case 2:
+ bNamedEvent = 1;
+ break;
+ case 3:
+ bSemaphore = 1;
+ break;
+ case 4:
+ bProcess = 1;
+ break;
+ case 5:
+ bLocalWaitAll = 1;
+ break;
+ case 6:
+ bRemoteWaitAll = 1;
+ break;
+ }
+ }
+
+ if (bEvent)
+ {
+ Trace("======================================================================\n");
+ Trace("Local unnamed event test\n");
+ Trace("----------------------------------------\n");
+ hThread = CreateThread(NULL, 0, EventTestThread, (PVOID)hEvent, 0, &dwSlaveThreadTid);
+ if (NULL == hThread)
+ {
+ Fail("Failed to create thread\n");
+ }
+
+ hObjs[0] = hEvent[0];
+ dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed\n");
+ }
+
+ hObjs[0] = hThread;
+ dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed\n");
+ }
+
+ CloseHandle(hThread);
+ Trace("Local unnamed event test done \n");
+ Trace("======================================================================\n");
+ }
+
+ if (bMutex)
+ {
+ Trace("======================================================================\n");
+ Trace("Mutex with remote thread awakening test\n");
+ Trace("----------------------------------------\n");
+
+ hThread = CreateThread(NULL, 0, MutexTestThread, (PVOID)hMutex, 0, &dwSlaveThreadTid);
+ if (NULL == hThread)
+ {
+ Fail("Failed to create thread\n");
+ }
+
+ Sleep(1000);
+
+ hObjs[0] = hMutex;
+
+ for (i=0;i<10;i++)
+ {
+ dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [dwRet=%x GetLastError()=%d\n",
+ dwRet, GetLastError());
+ }
+ }
+
+ hObjs[0] = hThread;
+ dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ for (i=0;i<10;i++)
+ {
+ bRet = ReleaseMutex(hMutex);
+ if (FALSE == bRet)
+ {
+ Fail("ReleaseMutex failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+ }
+
+ CloseHandle(hThread);
+ Trace("Mutex with remote thread awakening test done\n");
+ Trace("======================================================================\n");
+ }
+
+ if (bNamedEvent)
+ {
+ Trace("======================================================================\n");
+ Trace("Named event with remote thread awakening test\n");
+ Trace("----------------------------------------\n");
+
+ ZeroMemory ( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ ZeroMemory ( &pi, sizeof(pi) );
+
+ sprintf_s (szCmd, 128, "child6 -event %s", szTestName);
+ szCmd[127] = 0;
+
+ bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
+ if (FALSE == bRet)
+ {
+ Fail("CreateProcess failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ hObjs[0] = pi.hProcess;
+ hObjs[1] = hNamedEvent;
+
+ dwRet = WaitForMultipleObjects(2, hObjs, FALSE, INFINITE);
+ if (1 != dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [dwRet=%u GetLastError()=%u]\n",
+ dwRet, GetLastError());
+ }
+
+ dwRet = WaitForSingleObject(pi.hProcess, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+ Trace("Named event with remote thread awakening test done\n");
+ Trace("======================================================================\n");
+ }
+
+ if (bSemaphore)
+ {
+ Trace("======================================================================\n");
+ Trace("Semaphore with remote thread awakening test\n");
+ Trace("----------------------------------------\n");
+
+ ZeroMemory ( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ ZeroMemory ( &pi, sizeof(pi) );
+
+ sprintf_s (szCmd, 128, "child6 -semaphore %s", szTestName);
+ szCmd[127] = 0;
+
+ bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE,
+ 0, NULL, NULL, &si, &pi);
+ if (FALSE == bRet)
+ {
+ Fail("CreateProcessA failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Trace("Setting event %s\n", szEventName);
+ bRet = SetEvent(hNamedEvent);
+ if (FALSE == bRet)
+ {
+ Fail("[child] SetEvent failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Trace("Going to wait on semaphore %s\n", szSemName);
+
+
+ hObjs[0] = pi.hProcess;
+ hObjs[0] = hEvent[0];
+ hObjs[1] = hSemaphore;
+ for (i=0;i<10;i++)
+ {
+ dwRet = WaitForMultipleObjects(2, hObjs, FALSE, INFINITE);
+ if (1 != dwRet)
+ {
+ Trace("WaitForMultipleObjects failed [tid=%u dwRet=%u GetLastError()=%u]\n",
+ GetCurrentThreadId(), dwRet, GetLastError());
+ DebugBreak();
+ }
+ }
+
+ dwRet = WaitForSingleObject(pi.hProcess, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+ Trace("Semaphore with remote thread awakening test done\n");
+ Trace("======================================================================\n");
+ }
+
+ if (bProcess)
+ {
+ DWORD dwExitCode;
+
+ Trace("======================================================================\n");
+ Trace("Process wait test\n");
+ Trace("----------------------------------------\n");
+
+ iDesiredExitCode = rand() % 0xFF;
+
+ ZeroMemory ( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ ZeroMemory ( &pi, sizeof(pi) );
+
+ sprintf_s (szCmd, 128, "child6 -mutex %s -exitcode %d", szTestName, iDesiredExitCode);
+ szCmd[127] = 0;
+
+ bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
+ if (FALSE == bRet)
+ {
+ Fail("CreateProcess failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Trace("Going to wait on event %s\n", szEventName);
+ dwRet = WaitForSingleObject(hNamedEvent, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ hObjs[0] = hEvent[0]; // dummy, this is a local event
+ hObjs[1] = hMutex;
+
+ dwRet = WaitForMultipleObjects(2, hObjs, FALSE, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+ if (1 == dwRet || (1 + WAIT_ABANDONED_0) == dwRet)
+ {
+ bRet = ReleaseMutex(hMutex);
+ if (FALSE == bRet)
+ {
+ Fail("ReleaseMutex failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+ }
+
+ dwRet = WaitForSingleObject(pi.hProcess, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ if (!GetExitCodeProcess(pi.hProcess, &dwExitCode))
+ {
+ Trace("GetExitCodeProcess call failed LastError:(%u)\n",
+ GetLastError());
+ dwExitCode = FAIL;
+ }
+
+ if (iDesiredExitCode != dwExitCode)
+ {
+ Fail("Wrong return code: %u [%d]\n", dwExitCode, iDesiredExitCode);
+ }
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ Trace("Process wait test done\n");
+ Trace("======================================================================\n");
+ }
+
+ if (bLocalWaitAll)
+ {
+ Trace("======================================================================\n");
+ Trace("WaitAll with local thread awakening test\n");
+ Trace("----------------------------------------\n");
+
+ hThread = CreateThread(NULL, 0, EventTestThread, (PVOID)hEvent, 0, &dwSlaveThreadTid);
+ if (NULL == hThread)
+ {
+ Fail("CreateThread failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ dwRet = WaitForMultipleObjects(2, hEvent, TRUE, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ hObjs[0] = hThread;
+ dwRet = WaitForMultipleObjects(1, hObjs, FALSE, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ CloseHandle(hThread);
+ Trace("WaitAll with local thread awakening test done\n");
+ Trace("======================================================================\n");
+ }
+
+ if (bRemoteWaitAll)
+ {
+ Trace("======================================================================\n");
+ Trace("WaitAll with remote thread awakening test\n");
+ Trace("----------------------------------------\n");
+
+ ZeroMemory ( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ ZeroMemory ( &pi, sizeof(pi) );
+
+ sprintf_s (szCmd, 128, "child6 -mutex_and_named_event %s", szTestName);
+ szCmd[127] = 0;
+
+ bRet = CreateProcessA(NULL, szCmd, NULL, NULL, FALSE,
+ 0, NULL, NULL, &si, &pi);
+ if (FALSE == bRet)
+ {
+ Fail("CreateProcess failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ Sleep(1000);
+
+ hObjs[0] = hMutex;
+ hObjs[1] = hNamedEvent;
+
+ dwRet = WaitForMultipleObjects(2, hObjs, TRUE, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ bRet = ReleaseMutex(hMutex);
+ if (FALSE == bRet)
+ {
+ Fail("ReleaseMutex failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ dwRet = WaitForSingleObject(pi.hProcess, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [GetLastError()=%u]\n",
+ GetLastError());
+ }
+
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ Trace("WaitAll with remote thread awakening test done\n");
+ Trace("======================================================================\n");
+ }
+ }
+
+ return 0;
+}
+
+int __cdecl main(int argc, char **argv)
+{
+ DWORD dwRet;
+ DWORD dwSlaveThreadTid = 0;
+ int i, iCnt;
+
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return ( FAIL );
+ }
+
+ srand(time(NULL) * GetCurrentProcessId());
+
+ if (argc == 1)
+ {
+ g_bMutex = 1;
+ g_bEvent = 1;
+ g_bNamedEvent = 1;
+ g_bSemaphore = 1;
+ g_bProcess = 1;
+ g_bLocalWaitAll = 1;
+ g_bRemoteWaitAll = 1;
+ }
+ else
+ {
+ for (i=1;i<argc;i++)
+ {
+ if (0 == strcmp(argv[i], "-mutex"))
+ {
+ g_bMutex = 1;
+ }
+ else if (0 == strcmp(argv[i], "-event"))
+ {
+ g_bEvent = 1;
+ }
+ else if (0 == strcmp(argv[i], "-namedevent"))
+ {
+ g_bNamedEvent = 1;
+ }
+ else if (0 == strcmp(argv[i], "-semaphore"))
+ {
+ g_bSemaphore = 1;
+ }
+ else if (0 == strcmp(argv[i], "-process"))
+ {
+ g_bProcess = 1;
+ }
+ else if (0 == strcmp(argv[i], "-localwaitall"))
+ {
+ g_bLocalWaitAll = 1;
+ }
+ else if (0 == strcmp(argv[i], "-remotewaitall"))
+ {
+ g_bRemoteWaitAll = 1;
+ }
+ else if (0 == strcmp(argv[i], "-all"))
+ {
+ g_bMutex = 1;
+ g_bEvent = 1;
+ g_bNamedEvent = 1;
+ g_bSemaphore = 1;
+ g_bProcess = 1;
+ g_bLocalWaitAll = 1;
+ g_bRemoteWaitAll = 1;
+ }
+ else if (0 == strcmp(argv[i], "-random"))
+ {
+ g_bRandom = 1;
+ }
+ else if ((0 == strcmp(argv[i], "-count")) && (argc > i+1))
+ {
+ i++;
+ iCnt = atoi(argv[i]);
+ if (iCnt > 0 && iCnt < MAX_COUNT)
+ {
+ iCount = iCnt;
+ }
+ }
+ else if ((0 == strcmp(argv[i], "-threads")) && (argc > i+1))
+ {
+ i++;
+ iCnt = atoi(argv[i]);
+ if (iCnt > 0 && iCnt <= MAX_THREADS)
+ {
+ iThreads = iCnt;
+ }
+ }
+ else
+ {
+ Trace("Unknown option %s ignored\n", argv[i]);
+ }
+ }
+ }
+
+
+ iCnt = 0;
+ for (i=0;i<iThreads;i++)
+ {
+ hThreads[iCnt] = CreateThread(NULL, 0, TestThread, (VOID*)iCnt, 0, &dwSlaveThreadTid);
+ if (NULL == hThreads[iCnt])
+ {
+ Trace("Failed to create thread\n");
+ }
+ else
+ {
+ iCnt++;
+ }
+ }
+
+ if (0 == iCnt)
+ {
+ Fail("Can't create any thread\n");
+ }
+
+ for (i=0; i<iCnt; i+=64)
+ {
+ dwRet = WaitForMultipleObjects(MIN(64, iCnt-i), &hThreads[i], TRUE, INFINITE);
+ if (WAIT_FAILED == dwRet)
+ {
+ Fail("WaitForMultipleObjects failed [dwRet=%u GetLastError()=%u iCnt=%d i=%d]\n",
+ dwRet, GetLastError(), iCnt, i);
+ }
+ }
+
+
+ for (i=0; i<iCnt; i++)
+ {
+ CloseHandle(hThreads[i]);
+ }
+
+ PAL_Terminate();
+ return PASS;
+}
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/CMakeLists.txt
index 65fa0abe14..816a98bf2f 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- WFSOExMutexTest.c
+ WFSOExMutexTest.cpp
)
add_executable(paltest_waitforsingleobject_wfsoexmutextest
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.cpp
index 3737f9cc10..3737f9cc10 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.c
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExMutexTest/WFSOExMutexTest.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/CMakeLists.txt
index 12517e31e0..2d12b25e69 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- WFSOExSemaphoreTest.c
+ WFSOExSemaphoreTest.cpp
)
add_executable(paltest_waitforsingleobject_wfsoexsemaphoretest
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp
index 793c50995c..793c50995c 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.c
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExSemaphoreTest/WFSOExSemaphoreTest.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/CMakeLists.txt
index f3d868f082..915ee94a62 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- WFSOExThreadTest.c
+ WFSOExThreadTest.cpp
)
add_executable(paltest_waitforsingleobject_wfsoexthreadtest
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp
index 894d2804aa..894d2804aa 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.c
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOExThreadTest/WFSOExThreadTest.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/CMakeLists.txt
index 374880e90f..b96324d654 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- WFSOMutexTest.c
+ WFSOMutexTest.cpp
)
add_executable(paltest_waitforsingleobject_wfsomutextest
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c
deleted file mode 100644
index 5ecf517c2a..0000000000
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.c
+++ /dev/null
@@ -1,184 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: WFSOMutexTest.c
-**
-** Purpose: Test for WaitForSingleObjectTest.
-** Create Mutex Object
-** Create Two Threads, Each Threads does WFSO for the Mutex Object
-** Increments Counter
-** Releases Mutex
-** Test Passes if the above operations are successful
-**
-**
-**
-**=========================================================*/
-
-
-
-#include <palsuite.h>
-
-
-#define NUMBER_OF_WORKER_THREADS 2
-
-//Declaring Variables
-HANDLE hMutex = NULL;
-unsigned int globalcounter =0;
-int testReturnCode = PASS;
-
-//Declaring Function Prototypes
-DWORD WFSOMutexTest(LPVOID params);
-void incrementCounter(void);
-
-
-
-int __cdecl main(int argc, char **argv)
-{
-
- //Declare local variables
- int i =0;
-
- // 2 dimensional array to hold thread handles for each worker thread
- HANDLE hThread[NUMBER_OF_WORKER_THREADS];
- DWORD dwThreadId=0;
- int returnCode = 0;
-
- //Initialize PAL
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return ( FAIL );
- }
-
- //Create Mutex
- hMutex = CreateMutex(NULL, // no security attributes
- FALSE, // initially not owned
- NULL); // name of mutex
-
- //Check for Mutex Creation
-
- if (hMutex == NULL)
- {
- Fail("Create Mutex Failed, GetLastError: %d\n", GetLastError());
- }
-
-
- //Spawn 2 worker threads
- for (i=0;i<NUMBER_OF_WORKER_THREADS;i++)
- {
- //Create Thread
-
- hThread[i] = CreateThread(
- NULL,
- 0,
- WFSOMutexTest,
- NULL,
- 0,
- &dwThreadId);
-
- if ( NULL == hThread[i] )
- {
- Fail ( "CreateThread() returned NULL. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- }
-
- }
-
- /* Test running */
- returnCode = WaitForMultipleObjects( NUMBER_OF_WORKER_THREADS, hThread, TRUE, 5000);
- if( WAIT_OBJECT_0 != returnCode )
- {
- Trace("Wait for Object(s) returned %d, and GetLastError value is %d\n", returnCode, GetLastError());
- testReturnCode = FAIL;
- }
-
-//Close thread handles
-for (i=0;i<NUMBER_OF_WORKER_THREADS;i++)
- {
-
- if (0==CloseHandle(hThread[i]))
- {
- Trace("Could not Close thread handle\n");
- Fail ( "GetLastError returned %d\n", GetLastError());
- }
- }
-
-//Close Mutex Handle
-if (0==CloseHandle(hMutex))
- {
- Trace("Could not close mutex handle\n");
- Fail ( "GetLastError returned %d\n", GetLastError());
- }
-
-
-PAL_TerminateEx(testReturnCode);
-return ( testReturnCode );
-
-}
-
-
-void incrementCounter(void)
-{
- if (INT_MAX == globalcounter)
- {
- globalcounter = 0;
- }
-
- globalcounter++;
- Trace("Global Counter Value: %d \n", globalcounter);
-}
-
-
-DWORD WFSOMutexTest(LPVOID params)
-{
-
- DWORD dwWaitResult;
-
- // Request ownership of mutex.
-
- dwWaitResult = WaitForSingleObject(
- hMutex, // handle to mutex
- 5000L); // five-second time-out interval
-
- switch (dwWaitResult)
- {
- // The thread got mutex ownership.
- case WAIT_OBJECT_0:
- {
-
- incrementCounter();
-
- //Release ownership of the mutex object.
- if (! ReleaseMutex(hMutex))
- {
- Fail ( "ReleaseMutex() returned NULL. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- }
-
- break;
- }
-
- // Cannot get mutex ownership due to time-out.
- case WAIT_TIMEOUT:
- {
- Fail ( "Cannot get mutex ownership due to time-out. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- return FALSE;
- }
-
- // Got ownership of the abandoned mutex object.
- case WAIT_ABANDONED:
- {
- Fail ( "Got ownership of the abandoned mutex object. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- return FALSE;
- }
- }
-
- return 1;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.cpp b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.cpp
new file mode 100644
index 0000000000..f2537fa776
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOMutexTest/WFSOMutexTest.cpp
@@ -0,0 +1,184 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: WFSOMutexTest.c
+**
+** Purpose: Test for WaitForSingleObjectTest.
+** Create Mutex Object
+** Create Two Threads, Each Threads does WFSO for the Mutex Object
+** Increments Counter
+** Releases Mutex
+** Test Passes if the above operations are successful
+**
+**
+**
+**=========================================================*/
+
+
+
+#include <palsuite.h>
+
+
+#define NUMBER_OF_WORKER_THREADS 2
+
+//Declaring Variables
+HANDLE hMutex = NULL;
+unsigned int globalcounter =0;
+int testReturnCode = PASS;
+
+//Declaring Function Prototypes
+DWORD PALAPI WFSOMutexTest(LPVOID params);
+void incrementCounter(void);
+
+
+
+int __cdecl main(int argc, char **argv)
+{
+
+ //Declare local variables
+ int i =0;
+
+ // 2 dimensional array to hold thread handles for each worker thread
+ HANDLE hThread[NUMBER_OF_WORKER_THREADS];
+ DWORD dwThreadId=0;
+ int returnCode = 0;
+
+ //Initialize PAL
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return ( FAIL );
+ }
+
+ //Create Mutex
+ hMutex = CreateMutex(NULL, // no security attributes
+ FALSE, // initially not owned
+ NULL); // name of mutex
+
+ //Check for Mutex Creation
+
+ if (hMutex == NULL)
+ {
+ Fail("Create Mutex Failed, GetLastError: %d\n", GetLastError());
+ }
+
+
+ //Spawn 2 worker threads
+ for (i=0;i<NUMBER_OF_WORKER_THREADS;i++)
+ {
+ //Create Thread
+
+ hThread[i] = CreateThread(
+ NULL,
+ 0,
+ WFSOMutexTest,
+ NULL,
+ 0,
+ &dwThreadId);
+
+ if ( NULL == hThread[i] )
+ {
+ Fail ( "CreateThread() returned NULL. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ }
+
+ }
+
+ /* Test running */
+ returnCode = WaitForMultipleObjects( NUMBER_OF_WORKER_THREADS, hThread, TRUE, 5000);
+ if( WAIT_OBJECT_0 != returnCode )
+ {
+ Trace("Wait for Object(s) returned %d, and GetLastError value is %d\n", returnCode, GetLastError());
+ testReturnCode = FAIL;
+ }
+
+//Close thread handles
+for (i=0;i<NUMBER_OF_WORKER_THREADS;i++)
+ {
+
+ if (0==CloseHandle(hThread[i]))
+ {
+ Trace("Could not Close thread handle\n");
+ Fail ( "GetLastError returned %d\n", GetLastError());
+ }
+ }
+
+//Close Mutex Handle
+if (0==CloseHandle(hMutex))
+ {
+ Trace("Could not close mutex handle\n");
+ Fail ( "GetLastError returned %d\n", GetLastError());
+ }
+
+
+PAL_TerminateEx(testReturnCode);
+return ( testReturnCode );
+
+}
+
+
+void incrementCounter(void)
+{
+ if (INT_MAX == globalcounter)
+ {
+ globalcounter = 0;
+ }
+
+ globalcounter++;
+ Trace("Global Counter Value: %d \n", globalcounter);
+}
+
+
+DWORD PALAPI WFSOMutexTest(LPVOID params)
+{
+
+ DWORD dwWaitResult;
+
+ // Request ownership of mutex.
+
+ dwWaitResult = WaitForSingleObject(
+ hMutex, // handle to mutex
+ 5000L); // five-second time-out interval
+
+ switch (dwWaitResult)
+ {
+ // The thread got mutex ownership.
+ case WAIT_OBJECT_0:
+ {
+
+ incrementCounter();
+
+ //Release ownership of the mutex object.
+ if (! ReleaseMutex(hMutex))
+ {
+ Fail ( "ReleaseMutex() returned NULL. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ }
+
+ break;
+ }
+
+ // Cannot get mutex ownership due to time-out.
+ case WAIT_TIMEOUT:
+ {
+ Fail ( "Cannot get mutex ownership due to time-out. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ return FALSE;
+ }
+
+ // Got ownership of the abandoned mutex object.
+ case WAIT_ABANDONED:
+ {
+ Fail ( "Got ownership of the abandoned mutex object. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ return FALSE;
+ }
+ }
+
+ return 1;
+}
+
+
+
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/CMakeLists.txt
index a70b101988..61e17eb3ad 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(TESTSOURCES
- WFSOProcessTest.c
+ WFSOProcessTest.cpp
)
add_executable(paltest_waitforsingleobject_wfsoprocesstest
@@ -20,7 +20,7 @@ target_link_libraries(paltest_waitforsingleobject_wfsoprocesstest
set(HELPERSOURCES
- ChildProcess.c
+ ChildProcess.cpp
)
add_executable(paltest_waitforsingleobject_wfsoprocesstest_child
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/ChildProcess.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/ChildProcess.cpp
index 91c24d87bb..91c24d87bb 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/ChildProcess.c
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/ChildProcess.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.cpp
index 2711e26c29..2711e26c29 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.c
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOProcessTest/WFSOProcessTest.cpp
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/CMakeLists.txt
index 171e0583e5..d17f8da8e5 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- WFSOSemaphoreTest.c
+ WFSOSemaphoreTest.cpp
)
add_executable(paltest_waitforsingleobject_wfsosemaphoretest
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.c
deleted file mode 100644
index 9902d448cd..0000000000
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.c
+++ /dev/null
@@ -1,183 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: WFSOMutexTest.c
-**
-** Purpose: Test for WaitForSingleObjectTest.
-** Create Semaphore Object
-** Create Two Threads, Each Threads does WFSO for the Semaphore Object
-** Increments Counter
-** Releases Semaphore
-** Test Passes if the above operations are successful
-**
-**
-**
-**=========================================================*/
-
-
-
-#include <palsuite.h>
-
-
-#define NUMBER_OF_WORKER_THREADS 2
-
-
-//Declaring Variables
-HANDLE hSemaphore = NULL;
-unsigned int globalcounter =0;
-int testReturnCode = PASS;
-
-//Declaring Function Prototypes
-DWORD WFSOSemaphoreTest(LPVOID params);
-void incrementCounter(void);
-
-int __cdecl main(int argc, char **argv)
-{
-
- //Declare local variables
- int i =0;
- int cMax = 2;
-
- int returnCode = 0;
-
- // 2 dimensional array to hold thread handles for each worker thread
- HANDLE hThread[NUMBER_OF_WORKER_THREADS];
- DWORD dwThreadId=0;
-
- //Initialize PAL
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return ( FAIL );
- }
-
- //Create Semaphore
- hSemaphore = CreateSemaphore(
- NULL, // no security attributes
- cMax, // initial count
- cMax, // maximum count
- NULL); // unnamed semaphore
-
- if (hSemaphore == NULL)
- {
- // Check for error.
- Fail("Create Semaphore Failed, GetLastError: %d\n", GetLastError());
- }
-
-
-
- //Spawn 2 worker threads
- for (i=0;i<NUMBER_OF_WORKER_THREADS;i++)
- {
- //Create Thread
-
- hThread[i] = CreateThread(
- NULL,
- 0,
- WFSOSemaphoreTest,
- NULL,
- 0,
- &dwThreadId);
-
- if ( NULL == hThread[i] )
- {
- Fail ( "CreateThread() returned NULL. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- }
-
- }
-
-
- /* Test running */
- returnCode = WaitForMultipleObjects( NUMBER_OF_WORKER_THREADS, hThread, TRUE, 5000);
- if( WAIT_OBJECT_0 != returnCode )
- {
- Trace("Wait for Object(s) returned %d, and GetLastError value is %d\n", returnCode, GetLastError());
- testReturnCode = FAIL;
- }
-
-//Close thread handles
-for (i=0;i<NUMBER_OF_WORKER_THREADS;i++)
- {
-
- if (0==CloseHandle(hThread[i]))
- {
- Trace("Could not Close thread handle\n");
- Fail ( "GetLastError returned %d\n", GetLastError());
- }
- }
-
-//Close Semaphore Handle
-if (0==CloseHandle(hSemaphore))
- {
- Trace("Could not close semaphore handle\n");
- Fail ( "GetLastError returned %d\n", GetLastError());
- }
-
-PAL_TerminateEx(testReturnCode);
-return ( testReturnCode );
-
-}
-
-
-void incrementCounter(void)
-{
- if (INT_MAX == globalcounter)
- {
- globalcounter = 0;
- }
-
- globalcounter++;
- Trace("Global Counter Value: %d \n", globalcounter);
-}
-
-
-DWORD WFSOSemaphoreTest(LPVOID params)
-{
-
- DWORD dwWaitResult;
-
- // Request ownership of Semaphore
-
- dwWaitResult = WaitForSingleObject(
- hSemaphore, // handle to semaphore
- 0L); // zero-second time-out interval
-
-
- switch (dwWaitResult)
- {
- // The semaphore object was signaled.
- case WAIT_OBJECT_0:
- {
-
- incrementCounter();
- // Increment the count of the semaphore.
-
- if (!ReleaseSemaphore(
- hSemaphore, // handle to semaphore
- 1, // increase count by one
- NULL) ) // not interested in previous count
- {
- Fail ( "ReleaseSemaphore() returned NULL. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- }
-
- break;
- }
-
- // Semaphore was nonsignaled, so a time-out occurred.
- case WAIT_TIMEOUT:
- {
- Fail ( "Semaphore was nonsignaled, so a time-out occurred. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- return FALSE;
- }
- }
-
- return 1;
-}
-
-
-
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp
new file mode 100644
index 0000000000..b743b44544
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOSemaphoreTest/WFSOSemaphoreTest.cpp
@@ -0,0 +1,183 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: WFSOMutexTest.c
+**
+** Purpose: Test for WaitForSingleObjectTest.
+** Create Semaphore Object
+** Create Two Threads, Each Threads does WFSO for the Semaphore Object
+** Increments Counter
+** Releases Semaphore
+** Test Passes if the above operations are successful
+**
+**
+**
+**=========================================================*/
+
+
+
+#include <palsuite.h>
+
+
+#define NUMBER_OF_WORKER_THREADS 2
+
+
+//Declaring Variables
+HANDLE hSemaphore = NULL;
+unsigned int globalcounter =0;
+int testReturnCode = PASS;
+
+//Declaring Function Prototypes
+DWORD PALAPI WFSOSemaphoreTest(LPVOID params);
+void incrementCounter(void);
+
+int __cdecl main(int argc, char **argv)
+{
+
+ //Declare local variables
+ int i =0;
+ int cMax = 2;
+
+ int returnCode = 0;
+
+ // 2 dimensional array to hold thread handles for each worker thread
+ HANDLE hThread[NUMBER_OF_WORKER_THREADS];
+ DWORD dwThreadId=0;
+
+ //Initialize PAL
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return ( FAIL );
+ }
+
+ //Create Semaphore
+ hSemaphore = CreateSemaphore(
+ NULL, // no security attributes
+ cMax, // initial count
+ cMax, // maximum count
+ NULL); // unnamed semaphore
+
+ if (hSemaphore == NULL)
+ {
+ // Check for error.
+ Fail("Create Semaphore Failed, GetLastError: %d\n", GetLastError());
+ }
+
+
+
+ //Spawn 2 worker threads
+ for (i=0;i<NUMBER_OF_WORKER_THREADS;i++)
+ {
+ //Create Thread
+
+ hThread[i] = CreateThread(
+ NULL,
+ 0,
+ WFSOSemaphoreTest,
+ NULL,
+ 0,
+ &dwThreadId);
+
+ if ( NULL == hThread[i] )
+ {
+ Fail ( "CreateThread() returned NULL. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ }
+
+ }
+
+
+ /* Test running */
+ returnCode = WaitForMultipleObjects( NUMBER_OF_WORKER_THREADS, hThread, TRUE, 5000);
+ if( WAIT_OBJECT_0 != returnCode )
+ {
+ Trace("Wait for Object(s) returned %d, and GetLastError value is %d\n", returnCode, GetLastError());
+ testReturnCode = FAIL;
+ }
+
+//Close thread handles
+for (i=0;i<NUMBER_OF_WORKER_THREADS;i++)
+ {
+
+ if (0==CloseHandle(hThread[i]))
+ {
+ Trace("Could not Close thread handle\n");
+ Fail ( "GetLastError returned %d\n", GetLastError());
+ }
+ }
+
+//Close Semaphore Handle
+if (0==CloseHandle(hSemaphore))
+ {
+ Trace("Could not close semaphore handle\n");
+ Fail ( "GetLastError returned %d\n", GetLastError());
+ }
+
+PAL_TerminateEx(testReturnCode);
+return ( testReturnCode );
+
+}
+
+
+void incrementCounter(void)
+{
+ if (INT_MAX == globalcounter)
+ {
+ globalcounter = 0;
+ }
+
+ globalcounter++;
+ Trace("Global Counter Value: %d \n", globalcounter);
+}
+
+
+DWORD PALAPI WFSOSemaphoreTest(LPVOID params)
+{
+
+ DWORD dwWaitResult;
+
+ // Request ownership of Semaphore
+
+ dwWaitResult = WaitForSingleObject(
+ hSemaphore, // handle to semaphore
+ 0L); // zero-second time-out interval
+
+
+ switch (dwWaitResult)
+ {
+ // The semaphore object was signaled.
+ case WAIT_OBJECT_0:
+ {
+
+ incrementCounter();
+ // Increment the count of the semaphore.
+
+ if (!ReleaseSemaphore(
+ hSemaphore, // handle to semaphore
+ 1, // increase count by one
+ NULL) ) // not interested in previous count
+ {
+ Fail ( "ReleaseSemaphore() returned NULL. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ }
+
+ break;
+ }
+
+ // Semaphore was nonsignaled, so a time-out occurred.
+ case WAIT_TIMEOUT:
+ {
+ Fail ( "Semaphore was nonsignaled, so a time-out occurred. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ return FALSE;
+ }
+ }
+
+ return 1;
+}
+
+
+
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/CMakeLists.txt
index 18701a9da5..e2d36e08e1 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- WFSOThreadTest.c
+ WFSOThreadTest.cpp
)
add_executable(paltest_waitforsingleobject_wfsothreadtest
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/WFSOThreadTest.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/WFSOThreadTest.c
deleted file mode 100644
index 378350671a..0000000000
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/WFSOThreadTest.c
+++ /dev/null
@@ -1,179 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================
-**
-** Source: WFSOThreadTest.c
-**
-** Purpose: Test for WaitForSingleObjectTest.
-** Create One Thread and do some work
-** Use WFSO For the Thread to finish
-**
-** Test Passes if the above operations are successful
-**
-**
-**
-**=========================================================*/
-
-
-
-#include <palsuite.h>
-
-
-//Declaring Variables
-HANDLE hThread = NULL;
-HANDLE hEvent = NULL;
-
-unsigned int globalcounter =0;
-
-//Declaring Function Prototypes
-DWORD incrementCounter(LPVOID params);
-
-int __cdecl main(int argc, char **argv)
-{
-
- //Declare local variables
- DWORD dwThreadId=0;
- DWORD dwWaitResult=0;
-
- //Initialize PAL
- if(0 != (PAL_Initialize(argc, argv)))
- {
- return ( FAIL );
- }
-
-
- //Create Event
- hEvent = CreateEvent(NULL,TRUE,FALSE, NULL);
- if(hEvent == NULL)
- {
- Fail("Create Event Failed\n"
- "GetLastError returned %d\n", GetLastError());
- }
-
-
- //Create Thread
- hThread = CreateThread(
- NULL,
- 0,
- incrementCounter,
- NULL,
- 0,
- &dwThreadId);
-
- if ( NULL == hThread )
- {
- Fail ( "CreateThread() returned NULL. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- }
-
-
- //Wait For Thread to signal start
- dwWaitResult = WaitForSingleObject(hEvent,INFINITE);
-
- switch (dwWaitResult)
- {
- // The thread wait was successful
- case WAIT_OBJECT_0:
- {
-
- Trace ("Wait for Single Object (hEvent) was successful.\n");
- break;
- }
-
- // Time-out.
- case WAIT_TIMEOUT:
- {
- Fail ( "Time -out. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- return FALSE;
- }
-
- // Got ownership of the abandoned event object.
- case WAIT_ABANDONED:
- {
- Fail ( "Got ownership of the abandoned event object. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- return FALSE;
- }
-
- }
-
-
- //Wait for Thread to finish
- dwWaitResult = WaitForSingleObject(
- hThread, //handle to thread
- 5000L); //Wait Indefinitely
-
-
- switch (dwWaitResult)
- {
- // The thread wait was successful
- case WAIT_OBJECT_0:
- {
-
- Trace("Wait for thread was successful\n");
-
- break;
- }
-
- // Time-out.
- case WAIT_TIMEOUT:
- {
- Fail ( "Time -out. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- return FALSE;
- }
-
- // Got ownership of the abandoned thread object.
- case WAIT_ABANDONED:
- {
- Fail ( "Got ownership of the abandoned thread object. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- return FALSE;
- }
-
- }
-
-
-//Close Handles
-if (0==CloseHandle(hEvent))
- {
- Trace("Could not Close event handle\n");
- Fail ( "GetLastError returned %d\n", GetLastError());
- }
-if (0==CloseHandle(hThread))
- {
- Trace("Could not Close thread handle\n");
- Fail ( "GetLastError returned %d\n", GetLastError());
- }
-
-PAL_Terminate();
-return ( PASS );
-
-}
-
-DWORD incrementCounter(LPVOID params)
-{
-
- //Signal Event so that main thread can start to wait for thread object
- if (0==SetEvent(hEvent))
- {
- Fail ( "SetEvent returned Zero. Failing test.\n"
- "GetLastError returned %d\n", GetLastError());
- }
-
- for (globalcounter=0;globalcounter<100000;globalcounter++);
-
- //Sleep(5000);
-
- Trace("Global Counter Value: %d \n", globalcounter);
- return 0;
-}
-
-
-
-
-
-
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/WFSOThreadTest.cpp b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/WFSOThreadTest.cpp
new file mode 100644
index 0000000000..e3c3fe22b7
--- /dev/null
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/WFSOThreadTest/WFSOThreadTest.cpp
@@ -0,0 +1,179 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*============================================================
+**
+** Source: WFSOThreadTest.c
+**
+** Purpose: Test for WaitForSingleObjectTest.
+** Create One Thread and do some work
+** Use WFSO For the Thread to finish
+**
+** Test Passes if the above operations are successful
+**
+**
+**
+**=========================================================*/
+
+
+
+#include <palsuite.h>
+
+
+//Declaring Variables
+HANDLE hThread = NULL;
+HANDLE hEvent = NULL;
+
+unsigned int globalcounter =0;
+
+//Declaring Function Prototypes
+DWORD PALAPI incrementCounter(LPVOID params);
+
+int __cdecl main(int argc, char **argv)
+{
+
+ //Declare local variables
+ DWORD dwThreadId=0;
+ DWORD dwWaitResult=0;
+
+ //Initialize PAL
+ if(0 != (PAL_Initialize(argc, argv)))
+ {
+ return ( FAIL );
+ }
+
+
+ //Create Event
+ hEvent = CreateEvent(NULL,TRUE,FALSE, NULL);
+ if(hEvent == NULL)
+ {
+ Fail("Create Event Failed\n"
+ "GetLastError returned %d\n", GetLastError());
+ }
+
+
+ //Create Thread
+ hThread = CreateThread(
+ NULL,
+ 0,
+ incrementCounter,
+ NULL,
+ 0,
+ &dwThreadId);
+
+ if ( NULL == hThread )
+ {
+ Fail ( "CreateThread() returned NULL. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ }
+
+
+ //Wait For Thread to signal start
+ dwWaitResult = WaitForSingleObject(hEvent,INFINITE);
+
+ switch (dwWaitResult)
+ {
+ // The thread wait was successful
+ case WAIT_OBJECT_0:
+ {
+
+ Trace ("Wait for Single Object (hEvent) was successful.\n");
+ break;
+ }
+
+ // Time-out.
+ case WAIT_TIMEOUT:
+ {
+ Fail ( "Time -out. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ return FALSE;
+ }
+
+ // Got ownership of the abandoned event object.
+ case WAIT_ABANDONED:
+ {
+ Fail ( "Got ownership of the abandoned event object. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ return FALSE;
+ }
+
+ }
+
+
+ //Wait for Thread to finish
+ dwWaitResult = WaitForSingleObject(
+ hThread, //handle to thread
+ 5000L); //Wait Indefinitely
+
+
+ switch (dwWaitResult)
+ {
+ // The thread wait was successful
+ case WAIT_OBJECT_0:
+ {
+
+ Trace("Wait for thread was successful\n");
+
+ break;
+ }
+
+ // Time-out.
+ case WAIT_TIMEOUT:
+ {
+ Fail ( "Time -out. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ return FALSE;
+ }
+
+ // Got ownership of the abandoned thread object.
+ case WAIT_ABANDONED:
+ {
+ Fail ( "Got ownership of the abandoned thread object. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ return FALSE;
+ }
+
+ }
+
+
+//Close Handles
+if (0==CloseHandle(hEvent))
+ {
+ Trace("Could not Close event handle\n");
+ Fail ( "GetLastError returned %d\n", GetLastError());
+ }
+if (0==CloseHandle(hThread))
+ {
+ Trace("Could not Close thread handle\n");
+ Fail ( "GetLastError returned %d\n", GetLastError());
+ }
+
+PAL_Terminate();
+return ( PASS );
+
+}
+
+DWORD PALAPI incrementCounter(LPVOID params)
+{
+
+ //Signal Event so that main thread can start to wait for thread object
+ if (0==SetEvent(hEvent))
+ {
+ Fail ( "SetEvent returned Zero. Failing test.\n"
+ "GetLastError returned %d\n", GetLastError());
+ }
+
+ for (globalcounter=0;globalcounter<100000;globalcounter++);
+
+ //Sleep(5000);
+
+ Trace("Global Counter Value: %d \n", globalcounter);
+ return 0;
+}
+
+
+
+
+
+
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/CMakeLists.txt
index 0a71330ba1..25f3739492 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_waitforsingleobject_test1
diff --git a/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c b/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.cpp
index 2af80df677..2af80df677 100644
--- a/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/WaitForSingleObject/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/YieldProcessor/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/YieldProcessor/test1/CMakeLists.txt
index 5002bf763d..1c600bd81c 100644
--- a/src/pal/tests/palsuite/threading/YieldProcessor/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/YieldProcessor/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test1.c
+ test1.cpp
)
add_executable(paltest_yieldprocessor_test1
diff --git a/src/pal/tests/palsuite/threading/YieldProcessor/test1/test1.c b/src/pal/tests/palsuite/threading/YieldProcessor/test1/test1.cpp
index 6adbe989c2..6adbe989c2 100644
--- a/src/pal/tests/palsuite/threading/YieldProcessor/test1/test1.c
+++ b/src/pal/tests/palsuite/threading/YieldProcessor/test1/test1.cpp
diff --git a/src/pal/tests/palsuite/threading/releasesemaphore/test1/CMakeLists.txt b/src/pal/tests/palsuite/threading/releasesemaphore/test1/CMakeLists.txt
index e415f91fb2..4f6947476d 100644
--- a/src/pal/tests/palsuite/threading/releasesemaphore/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/threading/releasesemaphore/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- test.c
+ test.cpp
)
add_executable(paltest_releasesemaphore_test1
diff --git a/src/pal/tests/palsuite/threading/releasesemaphore/test1/test.c b/src/pal/tests/palsuite/threading/releasesemaphore/test1/test.cpp
index 4d736b7d9a..4d736b7d9a 100644
--- a/src/pal/tests/palsuite/threading/releasesemaphore/test1/test.c
+++ b/src/pal/tests/palsuite/threading/releasesemaphore/test1/test.cpp
diff --git a/src/pal/tools/gen-buildsys-clang.sh b/src/pal/tools/gen-buildsys-clang.sh
index b7945f3091..4054266f0b 100755
--- a/src/pal/tools/gen-buildsys-clang.sh
+++ b/src/pal/tools/gen-buildsys-clang.sh
@@ -126,13 +126,20 @@ fi
if [[ -n "$LLDB_INCLUDE_DIR" ]]; then
cmake_extra_defines="$cmake_extra_defines -DWITH_LLDB_INCLUDES=$LLDB_INCLUDE_DIR"
fi
-if [[ -n "$CROSSCOMPILE" ]]; then
- if ! [[ -n "$ROOTFS_DIR" ]]; then
- echo "ROOTFS_DIR not set for crosscompile"
- exit 1
+if [[ -n "$CROSSCOMPONENT" ]]; then
+ cmake_extra_defines="$cmake_extra_defines -DCLR_CROSS_COMPONENTS_BUILD=1"
+else
+ if [[ -n "$CROSSCOMPILE" ]]; then
+ if ! [[ -n "$ROOTFS_DIR" ]]; then
+ echo "ROOTFS_DIR not set for crosscompile"
+ exit 1
+ fi
+ if [[ -z $CONFIG_DIR ]]; then
+ CONFIG_DIR="$1/cross/$build_arch"
+ fi
+ cmake_extra_defines="$cmake_extra_defines -C $CONFIG_DIR/tryrun.cmake"
+ cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=$CONFIG_DIR/toolchain.cmake"
fi
- cmake_extra_defines="$cmake_extra_defines -C $1/cross/$build_arch/tryrun.cmake"
- cmake_extra_defines="$cmake_extra_defines -DCMAKE_TOOLCHAIN_FILE=$1/cross/$build_arch/toolchain.cmake"
fi
if [ "$build_arch" == "arm-softfp" ]; then
cmake_extra_defines="$cmake_extra_defines -DARM_SOFTFP=1"
diff --git a/src/pal/tools/gen-buildsys-win.bat b/src/pal/tools/gen-buildsys-win.bat
index ab57fb4bb4..f7f81fca33 100644
--- a/src/pal/tools/gen-buildsys-win.bat
+++ b/src/pal/tools/gen-buildsys-win.bat
@@ -36,7 +36,7 @@ goto loop
if defined CMakePath goto DoGen
:: Eval the output from probe-win1.ps1
-for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy RemoteSigned "& "%basePath%\probe-win.ps1""') do %%a
+for /f "delims=" %%a in ('powershell -NoProfile -ExecutionPolicy ByPass "& "%basePath%\probe-win.ps1""') do %%a
:DoGen
"%CMakePath%" "-DCMAKE_USER_MAKE_RULES_OVERRIDE=%basePath%\windows-compiler-override.txt" "-DCMAKE_INSTALL_PREFIX:PATH=$ENV{__CMakeBinDir}" "-DCLR_CMAKE_HOST_ARCH=%__Arch%" %__ExtraCmakeParams% -G "%__CmakeGenerator%" %__SourceDir%