summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-05-17 04:53:55 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-05-17 06:48:25 +0200
commit3257372f3434cca2428bfdbc57dd777135c65b34 (patch)
tree7493792df7ffed4c488c266b909f563e29231e1f /sc/qa/unit/ucalc.cxx
parent8ad59d194491af8317b3770e83d93d2e32508947 (diff)
add more databar length tests
Change-Id: I16ea569d360e75290b9b5a54b915c83dd99db759
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx29
1 files changed, 26 insertions, 3 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 4a76629253ef..6114eb370d61 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5909,12 +5909,12 @@ void testDataBarLengthImpl(ScDocument* pDoc, ScDataBarLengthData* pData, const S
pFormatData->mpUpperLimit->SetType(eMaxType);
pDatabar->SetDataBarData(pFormatData);
- for (size_t i = 0; pData[i].nVal != 0; ++i)
+ for (size_t i = 0; pData[i].nLength != -200; ++i)
{
pDoc->SetValue(nCol, i, 0, pData[i].nVal);
}
- for (size_t i = 0; pData[i].nVal != 0; ++i)
+ for (size_t i = 0; pData[i].nLength != -200; ++i)
{
ScDataBarInfo* pInfo = pDatabar->GetDataBarInfo(ScAddress(nCol, i, 0));
CPPUNIT_ASSERT(pInfo);
@@ -5937,12 +5937,35 @@ void Test::testDataBarLength()
{ 6, 75.0 },
{ 7, 100.0 },
{ 8, 100.0 },
- { 0, 0 }
+ { 9, 100.0 },
+ { 0, -200 }
};
testDataBarLengthImpl(m_pDoc, aValues, ScRange(0,0,0,0,7,0),
3, COLORSCALE_VALUE, 7, COLORSCALE_VALUE);
+ ScDataBarLengthData aValues2[] = {
+ { -6, -100 },
+ { -5, -100 },
+ { -4, -100 },
+ { -3, -75.0 },
+ { -2, -50.0 },
+ { -1, -25.0 },
+ { 0, 0.0 },
+ { 1, 12.5 },
+ { 2, 25.0 },
+ { 3, 37.5 },
+ { 4, 50.0 },
+ { 5, 62.5 },
+ { 6, 75.0 },
+ { 7, 87.5 },
+ { 8, 100.0 },
+ { 9, 100.0 },
+ { 0, -200 }
+ };
+ testDataBarLengthImpl(m_pDoc, aValues2, ScRange(1,0,0,1,15,0),
+ -4, COLORSCALE_VALUE, 8, COLORSCALE_VALUE);
+
m_pDoc->DeleteTab(0);
}