summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal/tests/palsuite')
-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
2659 files changed, 26070 insertions, 28426 deletions
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