Chaos Project

Featured Projects => Tasks => Advanced RPG Creator => Finished Tasks => Topic started by: Blizzard on March 27, 2011, 07:31:09 am

Title: [Finished] [RGSS] Table Class Testing
Post by: Blizzard on March 27, 2011, 07:31:09 am
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 (http://forum.chaos-project.com/index.php/topic,9089.0) 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.
Title: Re: Table Class Testing
Post by: Ryex on April 04, 2011, 08:24:11 pm
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.
Title: Re: Table Class Testing
Post by: Blizzard on April 05, 2011, 02:43:24 am
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.
Title: Re: Table Class Testing
Post by: Ryex on April 05, 2011, 02:52:23 am
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
Title: Re: Table Class Testing
Post by: Blizzard on April 05, 2011, 03:55:06 am
They are technically also out of bounds. But test them anyway since there's the alternative that they start indexing from the back.
Title: Re: Table Class Testing
Post by: Ryex on April 05, 2011, 04:38:15 am
nope returning nill, assigning to out of bounds dose nothing
committed the finished product
Title: Re: [Finished] Table Class Testing
Post by: Blizzard on April 05, 2011, 06:14:02 am
I reviewed the code and committed it. I'd say this is it, the task is done.