


     fnmatch(XPG4.os/genRelease	4.4.1 (UniSoft fnmatch(XPG4.os/genuts)



     NAME
	  XPG4.os/genuts/fnmatch - match filename of pathname testset

     DESCRIPTION
	  Tests	the fnmatch(), system call interface for conformance
	  to the XSI System Interfaces Page:fnmatch()

     TESTS
     Compliance
	  1    If fnmatch() is supported:
		   When	the flags argument is zero and the string
		   specified by	string matches the specified pattern,
		   then	a call to fnmatch() returns 0.
		   Testing Requirements: The test shall	ensure that
		   each	of the following are true:
		   a. A	slash character	in string is matched by
		   characters other than an explicit slash in pattern.
		   b. A	backslash character in pattern is treated as a
		   quoting character.
		   c. A	leading	period character in string is matched
		   by characters other than an explicit	leading	period
		   in pattern.
		   d. A	period character after a slash character in
		   string is matched by	characters other than an
		   explicit period in pattern.
	       Otherwise:
		   A call to fnmatch() returns a non-zero value	not
		   equal to FNM_NOMATCH	and sets errno to ENOSYS.

	  2    If fnmatch() is supported:
		   When	the flags argument is zero and the string
		   specified by	string does not	match the specified
		   pattern, then a call	to fnmatch() returns
		   FNM_NOMATCH.
	       Otherwise:
		   A call to fnmatch() returns a non-zero value	not
		   equal to FNM_NOMATCH	and sets errno to ENOSYS.

	  3    If fnmatch() is supported:
		   When	the FNM_PATHNAME flag is set and the
		   FNM_PERIOD flag is clear in the flags argument and
		   the string specified	by string matches the
		   specified pattern with each slash in	pattern
		   explicitly matching a slash in string, then a call
		   to fnmatch()	returns	0.
		   Testing Requirements: The test shall	ensure that
		   each	of the following are true:
		   a. A	leading	period character in string is matched
		   by characters other than an explicit	leading	period
		   in pattern.
		   b. A	period character after a slash character in
		   string is matched by	characters other than an



     Page 1					    (printed 2/21/103)






     fnmatch(XPG4.os/genRelease	4.4.1 (UniSoft fnmatch(XPG4.os/genuts)



		   explicit period in pattern.
	       Otherwise:
		   A call to fnmatch() returns a non-zero value	not
		   equal to FNM_NOMATCH	and sets errno to ENOSYS.

	  4    If fnmatch() is supported:
		   When	the FNM_PATHNAME flag is set and the
		   FNM_PERIOD flag is clear in the flags argument and
		   the string specified	by string matches the
		   specified pattern except that one or	more slashes
		   in pattern does not explicitly match	a slash	in
		   string, then	a call to fnmatch() returns
		   FNM_NOMATCH.
	       Otherwise:
		   A call to fnmatch() returns a non-zero value	not
		   equal to FNM_NOMATCH	and sets errno to ENOSYS.

	  5    If fnmatch() is supported:
		   When	the FNM_NOESCAPE flag is clear in the flags
		   argument and	the string specified by	string matches
		   the specified pattern with each character pair
		   commencing with a backslash character in pattern
		   explicitly matching the second character in the
		   character pair in string, then a call to fnmatch()
		   returns 0.
	       Otherwise:
		   A call to fnmatch() returns a non-zero value	not
		   equal to FNM_NOMATCH	and sets errno to ENOSYS.

	  6    If fnmatch() is supported:
		   When	the FNM_NOESCAPE flag is set in	the flags
		   argument and	the string specified by	string matches
		   the specified pattern with each backslash character
		   in pattern explicitly matching a backslash
		   character in	string,	then a call to fnmatch()
		   returns 0.
	       Otherwise:
		   A call to fnmatch() returns a non-zero value	not
		   equal to FNM_NOMATCH	and sets errno to ENOSYS.

	  7    If fnmatch() is supported:
		   When	the FNM_PERIOD flag is set and the
		   FNM_PATHNAME	flag is	clear in the flags argument
		   and the string specified by string matches the
		   specified pattern and the first character of
		   pattern is a	period,	then a call to fnmatch()
		   returns 0.
		   Testing Requirements: The test shall	ensure that
		   each	of the following are true:
		   a. A	slash character	in string is matched by
		   characters other than an explicit slash in pattern.
		   b. A	period character after a slash character in



     Page 2					    (printed 2/21/103)






     fnmatch(XPG4.os/genRelease	4.4.1 (UniSoft fnmatch(XPG4.os/genuts)



		   string is matched by	characters other than an
		   explicit period in pattern.
	       Otherwise:
		   A call to fnmatch() returns a non-zero value	not
		   equal to FNM_NOMATCH	and sets errno to ENOSYS.

	  8    If fnmatch() is supported:
		   When	the FNM_PERIOD flag is set and the
		   FNM_PATHNAME	flag is	clear in the flags argument
		   and the string specified by string matches the
		   specified pattern except that a leading period
		   character in	string is not explicitly matched by a
		   period in pattern, then a call to fnmatch() returns
		   FNM_NOMATCH.
	       Otherwise:
		   A call to fnmatch() returns a non-zero value	not
		   equal to FNM_NOMATCH	and sets errno to ENOSYS.

	  9    If fnmatch() is supported:
		   When	both the FNM_PERIOD and	the FNM_PATHNAME flags
		   are set in the flags	argument and the string
		   specified by	string matches the specified pattern
		   and either the first	character in pattern or	the
		   character immediately following one or more of the
		   slashes in pattern is a period, then	a call to
		   fnmatch() returns 0.
	       Otherwise:
		   A call to fnmatch() returns a non-zero value	not
		   equal to FNM_NOMATCH	and sets errno to ENOSYS.

	  10   If fnmatch() is supported:
		   When	both the FNM_PERIOD and	the FNM_PATHNAME flags
		   are set in the flags	argument and the string
		   specified by	string matches the specified pattern
		   except that either a	leading	period character or a
		   period character immediately	following one or more
		   of the slash	characters in string is	not explicitly
		   matched by a	period in pattern, then	a call to
		   fnmatch() returns FNM_NOMATCH.
	       Otherwise:
		   A call to fnmatch() returns a non-zero value	not
		   equal to FNM_NOMATCH	and sets errno to ENOSYS.

     Untestable	Aspects
	  1    If fnmatch() is supported:
		   When	a call to fnmatch() completes unsuccessfully,
		   then	a nonzero value	not equal to FNM_NOMATCH is
		   returned.

     OUTPUTS
     Tests:
	  1-10 Pass/Fail indication - failure information includes



     Page 3					    (printed 2/21/103)






     fnmatch(XPG4.os/genRelease	4.4.1 (UniSoft fnmatch(XPG4.os/genuts)



	       expected	and detected return values.

     RELEASE
	  4.4.1	(06/09/97)



















































     Page 4					    (printed 2/21/103)



