diff --git a/testcases/db/old-index.xml/README.md b/testcases/db/old-index.xml/README.md new file mode 100644 index 00000000..5416f89d --- /dev/null +++ b/testcases/db/old-index.xml/README.md @@ -0,0 +1,17 @@ +Description +=========== + +This folder contains the demo database files for various old versions of +kphotoalbum (and kimdaba). + + +## Note: version names + +The version indication of the file names refers to the version of +kphotoalbum/kimdaba, not the file format version (which can be seen by looking +at the file contents). + +## Note: compatibility + +The current state of affairs is that kphotoalbum can not read version 1 files, +i.e. files written by kimdaba/kphotoalbum v2.1 and lower. diff --git a/testcases/db/old-index.xml/v1.0.orig.xml b/testcases/db/old-index.xml/v1.0.orig.xml new file mode 100644 index 00000000..5dd42d24 --- /dev/null +++ b/testcases/db/old-index.xml/v1.0.orig.xml @@ -0,0 +1,388 @@ + + + + + + + + + + + Label and Dates + true + true + + + Image Preview + true + true + + + Description + true + true + + + Keywords + true + true + + + Locations + true + true + + + Persons + true + true + + + Label and Dates + Description + 0 + 31 + Label and Dates,Description + true + true + + + Label and Dates,Description + Image Preview + 1 + 70 + Label and Dates,Description,Image Preview + true + true + + + Locations + Keywords + 1 + 50 + Locations,Keywords + true + true + + + Persons + Locations,Keywords + 1 + 34 + Persons,Locations,Keywords + true + true + + + Label and Dates,Description,Image Preview + Persons,Locations,Keywords + 0 + 0 + Label and Dates,Description,Image Preview,Persons,Locations,Keywords + true + true + + Label and Dates,Description,Image Preview,Persons,Locations,Keywords + Label and Dates + + 6 + 6 + 930 + 492 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testcases/db/old-index.xml/v1.1.orig.xml b/testcases/db/old-index.xml/v1.1.orig.xml new file mode 100644 index 00000000..6144f789 --- /dev/null +++ b/testcases/db/old-index.xml/v1.1.orig.xml @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + Label and Dates + true + true + + + Image Preview + true + true + + + Description + true + true + + + Keywords + true + true + + + Locations + true + true + + + Persons + true + true + + + Label and Dates + Description + 0 + 31 + Label and Dates,Description + true + true + + + Label and Dates,Description + Image Preview + 1 + 70 + Label and Dates,Description,Image Preview + true + true + + + Locations + Keywords + 1 + 50 + Locations,Keywords + true + true + + + Persons + Locations,Keywords + 1 + 34 + Persons,Locations,Keywords + true + true + + + Label and Dates,Description,Image Preview + Persons,Locations,Keywords + 0 + 0 + Label and Dates,Description,Image Preview,Persons,Locations,Keywords + true + true + + Label and Dates,Description,Image Preview,Persons,Locations,Keywords + Label and Dates + + 6 + 6 + 930 + 492 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testcases/db/old-index.xml/v2.0.0.orig.xml b/testcases/db/old-index.xml/v2.0.0.orig.xml new file mode 100644 index 00000000..f9aacecd --- /dev/null +++ b/testcases/db/old-index.xml/v2.0.0.orig.xml @@ -0,0 +1,393 @@ + + + + + + + + + + + + + + + Label and Dates + true + true + + + Image Preview + true + true + + + Description + true + true + + + Keywords + true + true + + + Locations + true + true + + + Persons + true + true + + + Label and Dates + Description + 0 + 31 + Label and Dates,Description + true + true + + + Label and Dates,Description + Image Preview + 1 + 70 + Label and Dates,Description,Image Preview + true + true + + + Locations + Keywords + 1 + 50 + Locations,Keywords + true + true + + + Persons + Locations,Keywords + 1 + 34 + Persons,Locations,Keywords + true + true + + + Label and Dates,Description,Image Preview + Persons,Locations,Keywords + 0 + 0 + Label and Dates,Description,Image Preview,Persons,Locations,Keywords + true + true + + Label and Dates,Description,Image Preview,Persons,Locations,Keywords + Label and Dates + + 6 + 6 + 930 + 492 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testcases/db/old-index.xml/v2.1.orig.xml b/testcases/db/old-index.xml/v2.1.orig.xml new file mode 100644 index 00000000..1aa072de --- /dev/null +++ b/testcases/db/old-index.xml/v2.1.orig.xml @@ -0,0 +1,394 @@ + + + + + + + + + + + + + + + Label and Dates + true + true + + + Image Preview + true + true + + + Description + true + true + + + Keywords + true + true + + + Locations + true + true + + + Persons + true + true + + + Label and Dates + Description + 0 + 31 + Label and Dates,Description + true + true + + + Label and Dates,Description + Image Preview + 1 + 70 + Label and Dates,Description,Image Preview + true + true + + + Locations + Keywords + 1 + 50 + Locations,Keywords + true + true + + + Persons + Locations,Keywords + 1 + 34 + Persons,Locations,Keywords + true + true + + + Label and Dates,Description,Image Preview + Persons,Locations,Keywords + 0 + 0 + Label and Dates,Description,Image Preview,Persons,Locations,Keywords + true + true + + Label and Dates,Description,Image Preview,Persons,Locations,Keywords + Label and Dates + + 6 + 6 + 930 + 492 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testcases/db/old-index.xml/v2.2.orig.xml b/testcases/db/old-index.xml/v2.2.orig.xml new file mode 100644 index 00000000..470db529 --- /dev/null +++ b/testcases/db/old-index.xml/v2.2.orig.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testcases/db/old-index.xml/v2.2.result.xml b/testcases/db/old-index.xml/v2.2.result.xml new file mode 100644 index 00000000..287f847b --- /dev/null +++ b/testcases/db/old-index.xml/v2.2.result.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testcases/db/old-index.xml/v3.0.orig.xml b/testcases/db/old-index.xml/v3.0.orig.xml new file mode 100644 index 00000000..9126a503 --- /dev/null +++ b/testcases/db/old-index.xml/v3.0.orig.xml @@ -0,0 +1,356 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testcases/db/old-index.xml/v3.0.result.xml b/testcases/db/old-index.xml/v3.0.result.xml new file mode 100644 index 00000000..a7e33e10 --- /dev/null +++ b/testcases/db/old-index.xml/v3.0.result.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testcases/integration-tests/check_old-index.xml.sh b/testcases/integration-tests/check_old-index.xml.sh new file mode 100644 index 00000000..cc3065eb --- /dev/null +++ b/testcases/integration-tests/check_old-index.xml.sh @@ -0,0 +1,45 @@ +_checks[check_old-index.xml]="Compatibility: Old/ancient file formats" +_context[check_old-index.xml]="

What this test will do:

+

+

+

What you have to do:

+
    +
  1. Each time KPhotoAlbum starts, save the database and exit KPhotoAlbum.
  2. +
" +check_old-index.xml() +{ + local check_name="check_old-index.xml" + local check_dir="$TEMPDIR/$check_name" + local data_dir="$mydir/db/old-index.xml" + 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 v2.2 v3.0 + do + local subcheck_dir="$check_dir/$subcheck" + mkdir "$subcheck_dir" || return $result_err_setup + + local add_rc="[General]\nuntaggedCategory=\nuntaggedTag=\n" + echo -e "$add_rc$BASE_RC" > "$subcheck_dir/kphotoalbumrc" || return $result_err_setup + + # set logging rules: + cp -a "$check_dir/QtProject" "$subcheck_dir" + # 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 +}