Table Class Testing
DescriptionThe 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.
PriorityHigh.
PrerequisitesNone.
AssignedRyex
Everything elseRefer 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.
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
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.
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.
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
They are technically also out of bounds. But test them anyway since there's the alternative that they start indexing from the back.
nope returning nill, assigning to out of bounds dose nothing
committed the finished product
I reviewed the code and committed it. I'd say this is it, the task is done.