* add test case for mu view

This commit is contained in:
Dirk-Jan C. Binnema 2011-01-06 13:14:17 +02:00
parent 5487989b99
commit f00f1dc01b
6 changed files with 58 additions and 7 deletions

View File

@ -103,5 +103,6 @@ EXTRA_DIST= \
testdir2/bar/cur/mail1 \
testdir2/bar/cur/mail2 \
testdir2/bar/cur/mail3 \
testdir2/Foo/cur/mail4
testdir2/bar/cur/mail4 \
testdir2/Foo/cur/mail5

View File

@ -115,7 +115,7 @@ test_mu_index (void)
store = mu_store_new (xpath, 0, NULL);
g_assert (store);
g_assert_cmpuint (mu_store_count (store), ==, 4);
g_assert_cmpuint (mu_store_count (store), ==, 5);
mu_store_destroy (store);
g_free (muhome);
@ -197,7 +197,7 @@ test_mu_extract_01 (void)
{
gchar *cmdline, *output, *erroutput;
cmdline = g_strdup_printf ("%s extract %s%cFoo%ccur%cmail4",
cmdline = g_strdup_printf ("%s extract %s%cFoo%ccur%cmail5",
MU_PROGRAM,
MU_TESTMAILDIR2,
G_DIR_SEPARATOR,
@ -248,7 +248,7 @@ test_mu_extract_02 (void)
g_assert (g_mkdir_with_parents (tmpdir, 0700) == 0);
cmdline = g_strdup_printf ("%s extract -a --target-dir=%s %s%cFoo%ccur%cmail4",
cmdline = g_strdup_printf ("%s extract -a --target-dir=%s %s%cFoo%ccur%cmail5",
MU_PROGRAM,
tmpdir,
MU_TESTMAILDIR2,
@ -285,7 +285,7 @@ test_mu_extract_03 (void)
g_assert (g_mkdir_with_parents (tmpdir, 0700) == 0);
cmdline = g_strdup_printf ("%s extract --parts 3 "
"--target-dir=%s %s%cFoo%ccur%cmail4",
"--target-dir=%s %s%cFoo%ccur%cmail5",
MU_PROGRAM,
tmpdir,
MU_TESTMAILDIR2,
@ -310,6 +310,27 @@ test_mu_extract_03 (void)
}
static void
test_mu_view_01 (void)
{
gchar *cmdline, *output;
cmdline = g_strdup_printf ("%s view %s%cbar%ccur%cmail4",
MU_PROGRAM,
MU_TESTMAILDIR2,
G_DIR_SEPARATOR,
G_DIR_SEPARATOR,
G_DIR_SEPARATOR);
output = NULL;
g_assert (g_spawn_command_line_sync (cmdline, &output, NULL, NULL, NULL));
g_assert_cmpstr (output, !=, NULL);
/* not, this will break if/when decoding is fixed */
g_assert_cmpuint (strlen(output), ==, 370);
g_free (output);
g_free (cmdline);
}
int
@ -326,6 +347,7 @@ main (int argc, char *argv[])
g_test_add_func ("/mu-cmd/test-mu-extract-01", test_mu_extract_01);
g_test_add_func ("/mu-cmd/test-mu-extract-02", test_mu_extract_02);
g_test_add_func ("/mu-cmd/test-mu-extract-03", test_mu_extract_03);
g_test_add_func ("/mu-cmd/test-mu-view-01", test_mu_view_01);
g_log_set_handler (NULL,
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION,

View File

@ -195,7 +195,7 @@ test_mu_msg_04 (void)
MuMsg *msg;
msg = mu_msg_new (MU_TESTMAILDIR2
"Foo/cur/mail4", NULL, NULL);
"Foo/cur/mail5", NULL, NULL);
g_assert_cmpstr (mu_msg_get_to(msg),
==, "George Custer <gac@example.com>");

View File

@ -221,7 +221,7 @@ test_mu_util_get_dtype_with_lstat (void)
g_assert_cmpuint (
mu_util_get_dtype_with_lstat (MU_TESTMAILDIR2), ==, DT_DIR);
g_assert_cmpuint (
mu_util_get_dtype_with_lstat (MU_TESTMAILDIR2 "Foo/cur/mail4"),
mu_util_get_dtype_with_lstat (MU_TESTMAILDIR2 "Foo/cur/mail5"),
==, DT_REG);
}

View File

@ -0,0 +1,28 @@
Return-Path: <foo@example.com>
Delivered-To: foo@example.com
Received: from [128.88.204.56] by freemailng0304.web.de with HTTP;
Mon, 07 May 2005 00:27:52 +0200
Date: Mon, 07 May 2005 00:27:52 +0200
Message-Id: <293847329847@web.de>
MIME-Version: 1.0
From: =?iso-8859-1?Q? "=F6tzi" ?= <oetzi@web.de>
To: foo@example.com
Subject: =?iso-8859-1?Q?Re:=20der=20b=E4r=20und=20das=20m=E4dchen?=
Precedence: fm-user
Organization: http://freemail.web.de/
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by mailhost6.ladot.com id j48MScQ30791
X-UIDL: 93h!!\i<!!L)l!!%_I!!
X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on mindcrime
X-Spam-Level:
X-Spam-Status: No, score=-2.3 required=3.0 tests=AWL,BAYES_00 autolearn=ham
version=3.0.2
Viele liebe Gruesse aus der Stadt der Städte..
__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201