Changeset 509738fd in mainline
- Timestamp:
- 2018-07-05T21:41:18Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d49bae9
- Parents:
- a6ca1bc
- git-author:
- Jaroslav Jindrak <dzejrou@…> (2017-11-02 17:59:05)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:18)
- Location:
- uspace/lib/cpp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/internal/test/test.hpp
ra6ca1bc r509738fd 44 44 protected: 45 45 void report(bool, const char*); 46 void start(); 47 bool end(); 48 49 unsigned int failed_{}; 50 unsigned int succeeded_{}; 51 bool ok_{true}; 46 52 47 53 template<class... Args> … … 49 55 { 50 56 if (!assert_eq(std::forward<Args>(args)...)) 57 { 51 58 report(false, tname); 59 ++failed_; 60 ok_ = false; 61 } 52 62 else 63 { 53 64 report(true, tname); 65 ++succeeded_; 66 } 54 67 } 55 68 -
uspace/lib/cpp/src/internal/test/array.cpp
ra6ca1bc r509738fd 36 36 bool array_test::run() 37 37 { 38 start(); 39 38 40 auto check1 = {1, 2, 3, 4}; 39 41 auto check2 = {4, 3, 2, 1}; … … 99 101 // TODO: test bound checking of at when implemented 100 102 101 return true;103 return end(); 102 104 } 103 105 -
uspace/lib/cpp/src/internal/test/string.cpp
ra6ca1bc r509738fd 36 36 bool string_test::run() 37 37 { 38 start(); 39 38 40 test_construction_and_assignment(); 39 41 test_append(); … … 44 46 test_find(); 45 47 46 return true;48 return end(); 47 49 } 48 50 -
uspace/lib/cpp/src/internal/test/test.cpp
ra6ca1bc r509738fd 32 32 namespace std::test 33 33 { 34 35 34 void test_suite::report(bool result, const char* tname) 36 35 { … … 41 40 } 42 41 42 void test_suite::start() 43 { 44 std::printf("\n[TEST START][%s]\n", name()); 45 } 46 47 bool test_suite::end() 48 { 49 std::printf("[TEST END][%s][%lu OK][%lu FAIL]\n", 50 name(), succeeded_, failed_); 51 return ok_; 52 } 43 53 } -
uspace/lib/cpp/src/internal/test/vector.cpp
ra6ca1bc r509738fd 37 37 bool vector_test::run() 38 38 { 39 start(); 40 39 41 test_construction_and_assignment(); 40 42 test_insert(); 41 43 test_erase(); 42 return true; 44 45 return end(); 43 46 } 44 47
Note:
See TracChangeset
for help on using the changeset viewer.