Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 10:29:21 PM (8 years ago)
Author:
landauf
Message:

merged branch cpp11_v3 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/test/core_plugin/PluginTest.cc

    r11013 r11071  
    2323                PluginTest()
    2424                {
    25                     this->plugin_ = NULL;
     25                    this->plugin_ = nullptr;
    2626                }
    2727
     
    4444                {
    4545                    delete this->plugin_;
    46                     this->plugin_ = NULL;
    47                 }
    48 
    49                 virtual void TearDown()
     46                    this->plugin_ = nullptr;
     47                }
     48
     49                virtual void TearDown() override
    5050                {
    5151                    // make sure the plugin is unloaded
     
    7777    TEST_F(PluginTest, LoadsIdentifier)
    7878    {
    79         EXPECT_TRUE(getIdentifier() == NULL);
    80         this->loadPlugin();
    81         EXPECT_TRUE(getIdentifier() != NULL);
     79        EXPECT_TRUE(getIdentifier() == nullptr);
     80        this->loadPlugin();
     81        EXPECT_TRUE(getIdentifier() != nullptr);
    8282        this->unloadPlugin();
    8383    }
     
    8686    {
    8787        this->loadPlugin();
    88         EXPECT_TRUE(getIdentifier() != NULL);
    89         this->unloadPlugin();
    90         EXPECT_TRUE(getIdentifier() == NULL);
     88        EXPECT_TRUE(getIdentifier() != nullptr);
     89        this->unloadPlugin();
     90        EXPECT_TRUE(getIdentifier() == nullptr);
    9191    }
    9292
     
    9494    {
    9595        this->loadPlugin();
    96         EXPECT_TRUE(getIdentifier() != NULL);
    97         this->unloadPlugin();
    98         EXPECT_TRUE(getIdentifier() == NULL);
    99         this->loadPlugin();
    100         EXPECT_TRUE(getIdentifier() != NULL);
     96        EXPECT_TRUE(getIdentifier() != nullptr);
     97        this->unloadPlugin();
     98        EXPECT_TRUE(getIdentifier() == nullptr);
     99        this->loadPlugin();
     100        EXPECT_TRUE(getIdentifier() != nullptr);
    101101        this->unloadPlugin();
    102102    }
     
    107107
    108108        Identifier* identifier = getIdentifier();
    109         ASSERT_TRUE(identifier != NULL);
    110 
    111         Identifiable* object = identifier->fabricate(NULL);
    112         ASSERT_TRUE(object != NULL);
     109        ASSERT_TRUE(identifier != nullptr);
     110
     111        Identifiable* object = identifier->fabricate(nullptr);
     112        ASSERT_TRUE(object != nullptr);
    113113
    114114        Testclass* testclass = orxonox_cast<Testclass*>(object);
    115         ASSERT_TRUE(testclass != NULL);
     115        ASSERT_TRUE(testclass != nullptr);
    116116
    117117        EXPECT_EQ(666, testclass->getValue());
     
    131131        std::vector<Testsingleton*> singletons;
    132132
    133         for (ObjectList<Listable>::iterator it = ObjectList<Listable>::begin(); it; ++it)
    134         {
    135             Testsingleton* singleton = dynamic_cast<Testsingleton*>(*it);
     133        for (Listable* listable : ObjectList<Listable>())
     134        {
     135            Testsingleton* singleton = dynamic_cast<Testsingleton*>(listable);
    136136            if (singleton)
    137137                singletons.push_back(singleton);
     
    141141        {
    142142            case 0:
    143                 return NULL;
     143                return nullptr;
    144144            case 1:
    145145                return singletons[0];
     
    151151    TEST_F(PluginTest, LoadsSingleton)
    152152    {
    153         EXPECT_TRUE(getSingleton() == NULL);
    154         this->loadPlugin();
    155         EXPECT_TRUE(getSingleton() != NULL);
     153        EXPECT_TRUE(getSingleton() == nullptr);
     154        this->loadPlugin();
     155        EXPECT_TRUE(getSingleton() != nullptr);
    156156        this->unloadPlugin();
    157157    }
     
    160160    {
    161161        this->loadPlugin();
    162         EXPECT_TRUE(getSingleton() != NULL);
    163         this->unloadPlugin();
    164         EXPECT_TRUE(getSingleton() == NULL);
     162        EXPECT_TRUE(getSingleton() != nullptr);
     163        this->unloadPlugin();
     164        EXPECT_TRUE(getSingleton() == nullptr);
    165165    }
    166166
     
    168168    {
    169169        this->loadPlugin();
    170         EXPECT_TRUE(getSingleton() != NULL);
    171         this->unloadPlugin();
    172         EXPECT_TRUE(getSingleton() == NULL);
    173         this->loadPlugin();
    174         EXPECT_TRUE(getSingleton() != NULL);
     170        EXPECT_TRUE(getSingleton() != nullptr);
     171        this->unloadPlugin();
     172        EXPECT_TRUE(getSingleton() == nullptr);
     173        this->loadPlugin();
     174        EXPECT_TRUE(getSingleton() != nullptr);
    175175        this->unloadPlugin();
    176176    }
     
    181181
    182182        Testsingleton* singleton = getSingleton();
    183         ASSERT_TRUE(singleton != NULL);
     183        ASSERT_TRUE(singleton != nullptr);
    184184
    185185        EXPECT_EQ(999, singleton->getValue());
     
    255255    TEST_F(PluginTest, LoadsConsoleCommand)
    256256    {
    257         EXPECT_TRUE(getConsoleCommand() == NULL);
    258         this->loadPlugin();
    259         EXPECT_TRUE(getConsoleCommand() != NULL);
     257        EXPECT_TRUE(getConsoleCommand() == nullptr);
     258        this->loadPlugin();
     259        EXPECT_TRUE(getConsoleCommand() != nullptr);
    260260        this->unloadPlugin();
    261261    }
     
    264264    {
    265265        this->loadPlugin();
    266         EXPECT_TRUE(getConsoleCommand() != NULL);
    267         this->unloadPlugin();
    268         EXPECT_TRUE(getConsoleCommand() == NULL);
     266        EXPECT_TRUE(getConsoleCommand() != nullptr);
     267        this->unloadPlugin();
     268        EXPECT_TRUE(getConsoleCommand() == nullptr);
    269269    }
    270270
     
    272272    {
    273273        this->loadPlugin();
    274         EXPECT_TRUE(getConsoleCommand() != NULL);
    275         this->unloadPlugin();
    276         EXPECT_TRUE(getConsoleCommand() == NULL);
    277         this->loadPlugin();
    278         EXPECT_TRUE(getConsoleCommand() != NULL);
     274        EXPECT_TRUE(getConsoleCommand() != nullptr);
     275        this->unloadPlugin();
     276        EXPECT_TRUE(getConsoleCommand() == nullptr);
     277        this->loadPlugin();
     278        EXPECT_TRUE(getConsoleCommand() != nullptr);
    279279        this->unloadPlugin();
    280280    }
     
    285285
    286286        ConsoleCommand* command = getConsoleCommand();
    287         ASSERT_TRUE(command != NULL);
     287        ASSERT_TRUE(command != nullptr);
    288288
    289289        EXPECT_EQ(999, (*command->getExecutor())(333, 666).get<int>());
Note: See TracChangeset for help on using the changeset viewer.