Permalink
Browse files

Update th.

  • Loading branch information...
1 parent 1db3cf8 commit f51e1f30b380a43b9c2de4808250c79394fad684 @rescrv committed Aug 3, 2013
Showing with 13 additions and 17 deletions.
  1. +8 −12 th.cc
  2. +5 −5 th.h
View
@@ -1,9 +1,9 @@
// Copyright (c) 2013, Robert Escriva
// All rights reserved.
-//
+//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
-//
+//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
@@ -12,7 +12,7 @@
// * Neither the name of th nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific
// prior written permission.
-//
+//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -40,10 +40,10 @@
static std::vector<th::base*>* _th_tests = NULL;
-class throw_this_on_test_failure
+class escape_from_test_failure
{
public:
- throw_this_on_test_failure() {}
+ escape_from_test_failure() {}
};
th :: base :: base(const char* group,
@@ -63,10 +63,6 @@ th :: base :: base(const char* group,
_th_tests->push_back(this);
}
-th :: base :: ~base() throw ()
-{
-}
-
void
th :: base :: run(bool* failed)
{
@@ -77,7 +73,7 @@ th :: base :: run(bool* failed)
this->_run();
*failed = false;
}
- catch (throw_this_on_test_failure& ttotf)
+ catch (escape_from_test_failure& ttotf)
{
*failed = true;
}
@@ -214,6 +210,6 @@ th :: run_tests()
void
th :: fail()
{
- throw_this_on_test_failure ttotf;
- throw ttotf;
+ escape_from_test_failure eftf;
+ throw eftf;
}
View
@@ -1,9 +1,9 @@
// Copyright (c) 2013, Robert Escriva
// All rights reserved.
-//
+//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
-//
+//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
@@ -12,7 +12,7 @@
// * Neither the name of th nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific
// prior written permission.
-//
+//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -55,7 +55,7 @@ class base
const char* name,
const char* file,
size_t line);
- virtual ~base() throw ();
+ virtual ~base() throw () {}
public:
void run(bool* failed);
@@ -88,7 +88,7 @@ class base
std::cerr << "FAIL @ " << m_file << ":" << m_line << ": tested " << m_a << " " TH_XSTR(compiler) " " << m_b << "; got " << a << " " TH_XSTR(compiler) " " << b << std::endl; \
th::fail(); \
} \
- }
+ }
class predicate
{

0 comments on commit f51e1f3

Please sign in to comment.