[pso] test windows

Ioana Cutcutache pso@cursuri.cs.pub.ro
Sat, 15 May 2004 21:21:19 +0300


This is a multi-part message in MIME format.

------=_NextPart_000_0014_01C43AC2.905DF680
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


    Testul de windows pentru tema4 contine o gramada de greseli, nu cred =
ca cineva chiar l-a incercat..
    De exemplu :=20

    - in test_statfs testarea se face astfel :
        test("test free blocks", 0, FreeBlocks =3D =
PitixSuperBlock.bfree);
    test care evident ca o sa reuseasca mereu. Daca chiar s-ar face =
testare ar trebui recitit superblocul de pe disc si pus =3D=3D, nu =3D.

    - in test_file fisierul cu care se face comparatia (host) este =
deschis astfel :
    HostHandle =3D CreateFile(pitix_full_path, GENERIC_READ | =
GENERIC_WRITE ....)
                                        ^^^^^^^^^^^^^^^^
   adica se deschide tot pitix si astfel se compara cu el insusi.
   Si tot aici, la test file data, ar trebui sa fie=20
   test(str, 0, i =3D=3D file_size); si nu  test(str, 0, i =3D=3D =
(file_size -1));
   si in plus in macro-ul test ar trebui folosit un alt indice in loc de =
i (de ex. j) pt. ca strica i-ul care este testat aici.

    - in test_create  dupa ce este creat fisierul care va fi copiat si =
sunt scrise in el datele se recreaza si astfel se obtine un fisier gol =
care se copiaza...

    - si in test_delete sunt greseli , se face :
     str =3D (char*)malloc(sizeof("p:\\") + sizeof(token) + 1);
     strcat(str, "p:\\");
     strcat(str, token);
si evident ca primul ar trebui sa fie strcpy. si mai este inca o =
greseala similara tot aici.

  =20

------=_NextPart_000_0014_01C43AC2.905DF680
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; Testul de windows =
pentru tema4=20
contine o gramada de greseli, nu cred ca cineva chiar l-a=20
incercat..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; De exemplu : =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; - in test_statfs =
testarea se=20
face astfel :</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT=20
size=3D2>test("test free blocks", 0, FreeBlocks =3D=20
PitixSuperBlock.bfree);</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp; test =
care evident=20
ca o sa reuseasca mereu. Daca chiar s-ar face testare ar trebui recitit=20
superblocul de pe disc si pus =3D=3D, nu =3D.</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; - in test_file =
fisierul cu care=20
se face comparatia (host) este deschis astfel :</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; <FONT =
size=3D2>HostHandle =3D=20
CreateFile(pitix_full_path, GENERIC_READ | GENERIC_WRITE=20
....)</FONT></FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;=20
^^^^^^^^^^^^^^^^</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; adica se deschide tot =
pitix si astfel=20
se compara cu el insusi.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; Si tot aici, la test file =
data, ar=20
trebui sa fie </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; <FONT size=3D2>test(str, =
0, i =3D=3D=20
file_size); si nu&nbsp; <FONT size=3D2>test(str, 0, i =3D=3D (file_size=20
-1));</FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; si in plus in =
macro-ul&nbsp;test ar=20
trebui folosit un alt indice in loc de i (de ex. j) pt. ca strica i-ul =
care este=20
testat aici.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; - in =
test_create&nbsp; dupa ce=20
este creat fisierul care va fi copiat si sunt scrise in el datele se =
recreaza si=20
astfel se obtine un fisier gol care se copiaza...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; - si in test_delete =
sunt greseli=20
, se face :</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; s<FONT =
size=3D2>tr =3D=20
(</FONT><FONT size=3D2>char</FONT><FONT size=3D2>*)malloc(</FONT><FONT=20
size=3D2>sizeof</FONT><FONT size=3D2>("p:\\") + </FONT><FONT=20
size=3D2>sizeof</FONT><FONT size=3D2>(token) + 1);</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; =
strcat(str,=20
"p:\\");</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; =
strcat(str,=20
token);</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT size=3D2>si evident ca primul ar =
trebui sa fie=20
strcpy. si mai este inca o greseala similara tot =
aici.</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT =
size=3D2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><FONT=20
size=3D2>&nbsp;&nbsp;&nbsp;</DIV></FONT></FONT></BODY></HTML>

------=_NextPart_000_0014_01C43AC2.905DF680--