Skip to content
Snippets Groups Projects
Commit 147c0add authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Renamed the error code illegal-aux-item to illegal-aux-item-tag.

Added error code 62=aux-exists, 63=aux-bad-object,
64=illegal-aux-data, 65=aux-create-only, 66=aux-modify-only,
67=aux-server-only, 68=aux-data-exists and 69=aux-no-such-text.
Return proper error codes.  (Bug 192).
* doc/Protocol-A.texi (Predefined Aux-Item Types): Renamed the
error code illegal-aux-item to illegal-aux-item-tag.
(create-text): Updated the error code section to mention the
aux-related error codes illegal-aux-item-tag, aux-item-permission,
aux-exists, aux-bad-object, illegal-aux-data, aux-modify-only,
aux-server-only, aux-data-exists and aux-no-such-text instead of
only illegal-aux-item and aux-item-permission.  Refer to the
"Error Codes" node instead of duplicating the reasons here.
(create-anonymous-text): Ditto.
(create-conf): Ditto.
(create-person): Ditto.
(modify-text-info): Ditto, but with aux-create-only instead of
aux-modify-only.
(modify-conf-info): Ditto.
(modify-system-info): Ditto.
(Error Codes): Renamed error code 48 from illegal-aux-item to
illegal-aux-item-tag, and redefine it to not include errors in the
data.  Added error code 62=aux-exists, 63=aux-bad-object,
64=illegal-aux-data, 65=aux-create-only, 66=aux-modify-only,
67=aux-server-only, 68=aux-data-exists and 69=aux-no-such-text.
* doc/Makefile.am (check-doc): Replaced the error code
illegal-aux-item with illegal-aux-item-tag and
illegal-aux-item-data.
* src/include/kom-errno.h (enum kom_err): Renamed KOM_ILL_AUX to
KOM_ILL_AUX_TAG.  Added KOM_AUX_EXISTS, KOM_AUX_BAD_OBJECT,
KOM_ILL_AUX_DATA, KOM_AUX_CREATE_ONLY, KOM_AUX_MODIFY_ONLY,
KOM_AUX_SERVER_ONLY, KOM_AUX_DATA_EXISTS and KOM_AUX_NO_SUCH_TEXT.
* src/server/aux-items.c (aux_item_validate): Doc added.  Added
missing punctuation in comments.  Set kom_errno to
KOM_ILL_AUX_DATA instead of KOM_ILL_AUX when a regexp cannot be
compiled or doesn't match an entry, or when a validator fails.
(aux_item_add_perm): Document that kom_errno is set on failure.
Do not modify kom_errno on success.  Track name change of
KOM_ILL_AUX_TAG.  Set KOM_AUX_MODIFY_ONLY, KOM_AUX_CREATE_ONLY,
KOM_AUX_SERVER_ONLY when appropriate (used to be KOM_AUX_PERM).
Don't override the error code set by aux_item_check_unique() or
aux_item_validate() when any of those check fails.
(aux_item_check_unique): Set kom_errno to KOM_AUX_EXISTS or
KOM_AUX_DATA_EXISTS on failure (used to sometimes be
KOM_ILL_AUX).
(text_stat_check_add_aux_item_list): Track name change of
KOM_ILL_AUX_TAG.  Set kom_errno to KOM_AUX_BAD_OBJECT if the
aux-item is not allowed on the active object (used to be
KOM_AUX_PERM).
(conf_stat_check_add_aux_item_list): Ditto.
(system_check_add_aux_item_list): Ditto.
(aux_item_validate_existing_text): Set kom_errno to
KOM_AUX_NO_SUCH_TEXT instead of NO_SUCH_TEXT.  Set it to
KOM_ILL_AUX_DATA if the text number is non-numeric.
* src/server/testsuite/lyskomd.0/00.exp: Updated the expected
error codes for aux-item-related errors.
* src/server/testsuite/lyskomd.0/03.exp: Ditto.
* src/server/testsuite/lyskomd.0/04.exp: Ditto.
* src/server/testsuite/lyskomd.0/14.exp: Ditto.
* src/server/testsuite/lyskomd.0/17.exp: Ditto.
* src/server/testsuite/lyskomd.0/55.exp: Ditto.
* src/server/testsuite/lyskomd.0/aux-items-cov.exp: Ditto.
* src/server/testsuite/lyskomd.0/bug-572.exp: Ditto.
* src/server/testsuite/lyskomd.0/20.exp: Ditto.  Remove the
want_illegal_aux_item proc and simplify the code that checks the
error codes.
* src/server/testsuite/lyskomd.0/23.exp: Ditto.
* src/server/testsuite/lyskomd.0/26.exp: Ditto.
* src/server/testsuite/lyskomd.0/28.exp: Ditto.

Added test cases for handling duplicate faq-text aux-items.
* src/server/testsuite/lyskomd.0/21.exp: Added new tests that
attempt to set duplicate faq-text aux-items on a conference in
various ways, and removing it and re-adding it.  Also test adding
two different faq-text aux-items at the same time.
parent 16e3ba24
Branches
Tags
No related merge requests found
Showing
with 617 additions and 417 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment