On (16/04/14 14:39), Nikolai Kondrashov wrote:
On 04/16/2014 02:22 PM, Nikolai Kondrashov wrote:
>On 04/15/2014 09:42 PM, Lukas Slebodnik wrote:
>>On (15/04/14 20:00), Nikolai Kondrashov wrote:
>>>From 76b7d1ff6b1a4117a5e8917b29d8b2b916d1e439 Mon Sep 17 00:00:00 2001
>>>From: Nikolai Kondrashov <Nikolai.Kondrashov(a)redhat.com>
>>>Date: Tue, 15 Apr 2014 19:08:34 +0300
>>>Subject: [PATCH 1/1] tests: Don't assume absolute test dir in test_io.c
>>>
>>>Do not assume TEST_DIR path is absolute in test_io.c, assume it is
>>>the current directory.
>>>
>>>This fixes test-io execution with relative test dir path configured
>>>with --with-test-dir.
>>>---
>>>src/tests/cmocka/test_io.c | 4 ++--
>>>1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>>diff --git a/src/tests/cmocka/test_io.c b/src/tests/cmocka/test_io.c
>>>index 266f2ce..453e8f7 100644
>>>--- a/src/tests/cmocka/test_io.c
>>>+++ b/src/tests/cmocka/test_io.c
>>>@@ -40,7 +40,7 @@
>>>#include "util/util.h"
>>>#include "tests/common.h"
>>>
>>>-#define FILE_PATH TEST_DIR"/test_io.XXXXXX"
>>>+#define FILE_PATH "test_io.XXXXXX"
>>>#define NON_EX_PATH "non-existent-path"
>>>
>>>/* Creates a unique temporary file inside TEST_DIR and returns its path*/
>>>@@ -63,7 +63,7 @@ static char *get_filepath(char path[])
>>>
>>>void setup_dirp(void **state)
>>>{
>>>- DIR *dirp = opendir(TEST_DIR);
>>>+ DIR *dirp = opendir(".");
>>> if (dirp == NULL) {
>>> int err = errno;
>>> fprintf(stderr, "Could not open directory:'%s'
[%s]\n",
>>>--
>>>1.9.1
>>>
>>
>>This patch is useless.
>
>Wrong.
>
>>The default value of TESTDIR is "."
>
>Correct.
>
>It would be nice to at least test and provide more substantial evidence,
>before embarrassing a developer and making him spend time defending his
>patch.
Sorry, I felt a bit upset about "This patch is useless". I understand that my
patch probably didn't explain enough. However, saying "this is unclear, please
elaborate" would have been nicer.
If configure is run without argument "--with-test-dir" test will pass
If configure is run with argument "--with-test-dir=/tmp/dir" test will pass
result: This patch is useless
I can see only one problem.
We do not have a test whether value of --with-test-dir is directory.
LS