| 1 |
/** |
| 2 |
* FreeDink test suite - Screen |
| 3 |
|
| 4 |
* Copyright (C) 2015 Sylvain Beucler |
| 5 |
|
| 6 |
* This file is part of GNU FreeDink |
| 7 |
|
| 8 |
* GNU FreeDink is free software; you can redistribute it and/or |
| 9 |
* modify it under the terms of the GNU General Public License as |
| 10 |
* published by the Free Software Foundation; either version 3 of the |
| 11 |
* License, or (at your option) any later version. |
| 12 |
|
| 13 |
* GNU FreeDink is distributed in the hope that it will be useful, but |
| 14 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
* General Public License for more details. |
| 17 |
|
| 18 |
* You should have received a copy of the GNU General Public License |
| 19 |
* along with this program. If not, see |
| 20 |
* <http://www.gnu.org/licenses/>. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifdef HAVE_CONFIG_H |
| 24 |
#include <config.h> |
| 25 |
#endif |
| 26 |
|
| 27 |
#include "editor_screen.h" |
| 28 |
#include "live_screen.h" |
| 29 |
#include "paths.h" |
| 30 |
|
| 31 |
class TestScreen : public CxxTest::TestSuite { |
| 32 |
public: |
| 33 |
void setUp() { |
| 34 |
ts_paths_init(); |
| 35 |
} |
| 36 |
void tearDown() { |
| 37 |
} |
| 38 |
|
| 39 |
void test_new() { |
| 40 |
TS_ASSERT_EQUALS(cur_ed_screen.script, ""); |
| 41 |
|
| 42 |
strcpy(cur_ed_screen.script, "onenter.c"); |
| 43 |
save_screen("map.dat", 1); |
| 44 |
strcpy(cur_ed_screen.script, ""); |
| 45 |
load_screen_to("map.dat", 1, &cur_ed_screen); |
| 46 |
TS_ASSERT_EQUALS(cur_ed_screen.script, "onenter.c"); |
| 47 |
} |
| 48 |
}; |