Cleanup the tests

This commit is contained in:
Baptiste Wicht 2016-08-09 18:01:18 +02:00
parent d8b2fd7e61
commit 0088d9eb7f
3 changed files with 35 additions and 12 deletions

View File

@ -10,18 +10,7 @@
#include <string.hpp>
void check(bool condition, const char* message){
if(!condition){
printf("Check failed: \"%s\"\n", message);
}
}
void check_equals(long value, long expected, const char* message){
if(value != expected){
printf("Check failed: \"%s\"\n", message);
printf("\t expected: %ld was: %ld\n", expected, value);
}
}
#include "test.hpp"
namespace {

View File

@ -5,10 +5,32 @@
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <cstdio>
#include <cstring>
#include "test.hpp"
void string_tests();
void traits_tests();
int main(){
string_tests();
traits_tests();
printf("All tests finished\n");
return 0;
}
void check(bool condition, const char* message){
if(!condition){
printf("Check failed: \"%s\"\n", message);
}
}
void check_equals(long value, long expected, const char* message){
if(value != expected){
printf("Check failed: \"%s\"\n", message);
printf("\t expected: %ld was: %ld\n", expected, value);
}
}

12
tstl/test_suite/test.hpp Normal file
View File

@ -0,0 +1,12 @@
//=======================================================================
// Copyright Baptiste Wicht 2013-2016.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
#include <cstdio>
#include <cstring>
void check(bool condition, const char* message);
void check_equals(long value, long expected, const char* message);