int
run_main (int, ACE_TCHAR *[])
{
  ACE_START_TEST (ACE_TEXT("Compiler_Features_19_Test"));

  typedef IDL::bounded_string<100> string100;
  string100 s100("world");

  ACE_DEBUG ((LM_DEBUG,
              ACE_TEXT ("String %C bound %d\n"), s100.c_str(), s100.bound ()));

  ACE_DEBUG ((LM_INFO,
              ACE_TEXT ("Template alias works.\n")));

  ACE_END_TEST;

  return 0;
}
Example #2
0
void V3TSP::selfTestStates() {
    // Linear test -- coords all along the x-axis
    {
        V3TSP::StateVec states;
        TspTestState s10(10,0);
        TspTestState s60(60,0);
        TspTestState s20(20,0);
        TspTestState s100(100,0);
        TspTestState s5(5,0);
        states.push_back(&s10);
        states.push_back(&s60);
        states.push_back(&s20);
        states.push_back(&s100);
        states.push_back(&s5);

        V3TSP::StateVec result;
        tspSort(states, &result);

        V3TSP::StateVec expect;
        expect.push_back(&s100);
        expect.push_back(&s60);
        expect.push_back(&s20);
        expect.push_back(&s10);
        expect.push_back(&s5);
        if (expect != result) {
            for (V3TSP::StateVec::iterator it = result.begin();
                 it != result.end(); ++it) {
                const TspTestState* statep = dynamic_cast<const TspTestState*>(*it);
                cout<<statep->xpos()<<" ";
            }
            cout<<endl;
            v3fatalSrc("TSP linear self-test fail. Result (above) did not match expectation.");
        }
    }

    // Second test. Coords are distributed in 2D space.
    // Test that tspSort() will rotate the list for minimum cost.
    {
        V3TSP::StateVec states;
        TspTestState a(0,0);
        TspTestState b(100,0);
        TspTestState c(200,0);
        TspTestState d(200,100);
        TspTestState e(150,150);
        TspTestState f(0,150);
        TspTestState g(0,100);

        states.push_back(&a);
        states.push_back(&b);
        states.push_back(&c);
        states.push_back(&d);
        states.push_back(&e);
        states.push_back(&f);
        states.push_back(&g);

        V3TSP::StateVec result;
        tspSort(states, &result);

        V3TSP::StateVec expect;
        expect.push_back(&f);
        expect.push_back(&g);
        expect.push_back(&a);
        expect.push_back(&b);
        expect.push_back(&c);
        expect.push_back(&d);
        expect.push_back(&e);

        if (expect != result) {
            for (V3TSP::StateVec::iterator it = result.begin();
                 it != result.end(); ++it) {
                const TspTestState* statep = dynamic_cast<const TspTestState*>(*it);
                cout<<statep->xpos()<<","<<statep->ypos()<<" ";
            }
            cout<<endl;
            v3fatalSrc("TSP 2d cycle=false self-test fail. Result (above) did not match expectation.");
        }
    }
}