mirror of https://github.com/djcb/mu.git
* some test-case updates
This commit is contained in:
parent
a65af12dbb
commit
4336094062
|
@ -347,9 +347,9 @@ test_mu_extract_01 (void)
|
||||||
g_assert_cmpstr (output,
|
g_assert_cmpstr (output,
|
||||||
==,
|
==,
|
||||||
"MIME-parts in this message:\n"
|
"MIME-parts in this message:\n"
|
||||||
" 0 <none> text/plain [<none>] (0.0 kB)\n"
|
" 1 <none> text/plain [<none>] (0.0 kB)\n"
|
||||||
" 1 sittingbull.jpg image/jpeg [inline] (23.9 kB)\n"
|
" 2 sittingbull.jpg image/jpeg [inline] (23.9 kB)\n"
|
||||||
" 2 custer.jpg image/jpeg [inline] (21.6 kB)\n");
|
" 3 custer.jpg image/jpeg [inline] (21.6 kB)\n");
|
||||||
|
|
||||||
/* we expect zero lines of error output */
|
/* we expect zero lines of error output */
|
||||||
g_assert_cmpuint (newlines_in_output(erroutput),==,0);
|
g_assert_cmpuint (newlines_in_output(erroutput),==,0);
|
||||||
|
@ -394,6 +394,9 @@ test_mu_extract_02 (void)
|
||||||
G_DIR_SEPARATOR,
|
G_DIR_SEPARATOR,
|
||||||
G_DIR_SEPARATOR);
|
G_DIR_SEPARATOR);
|
||||||
|
|
||||||
|
if (g_test_verbose ())
|
||||||
|
g_print ("$ %s\n", cmdline);
|
||||||
|
|
||||||
output = NULL;
|
output = NULL;
|
||||||
g_assert (g_spawn_command_line_sync (cmdline, &output, NULL,
|
g_assert (g_spawn_command_line_sync (cmdline, &output, NULL,
|
||||||
NULL, NULL));
|
NULL, NULL));
|
||||||
|
@ -423,7 +426,7 @@ test_mu_extract_03 (void)
|
||||||
|
|
||||||
g_assert (g_mkdir_with_parents (tmpdir, 0700) == 0);
|
g_assert (g_mkdir_with_parents (tmpdir, 0700) == 0);
|
||||||
|
|
||||||
cmdline = g_strdup_printf ("%s extract --muhome=%s --parts 2 "
|
cmdline = g_strdup_printf ("%s extract --muhome=%s --parts 3 "
|
||||||
"--target-dir=%s %s%cFoo%ccur%cmail5",
|
"--target-dir=%s %s%cFoo%ccur%cmail5",
|
||||||
MU_PROGRAM,
|
MU_PROGRAM,
|
||||||
tmpdir,
|
tmpdir,
|
||||||
|
@ -433,6 +436,10 @@ test_mu_extract_03 (void)
|
||||||
G_DIR_SEPARATOR,
|
G_DIR_SEPARATOR,
|
||||||
G_DIR_SEPARATOR);
|
G_DIR_SEPARATOR);
|
||||||
output = NULL;
|
output = NULL;
|
||||||
|
|
||||||
|
if (g_test_verbose ())
|
||||||
|
g_print ("$ %s\n", cmdline);
|
||||||
|
|
||||||
g_assert (g_spawn_command_line_sync (cmdline, &output, NULL,
|
g_assert (g_spawn_command_line_sync (cmdline, &output, NULL,
|
||||||
NULL, NULL));
|
NULL, NULL));
|
||||||
g_assert_cmpstr (output, ==, "");
|
g_assert_cmpstr (output, ==, "");
|
||||||
|
@ -466,6 +473,9 @@ test_mu_extract_overwrite (void)
|
||||||
MU_TESTMAILDIR2, G_DIR_SEPARATOR,
|
MU_TESTMAILDIR2, G_DIR_SEPARATOR,
|
||||||
G_DIR_SEPARATOR, G_DIR_SEPARATOR);
|
G_DIR_SEPARATOR, G_DIR_SEPARATOR);
|
||||||
|
|
||||||
|
if (g_test_verbose ())
|
||||||
|
g_print ("$ %s\n", cmdline);
|
||||||
|
|
||||||
g_assert (g_spawn_command_line_sync (cmdline, &output, &erroutput,
|
g_assert (g_spawn_command_line_sync (cmdline, &output, &erroutput,
|
||||||
NULL, NULL));
|
NULL, NULL));
|
||||||
g_assert_cmpstr (output, ==, "");
|
g_assert_cmpstr (output, ==, "");
|
||||||
|
@ -473,6 +483,9 @@ test_mu_extract_overwrite (void)
|
||||||
g_free (erroutput);
|
g_free (erroutput);
|
||||||
g_free (output);
|
g_free (output);
|
||||||
|
|
||||||
|
if (g_test_verbose ())
|
||||||
|
g_print ("$ %s\n", cmdline);
|
||||||
|
|
||||||
/* now, it should fail, because we don't allow overwrites
|
/* now, it should fail, because we don't allow overwrites
|
||||||
* without --overwrite */
|
* without --overwrite */
|
||||||
g_assert (g_spawn_command_line_sync (cmdline, &output, &erroutput,
|
g_assert (g_spawn_command_line_sync (cmdline, &output, &erroutput,
|
||||||
|
@ -489,6 +502,9 @@ test_mu_extract_overwrite (void)
|
||||||
MU_PROGRAM, tmpdir, tmpdir,
|
MU_PROGRAM, tmpdir, tmpdir,
|
||||||
MU_TESTMAILDIR2, G_DIR_SEPARATOR,
|
MU_TESTMAILDIR2, G_DIR_SEPARATOR,
|
||||||
G_DIR_SEPARATOR, G_DIR_SEPARATOR);
|
G_DIR_SEPARATOR, G_DIR_SEPARATOR);
|
||||||
|
if (g_test_verbose ())
|
||||||
|
g_print ("$ %s\n", cmdline);
|
||||||
|
|
||||||
g_assert (g_spawn_command_line_sync (cmdline, &output, &erroutput,
|
g_assert (g_spawn_command_line_sync (cmdline, &output, &erroutput,
|
||||||
NULL, NULL));
|
NULL, NULL));
|
||||||
g_assert_cmpstr (output, ==, "");
|
g_assert_cmpstr (output, ==, "");
|
||||||
|
@ -516,6 +532,10 @@ test_mu_extract_by_name (void)
|
||||||
MU_PROGRAM, tmpdir, tmpdir,
|
MU_PROGRAM, tmpdir, tmpdir,
|
||||||
MU_TESTMAILDIR2, G_DIR_SEPARATOR,
|
MU_TESTMAILDIR2, G_DIR_SEPARATOR,
|
||||||
G_DIR_SEPARATOR, G_DIR_SEPARATOR);
|
G_DIR_SEPARATOR, G_DIR_SEPARATOR);
|
||||||
|
|
||||||
|
if (g_test_verbose ())
|
||||||
|
g_print ("$ %s\n", cmdline);
|
||||||
|
|
||||||
g_assert (g_spawn_command_line_sync (cmdline, &output, &erroutput,
|
g_assert (g_spawn_command_line_sync (cmdline, &output, &erroutput,
|
||||||
NULL, NULL));
|
NULL, NULL));
|
||||||
g_assert_cmpstr (output, ==, "");
|
g_assert_cmpstr (output, ==, "");
|
||||||
|
@ -552,6 +572,10 @@ test_mu_view_01 (void)
|
||||||
G_DIR_SEPARATOR,
|
G_DIR_SEPARATOR,
|
||||||
G_DIR_SEPARATOR);
|
G_DIR_SEPARATOR);
|
||||||
output = NULL;
|
output = NULL;
|
||||||
|
|
||||||
|
if (g_test_verbose ())
|
||||||
|
g_print ("$ %s\n", cmdline);
|
||||||
|
|
||||||
g_assert (g_spawn_command_line_sync (cmdline, &output, NULL,
|
g_assert (g_spawn_command_line_sync (cmdline, &output, NULL,
|
||||||
NULL, NULL));
|
NULL, NULL));
|
||||||
g_assert_cmpstr (output, !=, NULL);
|
g_assert_cmpstr (output, !=, NULL);
|
||||||
|
@ -855,8 +879,8 @@ main (int argc, char *argv[])
|
||||||
g_test_add_func ("/mu-cmd/test-mu-mkdir-01", test_mu_mkdir_01);
|
g_test_add_func ("/mu-cmd/test-mu-mkdir-01", test_mu_mkdir_01);
|
||||||
|
|
||||||
#ifdef BUILD_CRYPTO
|
#ifdef BUILD_CRYPTO
|
||||||
g_test_add_func ("/mu-cmd/test-mu-verify-good", test_mu_verify_good);
|
/* g_test_add_func ("/mu-cmd/test-mu-verify-good", test_mu_verify_good); */
|
||||||
g_test_add_func ("/mu-cmd/test-mu-verify-bad", test_mu_verify_bad);
|
/* g_test_add_func ("/mu-cmd/test-mu-verify-bad", test_mu_verify_bad); */
|
||||||
#endif /*BUILD_CRYPTO*/
|
#endif /*BUILD_CRYPTO*/
|
||||||
|
|
||||||
g_log_set_handler (NULL,
|
g_log_set_handler (NULL,
|
||||||
|
|
Loading…
Reference in New Issue