summaryrefslogtreecommitdiff
path: root/tests/csgtestcore.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-12-26 20:20:05 (GMT)
committerMarius Kintel <marius@kintel.net>2011-12-26 20:20:05 (GMT)
commitcde24f681580f8911ac4fe29265b169a0bac5f49 (patch)
treeb426b377e367a50b406bad51a0dbb76510278102 /tests/csgtestcore.cc
parent36056e27f34a6049c18e49d5f24bfbd7cc6eabf4 (diff)
parentbc3454f369a21cd689f42f5e9ec5cb316f9ebdd5 (diff)
Merge branch 'master' into buildfix
Diffstat (limited to 'tests/csgtestcore.cc')
-rw-r--r--tests/csgtestcore.cc21
1 files changed, 5 insertions, 16 deletions
diff --git a/tests/csgtestcore.cc b/tests/csgtestcore.cc
index c2be326..e8a6878 100644
--- a/tests/csgtestcore.cc
+++ b/tests/csgtestcore.cc
@@ -19,6 +19,7 @@
#include "ThrownTogetherRenderer.h"
#include "csgterm.h"
+#include "csgtermnormalizer.h"
#include "OffscreenView.h"
#include <QApplication>
@@ -315,12 +316,8 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)
}
// CSG normalization
- csgInfo.root_norm_term = root_raw_term;
- while (1) {
- shared_ptr<CSGTerm> n = CSGTerm::normalize(csgInfo.root_norm_term);
- if (csgInfo.root_norm_term == n) break;
- csgInfo.root_norm_term = n;
- }
+ CSGTermNormalizer normalizer;
+ csgInfo.root_norm_term = normalizer.normalize(root_raw_term);
assert(csgInfo.root_norm_term);
@@ -333,11 +330,7 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)
csgInfo.highlights_chain = new CSGChain();
for (unsigned int i = 0; i < csgInfo.highlight_terms.size(); i++) {
- while (1) {
- shared_ptr<CSGTerm> n = CSGTerm::normalize(csgInfo.highlight_terms[i]);
- if (csgInfo.highlight_terms[i] == n) break;
- csgInfo.highlight_terms[i] = n;
- }
+ csgInfo.highlight_terms[i] = normalizer.normalize(csgInfo.highlight_terms[i]);
csgInfo.highlights_chain->import(csgInfo.highlight_terms[i]);
}
}
@@ -347,11 +340,7 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type)
csgInfo.background_chain = new CSGChain();
for (unsigned int i = 0; i < csgInfo.background_terms.size(); i++) {
- while (1) {
- shared_ptr<CSGTerm> n = CSGTerm::normalize(csgInfo.background_terms[i]);
- if (csgInfo.background_terms[i] == n) break;
- csgInfo.background_terms[i] = n;
- }
+ csgInfo.background_terms[i] = normalizer.normalize(csgInfo.background_terms[i]);
csgInfo.background_chain->import(csgInfo.background_terms[i]);
}
}
contact: Jan Huwald // Impressum