diff --git a/ChangeLog b/ChangeLog index ac699ccfdcaecd944b635ca3d689a853c865cd07..2186c843ede9da3d39b92a30d41b328e79561538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2006-08-01 Per Cederqvist + Added more test cases for aux-items with restrictions on when they + can be set. + * src/server/testsuite/lyskomd.0/55.exp: New file. Test creation + of aux-items that are only allowed to be set when modifying or + creating an object. + * src/server/testsuite/lyskomd.0/aux-items-55.conf: New file, used + by 55.exp. + Comment fix. * src/server/aux-items.c (aux_item_validate): Fixed a typo in a comment. diff --git a/src/server/testsuite/lyskomd.0/55.exp b/src/server/testsuite/lyskomd.0/55.exp new file mode 100644 index 0000000000000000000000000000000000000000..7710139c2ef9d5207837d7c5e853336a583c51c6 --- /dev/null +++ b/src/server/testsuite/lyskomd.0/55.exp @@ -0,0 +1,119 @@ +# Test suite for lyskomd. +# Copyright (C) 2006 Lysator Academic Computer Association. +# +# This file is part of the LysKOM server. +# +# LysKOM is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 1, or (at your option) +# any later version. +# +# LysKOM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with LysKOM; see the file COPYING. If not, write to +# Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN, +# or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, +# MA 02139, USA. +# +# Please report bugs at http://bugzilla.lysator.liu.se/. + +# Test creation of aux-items that are only allowed to be set when +# modifying or creating an object. + +# Start lyskomd. +lyskomd_start "lyskomd.0/aux-items-55.conf" + +# Connect session 1. +client_start 1 +send "A[holl "one"]\n" +simple_expect "LysKOM" "connected" +send "1000 80 1 { 12 }\n" +simple_expect "=1000" +send "1001 0 5 [holl "gazonk"]\n" +simple_expect "=1001" + +# Create a text with a create-only aux-item. +send "1002 86 [holl "foo"] 0 { } 1 { 1 00000000 0 [holl "foo"] }\n" +simple_expect "=1002 1" + +# Create a text with a modify-only aux-item (fails). +send "1003 86 [holl "foo"] 0 { } 1 { 2 00000000 0 [holl "foo"] }\n" +simple_expect "%1003 49 0" + +# Add a create-only aux-item to a text (fails). +send "1004 92 1 0 { } 1 { 1 00000000 0 [holl "foo"] }\n" +simple_expect "%1004 49 0" + +# Add a modify-only aux-item to a text. +send "1005 92 1 0 { } 1 { 2 00000000 0 [holl "foo"] }\n" +simple_expect "=1005" + +# Create a conference with a create-only aux-item. +send "1006 88 [holl "attempt 1"] 00001000 1 { 3 00000000 0 [holl "foo"] }\n" +simple_expect "=1006 6" + +# Create a conference with a modify-only aux-item (fails). +send "1007 88 [holl "attempt 2"] 00001000 1 { 4 00000000 0 [holl "foo"] }\n" +simple_expect "%1007 49 0" + +# Add a create-only aux-item to a conference (fails). +send "1008 93 6 0 { } 1 { 3 00000000 0 [holl "foo"] }\n" +simple_expect "%1008 49 0" + +# Add a modify-only aux-item to a conference. +send "1009 93 6 0 { } 1 { 4 00000000 0 [holl "foo"] }\n" +simple_expect "=1009" + +# Create a person with a create-only aux-item. +send "1010 89 [holl "attempt 3"] [holl "secret 3"] 00000000 1 { 5 00000000 0 [holl "foo"] }\n" +extracting_expect "=1010 ($any_num)" attempt3 1 +set test "Correct conference number created" +if {$attempt3 == 7} { + pass "$test" +} else { + if {$attempt3 == 8} { + setup_xfail "*-*-*" "Bug 146" + } + fail "$test (got $attempt3 instead of 7)" +} + +# Create a person with a modify-only aux-item (fails). +send "1011 89 [holl "attempt 4"] [holl "secret 4"] 00000000 1 { 6 00000000 0 [holl "foo"] }\n" +simple_expect "%1011 49 0" + +# Add a create-only aux-item to a person (fails). +send "1012 93 $attempt3 0 { } 1 { 5 00000000 0 [holl "foo"] }\n" +simple_expect "%1012 49 0" + +# Add a modify-only aux-item to a person. +send "1013 93 $attempt3 0 { } 1 { 6 00000000 0 [holl "foo"] }\n" +simple_expect "=1013" + +# Create a text with a create-only "any" aux-item. +send "1014 86 [holl "foo"] 0 { } 1 { 7 00000000 0 [holl "foo"] }\n" +simple_expect "=1014 2" + +# Create a text with a modify-only "any" aux-item (fails). +send "1015 86 [holl "foo"] 0 { } 1 { 8 00000000 0 [holl "foo"] }\n" +simple_expect "%1015 49 0" + +# Add a create-only "any" aux-item to a text (fails). +send "1016 92 1 0 { } 1 { 7 00000000 0 [holl "foo"] }\n" +simple_expect "%1016 49 0" + +# Add a modify-only "any" aux-item to a text. +send "1017 92 1 0 { } 1 { 8 00000000 0 [holl "foo"] }\n" +simple_expect "=1017" + +# Shut down. +talk_to client 1 +send "1018 42 255\n" +simple_expect "=1018" +send "1019 44 0\n" +simple_expect "=1019" +client_death 1 +lyskomd_death diff --git a/src/server/testsuite/lyskomd.0/aux-items-55.conf b/src/server/testsuite/lyskomd.0/aux-items-55.conf new file mode 100644 index 0000000000000000000000000000000000000000..adf57482c2702d608b8bc1ebea19985f6b58c755 --- /dev/null +++ b/src/server/testsuite/lyskomd.0/aux-items-55.conf @@ -0,0 +1,31 @@ +1 : create-text (create text) +{ +} + +2 : modify-text (modify text) +{ +} + +3 : create-conf (create conference) +{ +} + +4 : modify-conf (modify conference) +{ +} + +5 : create-letterbox (create letterbox) +{ +} + +6 : modify-letterbox (modify letterbox) +{ +} + +7 : create-any (create any) +{ +} + +8 : modify-any (modify any) +{ +}