Changeset 99
- Timestamp:
- 12/20/07 08:29:30 (4 years ago)
- Files:
-
- trunk/hightest/src/graph/Graph.cpp (modified) (2 diffs)
- trunk/hightest/src/graph/Graph.h (modified) (1 diff)
- trunk/hightest/src/graph/Node.cpp (modified) (1 diff)
- trunk/hightest/src/graph/Node.h (modified) (2 diffs)
- trunk/hightest/src/graph/NodeBase.cpp (modified) (3 diffs)
- trunk/hightest/src/graph/NodeBase.h (modified) (2 diffs)
- trunk/hightest/src/graph/example/CommentsOnly.cpp (modified) (1 diff)
- trunk/hightest/src/graph/example/CommentsOnly.h (modified) (1 diff)
- trunk/hightest/src/graph/example/FileReader.cpp (modified) (2 diffs)
- trunk/hightest/src/graph/example/FileReader.h (modified) (5 diffs)
- trunk/hightest/src/graph/example/FileWriter.cpp (modified) (2 diffs)
- trunk/hightest/src/graph/example/FileWriter.h (modified) (3 diffs)
- trunk/hightest/src/graph/example/Spell.cpp (modified) (2 diffs)
- trunk/hightest/src/graph/example/Spell.h (modified) (3 diffs)
- trunk/hightest/src/graph/example/Tee.cpp (modified) (2 diffs)
- trunk/hightest/src/graph/example/Tee.h (modified) (1 diff)
- trunk/hightest/src/graph/example/WordCount.cpp (modified) (3 diffs)
- trunk/hightest/src/graph/example/WordCount.h (modified) (2 diffs)
- trunk/hightest/src/graph/example/WordEmitter.cpp (modified) (3 diffs)
- trunk/hightest/src/graph/example/WordEmitter.h (modified) (2 diffs)
- trunk/hightest/src/graph/example/WordFilter.cpp (modified) (3 diffs)
- trunk/hightest/src/graph/example/WordFilter.h (modified) (2 diffs)
- trunk/hightest/src/graph/example/WordParser.cpp (modified) (2 diffs)
- trunk/hightest/src/graph/example/WordParser.h (modified) (4 diffs)
- trunk/hightest/src/graph/example/main.cpp (modified) (1 diff)
- trunk/hightest/src/graph/example/test.cpp (modified) (1 diff)
- trunk/hightest/src/graph/test.cpp (modified) (1 diff)
- trunk/hightest/src/graph/test.h (modified) (1 diff)
- trunk/hightest/src/hightest/config.h (modified) (1 diff)
- trunk/hightest/src/log/log.cpp (modified) (2 diffs)
- trunk/hightest/src/log/log.h (modified) (1 diff)
- trunk/hightest/src/log/test.cpp (modified) (1 diff)
- trunk/hightest/src/options/Attribute.cpp (modified) (1 diff)
- trunk/hightest/src/options/Attribute.h (modified) (2 diffs)
- trunk/hightest/src/options/Config.cpp (modified) (1 diff)
- trunk/hightest/src/options/Config.h (modified) (2 diffs)
- trunk/hightest/src/options/XmlConfig.cpp (modified) (2 diffs)
- trunk/hightest/src/options/XmlConfig.h (modified) (1 diff)
- trunk/hightest/src/options/test.cpp (modified) (4 diffs)
- trunk/hightest/src/test/driver.cpp (modified) (1 diff)
- trunk/hightest/src/utils/DynamicLibrary.h (modified) (2 diffs)
- trunk/hightest/src/utils/Error.cpp (modified) (1 diff)
- trunk/hightest/src/utils/Error.h (modified) (1 diff)
- trunk/hightest/src/utils/String.cpp (modified) (1 diff)
- trunk/hightest/src/utils/String.h (modified) (1 diff)
- trunk/hightest/src/utils/test.cpp (modified) (1 diff)
- trunk/hightest/src/utils/unittest.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/hightest/src/graph/Graph.cpp
r57 r99 9 9 #include <vector> 10 10 11 using namespace swct;11 using namespace ht; 12 12 using namespace graph; 13 13 using namespace utils; … … 30 30 } 31 31 32 Node * swct::graph::Graph::construct(const options::Config *c)32 Node * ht::graph::Graph::construct(const options::Config *c) 33 33 { 34 34 string how; trunk/hightest/src/graph/Graph.h
r96 r99 1 1 // -*- c++ -*- 2 #ifndef SWCT_GRAPH_GRAPH_H3 #define SWCT_GRAPH_GRAPH_H2 #ifndef HT_GRAPH_GRAPH_H 3 #define HT_GRAPH_GRAPH_H 4 4 5 5 #include <hightest/config.h> 6 6 #include <graph/Node.h> 7 7 8 namespace swct {8 namespace ht { 9 9 namespace options { class Config; } 10 10 namespace graph { trunk/hightest/src/graph/Node.cpp
r2 r99 1 1 #include <graph/Node.h> 2 2 3 using namespace swct;3 using namespace ht; 4 4 using namespace graph; 5 5 trunk/hightest/src/graph/Node.h
r95 r99 1 1 // -*- c++ -*- 2 #ifndef SWCT_GRAPH_NODE_H3 #define SWCT_GRAPH_NODE_H2 #ifndef HT_GRAPH_NODE_H 3 #define HT_GRAPH_NODE_H 4 4 5 5 #include "hightest/config.h" … … 8 8 #include <vector> 9 9 10 namespace swct {10 namespace ht { 11 11 namespace options { class Config; } 12 12 namespace graph { trunk/hightest/src/graph/NodeBase.cpp
r79 r99 3 3 #include <options/Config.h> 4 4 5 using namespace swct;5 using namespace ht; 6 6 using namespace options; 7 7 using namespace graph; … … 10 10 void inline doNothing() {} 11 11 12 swct::graph::NodeBase::~NodeBase()12 ht::graph::NodeBase::~NodeBase() 13 13 { 14 14 } 15 15 16 const string & swct::graph::NodeBase::name() const16 const string & ht::graph::NodeBase::name() const 17 17 { 18 18 return name_; 19 19 } 20 20 21 void swct::graph::NodeBase::configure(const options::Config * c)21 void ht::graph::NodeBase::configure(const options::Config * c) 22 22 { 23 23 c->attribute("id") >> name_; … … 26 26 } 27 27 28 void swct::graph::NodeBase::configured()28 void ht::graph::NodeBase::configured() 29 29 { 30 30 } 31 31 32 void swct::graph::NodeBase::start()32 void ht::graph::NodeBase::start() 33 33 { 34 34 } 35 35 36 void swct::graph::NodeBase::stop()36 void ht::graph::NodeBase::stop() 37 37 { 38 38 } 39 39 40 void swct::graph::NodeBase::connect(swct::graph::Node *)40 void ht::graph::NodeBase::connect(ht::graph::Node *) 41 41 { 42 42 } 43 43 44 void swct::graph::NodeBase::disconnect(swct::graph::Node *)44 void ht::graph::NodeBase::disconnect(ht::graph::Node *) 45 45 { 46 46 } trunk/hightest/src/graph/NodeBase.h
r95 r99 1 1 // -*- c++ -*- 2 #ifndef SWCT_GRAPH_NODEBASE_H_3 #define SWCT_GRAPH_NODEBASE_H_2 #ifndef HT_GRAPH_NODEBASE_H_ 3 #define HT_GRAPH_NODEBASE_H_ 4 4 5 5 #include "hightest/config.h" … … 7 7 #include <graph/Node.h> 8 8 9 namespace swct {9 namespace ht { 10 10 namespace options { class Config; } 11 11 namespace graph { trunk/hightest/src/graph/example/CommentsOnly.cpp
r73 r99 5 5 using namespace std; 6 6 7 namespace swct {7 namespace ht { 8 8 namespace example { 9 9 bool CommentsOnly::test(const WordBuffer & buf) { trunk/hightest/src/graph/example/CommentsOnly.h
r84 r99 1 #ifndef SWCT_EXAMPLE_COMMENTS_ONLY_H_2 #define SWCT_EXAMPLE_COMMENTS_ONLY_H_1 #ifndef HT_EXAMPLE_COMMENTS_ONLY_H_ 2 #define HT_EXAMPLE_COMMENTS_ONLY_H_ 3 3 4 4 #include <graph/example/WordFilter.h> 5 5 6 namespace swct {6 namespace ht { 7 7 namespace example { 8 8 /** A WordFilter that allows only C/C++ comments through */ trunk/hightest/src/graph/example/FileReader.cpp
r84 r99 3 3 #include <iostream> 4 4 5 using namespace swct::graph;6 using namespace swct::options;5 using namespace ht::graph; 6 using namespace ht::options; 7 7 8 namespace swct {8 namespace ht { 9 9 namespace example { 10 10 … … 54 54 55 55 extern "C" { 56 Node * FileReader() { return new swct::example::FileReader(); }56 Node * FileReader() { return new ht::example::FileReader(); } 57 57 } trunk/hightest/src/graph/example/FileReader.h
r84 r99 1 #ifndef SWCT_EXAMPLE_FILE_READER_2 #define SWCT_EXAMPLE_FILE_READER_1 #ifndef HT_EXAMPLE_FILE_READER_ 2 #define HT_EXAMPLE_FILE_READER_ 3 3 4 4 #include <graph/NodeBase.h> 5 5 #include <fstream> 6 6 7 namespace swct {7 namespace ht { 8 8 namespace example { 9 9 … … 18 18 19 19 /** Base class for all consumers of ByteBuffers */ 20 class BlockReader : public swct::graph::NodeBase20 class BlockReader : public ht::graph::NodeBase 21 21 { 22 22 public: … … 26 26 27 27 /** Input reads and pushes them to the next node */ 28 class FileReader : public swct::graph::NodeBase28 class FileReader : public ht::graph::NodeBase 29 29 { 30 30 std::fstream stream_; … … 34 34 35 35 /* Configure our input file, or use stdin. */ 36 void configure(const swct::options::Config *);36 void configure(const ht::options::Config *); 37 37 38 38 /* Read blocks of data from the input and send it to the next node. */ … … 43 43 44 44 /* Connect this node to the next node in the graph. */ 45 void connect( swct::graph::Node *n);45 void connect(ht::graph::Node *n); 46 46 }; 47 47 } trunk/hightest/src/graph/example/FileWriter.cpp
r84 r99 6 6 #include "FileReader.h" 7 7 8 using namespace swct::options;9 using namespace swct::example;8 using namespace ht::options; 9 using namespace ht::example; 10 10 11 void swct::example::FileWriter::configure(const Config *c) {11 void ht::example::FileWriter::configure(const Config *c) { 12 12 BlockReader::configure(c); 13 13 std::string filename; … … 23 23 } 24 24 /// Write the given buffer to our configured output. 25 void swct::example::FileWriter::process(const ByteBuffer & buf) {25 void ht::example::FileWriter::process(const ByteBuffer & buf) { 26 26 stream_->write(buf.buffer, buf.count); 27 27 } 28 28 29 void swct::example::FileWriter::stop() { out_.close(); }29 void ht::example::FileWriter::stop() { out_.close(); } 30 30 31 31 extern "C" { 32 swct::graph::Node * FileWriter() { return new swct::example::FileWriter(); }32 ht::graph::Node * FileWriter() { return new ht::example::FileWriter(); } 33 33 } trunk/hightest/src/graph/example/FileWriter.h
r84 r99 1 #ifndef SWCT_EXAMPLE_FILE_WRITER_2 #define SWCT_EXAMPLE_FILE_WRITER_1 #ifndef HT_EXAMPLE_FILE_WRITER_ 2 #define HT_EXAMPLE_FILE_WRITER_ 3 3 4 4 #include <graph/NodeBase.h> … … 7 7 #include "FileReader.h" 8 8 9 namespace swct {9 namespace ht { 10 10 namespace options { class Config; } 11 11 namespace example { … … 16 16 std::ostream *stream_; 17 17 public: 18 void configure(const swct::options::Config *c);18 void configure(const ht::options::Config *c); 19 19 /// Write the given buffer to our configured output. 20 20 void process(const ByteBuffer & buf); trunk/hightest/src/graph/example/Spell.cpp
r90 r99 2 2 #include <fstream> 3 3 4 namespace swct {4 namespace ht { 5 5 namespace example { 6 void Spell::configure(const swct::options::Config *c) {6 void Spell::configure(const ht::options::Config *c) { 7 7 WordFilter::configure(c); 8 8 std::string filename; … … 25 25 26 26 extern "C" { 27 swct::graph::Node * Spell() { return new swct::example::Spell(); }27 ht::graph::Node * Spell() { return new ht::example::Spell(); } 28 28 } trunk/hightest/src/graph/example/Spell.h
r84 r99 1 #ifndef _ SWCT_EXAMPLE_SPELL_H2 #define _ SWCT_EXAMPLE_SPELL_H1 #ifndef _HT_EXAMPLE_SPELL_H 2 #define _HT_EXAMPLE_SPELL_H 3 3 4 4 #include <graph/example/WordFilter.h> … … 6 6 #include <string> 7 7 8 namespace swct {8 namespace ht { 9 9 namespace example { 10 10 /** Emit the words that don't match those in another file */ … … 14 14 public: 15 15 Spell() {} 16 void configure(const swct::options::Config *c);16 void configure(const ht::options::Config *c); 17 17 /// Implement WordFilter test: return true if the word is unknown 18 18 bool test(const WordBuffer & buf); trunk/hightest/src/graph/example/Tee.cpp
r81 r99 2 2 #include <options/Config.h> 3 3 4 using namespace swct::options;4 using namespace ht::options; 5 5 6 namespace swct {6 namespace ht { 7 7 namespace example { 8 8 … … 36 36 37 37 extern "C" { 38 swct::graph::Node * Tee() { return new swct::example::Tee(); }38 ht::graph::Node * Tee() { return new ht::example::Tee(); } 39 39 } trunk/hightest/src/graph/example/Tee.h
r84 r99 1 #ifndef SWCT_EXAMPLE_TEE_2 #define SWCT_EXAMPLE_TEE_1 #ifndef HT_EXAMPLE_TEE_ 2 #define HT_EXAMPLE_TEE_ 3 3 4 4 #include <graph/example/FileReader.h> 5 5 6 namespace swct {6 namespace ht { 7 7 namespace example { 8 8 trunk/hightest/src/graph/example/WordCount.cpp
r57 r99 3 3 #include <iostream> 4 4 5 void swct::example::WordCount::process(const swct::example::WordBuffer & buf)5 void ht::example::WordCount::process(const ht::example::WordBuffer & buf) 6 6 { 7 7 bytes_ += buf.length; … … 21 21 } 22 22 23 void swct::example::WordCount::stop() {23 void ht::example::WordCount::stop() { 24 24 if (!next_) { 25 25 std::cout << lines_ << " " << words_ << " " << bytes_ << std::endl; 26 26 } else { 27 swct::example::ByteBuffer b;27 ht::example::ByteBuffer b; 28 28 snprintf(b.buffer, sizeof(b.buffer), 29 29 "%4d %4d %4d\n", … … 34 34 } 35 35 36 void swct::example::WordCount::connect(swct::graph::Node *next) {37 next_ = dynamic_cast< swct::example::FileWriter*>(next);36 void ht::example::WordCount::connect(ht::graph::Node *next) { 37 next_ = dynamic_cast<ht::example::FileWriter*>(next); 38 38 } 39 39 40 40 41 41 extern "C" { 42 swct::graph::Node * WordCount() { return new swct::example::WordCount(); }42 ht::graph::Node * WordCount() { return new ht::example::WordCount(); } 43 43 } trunk/hightest/src/graph/example/WordCount.h
r84 r99 1 #ifndef _ SWCT_EXAMPLE_WORDCOUNT_H2 #define _ SWCT_EXAMPLE_WORDCOUNT_H1 #ifndef _HT_EXAMPLE_WORDCOUNT_H 2 #define _HT_EXAMPLE_WORDCOUNT_H 3 3 4 4 #include <graph/example/WordParser.h> 5 5 6 namespace swct {6 namespace ht { 7 7 namespace example { 8 8 class FileWriter; … … 17 17 WordCount() : words_(0), lines_(0), bytes_(0), next_(0) {} 18 18 void process(const WordBuffer & buf); 19 void connect( swct::graph::Node *next);19 void connect(ht::graph::Node *next); 20 20 /** Send the count of lines, words and characters as whole 21 21 * numbers, space separated trunk/hightest/src/graph/example/WordEmitter.cpp
r90 r99 2 2 #include <graph/example/FileReader.h> 3 3 4 namespace swct {4 namespace ht { 5 5 namespace example { 6 6 7 void WordEmitter::connect( swct::graph::Node *node) {7 void WordEmitter::connect(ht::graph::Node *node) { 8 8 next_ = dynamic_cast<BlockReader*>(node); 9 9 } … … 11 11 void WordEmitter::configured() { 12 12 if (!next_) 13 throw swct::options::ConfigError("No follow-on node for " + name());13 throw ht::options::ConfigError("No follow-on node for " + name()); 14 14 } 15 15 … … 24 24 } 25 25 extern "C" { 26 swct::graph::Node * WordEmitter() { return new swct::example::WordEmitter(); }26 ht::graph::Node * WordEmitter() { return new ht::example::WordEmitter(); } 27 27 } trunk/hightest/src/graph/example/WordEmitter.h
r84 r99 1 #ifndef _ SWCT_EXAMPLE_EMITTER_H2 #define _ SWCT_EXAMPLE_EMITTER_H1 #ifndef _HT_EXAMPLE_EMITTER_H 2 #define _HT_EXAMPLE_EMITTER_H 3 3 4 4 #include <graph/example/WordParser.h> 5 5 6 namespace swct {6 namespace ht { 7 7 namespace example { 8 8 class FileReader; … … 13 13 public: 14 14 WordEmitter() : next_(0) {} 15 void connect( swct::graph::Node *node);15 void connect(ht::graph::Node *node); 16 16 void configured(); 17 17 void process(const WordBuffer &buf); trunk/hightest/src/graph/example/WordFilter.cpp
r84 r99 2 2 #include <options/Config.h> 3 3 4 void swct::example::WordFilter::connect(swct::graph::Node *next)4 void ht::example::WordFilter::connect(ht::graph::Node *next) 5 5 { 6 6 next_ = dynamic_cast<WordReader*>(next); … … 8 8 9 9 10 void swct::example::WordFilter::configured()10 void ht::example::WordFilter::configured() 11 11 { 12 12 if (!next_) … … 14 14 } 15 15 16 void swct::example::WordFilter::process(const WordBuffer & buf)16 void ht::example::WordFilter::process(const WordBuffer & buf) 17 17 { 18 18 if (test(buf)) trunk/hightest/src/graph/example/WordFilter.h
r84 r99 1 #ifndef _ SWCT_EXAMPLE_WORD_FILTER_H_2 #define _ SWCT_EXAMPLE_WORD_FILTER_H_1 #ifndef _HT_EXAMPLE_WORD_FILTER_H_ 2 #define _HT_EXAMPLE_WORD_FILTER_H_ 3 3 4 4 #include <graph/example/WordParser.h> 5 5 6 namespace swct {6 namespace ht { 7 7 namespace example { 8 8 /** Decorator that specializes in *not* sending each word through. */ … … 13 13 WordFilter() : next_(0) {} 14 14 /// Connect to the next node 15 void connect( swct::graph::Node *next);15 void connect(ht::graph::Node *next); 16 16 /// Verify we have a follow-on connection 17 17 void configured(); trunk/hightest/src/graph/example/WordParser.cpp
r49 r99 1 1 #include <graph/example/WordParser.h> 2 2 3 namespace swct {3 namespace ht { 4 4 namespace example { 5 5 void WordParser::stop() { … … 60 60 61 61 extern "C" { 62 swct::graph::Node * WordParser() { return new swct::example::WordParser(); }62 ht::graph::Node * WordParser() { return new ht::example::WordParser(); } 63 63 } trunk/hightest/src/graph/example/WordParser.h
r84 r99 1 #ifndef SWCT_EXAMPLE_WORD_PARSER_2 #define SWCT_EXAMPLE_WORD_PARSER_1 #ifndef HT_EXAMPLE_WORD_PARSER_ 2 #define HT_EXAMPLE_WORD_PARSER_ 3 3 4 4 #include <graph/example/FileReader.h> … … 11 11 virtual void configured() const { \ 12 12 if (!next_) \ 13 throw swct::options::ConfigError("No follow-on node for node " + name()); \13 throw ht::options::ConfigError("No follow-on node for node " + name()); \ 14 14 } \ 15 15 void connect(Node *n) \ … … 25 25 26 26 27 namespace swct {27 namespace ht { 28 28 namespace example { 29 29 … … 46 46 47 47 /** Base class for all consumers of WordBuffers */ 48 class WordReader : public swct::graph::NodeBase48 class WordReader : public ht::graph::NodeBase 49 49 { 50 50 public: trunk/hightest/src/graph/example/main.cpp
r55 r99 5 5 #include <stdlib.h> 6 6 7 using namespace swct::options;8 using namespace swct::graph;7 using namespace ht::options; 8 using namespace ht::graph; 9 9 using namespace std; 10 10 trunk/hightest/src/graph/example/test.cpp
r84 r99 19 19 #include <graph/test.h> 20 20 21 using namespace swct::example;22 using namespace swct::options;23 using namespace swct::graph;21 using namespace ht::example; 22 using namespace ht::options; 23 using namespace ht::graph; 24 24 using namespace std; 25 25 trunk/hightest/src/graph/test.cpp
r83 r99 8 8 #include <graph/test.h> 9 9 10 using namespace swct;10 using namespace ht; 11 11 using namespace graph; 12 12 using namespace options; trunk/hightest/src/graph/test.h
r40 r99 1 #ifndef _ SWCT_GRAPH_TEST_H2 #define _ SWCT_GRAPH_TEST_H1 #ifndef _HT_GRAPH_TEST_H 2 #define _HT_GRAPH_TEST_H 3 3 4 4 #define ASSERT_ERROR_MESSAGE(expr, ExceptionType, msg) { \ trunk/hightest/src/hightest/config.h
r2 r99 1 #ifndef SWCT_CONFIG_H2 #define SWCT_CONFIG_H1 #ifndef HT_CONFIG_H 2 #define HT_CONFIG_H 3 3 4 4 /* placeholder for site-specific options */ trunk/hightest/src/log/log.cpp
r23 r99 7 7 #include <options/Config.h> 8 8 9 using namespace swct;10 using namespace swct::log;11 using namespace swct::options;9 using namespace ht; 10 using namespace ht::log; 11 using namespace ht::options; 12 12 13 13 Logger::~Logger() … … 112 112 } 113 113 114 void swct::log::configure(const Config *cfg)114 void ht::log::configure(const Config *cfg) 115 115 { 116 116 /* trunk/hightest/src/log/log.h
r22 r99 1 #ifndef SWCT_LOG_H_2 #define SWCT_LOG_H_1 #ifndef HT_LOG_H_ 2 #define HT_LOG_H_ 3 3 4 4 #include <string> 5 5 6 namespace swct {6 namespace ht { 7 7 namespace options { class Config; } 8 8 namespace log { trunk/hightest/src/log/test.cpp
r23 r99 7 7 #include <iostream> 8 8 9 using namespace swct;10 using namespace swct::options;11 using namespace swct::log;9 using namespace ht; 10 using namespace ht::options; 11 using namespace ht::log; 12 12 13 13 class Test : public CppUnit::TestCase { trunk/hightest/src/options/Attribute.cpp
r23 r99 5 5 6 6 using namespace std; 7 using namespace swct;7 using namespace ht; 8 8 using namespace options; 9 9 10 swct::options::Attribute::Attribute(const std::string & value) : value_(value) {}11 swct::options::Attribute::~Attribute() {}12 const string & swct::options::Attribute::value() const { return value_; }10 ht::options::Attribute::Attribute(const std::string & value) : value_(value) {} 11 ht::options::Attribute::~Attribute() {} 12 const string & ht::options::Attribute::value() const { return value_; } 13 13 14 14 inline void doNothing() {} 15 15 16 namespace swct {16 namespace ht { 17 17 namespace options { 18 18 19 AttributeConversionError::AttributeConversionError( 20 const std::string & value 21 ) 22 : ht::utils::BaseException(value) { 23 } 19 24 void operator>>(const Attribute & a, double & v) { 20 25 string s(a.value()); 21 26 const char * ptr = s.c_str(); 22 27 char * end = 0; 23 v = strtod(ptr, &end);28 v = ::strtod(ptr, &end); 24 29 if (end != ptr + s.length()) { 25 throw AttributeConversionError( );30 throw AttributeConversionError(s); 26 31 } 27 32 doNothing(); // for coverage trunk/hightest/src/options/Attribute.h
r95 r99 1 1 // -*- c++ -*- 2 2 #include <hightest/config.h> 3 #include <utils/Error.h> 3 4 4 5 #include <string> 5 6 6 namespace swct {7 namespace ht { 7 8 namespace options { 8 9 /** An intermediate class for extracting values from a config node. */ … … 18 19 }; 19 20 /** Simple class to tell you what you are doing wrong. */ 20 class AttributeConversionError : public std::exception {}; 21 class AttributeConversionError : public ht::utils::BaseException 22 { 23 public: 24 AttributeConversionError(const std::string & value); 25 }; 21 26 22 27 /** Use the C++ streams metaphore to extract components from a graph */ trunk/hightest/src/options/Config.cpp
r16 r99 1 1 #include <options/Config.h> 2 2 3 swct::options::Config::~Config() {}3 ht::options::Config::~Config() {} trunk/hightest/src/options/Config.h
r95 r99 1 1 // -*- c++ -*- 2 #ifndef SWCT_OPTIONS_CONFIG_H3 #define SWCT_OPTIONS_CONFIG_H2 #ifndef HT_OPTIONS_CONFIG_H 3 #define HT_OPTIONS_CONFIG_H 4 4 5 5 #include <hightest/config.h> … … 11 11 #include <vector> 12 12 13 namespace swct {13 namespace ht { 14 14 namespace options { 15 15 /** Exception thrown when a config file is bad */ trunk/hightest/src/options/XmlConfig.cpp
r23 r99 10 10 #include <expat.h> 11 11 12 using namespace swct;12 using namespace ht; 13 13 using namespace options; 14 14 using namespace std; … … 170 170 171 171 /** Factory function for an Xml-based configuration reader */ 172 Config * swct::options::XmlConfig(istream &s)172 Config * ht::options::XmlConfig(istream &s) 173 173 { 174 174 Parser parser; trunk/hightest/src/options/XmlConfig.h
r2 r99 1 1 // -*- c++ -*- 2 #ifndef SWCT_OPTIONS_XMLCONFIG_H3 #define SWCT_OPTIONS_XMLCONFIG_H2 #ifndef HT_OPTIONS_XMLCONFIG_H 3 #define HT_OPTIONS_XMLCONFIG_H 4 4 5 5 #include <options/Config.h> 6 6 #include <istream> 7 7 8 namespace swct {8 namespace ht { 9 9 namespace options { 10 10 Config *XmlConfig(std::istream &); trunk/hightest/src/options/test.cpp
r90 r99 1 1 #include <options/XmlConfig.h> 2 #include <utils/Error.h> 2 3 #include <cppunit/TestCaller.h> 3 4 #include <cppunit/TestSuite.h> … … 9 10 #include <malloc.h> 10 11 11 using namespace swct::options; 12 using namespace ht::options; 13 using namespace ht::utils; 12 14 using namespace std; 13 15 … … 55 57 a->attribute("bad") >> str; 56 58 CPPUNIT_ASSERT(str == "1="); 57 CPPUNIT_ASSERT_THROW(a->attribute("bad") >> d, exception);59 CPPUNIT_ASSERT_THROW(a->attribute("bad") >> d, BaseException); 58 60 stringstream broken("<"); 59 CPPUNIT_ASSERT_THROW(XmlConfig(broken), exception);61 CPPUNIT_ASSERT_THROW(XmlConfig(broken), BaseException); 60 62 try { 61 63 XmlConfig(broken); … … 88 90 __malloc_hook = malloc_fails; 89 91 p = XmlConfig(data), 90 exception);92 bad_alloc); 91 93 __malloc_hook = oldHook; 92 94 #endif trunk/hightest/src/test/driver.cpp
r52 r99 13 13 for (int i = 1; i < argc; i++) { 14 14 TestFunction function = 0; 15 swct::utils::LoadFunction(argv[i], "test", function);15 ht::utils::LoadFunction(argv[i], "test", function); 16 16 if (function) { 17 17 runner.addTest(function()); trunk/hightest/src/utils/DynamicLibrary.h
r96 r99 1 #ifndef SWCT_UTILS_DYNAMICLIBRARY_H2 #define SWCT_UTILS_DYNAMICLIBRARY_H1 #ifndef HT_UTILS_DYNAMICLIBRARY_H 2 #define HT_UTILS_DYNAMICLIBRARY_H 3 3 4 4 #include <hightest/config.h> … … 6 6 #include <dlfcn.h> 7 7 8 namespace swct {8 namespace ht { 9 9 namespace utils { 10 10 /// Error thrown when a library fails to load trunk/hightest/src/utils/Error.cpp
r7 r99 1 1 #include <utils/Error.h> 2 2 3 namespace swct {3 namespace ht { 4 4 namespace utils { 5 5 const char * BaseException::what() const throw() { trunk/hightest/src/utils/Error.h
r23 r99 1 #ifndef SWCT_UTILS_ERROR_H2 #define SWCT_UTILS_ERROR_H1 #ifndef HT_UTILS_ERROR_H 2 #define HT_UTILS_ERROR_H 3 3 4 4 #include <exception> 5 5 #include <string> 6 6 7 namespace swct {7 namespace ht { 8 8 namespace utils { 9 9 /// Very simple exception type that holds an error message. trunk/hightest/src/utils/String.cpp
r2 r99 3 3 using namespace std; 4 4 5 int swct::utils::split(const string& input,6 const string& delimiter,7 vector<string>& results)5 int ht::utils::split(const string& input, 6 const string& delimiter, 7 vector<string>& results) 8 8 { 9 9 size_t start = 0; trunk/hightest/src/utils/String.h
r2 r99 1 1 // -*- c++ -*- 2 #ifndef SWCT_UTIL_STRING_H3 #define SWCT_UTIL_STRING_H2 #ifndef HT_UTIL_STRING_H 3 #define HT_UTIL_STRING_H 4 4 5 5 #include <string> 6 6 #include <vector> 7 7 8 namespace swct {8 namespace ht { 9 9 namespace utils { 10 10 int split(const std::string& input, trunk/hightest/src/utils/test.cpp
r23 r99 2 2 #include <cppunit/TestCaller.h> 3 3 4 using namespace swct::utils;4 using namespace ht::utils; 5 5 using namespace std; 6 6 trunk/hightest/src/utils/unittest.h
r2 r99 1 #ifndef SWCT_UTILS_UNITTEST_H2 #define SWCT_UTILS_UNITTEST_H1 #ifndef HT_UTILS_UNITTEST_H 2 #define HT_UTILS_UNITTEST_H 3 3 4 4 #include <cppunit/TestCaller.h>
