Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7515883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:57:17+00:00 2026-05-30T00:57:17+00:00

Ive been staring at my code and I can’t figure out why on earth

  • 0

Ive been staring at my code and I can’t figure out why on earth my constructor is not gettign called.

It’s just ignoring my constructor completely (i’ve check with stepping with debugger).

Here’s my testapp:

using namespace MyEngine;

int _tmain(int argc, _TCHAR* argv[])
{
    TestManager* testMgr = new TestManager();
    testMgr->RunAllTests();

    delete testMgr;

    getchar();
    return 0;
}

TestManager.h:

namespace MyEngine
{

    class TestManager 
    {
    public:
        TestManager();
        TestManager(uint64_t RepeatTimes);
        ~TestManager();

        bool RunAllTests();

        bool RunMemoryTests();

    private:
        Engine* mEngine;
        ILogManager* mLogger;

        MemoryTestManager* mMemTestMgr;
        uint64_t mRepeatTimes;

    };

}

and TestManager.cpp

namespace MyEngine
{

    TestManager::TestManager()
    {
        TestManager(1);
    }

    TestManager::TestManager(uint64_t RepeatTimes)
    {
        if (RepeatTimes>0)
            mRepeatTimes = RepeatTimes;
        else 
        {
            mRepeatTimes = 1;
        }

        mEngine = Engine::GetEngine();
        mMemTestMgr = new MemoryTestManager();
    }

    TestManager::~TestManager()
    {

    }


    /* Runs all testing modules */
    bool TestManager::RunAllTests()
    {
        bool res = true;

        /* Init Engine */
        if(mEngine->Init(0,0,0))
        {
            res = true;
            res && mEngine->GetRenderManager()->Init();
            res && mLogger->Init(true,true);
            res && mEngine->GetMemoryManager()->Init(false);

        }
        else
            return false;

        /* Start Engine */
        mEngine->Start();

        /* Get logger */
        mLogger = mEngine->GetLogger();

        /* Run Memory Tests */
        res &= RunMemoryTests();

        if (res)
            mLogger->LogInfo("TEST: TESTING SUCCESSFULL");
        else
            mLogger->LogError("TEST: TESTING FAILED");

        return res;
    }

    /* Runs all memory tests */
    bool TestManager::RunMemoryTests()
    {
        bool res = true;

        res &= mMemTestMgr->AllocateTest();
        res &= mMemTestMgr->ReferenceTest();

        if (res)
            mLogger->LogInfo("TEST: RunMemoryTests SUCCESSFULL");
        else
            mLogger->LogError("TEST: RunMemoryTests FAILED");

        return res;
    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:57:19+00:00Added an answer on May 30, 2026 at 12:57 am

    You cant call another constructor from the same class. I’d refactor the init code into a separate method and call it from both constructors:

    namespace MyEngine
    {
    
        TestManager::TestManager()
        {
            Init(1);
        }
    
        TestManager::TestManager(uint64_t RepeatTimes)
        {
            Init(RepeatTimes);
        }
    
        void TestManager::Init(uint64_t RepeatTimes)
        {
            if (RepeatTimes>0)
                mRepeatTimes = RepeatTimes;
            else 
            {
                mRepeatTimes = 1;
            }
    
            mEngine = Engine::GetEngine();
            mMemTestMgr = new MemoryTestManager();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been staring at this for quite a while and can't figure out how
I've been staring at my code for hours now trying to work out why
Either I've been staring at this code for way too long or I just
Ok, I have been staring at this for hours trying to figure out what's
I've been staring at the source code of these two download pages for awhile
I've been staring at this for a while and not getting very far. FruitBasketFactory,
I'm probably making a dumb mistake here, but I've been staring at my code
Alright, I've been staring at this for nearly an hour now and can't get
I've been staring at this all day to no avail and I'm out of
I don't get it. I've been staring at the code the code for three

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.