diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2015-01-03 21:07:56 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2015-01-03 21:58:26 -0800 |
commit | 00da6b5977574a0564169172227d8aab45be188f (patch) | |
tree | dd52eee506a98e1eb9fcdea52e7db25079a7ad28 /src/compat/attr_test.cpp | |
parent | 4c91abd6a020ee030114ae3f22d8f6066e7528be (diff) | |
download | tmwa-00da6b5977574a0564169172227d8aab45be188f.tar.gz tmwa-00da6b5977574a0564169172227d8aab45be188f.tar.bz2 tmwa-00da6b5977574a0564169172227d8aab45be188f.tar.xz tmwa-00da6b5977574a0564169172227d8aab45be188f.zip |
Switch MATCH to separate begin/end macros
The for loop trick turned out to be very prone to infinite loops
at runtime. It's better to force compiler errors even if it's ugly.
Diffstat (limited to 'src/compat/attr_test.cpp')
-rw-r--r-- | src/compat/attr_test.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/compat/attr_test.cpp b/src/compat/attr_test.cpp deleted file mode 100644 index eb9042d..0000000 --- a/src/compat/attr_test.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "attr.hpp" -// attr_test.cpp - Tests for attributes -// -// Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com> -// -// This file is part of The Mana World (Athena server) -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -#include <gtest/gtest.h> - -#include "../poison.hpp" - - -namespace tmwa -{ -TEST(attr, withvar) -{ - int x = 41; - for (int i = 0; i < 2; ++i) - { - WITH_VAR_NOLOOP(auto, y, x + 1) - { - x = y; - } - } - EXPECT_EQ(x, 43); - for (int i = 0; i < 2; ++i) - { - if (i == 1) - WITH_VAR_INLOOP(auto, y, i) - { - x = y; - break; - } - } - EXPECT_EQ(x, 1); -} -} // namespace tmwa |