mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
FS#11439: Fix version comparison regression.
Improve string suffix handling by distinguishing between version number separators (i.e. dots) and extended separators and additional version characters. Corrects false update information displayed for 64bit binaries of Rockbox Utility. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27201 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
35150b6dcb
commit
10b8e327d8
2 changed files with 23 additions and 4 deletions
|
|
@ -62,6 +62,12 @@ const struct testvector testdata[] =
|
|||
{ "test-1.2.3.tar.gz", "program-1.2.3.1.tar.bz2", 1 },
|
||||
{ "program-1.2.3.zip", "program-1.2.3a.zip", 1 },
|
||||
{ "program-1.2.3.tar.bz2", "2.0.0", 1 },
|
||||
{ "prog-1.2-64bit.tar.bz2", "prog-1.2.3.tar.bz2", 1 },
|
||||
{ "prog-1.2-64bit.tar.bz2", "prog-1.2-64bit.tar.bz2", 0 },
|
||||
{ "prog-1.2-64bit.tar.bz2", "prog-1.2.3-64bit.tar.bz2", 1 },
|
||||
{ "prog-1.2a-64bit.tar.bz2","prog-1.2b-64bit.tar.bz2", 1 },
|
||||
{ "prog-1.2-64bit.tar.bz2", "prog-1.2.3a-64bit.tar.bz2", 1 },
|
||||
{ "prog-1.2a-64bit.tar.bz2","prog-1.2.3-64bit.tar.bz2", 1 },
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -72,8 +78,9 @@ void TestVersionCompare::testMain()
|
|||
QCOMPARE(Utils::compareVersionStrings(testdata[i].first,
|
||||
testdata[i].second), testdata[i].expected);
|
||||
// inverse test possible because function return values are symmetrical.
|
||||
QCOMPARE(Utils::compareVersionStrings(testdata[i].second,
|
||||
testdata[i].first), -testdata[i].expected);
|
||||
if(testdata[i].expected != 0)
|
||||
QCOMPARE(Utils::compareVersionStrings(testdata[i].second,
|
||||
testdata[i].first), -testdata[i].expected);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue