-
Notifications
You must be signed in to change notification settings - Fork 123
Conversation
|
||
typedef enum | ||
{ | ||
BSN, //Below Same Namespace, cascading namespace matches only cascading namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be in proposal first. And please suffix the names.
just wanted to know if it's basically ok (return values/relationship checks/etc) before i finish it up |
Its always good if you write what you want to know directly in the PR description :-) Again, its hard to say what you wanted to achieve. Please put proper API docu in the source. The description of the return values seem to be flawed, -1 is used for two different purposes. Why do you think is the And I need to get used to the enum values... Maybe a bit longer names would be better. (comment was edited multiple times) |
{ | ||
if (!key || !check) return -1; | ||
if (!key->key || !check->key) return -1; | ||
if (!keyCmp (key, check)) return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would avoid this, users can check with keyCmp themselves.
you are right about the return values. not even sure if checking if the keys are the same is needed here. |
where should i put the testcases for keyRel2 ? |
nvm, just found test_proposal.c i've updated it now, and used longer names for the enum values |
@@ -64,5 +186,9 @@ int main (int argc, char ** argv) | |||
test_ksPopAtCursor (); | |||
test_ksToArray (); | |||
|
|||
test_keyAsCascading (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please run code formatter
@markus2330 done |
Thank you, well done! |
Key relation types: Below, DirectBelow, Silbling, and Nephew
DirectBelow and Silbling are boolean tests
relation suffixes:
SN: the namespaces have to match
IN: ignoring namespaces completely
CN: cascading namespace matches all namespaces
currently returns:
-1 for invalid keys / usage error
0 for failed tests
1 if a boolean relation test succeeded