mirror of https://github.com/djcb/mu.git
Merge pull request #1663 from czan/master
mu: always sort descending within threads
This commit is contained in:
commit
53b553124c
|
@ -365,10 +365,7 @@ sort_func_root (MuContainer *a, MuContainer *b, SortFuncData *data)
|
||||||
static int
|
static int
|
||||||
sort_func_child (MuContainer *a, MuContainer *b, SortFuncData *data)
|
sort_func_child (MuContainer *a, MuContainer *b, SortFuncData *data)
|
||||||
{
|
{
|
||||||
if (data->descending)
|
return container_cmp (a, b, data->mfid);
|
||||||
return container_cmp (a, b, data->mfid);
|
|
||||||
else
|
|
||||||
return container_cmp (b, a, data->mfid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static MuContainer*
|
static MuContainer*
|
||||||
|
|
|
@ -158,9 +158,9 @@ test_mu_threads_01 (void)
|
||||||
|
|
||||||
const tinfo items [] = {
|
const tinfo items [] = {
|
||||||
{"0", "root0@msg.id", "root0"},
|
{"0", "root0@msg.id", "root0"},
|
||||||
{"0:0", "child0.1@msg.id", "Re: child 0.1"},
|
{"0:0", "child0.0@msg.id", "Re: child 0.0"},
|
||||||
{"0:0:0", "child0.1.0@msg.id", "Re: child 0.1.0"},
|
{"0:1", "child0.1@msg.id", "Re: child 0.1"},
|
||||||
{"0:1", "child0.0@msg.id", "Re: child 0.0"},
|
{"0:1:0", "child0.1.0@msg.id", "Re: child 0.1.0"},
|
||||||
{"1", "root1@msg.id", "root1"},
|
{"1", "root1@msg.id", "root1"},
|
||||||
{"2", "root2@msg.id", "root2"},
|
{"2", "root2@msg.id", "root2"},
|
||||||
/* next one's been promoted 2.0.0 => 2.0 */
|
/* next one's been promoted 2.0.0 => 2.0 */
|
||||||
|
@ -169,8 +169,8 @@ test_mu_threads_01 (void)
|
||||||
{"3", "child3.0.0.0.0@msg.id", "Re: child 3.0.0.0"},
|
{"3", "child3.0.0.0.0@msg.id", "Re: child 3.0.0.0"},
|
||||||
|
|
||||||
/* two children of absent root 4.0 */
|
/* two children of absent root 4.0 */
|
||||||
{"4:0", "child4.1@msg.id", "Re: child 4.1"},
|
{"4:0", "child4.0@msg.id", "Re: child 4.0"},
|
||||||
{"4:1", "child4.0@msg.id", "Re: child 4.0"}
|
{"4:1", "child4.1@msg.id", "Re: child 4.1"}
|
||||||
};
|
};
|
||||||
|
|
||||||
xpath = fill_database (MU_TESTMAILDIR3);
|
xpath = fill_database (MU_TESTMAILDIR3);
|
||||||
|
@ -194,17 +194,17 @@ test_mu_threads_rogue (void)
|
||||||
tinfo *items;
|
tinfo *items;
|
||||||
|
|
||||||
tinfo items1 [] = {
|
tinfo items1 [] = {
|
||||||
{"0", "cycle0@msg.id", "cycle0"},
|
{"0", "cycle0@msg.id", "cycle0"},
|
||||||
{"0:0", "cycle0.0@msg.id", "cycle0.0"},
|
{"0:0", "cycle0.0@msg.id", "cycle0.0"},
|
||||||
{"0:0:0", "cycle0.0.0@msg.id", "cycle0.0.0"},
|
{"0:0:0", "cycle0.0.0@msg.id", "cycle0.0.0"},
|
||||||
{"0:1", "rogue0@msg.id", "rogue0"},
|
{"0:1", "rogue0@msg.id", "rogue0"},
|
||||||
};
|
};
|
||||||
|
|
||||||
tinfo items2 [] = {
|
tinfo items2 [] = {
|
||||||
{"0", "cycle0.0@msg.id", "cycle0.0"},
|
{"0", "cycle0.0@msg.id", "cycle0.0"},
|
||||||
{"0:0", "cycle0.0.0@msg.id", "cycle0.0.0"},
|
{"0:0", "cycle0@msg.id", "cycle0"},
|
||||||
{"0:1", "cycle0@msg.id", "cycle0"},
|
{"0:0:0", "rogue0@msg.id", "rogue0" },
|
||||||
{"0:1:0", "rogue0@msg.id", "rogue0" }
|
{"0:1", "cycle0.0.0@msg.id", "cycle0.0.0"}
|
||||||
};
|
};
|
||||||
|
|
||||||
xpath = fill_database (MU_TESTMAILDIR3);
|
xpath = fill_database (MU_TESTMAILDIR3);
|
||||||
|
@ -308,8 +308,8 @@ test_mu_threads_sort_2nd_child_promotes_thread (void)
|
||||||
{ "0", "A@msg.id", "A"},
|
{ "0", "A@msg.id", "A"},
|
||||||
{ "1", "D@msg.id", "D"},
|
{ "1", "D@msg.id", "D"},
|
||||||
{ "2", "B@msg.id", "B"},
|
{ "2", "B@msg.id", "B"},
|
||||||
{ "2:0", "E@msg.id", "E"},
|
{ "2:0", "C@msg.id", "C"},
|
||||||
{ "2:1", "C@msg.id", "C"},
|
{ "2:1", "E@msg.id", "E"},
|
||||||
};
|
};
|
||||||
const tinfo expected_desc [] = {
|
const tinfo expected_desc [] = {
|
||||||
{ "0", "B@msg.id", "B"},
|
{ "0", "B@msg.id", "B"},
|
||||||
|
@ -334,8 +334,8 @@ test_mu_threads_sort_orphan_promotes_thread (void)
|
||||||
const tinfo expected_asc [] = {
|
const tinfo expected_asc [] = {
|
||||||
{ "0", "A@msg.id", "A"},
|
{ "0", "A@msg.id", "A"},
|
||||||
{ "1", "D@msg.id", "D"},
|
{ "1", "D@msg.id", "D"},
|
||||||
{ "2:0", "E@msg.id", "E"},
|
{ "2:0", "C@msg.id", "C"},
|
||||||
{ "2:1", "C@msg.id", "C"},
|
{ "2:1", "E@msg.id", "E"},
|
||||||
};
|
};
|
||||||
const tinfo expected_desc [] = {
|
const tinfo expected_desc [] = {
|
||||||
{ "0:0", "C@msg.id", "C"},
|
{ "0:0", "C@msg.id", "C"},
|
||||||
|
@ -409,10 +409,10 @@ test_mu_threads_sort_granchild_promotes_only_subthread (void)
|
||||||
const tinfo expected_asc [] = {
|
const tinfo expected_asc [] = {
|
||||||
{ "0", "A@msg.id", "A"},
|
{ "0", "A@msg.id", "A"},
|
||||||
{ "1", "B@msg.id", "B"},
|
{ "1", "B@msg.id", "B"},
|
||||||
{ "1:0", "E@msg.id", "E"},
|
{ "1:0", "C@msg.id", "C"},
|
||||||
{ "1:1", "D@msg.id", "D"},
|
{ "1:1", "D@msg.id", "D"},
|
||||||
{ "1:1:0", "F@msg.id", "F"},
|
{ "1:1:0", "F@msg.id", "F"},
|
||||||
{ "1:2", "C@msg.id", "C"},
|
{ "1:2", "E@msg.id", "E"},
|
||||||
{ "2", "G@msg.id", "G"},
|
{ "2", "G@msg.id", "G"},
|
||||||
};
|
};
|
||||||
const tinfo expected_desc [] = {
|
const tinfo expected_desc [] = {
|
||||||
|
|
Loading…
Reference in New Issue