I've built unit-test on Windows (clang-cl). But when running
it, it crashes after the message:
  RUNNING TEST test_hsts_new_entry...

Since 'opt.homedir' and therefore 'get_hsts_store_filename()'
returns NULL. How is 'opt.homedir' supposed to be set?

If I add:
  opt.homedir = home_dir();

to 'all_tests()', I do get the correct %HOME path (equals %APPDATA).
But it seems 'opt.homedir' gets cleared afterwards somewhere.
In test_cmd_spec_restrict_file_names() or test_path_simplify()?

So if I do this, all tests passes:

--- a/tests/unit-tests.c 2018-05-21 17:59:47
+++ b/tests/unit-tests.c 2018-05-22 15:00:19
@@ -43,11 +43,19 @@
 static const char *
 all_tests(void)
 {
+  opt.homedir = home_dir();
+
 #ifdef HAVE_METALINK
   mu_run_test (test_find_key_value);
   mu_run_test (test_find_key_values);
   mu_run_test (test_has_key);
 #endif
+#ifdef HAVE_HSTS
+  mu_run_test (test_hsts_new_entry);
+  mu_run_test (test_hsts_url_rewrite_superdomain);
+  mu_run_test (test_hsts_url_rewrite_congruent);
+  mu_run_test (test_hsts_read_database);
+#endif
   mu_run_test (test_parse_content_disposition);
   mu_run_test (test_parse_range_header);
   mu_run_test (test_subdir_p);
@@ -58,12 +66,6 @@
   mu_run_test (test_append_uri_pathel);
   mu_run_test (test_are_urls_equal);
   mu_run_test (test_is_robots_txt_url);
-#ifdef HAVE_HSTS
-  mu_run_test (test_hsts_new_entry);
-  mu_run_test (test_hsts_url_rewrite_superdomain);
-  mu_run_test (test_hsts_url_rewrite_congruent);
-  mu_run_test (test_hsts_read_database);
-#endif

--
--gv

Reply via email to