Index: contrib/netbsd-tests/sbin/newfs_msdos/t_create.sh =================================================================== --- contrib/netbsd-tests/sbin/newfs_msdos/t_create.sh +++ contrib/netbsd-tests/sbin/newfs_msdos/t_create.sh @@ -31,11 +31,21 @@ } validfat32_body() { - atf_check -s eq:0 -o ignore -e ignore \ + if true; then + # FreeBSD + exp_err=empty + fsck=fsck_msdosfs + else + # NetBSD + exp_err=ignore + fsck=fsck_msdos + fi + + atf_check -s eq:0 -o ignore -e $exp_err \ newfs_msdos -b 512 -C 33m -F 32 msdos.img # fsck_msdos/newfs_msdos have been fixed # atf_expect_fail "PR bin/46743" - atf_check -s eq:0 -o not-match:FIXED -e empty fsck_msdos -p msdos.img + atf_check -s eq:0 -o not-match:FIXED -e empty $fsck -p msdos.img atf_expect_pass } Index: etc/mtree/BSD.tests.dist =================================================================== --- etc/mtree/BSD.tests.dist +++ etc/mtree/BSD.tests.dist @@ -442,6 +442,8 @@ .. mdconfig .. + newfs_msdos + .. nvmecontrol .. pfctl Index: sbin/newfs_msdos/Makefile =================================================================== --- sbin/newfs_msdos/Makefile +++ sbin/newfs_msdos/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PACKAGE=runtime PROG= newfs_msdos MAN= newfs_msdos.8 @@ -11,4 +13,7 @@ .endif CSTD= c11 +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include Index: sbin/newfs_msdos/mkfs_msdos.c =================================================================== --- sbin/newfs_msdos/mkfs_msdos.c +++ sbin/newfs_msdos/mkfs_msdos.c @@ -842,10 +842,10 @@ static ssize_t getchunksize(void) { - static int chunksize; + static ssize_t chunksize; if (chunksize != 0) - return ((ssize_t)chunksize); + return (chunksize); #ifdef KERN_MAXPHYS int mib[2]; @@ -874,7 +874,7 @@ assert(powerof2(chunksize)); assert(chunksize > MAXBPS); - return ((ssize_t)chunksize); + return (chunksize); } /* Index: sbin/newfs_msdos/tests/Makefile =================================================================== --- /dev/null +++ sbin/newfs_msdos/tests/Makefile @@ -0,0 +1,6 @@ +TESTSRC=${SRCTOP}/contrib/netbsd-tests/sbin/newfs_msdos + +NETBSD_ATF_TESTS_SH+= create + +.include +.include