[Finished] [RGSS] Table Class Testing

Started by Blizzard, March 27, 2011, 07:31:09 am

Previous topic - Next topic

Blizzard

March 27, 2011, 07:31:09 am Last Edit: September 10, 2011, 03:26:43 am by Blizzard
Table Class Testing




Description

The table class is one of the trickier classes because it has quite a few extra functionalities. This task covers 2 things.

1. Check how the original behaves when you try to access (get or set) data with one or more indexes outside of the boundaries (e.g. make a table with dimensions 2, 2, 2 and try to access 3, 2, 2 or something like that). This behavior needs to be implemented if necessary. Currently there are no limitations, no clamping and actually you can access data like this even though it should not be possible.

2. The class needs to be tested. Make a table, run some tests, check if everything behaves normally. Try creating and destroying the table (such as creating within a function and after the end of the function, call GC.start). I suggest that you add zer0::log calls in the creation (rb_new) an destruction routines (gc_free). Remember to temporarily include zer0.h if you call zer0::log.



Priority

High.



Prerequisites

None.



Assigned

Ryex



Everything else

Refer to this topic for the first part of the task.
Don't forget to implement x, y, z limitations using hclamp if you find out the real RGSS does not throw errors when the indexes are out of the boundaries.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

April 04, 2011, 08:24:11 pm #1 Last Edit: April 05, 2011, 12:48:51 am by Ryex
I'm going to do the testing in a little bit here, the first question I answered in the  other topic I'll implement that behavior.

EDIT:
I tried
#include <zer0/zer0.h>

but it just gave me an error about not being able to open the source file

so I just riped and modified the log function from the arc namespace

EDIT:
ok I've tested the table and it seems to work perfectly so far, I haven't implemented the out of bounds returns nil because I reallied I never tested what negative indexes do.

In light of my logging troubles I would like to suggest that the log call be extended into the RGSS library.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

zer0.h is part of the zer0 project while the rgss project is separate. You can't use zer0.h in rgss anymore. ._. You'll have to use printf().
I'll add a log function into the rgss library as well. I will commit the changes in a couple of minutes.
Test what negative indexes do and what out-of-bounds indexes do.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

I know what out of bounds indexes do. they return nil like I put in the questions topic. I just don't know what negative indexes do
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

They are technically also out of bounds. But test them anyway since there's the alternative that they start indexing from the back.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

nope returning nill, assigning to out of bounds dose nothing
committed the finished product
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

I reviewed the code and committed it. I'd say this is it, the task is done.
Check out our game brands:

Daygames
Game Night Games
Chugnar Games

Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.