Author: tkreuzer Date: Tue May 31 17:26:30 2011 New Revision: 52022
URL: http://svn.reactos.org/svn/reactos?rev=52022&view=rev Log: [MSVCRT_APITEST] Add tests for splitpath
Added: trunk/rostests/apitests/msvcrt/ (with props) trunk/rostests/apitests/msvcrt/CMakeLists.txt (with props) trunk/rostests/apitests/msvcrt/msvcrt_apitest.rbuild (with props) trunk/rostests/apitests/msvcrt/splitpath.c (with props) trunk/rostests/apitests/msvcrt/testlist.c (with props)
Propchange: trunk/rostests/apitests/msvcrt/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Tue May 31 17:26:30 2011 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+)
Propchange: trunk/rostests/apitests/msvcrt/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/rostests/apitests/msvcrt/ ------------------------------------------------------------------------------ bugtraq:url = http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/rostests/apitests/msvcrt/ ------------------------------------------------------------------------------ tsvn:logminsize = 10
Added: trunk/rostests/apitests/msvcrt/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/CMakeLists... ============================================================================== --- trunk/rostests/apitests/msvcrt/CMakeLists.txt (added) +++ trunk/rostests/apitests/msvcrt/CMakeLists.txt [iso-8859-1] Tue May 31 17:26:30 2011 @@ -1,0 +1,12 @@ + +add_definitions(-D_DLL -D__USE_CRTIMP) + +list(APPEND SOURCE + splitpath.c + testlist.c) + +add_executable(msvcrt_apitest ${SOURCE}) +target_link_libraries(msvcrt_apitest wine) +set_module_type(msvcrt_apitest win32cui) +add_importlibs(msvcrt_apitest msvcrt kernel32) +add_cd_file(TARGET msvcrt_apitest DESTINATION reactos/bin FOR all)
Propchange: trunk/rostests/apitests/msvcrt/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/rostests/apitests/msvcrt/msvcrt_apitest.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/msvcrt_api... ============================================================================== --- trunk/rostests/apitests/msvcrt/msvcrt_apitest.rbuild (added) +++ trunk/rostests/apitests/msvcrt/msvcrt_apitest.rbuild [iso-8859-1] Tue May 31 17:26:30 2011 @@ -1,0 +1,13 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<group> +<module name="msvcrt_apitest" type="win32cui" installbase="bin" installname="msvcrt_apitest.exe"> + <include base="msvcrt_apitest">.</include> + <library>wine</library> + <library>pseh</library> + <file>testlist.c</file> + + <file>splitpath.c</file> + +</module> +</group>
Propchange: trunk/rostests/apitests/msvcrt/msvcrt_apitest.rbuild ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/rostests/apitests/msvcrt/splitpath.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/splitpath.... ============================================================================== --- trunk/rostests/apitests/msvcrt/splitpath.c (added) +++ trunk/rostests/apitests/msvcrt/splitpath.c [iso-8859-1] Tue May 31 17:26:30 2011 @@ -1,0 +1,94 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Test for _splitpath + * PROGRAMMER: Timo Kreuzer + */ + +#include <wine/test.h> +#include <stdio.h> +#include <stdlib.h> +#include <strings.h> +#include <stdarg.h> + +#define ok_str(x, y) \ + ok(strcmp(x, y) == 0, "got '%s', expected '%s'\n", x, y); + +#define ok_int(x, y) \ + ok(x == y, "got %d, expected %d\n", x, y); + +START_TEST(splitpath) +{ + char drive[5]; + char dir[64]; + char fname[32]; + char ext[10]; + + _splitpath("c:\dir1\dir2\file.ext", drive, dir, fname, ext); + ok_str(drive, "c:"); + ok_str(dir, "\dir1\dir2\"); + ok_str(fname, "file"); + ok_str(ext, ".ext"); + + *_errno() = 0; + _splitpath("c:\dir1\dir2\file.ext", 0, 0, 0, 0); + ok_int(*_errno(), 0); + + *_errno() = 0; + _splitpath(0, drive, dir, fname, ext); + ok_int(*_errno(), EINVAL); + ok_str(drive, ""); + ok_str(dir, ""); + ok_str(fname, ""); + ok_str(ext, ""); + + _splitpath("\\?\c:\dir1\dir2\file.ext", drive, dir, fname, ext); + ok_str(drive, "c:"); + ok_str(dir, "\dir1\dir2\"); + ok_str(fname, "file"); + ok_str(ext, ".ext"); + + _splitpath("ab:\dir1\..\file", drive, dir, fname, ext); + ok_str(drive, ""); + ok_str(dir, "ab:\dir1\..\"); + ok_str(fname, "file"); + ok_str(ext, ""); + + _splitpath("//?/c:/dir1/dir2/file.ext", drive, dir, fname, ext); + ok_str(drive, ""); + ok_str(dir, "//?/c:/dir1/dir2/"); + ok_str(fname, "file"); + ok_str(ext, ".ext"); + + _splitpath("\\?\0:/dir1\dir2/file.", drive, dir, fname, ext); + ok_str(drive, "0:"); + ok_str(dir, "/dir1\dir2/"); + ok_str(fname, "file"); + ok_str(ext, "."); + + _splitpath("\\.\c:\dir1\dir2\.ext.ext2", drive, dir, fname, ext); + ok_str(drive, ""); + ok_str(dir, "\\.\c:\dir1\dir2\"); + ok_str(fname, ".ext"); + ok_str(ext, ".ext2"); + + _splitpath("\??\c:\dir1\dir2\file. ~ ", drive, dir, fname, ext); + ok_str(drive, ""); + ok_str(dir, "\??\c:\dir1\dir2\"); + ok_str(fname, "file"); + ok_str(ext, ". ~ "); + + _splitpath("x: dir1\/dir2 \.blub", drive, dir, fname, ext); + ok_str(drive, "x:"); + ok_str(dir, " dir1\/dir2 \"); + ok_str(fname, ""); + ok_str(ext, ".blub"); + + _splitpath("/:\dir1\dir2\file.ext", drive, dir, fname, ext); + ok_str(drive, "/:"); + ok_str(dir, "\dir1\dir2\"); + ok_str(fname, "file"); + ok_str(ext, ".ext"); + +} +
Propchange: trunk/rostests/apitests/msvcrt/splitpath.c ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/rostests/apitests/msvcrt/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/testlist.c... ============================================================================== --- trunk/rostests/apitests/msvcrt/testlist.c (added) +++ trunk/rostests/apitests/msvcrt/testlist.c [iso-8859-1] Tue May 31 17:26:30 2011 @@ -1,0 +1,16 @@ +#define WIN32_LEAN_AND_MEAN +#define __ROS_LONG64__ +#include <windows.h> + +#define STANDALONE +#include "wine/test.h" + +extern void func_splitpath(void); + +const struct test winetest_testlist[] = +{ + { "splitpath", func_splitpath }, + + { 0, 0 } +}; +
Propchange: trunk/rostests/apitests/msvcrt/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native