diff --git a/testcases/db/version6-transition/README b/testcases/db/version6-transition/README index 62746a43..1059156a 100644 --- a/testcases/db/version6-transition/README +++ b/testcases/db/version6-transition/README @@ -1,19 +1,17 @@ Description =========== Originally, KPhotoAlbum shipped with the standard categories "Keywords", "Locations", and "Persons". These were at some point replaced with the standard categories "Events", "Places", and "People". While "Keywords" and "Events" are not a one-to-one match and can therefore not be renamed automatically, "Locations" and "Persons" were automatically translated, with extra bookkeeping to make sure newer code worked well with the old standard names. To make matters more complex, some versions of KPhotoAlbum stored the localized names of the standard categories into the database. -Beginning with database format version 6, the old names (except "Keywords") are -automatically translated on startup and then stored by their new names. After -the one-time rename operation, the old names loose their "special" meaning and -are handled just like every other user-created category. +Beginning with database format version 6, the old names loose their "special" +meaning and are handled just like every other user-created category. diff --git a/testcases/db/version6-transition/check.sh b/testcases/db/version6-transition/check.sh deleted file mode 100755 index 22236fe8..00000000 --- a/testcases/db/version6-transition/check.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -e - -mydir=`dirname "$0"` -TESTDIR=`mktemp -d kpa.XXXXXX` -echo "Using temporary directory $TESTDIR" >&2 - -for _orig in "$mydir"/*.orig.xml -do - _name=`basename "$_orig"` - _name="${_name/.orig.xml/}" - _dir="$TESTDIR/$_name" - echo "** $_name" >&2 - - mkdir "$_dir" - cp "$_orig" "$_dir/index.xml" - kphotoalbum --db "$_dir/index.xml" - - if diff -u "$mydir/$_name.result.xml" "$_dir/index.xml" - then - echo " SUCCESS" >&2 - else - echo " FAILED" >&2 - fi -done - -echo "Please remember to remove $TESTDIR" >&2 diff --git a/testcases/db/version6-transition/compressed.result.xml b/testcases/db/version6-transition/compressed.result.xml index 8f64a012..5fc0d892 100644 --- a/testcases/db/version6-transition/compressed.result.xml +++ b/testcases/db/version6-transition/compressed.result.xml @@ -1,55 +1,54 @@ - + - + - + - - - + + - - - - + + + + - + diff --git a/testcases/db/version6-transition/demo-to-compressed.result.xml b/testcases/db/version6-transition/demo-to-compressed.result.xml index fc788004..c8c65561 100644 --- a/testcases/db/version6-transition/demo-to-compressed.result.xml +++ b/testcases/db/version6-transition/demo-to-compressed.result.xml @@ -1,96 +1,95 @@ - + - + + - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + diff --git a/testcases/db/version6-transition/positionable-tags.result.xml b/testcases/db/version6-transition/positionable-tags.result.xml index 275e3879..6eccdd09 100644 --- a/testcases/db/version6-transition/positionable-tags.result.xml +++ b/testcases/db/version6-transition/positionable-tags.result.xml @@ -1,55 +1,54 @@ - + - + - + - - - + + - + - diff --git a/testcases/db/version6-transition/uncompressed.result.xml b/testcases/db/version6-transition/uncompressed.result.xml index cb8e8032..3f1c3d26 100644 --- a/testcases/db/version6-transition/uncompressed.result.xml +++ b/testcases/db/version6-transition/uncompressed.result.xml @@ -1,86 +1,85 @@ - + - + - + - - - + + - + - - + - - + - - + - + - - + - - + + diff --git a/testcases/integration-tests/check_dbv6-transition.sh b/testcases/integration-tests/check_dbv6-transition.sh new file mode 100644 index 00000000..dff40c0d --- /dev/null +++ b/testcases/integration-tests/check_dbv6-transition.sh @@ -0,0 +1,48 @@ +_checks[check_dbv6-transition]="Compatibility: upgrade to version 6 database files." +_context[check_dbv6-transition]="

What this test will do:

+

    +
  • This test checks whether pre version 6 database files are properly handled.
  • +
  • After you close this dialog, KPhotoAlbum will be started 4 times in a row.
  • +
+For more information, you can read the remarks in testcases/db/version6-transition/README. +

+

What you have to do:

+
    +
  1. Each time KPhotoAlbum starts, save the database and exit KPhotoAlbum.
  2. +
" +check_dbv6-transition() +{ + local check_name="check_dbv6-transition" + local check_dir="$TEMPDIR/$check_name" + local data_dir="$mydir/db/version6-transition" + setup_check "$check_dir" || return $result_err_setup + # not needed in this scenario: + rm -r "$check_dir/db" + + kdialog --msgbox "

$check_name

${_context[$check_name]}" + + for subcheck in compressed demo-to-compressed positionable-tags uncompressed + do + local subcheck_dir="$check_dir/$subcheck" + mkdir "$subcheck_dir" || return $result_err_setup + + local add_rc="[General]\nuntaggedCategory=\nuntaggedTag=\n" + if [[ "$subcheck" == "uncompressed" ]] + then + add_rc="$add_rc\nuseCompressedIndexXML=false\n" + fi + echo -e "$add_rc$BASE_RC" > "$subcheck_dir/kphotoalbumrc" || return $result_err_setup + + # prepare database: + cp "$data_dir/$subcheck.orig.xml" "$subcheck_dir/index.xml" || return $result_err_setup + + export XDG_CONFIG_HOME="$subcheck_dir" + kphotoalbum --db "$subcheck_dir/index.xml" > "$subcheck_dir/log" 2>&1 || return $result_err_crash + + if ! diff -u "$data_dir/$subcheck.result.xml" "$subcheck_dir/index.xml" + then + return $result_failed + fi + done + return $result_ok +}