Hi!
> +#define TESTDIR "testdir"
> +#define NEW_TESTDIR "newtestdir"
> +#define TESTFILE "testfile"
> +#define NEW_TESTFILE "newtestfile"
> +#define TESTFILE2 "testdir/testfile"
> +#define NEW_TESTFILE2 "newtestdir/newtestfile"
> +#define TESTFILE3 "/tmp/testfile3"
> +#define NEW_TESTFILE3 "/tmp/newtestfile3"

The test must not create files outside of the test tmpdir. Have a look
at mkdriat01.c, readlinkat01.c or any *at01.c that I've fixed recently.

You need to construct the absolute path from output of tst_get_tmpdir().

> +static void setup(void);
> +static void cleanup(void);
> +static void test_success1(void);
> +static void test_success2(void);
> +static void test_success3(void);
> +static void test_enotdir(void);
> +static void test_ebadf(void);
> +static void check_and_print(int expected_errno);
> +
> +static void (*testfunc[])(void) = { test_success1, test_success2,
> +                             test_success3, test_enotdir, test_ebadf };

I think that the data driven approach (having one structure with all
parameters and single test function) is a bit easier to read, but that
is not a big problem. Have a look at mkdirat01.c.

-- 
Cyril Hrubis
chru...@suse.cz

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to