Jump to page: 1 2
Thread overview
DStress / regression tests
Sep 23, 2004
Thomas Kuehne
Sep 23, 2004
Ben Hinkle
Sep 23, 2004
Thomas Kuehne
Sep 25, 2004
Thomas Kuehne
Sep 23, 2004
Ben Hinkle
Sep 23, 2004
Thomas Kuehne
Sep 24, 2004
Russ Lewis
Sep 24, 2004
Ben Hinkle
Sep 24, 2004
Thomas Kuehne
Sep 24, 2004
Ben Hinkle
Sep 23, 2004
Ben Hinkle
Sep 23, 2004
Sjoerd van Leent
Sep 23, 2004
Thomas Kuehne
Sep 24, 2004
Helmut Leitner
September 23, 2004
I've put my regression tests and the results online.
These tests have been performed on a Linux box.

http://dmd.kuehne.cn/dstress.html

Everybody is invited to add or correct tests.

Thomas


September 23, 2004
"Thomas Kuehne" <eisvogel@users.sourceforge.net> wrote in message news:ciutra$1m5e$1@digitaldaemon.com...
> I've put my regression tests and the results online.
> These tests have been performed on a Linux box.
>
> http://dmd.kuehne.cn/dstress.html
>
> Everybody is invited to add or correct tests.
>
> Thomas
>
>

That's a good idea to keep a testsuite so we can track issues (though Walter is doing the same thing I'm sure...)

How do we correct (or remove) tests? In particular I think test in_03.d should be removed. The "in" parameter is the object reference and doesn't apply to the member fields of the object. Either that or the test should be changed so that the final assert should make sure the field has the new value and not the old one.

It would be nice to review any that are failing and see if they are in fact bugs.

-Ben


September 23, 2004
"Thomas Kuehne" <eisvogel@users.sourceforge.net> wrote in message news:ciutra$1m5e$1@digitaldaemon.com...
> I've put my regression tests and the results online.
> These tests have been performed on a Linux box.
>
> http://dmd.kuehne.cn/dstress.html
>
> Everybody is invited to add or correct tests.
>
> Thomas
>
>

It would also be nice to say on the web page which platform the tests were run on. When I run foreach_13.d on win32 it passes just fine. Plus I'm not sure one can change the values in string constants (ala C string constants). Try "dup"ing the string before changing it.

-Ben


September 23, 2004
in bit_05.d the line
 MyClass c;
should be
 MyClass c = new MyClass;

"Thomas Kuehne" <eisvogel@users.sourceforge.net> wrote in message news:ciutra$1m5e$1@digitaldaemon.com...
> I've put my regression tests and the results online.
> These tests have been performed on a Linux box.
>
> http://dmd.kuehne.cn/dstress.html
>
> Everybody is invited to add or correct tests.
>
> Thomas
>
>


September 23, 2004
Ben Hinkle wrote:
> in bit_05.d the line
>  MyClass c;
> should be
>  MyClass c = new MyClass;
> 
> "Thomas Kuehne" <eisvogel@users.sourceforge.net> wrote in message
> news:ciutra$1m5e$1@digitaldaemon.com...
> 
>>I've put my regression tests and the results online.
>>These tests have been performed on a Linux box.
>>
>>http://dmd.kuehne.cn/dstress.html
>>
>>Everybody is invited to add or correct tests.
>>
>>Thomas
>>
>>
> 
> 
> 

Indeed, MyClass is not initialized, therefor it is correct behaviour to fail.

Regards,
Sjoerd
September 23, 2004
> Indeed, MyClass is not initialized, therefor it is correct behaviour to fail.

Ops, fixed

Thomas


September 23, 2004
Ben Hinkle schrieb:
> It would also be nice to say on the web page which platform the tests were run on.
Yup, done

> When I run foreach_13.d on win32 it passes just fine. Plus I'm not
> sure one can change the values in string constants (ala C string
> constants).
> Try "dup"ing the string before changing it.

I don't see any constant there.

I thought the following snipplets had the same effect ...

--A--
char[2] array;
array[0]='a';
array[1]='b';

--B--
char[] array="ab";

apparently  they behave differently - at least on linux ;)

Rewritten in plain c and compiled with gcc-3.4 those two snipplets behaved alike.

Thomas



September 23, 2004
Ben Hinkle schrieb:
>  In particular I think test in_03.d
> should be removed. The "in" parameter is the object reference and doesn't
> apply to the member fields of the object. Either that or the test should
> be changed so that the final assert should make sure the field has the
> new value and not the old one.

Thanks, I fixed in_03.

Concerning adding & fixing:
Tomorrow I am going to bring the cvs server online.
Anonymous read access for everyone and write access on request.

Thomas




September 24, 2004

Thomas Kuehne wrote:
> 
> I've put my regression tests and the results online.
> These tests have been performed on a Linux box.
> 
> http://dmd.kuehne.cn/dstress.html
> 
> Everybody is invited to add or correct tests.

Thank you for creating that page.

-- 
Helmut Leitner    leitner@hls.via.at
Graz, Austria   www.hls-software.com
September 24, 2004
Thomas Kuehne wrote:
> I thought the following snipplets had the same effect ...
> 
> --A--
> char[2] array;
> array[0]='a';
> array[1]='b';
> 
> --B--
> char[] array="ab";
> 
> apparently  they behave differently - at least on linux ;)
> 
> Rewritten in plain c and compiled with gcc-3.4 those two snipplets behaved
> alike.

You'll be really excited when you understand the difference :)

'A' above declares a static array of length 2.  Its length cannot ever be changed, and you can think of it more or less like the C array. Although the fact that you can't change the length (which means less flexibility), this means that the compiler can know the length of the array at all times, and that might mean it's more efficient.

'B' declares a dynamic array.  A dynamic array can be thought of as a struct like this:
	struct Array {
		char *ptr;
		int length;
	} array;
When you set a dynamic array, you are setting its pointer an length variables.  Dynamic arrays are thus fundamentally different than C arrays.  You can resize them, you can concatenate them together, etc.

I would highly recommend that you use dynamic arrays at all times. Never use static arrays unless you really know that you need them.  Get used to the flexibility and power of dynamic arrays, and you'll never want to go back!

One more caveat to remember: since D arrays know their own length, D strings are typically NOT null terminated.  Thus, the length of the array in 'B' above is 2.  However, this means that you can't cut down the length of a static array by adding a null.  For instance, see the code below:
	char[4] static_arr;
	static_arr[0] = 'a';
	static_arr[1] = 'b';
	static_arr[2] = '\0';
The length of static_arr is still 4!  This can be a problem if you tried to concatenate strings.  What happens if you do this?
	char[] concat_arr = static_arr ~ "cd";
I'm pretty sure (95%) that you end up with an array of length 6, with a null character (and an undefined character) in the middle.  In the above example, what would have worked better would have been:
	char[] dyn_arr;
	dyn_arr = "ab";
	char[] concat_arr2 = dyn_arr ~ "cd";
This code does what you want.

« First   ‹ Prev
1 2