diff --git a/test/library_server.cpp b/test/library_server.cpp index d8f1ecacf..bed7806bc 100644 --- a/test/library_server.cpp +++ b/test/library_server.cpp @@ -70,20 +70,20 @@ std::string maskVariableOPDSFeedData(std::string s) " type=\"application/opensearchdescription+xml\"" \ " href=\"/ROOT/catalog/searchdescription.xml\" />\n" -#define CHARLES_RAY_CATALOG_ENTRY \ +#define CATALOG_ENTRY(UUID, TITLE, SUMMARY, LANG, NAME, CATEGORY, TAGS, EXTRA_LINK, CONTENT_NAME, FILE_NAME, LENGTH) \ " \n" \ - " urn:uuid:charlesray\n" \ - " Charles, Ray\n" \ + " urn:uuid:" UUID "\n" \ + " " TITLE "\n" \ " YYYY-MM-DDThh:mm:ssZ\n" \ - " Wikipedia articles about Ray Charles\n" \ - " fra\n" \ - " wikipedia_fr_ray_charles\n" \ + " " SUMMARY "\n" \ + " " LANG "\n" \ + " " NAME "\n" \ " \n" \ - " jazz\n" \ - " unittest;wikipedia;_category:jazz;_pictures:no;_videos:no;_details:no;_ftindex:yes\n" \ + " " CATEGORY "\n" \ + " " TAGS "\n" \ " 284\n" \ " 2\n" \ - " \n" \ + " " EXTRA_LINK "\n" \ " \n" \ " Wikipedia\n" \ " \n" \ @@ -91,59 +91,53 @@ std::string maskVariableOPDSFeedData(std::string s) " Kiwix\n" \ " \n" \ " 2020-03-31T00:00:00Z\n" \ - " \n" \ + " \n" \ " \n" -#define RAY_CHARLES_CATALOG_ENTRY \ - " \n" \ - " urn:uuid:raycharles\n" \ - " Ray Charles\n" \ - " YYYY-MM-DDThh:mm:ssZ\n" \ - " Wikipedia articles about Ray Charles\n" \ - " eng\n" \ - " wikipedia_en_ray_charles\n" \ - " \n" \ - " wikipedia\n" \ - " public_tag_without_a_value;_private_tag_without_a_value;wikipedia;_category:wikipedia;_pictures:no;_videos:no;_details:no;_ftindex:yes\n" \ - " 284\n" \ - " 2\n" \ - " \n" \ - " \n" \ - " \n" \ - " Wikipedia\n" \ - " \n" \ - " \n" \ - " Kiwix\n" \ - " \n" \ - " 2020-03-31T00:00:00Z\n" \ - " \n" \ - " \n" -#define UNCATEGORIZED_RAY_CHARLES_CATALOG_ENTRY \ - " \n" \ - " urn:uuid:raycharles_uncategorized\n" \ - " Ray (uncategorized) Charles\n" \ - " YYYY-MM-DDThh:mm:ssZ\n" \ - " No category is assigned to this library entry.\n" \ - " rus\n" \ - " wikipedia_ru_ray_charles\n" \ - " \n" \ - " \n" \ - " public_tag_with_a_value:value_of_a_public_tag;_private_tag_with_a_value:value_of_a_private_tag;wikipedia;_pictures:no;_videos:no;_details:no\n" \ - " 284\n" \ - " 2\n" \ - " \n" \ - " \n" \ - " Wikipedia\n" \ - " \n" \ - " \n" \ - " Kiwix\n" \ - " \n" \ - " 2020-03-31T00:00:00Z\n" \ - " \n" \ - " \n" +#define CHARLES_RAY_CATALOG_ENTRY CATALOG_ENTRY( \ + "charlesray", \ + "Charles, Ray", \ + "Wikipedia articles about Ray Charles", \ + "fra", \ + "wikipedia_fr_ray_charles",\ + "jazz",\ + "unittest;wikipedia;_category:jazz;_pictures:no;_videos:no;_details:no;_ftindex:yes",\ + "", \ + "zimfile%26other", \ + "zimfile%26other", \ + "569344" \ +) + +#define RAY_CHARLES_CATALOG_ENTRY CATALOG_ENTRY(\ + "raycharles",\ + "Ray Charles",\ + "Wikipedia articles about Ray Charles",\ + "eng",\ + "wikipedia_en_ray_charles",\ + "wikipedia",\ + "public_tag_without_a_value;_private_tag_without_a_value;wikipedia;_category:wikipedia;_pictures:no;_videos:no;_details:no;_ftindex:yes",\ + "\n ", \ + "zimfile", \ + "zimfile", \ + "569344"\ +) + +#define UNCATEGORIZED_RAY_CHARLES_CATALOG_ENTRY CATALOG_ENTRY(\ + "raycharles_uncategorized",\ + "Ray (uncategorized) Charles",\ + "No category is assigned to this library entry.",\ + "rus",\ + "wikipedia_ru_ray_charles",\ + "",\ + "public_tag_with_a_value:value_of_a_public_tag;_private_tag_with_a_value:value_of_a_private_tag;wikipedia;_pictures:no;_videos:no;_details:no",\ + "",\ + "zimfile", \ + "zimfile", \ + "125952"\ +) TEST_F(LibraryServerTest, catalog_root_xml) {