X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Fovsdb-data.at;h=51d32e7317351517f127db3b9accf3bd1c150b08;hb=cfc50ae514f805dcd9c14589f21158185424daf6;hp=98e810837aac481691b1c23adf1c52ace32237bb;hpb=991559357f6a03c3a5b70c053c8c2554aa8d5ee4;p=sliver-openvswitch.git diff --git a/tests/ovsdb-data.at b/tests/ovsdb-data.at index 98e810837..51d32e731 100644 --- a/tests/ovsdb-data.at +++ b/tests/ovsdb-data.at @@ -231,14 +231,28 @@ OVSDB_CHECK_POSITIVE_CPY([real not acceptable integer JSON atom], dnl is not allowed anywhere in a UTF-8 string. dnl is a surrogate and not allowed in UTF-8. -OVSDB_CHECK_POSITIVE_CPY([no invalid UTF-8 sequences in strings], +OVSDB_CHECK_POSITIVE([no invalid UTF-8 sequences in strings], [parse-atoms '[["string"]]' \ '@<:@"m4_esyscmd([printf "\300"])"@:>@' \ '@<:@"m4_esyscmd([printf "\355\240\200"])"@:>@' \ ], - [constraint violation: "m4_esyscmd([printf "\300"])" is not a valid UTF-8 string: invalid UTF-8 sequence 0xc0 -constraint violation: "m4_esyscmd([printf "\355\240\200"])" is not a valid UTF-8 string: invalid UTF-8 sequence 0xed 0xa0], - [], [], [xfail]) + [constraint violation: not a valid UTF-8 string: invalid UTF-8 sequence 0xc0 +constraint violation: not a valid UTF-8 string: invalid UTF-8 sequence 0xed 0xa0]) + +dnl Python won't let invalid UTF-8 (its idea of invalid UTF-8, anyway) into it +dnl at all, so this test never gets as far as a constraint violation. It's +dnl just a JSON parse error. +dnl +dnl is not allowed anywhere in a UTF-8 string. +dnl ( is not allowed in UTF-8 but Python doesn't care.) +dnl is not allowed in UTF-8. +OVSDB_CHECK_POSITIVE_PY([no invalid UTF-8 sequences in strings - Python], + [parse-atoms '[["string"]]' \ + '@<:@"m4_esyscmd([printf "\300"])"@:>@' \ + '@<:@"m4_esyscmd([printf "\355\200\177"])"@:>@' \ +], + ["not a valid UTF-8 string: invalid UTF-8 sequence 0xc0" +"not a valid UTF-8 string: invalid UTF-8 sequence 0xed 0x80"]) OVSDB_CHECK_NEGATIVE([real not acceptable integer string atom], [[parse-atom-strings '["integer"]' '0.5' ]], @@ -260,6 +274,10 @@ OVSDB_CHECK_POSITIVE_CPY([uuid atom must be expressed as JSON array], [[parse-atoms '["uuid"]' '["550e8400-e29b-41d4-a716-446655440000"]']], [[syntax ""550e8400-e29b-41d4-a716-446655440000"": syntax error: expected ["uuid", ]]]) +OVSDB_CHECK_POSITIVE_CPY([named-uuid requires symbol table], + [parse-atoms '[["uuid"]]' '[["named-uuid", "x"]]'], + [[syntax "["named-uuid","x"]": syntax error: expected ["uuid", ]]]) + OVSDB_CHECK_NEGATIVE([empty string atom must be quoted], [[parse-atom-strings '["string"]' '']], [An empty string is not valid as input; use "" to represent the empty string]) @@ -449,7 +467,11 @@ constraint violation: "a" length 1 is less than minimum allowed length 2 "ab" "abc" constraint violation: "𝄞" length 1 is less than minimum allowed length 2]], - [], [], [xfail]) + [], + [], + [dnl This test requires a wide build of Python. + AT_CHECK([$PYTHON -c 'unichr(0x10000)' || exit 77], + [0], [ignore], [ignore])]) OVSDB_CHECK_POSITIVE_CPY([strings no more than 2 characters long], [[parse-atoms '{"type": "string", "maxLength": 2}' \ @@ -457,12 +479,12 @@ OVSDB_CHECK_POSITIVE_CPY([strings no more than 2 characters long], '["a"]' \ '["ab"]' \ '["abc"]' \ - '["\ud834\udd1e"]']], + '["de"]']], [["" "a" "ab" constraint violation: "abc" length 3 is greater than maximum allowed length 2 -"𝄞"]]) +"de"]]) AT_BANNER([OSVDB -- simple data])