Skip to content

Commit

Permalink
Add test for uri_cpe_to_uri_product
Browse files Browse the repository at this point in the history
  • Loading branch information
timopollmeier committed Jan 31, 2025
1 parent 27f2934 commit 1784cb6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions util/cpeutils_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,15 @@ Ensure (cpeutils, cpe_struct_match)
cpe_struct_free (&cpe2);
}

Ensure (cpeutils, uri_cpe_to_uri_product)
{
char *uri_cpe, *uri_product;
uri_cpe = "cpe:/a:hp:insight_diagnostics:7.4.0.1570:-:~~online~win2003~x64~";

uri_product = uri_cpe_to_uri_product (uri_cpe);
assert_string_equal (uri_product, "cpe:/a:hp:insight_diagnostics");
}

/* Test suite. */
int
main (int argc, char **argv)
Expand All @@ -296,6 +305,7 @@ main (int argc, char **argv)
add_test_with_context (suite, cpeutils, uri_cpe_to_fs_cpe);
add_test_with_context (suite, cpeutils, fs_cpe_to_uri_cpe);
add_test_with_context (suite, cpeutils, cpe_struct_match);
add_test_with_context (suite, cpeutils, uri_cpe_to_uri_product);

if (argc > 1)
return run_single_test (suite, argv[1], create_text_reporter ());
Expand Down

0 comments on commit 1784cb6

Please sign in to comment.