summaryrefslogtreecommitdiffabout
path: root/test/test.cc
authorqdii <qdii@reblochon.be>2012-11-02 13:49:03 (UTC)
committer Michael Krelin <hacker@klever.net>2012-11-02 13:49:03 (UTC)
commit648ae5dbd90e062f3432f809a846d50d994b86d4 (patch) (unidiff)
treed9cbb0276d9a51db9243449866f01828dba36ab7 /test/test.cc
parent824440e52ce8ddf1c45487d20d8996d08d0f96b5 (diff)
downloadlibopkele-648ae5dbd90e062f3432f809a846d50d994b86d4.zip
libopkele-648ae5dbd90e062f3432f809a846d50d994b86d4.tar.gz
libopkele-648ae5dbd90e062f3432f809a846d50d994b86d4.tar.bz2
Function _exit was referenced in the code, but <unistd.h> was not included, causing compilation to fail.
Diffstat (limited to 'test/test.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--test/test.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/test.cc b/test/test.cc
index 2143ac0..770e0c6 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -1,34 +1,35 @@
1#include <iostream> 1#include <iostream>
2#include <stdexcept> 2#include <stdexcept>
3#include <unistd.h>
3using namespace std; 4using namespace std;
4#include <opkele/exception.h> 5#include <opkele/exception.h>
5#include <opkele/util.h> 6#include <opkele/util.h>
6 7
7#include "config.h" 8#include "config.h"
8 9
9class failed_test : public opkele::exception { 10class failed_test : public opkele::exception {
10 public: 11 public:
11 failed_test(OPKELE_E_PARS) 12 failed_test(OPKELE_E_PARS)
12 : exception(OPKELE_E_CONS) { } 13 : exception(OPKELE_E_CONS) { }
13}; 14};
14 15
15void test_rfc_3986_normalize_uri(const string &ouri,bool success,const string& nuri="") { 16void test_rfc_3986_normalize_uri(const string &ouri,bool success,const string& nuri="") {
16 try { 17 try {
17 string n = opkele::util::rfc_3986_normalize_uri(ouri); 18 string n = opkele::util::rfc_3986_normalize_uri(ouri);
18 if(!success) 19 if(!success)
19 throw failed_test(OPKELE_CP_ "Normalized URI when it shouldn't ('"+ouri+"' normalization resulted in '"+n+"')"); 20 throw failed_test(OPKELE_CP_ "Normalized URI when it shouldn't ('"+ouri+"' normalization resulted in '"+n+"')");
20 if(n!=nuri) 21 if(n!=nuri)
21 throw failed_test(OPKELE_CP_ "rfc_3986_test_failed for '"+ouri+"' failed, expected '"+nuri+"', got '"+n+"'"); 22 throw failed_test(OPKELE_CP_ "rfc_3986_test_failed for '"+ouri+"' failed, expected '"+nuri+"', got '"+n+"'");
22 }catch(opkele::bad_input& obi) { 23 }catch(opkele::bad_input& obi) {
23 if(success) 24 if(success)
24 throw failed_test(OPKELE_CP_ "Test '"+ouri+"' failed due to 'bad_input'["+obi.what()+"]"); 25 throw failed_test(OPKELE_CP_ "Test '"+ouri+"' failed due to 'bad_input'["+obi.what()+"]");
25 }catch(opkele::not_implemented& oni) { 26 }catch(opkele::not_implemented& oni) {
26 if(success) 27 if(success)
27 throw failed_test(OPKELE_CP_ "Test '"+ouri+"' failed due to 'not_implemented'["+oni.what()+"]"); 28 throw failed_test(OPKELE_CP_ "Test '"+ouri+"' failed due to 'not_implemented'["+oni.what()+"]");
28 } 29 }
29} 30}
30 31
31void test_rfc_3986_normalize_uri() { 32void test_rfc_3986_normalize_uri() {
32 test_rfc_3986_normalize_uri( 33 test_rfc_3986_normalize_uri(
33 "invalid", false ); 34 "invalid", false );
34 test_rfc_3986_normalize_uri( 35 test_rfc_3986_normalize_uri(