Changeset 910

Show
Ignore:
Timestamp:
03/07/08 12:08:56 (13 years ago)
Author:
ppalmers
Message:

extend 1394 service test

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/tests/test-ieee1394service.cpp

    r909 r910  
    5757 
    5858#define DIFF_CONSIDERED_LARGE (3027/2) 
    59 int PORT_TO_USE = 0
     59int PORT_TO_USE = 1
    6060 
    6161int max_diff=-99999; 
     
    8989        { 
    9090            debugOutput(DEBUG_LEVEL_NORMAL, "(%p) Execute\n", this); 
    91             ctr=0; 
    92             ctr_dll=0; 
    93          
    94             ctr_prev=0; 
    95             ctr_dll_prev=0; 
     91            ctr = 0; 
     92            ctr_dll = 0; 
     93         
     94            ctr_prev = 0; 
     95            ctr_dll_prev = 0; 
     96            nb_checks = 0; 
     97            summed_diff = 0; 
     98            avg_diff = 0; 
     99            m_reset_avg = 1; 
    96100            m_handle = raw1394_new_handle_on_port( PORT_TO_USE ); 
    97101            if ( !m_handle ) { 
     
    120124        int64_t summed_diff; 
    121125        double avg_diff; 
     126        int m_reset_avg; 
    122127}; 
    123128 
     
    169174    // for jitter plots 
    170175    //     debugOutput(DEBUG_LEVEL_NORMAL, "9876543210: %lld\n", diff); 
     176 
     177    if(m_reset_avg) { 
     178        m_reset_avg = 0; 
     179        summed_diff = 0; 
     180        nb_checks = 0; 
     181    } 
    171182 
    172183    // not 100% thread safe, but will do 
     
    348359        debugOutput(DEBUG_LEVEL_NORMAL, "%08d: (max: %6d, min: %6d)\n", cnt, max_diff, min_diff); 
    349360        m_service->show(); 
     361        max_diff = -999999; 
     362        min_diff = 999999; 
    350363         
    351364        for (i=0; i < NB_THREADS; i++) { 
    352365            debugOutput(DEBUG_LEVEL_NORMAL, "%2d: avg: %6f\n", i,  thread_runners[i]->avg_diff); 
     366            thread_runners[i]->m_reset_avg = 1; 
    353367        } 
    354368