summaryrefslogtreecommitdiff
path: root/tests/glean/tblend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/glean/tblend.cpp')
-rw-r--r--tests/glean/tblend.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/glean/tblend.cpp b/tests/glean/tblend.cpp
index 9b4c458ec..057ee4a33 100644
--- a/tests/glean/tblend.cpp
+++ b/tests/glean/tblend.cpp
@@ -84,6 +84,7 @@ factorToName(GLenum factor) {
for (unsigned int i = 0; i < ELEMENTS(factorNames); ++i)
if (factorNames[i].token == factor)
return factorNames[i].name;
+ assert(0);
return 0;
} // factorToName
@@ -92,6 +93,7 @@ nameToFactor(string& name) {
for (unsigned int i = 0; i < ELEMENTS(factorNames); ++i)
if (factorNames[i].name == name)
return factorNames[i].token;
+ assert(0);
return GL_ZERO;
} // nameToFactor
@@ -100,6 +102,7 @@ opToName(GLenum op) {
for (unsigned int i = 0; i < ELEMENTS(blendopNames); ++i)
if (blendopNames[i].token == op)
return blendopNames[i].name;
+ assert(0);
return 0;
} // opToName
@@ -108,6 +111,7 @@ nameToOp(string& name) {
for (unsigned int i = 0; i < ELEMENTS(blendopNames); ++i)
if (blendopNames[i].name == name)
return blendopNames[i].token;
+ assert(0);
return GL_ZERO;
} // nameToOp
@@ -981,7 +985,9 @@ BlendFuncTest::compareOne(BlendFuncResult& oldR, BlendFuncResult& newR) {
///////////////////////////////////////////////////////////////////////////////
void
BlendFuncResult::putresults(ostream& s) const {
+ // write number of lines first
s << results.size() << '\n';
+ // write each result as one line of text
for (vector<PartialResult>::const_iterator p = results.begin();
p != results.end(); ++p)
s << factorToName(p->srcRGB) << ' '
@@ -996,7 +1002,9 @@ BlendFuncResult::putresults(ostream& s) const {
bool
BlendFuncResult::getresults(istream& s) {
int n;
+ // read number of lines
s >> n;
+ // parse each line/result
for (int i = 0; i < n; ++i) {
PartialResult p;
string srcRGB, srcA;
@@ -1005,10 +1013,10 @@ BlendFuncResult::getresults(istream& s) {
s >> srcRGB >> srcA >> dstRGB >> dstA >> opRGB >> opA >> p.rbErr >> p.blErr;
p.srcRGB = nameToFactor(srcRGB);
p.srcA = nameToFactor(srcA);
- p.srcRGB = nameToFactor(srcRGB);
+ p.dstRGB = nameToFactor(dstRGB);
p.dstA = nameToFactor(dstA);
- p.opRGB = nameToFactor(opRGB);
- p.opA = nameToFactor(opA);
+ p.opRGB = nameToOp(opRGB);
+ p.opA = nameToOp(opA);
results.push_back(p);
}