|
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
Unit tests for verifying URL parsing into CURL objects. More...
#include "ServiceBroker.h"#include "URL.h"#include "filesystem/MultiPathDirectory.h"#include "settings/AdvancedSettings.h"#include "settings/SettingsComponent.h"#include "utils/URIUtils.h"#include <utility>#include <gtest/gtest.h>#include "test/TestUtils.h"#include "utils/JSONVariantParser.h"#include "utils/JSONVariantWriter.h"#include "utils/Variant.h"#include <fstream>Classes | |
| class | TestURLParseDetails |
Functions | |
| TEST_F (TestURLParseDetails, ParseAllURLResults) | |
Unit tests for verifying URL parsing into CURL objects.
This test suite validates the correctness and robustness of Kodi's URL parsing implementation by ensuring that different types of URLs are correctly decomposed into their component parts (scheme, host, port, path, query, etc.) within CURL objects.
Each test loads URL test cases from JSON files that define the expected parse results. The tests then verify that the CURL object correctly represents each URL as expected. This provides a comprehensive regression suite to guard against changes or regressions in URL parsing logic.
The input and expected output for these tests are stored as JSON files under xbmc/utils/test/testdata/. As there are many such test files, it is often easier to regenerate them rather than edit each file manually.
To regenerate all test case JSON files, define the following symbol before building or running the tests:
This can be defined either inline in this test file or passed via the build system when building kodi-test. When defined, executing the tests will generate updated JSON test case files in your CMake build directory.
After generation, the new JSON files should be reviewed and copied or moved into the xbmc/utils/test/testdata/ directory before committing them with your branch.
These tests are part of the kodi-test suite and are executed using GoogleTest. To run all URL parsing tests:
TestURLParseDetails suite after changes to confirm no regressions were introduced.| TEST_F | ( | TestURLParseDetails | , |
| ParseAllURLResults | ) |