summaryrefslogtreecommitdiff
path: root/tests/csgtestcore.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-01-04 22:07:32 (GMT)
committerMarius Kintel <marius@kintel.net>2012-01-04 22:07:32 (GMT)
commitfdce8d15fc4a927d1a6a257783dde5054d9f3e7b (patch)
tree6a779b50ef65474af9c539ad7d42268f7e760ae8 /tests/csgtestcore.cc
parentcbabbaed700536b3a1f513fd5a07d25382cb137f (diff)
parentba8aa515d14cf270c9d0fdf50b4c7c55b3c416a8 (diff)
Merge branch 'master' into boost_filesystem
Conflicts: boost.pri src/lexer.l tests/CMakeLists.txt
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 2406349..fcf88d8 100644
--- a/tests/csgtestcore.cc
+++ b/tests/csgtestcore.cc
@@ -20,6 +20,7 @@
#include "ThrownTogetherRenderer.h"
#include "csgterm.h"
+#include "csgtermnormalizer.h"
#include "OffscreenView.h"
#include <QApplication>
@@ -297,12 +298,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);
@@ -315,11 +312,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]);
}
}
@@ -329,11 +322,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