Example #1
0
    bool
    test1()
    {
//        dbg();
        Put() = 42;
//        dbg();
//        Put() = 44;
//        dbg();

        D::Msg m1 = *Get1().begin();
//        dbg();
        D::Msg m2 = *Get2().begin();
//        dbg();
        D::Msg m3 = *Get3().begin();
//        dbg();

        Put() = 43;
        m1 = *Get1().begin();
        m2 = *Get2().begin();
        m3 = *Get3().begin();

//        dbg();
        Put() = 44;
        m1 = *Get1().begin();
        m2 = *Get2().begin();
        m3 = *Get3().begin();
//        dbg();
        
        std::cout << "m1: " << m1
                  << ", m2: " << m2
                  << ", m3: " << m3
                  << std::endl;

        return m1 == 44 && m2 == 44 && m3 ==44;
    }
Example #2
0
 void Evaluate()
 {
     GetValueInternal() =
         (float)(
               ((DWORD)Get0()->GetValue())
             ^ ((DWORD)Get1()->GetValue())
         );
 }
Example #3
0
 void Evaluate()
 {
     GetValueInternal() =
            Get0()->GetValue()
         || Get1()->GetValue();
 }
Example #4
0
 void Evaluate()
 {
     GetValueInternal() = max(Get0()->GetValue(), Get1()->GetValue());
 }
Example #5
0
    bool test()
    {
        Put() = 42;
        Put() = 43;
//        dbg();
        try
        {
            Put() = 44;

//            std::cout << "put spin fail" << std::endl;
            return false;
        }
        catch(const std::exception& ex)
        {
//            std::cout << ex.what() << std::endl;
        }
//        dbg();
        auto i = Get1().begin();
        if(*i == 42 && *++i != 43)
        {
            return false;
        }
        try
        {
            auto i = Get1();
//            std::cout << "get spin fail" << std::endl;
            return false;
        }
        catch(const std::exception& ex)
        {
//            std::cout << ex.what() << std::endl;
        }
        try
        {
            Put() = 44;

//            std::cout << "put spin fail" << std::endl;
            return false;
        }
        catch(const std::exception& ex)
        {
//            std::cout << ex.what() << std::endl;
        }
        i = Get2().begin();
        if(*i == 42 && *++i != 43)
        {
            return false;
        }
//        dbg();
        try
        {
            auto i = Get2();
//            std::cout << "get spin fail" << std::endl;
            return false;
        }
        catch(const std::exception& ex)
        {
//            std::cout << ex.what() << std::endl;
        }
        Put() = 44;
        return true;
    }