mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-14 15:06:52 -04:00
Cleanup the tests
This commit is contained in:
parent
d8b2fd7e61
commit
0088d9eb7f
@ -10,18 +10,7 @@
|
|||||||
|
|
||||||
#include <string.hpp>
|
#include <string.hpp>
|
||||||
|
|
||||||
void check(bool condition, const char* message){
|
#include "test.hpp"
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -5,10 +5,32 @@
|
|||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "test.hpp"
|
||||||
|
|
||||||
void string_tests();
|
void string_tests();
|
||||||
|
void traits_tests();
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
string_tests();
|
string_tests();
|
||||||
|
traits_tests();
|
||||||
|
|
||||||
|
printf("All tests finished\n");
|
||||||
|
|
||||||
return 0;
|
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
12
tstl/test_suite/test.hpp
Normal 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);
|
Loading…
x
Reference in New Issue
Block a user