bug-myserver
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-myserver] Test for class File, not tested :D


From: Giuseppe Scrivano
Subject: Re: [bug-myserver] Test for class File, not tested :D
Date: Mon, 23 Mar 2009 14:22:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux)

Hello,

> You said that using the default constructor may leave the file
> descriptor in the object inconsistent, but now I explicitly open and
> close the file I'm working with.
> From what I saw in the source for openFile(), I should be either
> getting the right descriptor
> or getting an error.

Right.  By the way, show APIs inconsistence is a side effect of unit testing.


> fname is 
> "/home/sun/tmp/myserver/myserver/trunk/myserver/tests/myserver_2_0.tmp",
> so there's no problem with my using of FilesUtility::temporaryFileName().
>
> So, for now the tests always write to the stdout and read from stdin : )
> Any ideas or should I dive more in the problem?  ( well, at least i'll
> learn more that way : )

Does it use stdin and stdout even after you explicitely open the file
with openFile?  If so, it is a bug and must be fixed.


>   void testGetFileSize ( )
>   {
>     // it should be > 0, because we wrote before ( and what happens when 
> nothing is written ? no file ?
> //    CPPUNIT_ASSERT( tfile->getFileSize ( ) > 0 );
>   }

Here too, please don't depend from the result of another test.  Write
something to the file before look at its size.


The rest of the code seems ok, are MyServer APIs easy to use? :)

Giuseppe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]