1 // -*- Mode: C++; tab-width:2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi:tw=80:et:ts=2:sts=2
3 //
4 // -----------------------------------------------------------------------
5 //
6 // This file is part of RLVM, a RealLive virtual machine clone.
7 //
8 // -----------------------------------------------------------------------
9 //
10 // Copyright (C) 2009 Elliot Glaysher
11 //
12 // This program is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation; either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
25 // -----------------------------------------------------------------------
26 
27 #include "gtest/gtest.h"
28 
29 #include "libreallive/archive.h"
30 #include "machine/rlmachine.h"
31 #include "modules/module_msg.h"
32 #include "test_system/test_machine.h"
33 #include "test_system/test_system.h"
34 
35 #include "test_utils.h"
36 
37 class MediumMsgLoopTest : public FullSystemTest {
38  protected:
MediumMsgLoopTest()39   MediumMsgLoopTest() { rlmachine.AttachModule(new MsgModule); }
40 };
41 
TEST_F(MediumMsgLoopTest,TestFastText)42 TEST_F(MediumMsgLoopTest, TestFastText) {
43   system.text().set_fast_text_mode(0);
44 
45   rlmachine.Exe("FastText", 0);
46   EXPECT_TRUE(system.text().fast_text_mode());
47 
48   rlmachine.Exe("NormalText", 0);
49   EXPECT_FALSE(system.text().fast_text_mode());
50 }
51