Ejemplo n.º 1
0
void HH_Runtime::VerifyUnitTestResults( const std::string& batchBuildId )
{
    m_notifier.ReportProgressMessage( "Verifing unit test results..." );

    if  ( _access( m_dotKnownGoodFileName.c_str(), 00 ) != 0 )
    {
        throw HH_CantOpenKnownGoodFile( m_dotKnownGoodFileName );
    }

    // Compare the .out and .good files
    HH_File   dotOutputFile( m_dotOutputFileName );
    HH_File   dotKnownGoodFile( m_dotKnownGoodFileName );

    if ( !dotOutputFile.Compare( dotKnownGoodFile ) )
    {
        m_notifier.ReportTestResult( false );
        if ( batchBuildId.length() > 0 && m_externalResult.length() > 0 )
        {
            // Report failure to external system
            ReportResult( "FAILED", batchBuildId );
        }
    }
    else
    {
        m_notifier.ReportTestResult( true );
        if ( batchBuildId.length() > 0 && m_externalResult.length() > 0 )
        {
            // Report success to external system
            ReportResult( "PASSED", batchBuildId );
        }
    }
}
Ejemplo n.º 2
0
ASSERTDATA


//+----------------------------------------------------------------------------
//
//      Member:
//              CDataAdviseCache::CreateDataAdviseCache, static public
//
//      Synopsis:
//              Creates an instance of the CDataAdviseCache
//
//      Arguments:
//              [pp] -- pointer to a location to where to return the
//                      newly created CDataAdviseCache
//
//      Returns:
//              E_OUTOFMEMORY, S_OK
//
//      Notes:
//
//      History:
//              11/02/93 - ChrisWe - file cleanup and inspection
//
//-----------------------------------------------------------------------------

#pragma SEG(CreateDataAdviseCache)
FARINTERNAL CDataAdviseCache::CreateDataAdviseCache(LPDATAADVCACHE FAR* pp)
{
	VDATEHEAP();

	VDATEPTRIN(pp, LPDATAADVCACHE);

	// try to allocate the CDataAdviseCache
	if(NULL == (*pp = new DATAADVCACHE))
		return ReportResult(0, E_OUTOFMEMORY, 0, 0);

	// initialize the DataAdviseHolder member
	if(CreateDataAdviseHolder(&((*pp)->m_pDAH)) != NOERROR)
	{
		// free the DataAdviseCache
		delete *pp;
		*pp = NULL;

		return ReportResult(0, E_OUTOFMEMORY, 0, 0);
	}

	return(NOERROR);
}
Ejemplo n.º 3
0
STDMETHODIMP COAHolder::QueryInterface(REFIID iid, LPVOID FAR* ppv)
{
	VDATEHEAP();

	M_PROLOG(this);

	VDATEPTROUT(ppv, LPVOID FAR *);

	LEDebugOut((DEB_ITRACE,
		"%p _IN COAHolder::QueryInterface ( %p , %p )"
		"\n", this, iid, ppv));

	HRESULT hr = ReportResult(0, E_NOINTERFACE, 0, 0);

	if (IsEqualIID(iid, IID_IUnknown) ||
			IsEqualIID(iid, IID_IOleAdviseHolder))
	{
		*ppv = (IOleAdviseHolder FAR *)this;
		AddRef();
		hr = NOERROR;
	}
	else
	{
		*ppv = NULL;
	}

	LEDebugOut((DEB_ITRACE, "%p OUT COAHolder::QueryInterface ( %lx )"
		" [ %p ]\n", this, hr, *ppv));

	return hr;
}
Ejemplo n.º 4
0
void WapacheProtocol::ProcessConnection(void) {
	// this function runs inside the worker thread
	apr_socket_t *sock;
	long thread_num = 1;
    ap_sb_handle_t *sbh;
	apr_bucket_alloc_t *ba;
	bool redirected;

	// create a fake socket
	sock = (apr_socket_t *) apr_pcalloc(Pool, sizeof(apr_socket_t));

    sock->pool = Pool;
    sock->local_port_unknown = 1;
    sock->local_interface_unknown = 1;
    sock->remote_addr_unknown = 1;
    sock->userdata = (sock_userdata_t *) this;

    ba = apr_bucket_alloc_create(Pool);

    ap_create_sb_handle(&sbh, Pool, 0, thread_num);
	Connection = ap_run_create_connection(Pool, Application.ServerConf, sock, thread_num, sbh, ba);

	if(Connection) {
		do {
			redirected = Redirecting;
			Redirecting = false;
			if(!Terminated) {
				ap_process_connection(Connection, sock);
			}
		} while(Redirecting);
	}
	else {
		// can't create the connection object for some reason
		HttpStatusCode = 500;
	}

	if(!HttpStatusCode || HttpStatusCode >= 400 || HttpStatusCode == 204) {
		ReportResult(E_ABORT, ERROR_CANCELLED);
	}
	else {
		ReportResult(S_OK, 0);
	} 
}
Ejemplo n.º 5
0
void ReplicationTest::tryResultData()
{
  QString sql;
  QSqlQuery *q;

  repl_ticks++;

  //
  // Read Value
  //
  sql=QString("select VALUE from ")+repl_config->pingTablename(Am::This);
  q=new QSqlQuery(sql,QSqlDatabase::database("repl_db"));
  if(!q->first()) {
    syslog(LOG_ERR,"cannot select from mysql at %s [%s]",
	   (const char *)repl_config->address(Am::That,repl_addr).toString().
	   toAscii(),
	   (const char *)q->lastError().text().toAscii());
    delete q;
    ReportResult(false,0);
    return;
  }
  if(q->value(0).toInt()==repl_value) {
    delete q;
    ReportResult(true,repl_ticks);
    return;
  }
  delete q;

  //
  // Check for Timeout
  //
  if(repl_ticks>=repl_config->globalMysqlReplicationTimeout()) {
    ReportResult(false,0);
    return;
  }

  //
  // Restart for Another Attempt
  //
  repl_timer->start(AM_REPLICATION_TICK_INTERVAL);
}
Ejemplo n.º 6
0
HRESULT CDataAdviseCache::ClientToDelegate(DWORD dwClient,
		DWORD FAR* pdwDelegate)
{
	VDATEHEAP();

	VDATEPTRIN(pdwDelegate, DWORD);
	DWORD dwDelegate = *pdwDelegate = 0;

	if (FALSE == m_mapClientToDelegate.Lookup(dwClient, dwDelegate))
		return(ReportResult(0, OLE_E_NOCONNECTION, 0, 0));

	*pdwDelegate = dwDelegate;
	return NOERROR;
}
Ejemplo n.º 7
0
int joinBucket() 
{
  // cerr << "---------------------------------------------------" << endl;
  int pairs = 0;
  bool selfjoin = stop.join_cardinality ==1 ? true : false ;
  int idx1 = SID_1 ; 
  int idx2 = selfjoin ? SID_1 : SID_2 ;
  double low[2], high[2];
  
  // for each tile (key) in the input stream 
  try { 

    std::vector<Geometry*>  & poly_set_one = polydata[idx1];
    std::vector<Geometry*>  & poly_set_two = polydata[idx2];

    int len1 = poly_set_one.size();
    int len2 = poly_set_two.size();

    if (len1 <= 0 || len2 <= 0) {
         return 0;
    }
    
    map<int,Geometry*> geom_polygons2;
    for (int j = 0; j < len2; j++) {
        geom_polygons2[j] = poly_set_two[j];
    }
    
    // build spatial index for input polygons from idx2
    bool ret = buildIndex(geom_polygons2);
    if (ret == false) {
        return -1;
    }
    // cerr << "len1 = " << len1 << endl;
    // cerr << "len2 = " << len2 << endl;

    for (int i = 0; i < len1; i++) {
        const Geometry* geom1 = poly_set_one[i];
        const Envelope * env1 = geom1->getEnvelopeInternal();
        low[0] = env1->getMinX();
        low[1] = env1->getMinY();
        high[0] = env1->getMaxX();
        high[1] = env1->getMaxY();
        /* Handle the buffer expansion for R-tree */
        if (stop.JOIN_PREDICATE == ST_DWITHIN) {
            low[0] -= stop.expansion_distance;
            low[1] -= stop.expansion_distance;
            high[0] += stop.expansion_distance;
            high[1] += stop.expansion_distance;
        }
        Region r(low, high, 2);
        hits.clear();
        MyVisitor vis;
        spidx->intersectsWithQuery(r, vis);
        //cerr << "j = " << j << " hits: " << hits.size() << endl;
        for (uint32_t j = 0 ; j < hits.size(); j++ ) 
        {
            if (hits[j] == i && selfjoin) {
                continue;
            }
            const Geometry* geom2 = poly_set_two[hits[j]];
            const Envelope * env2 = geom2->getEnvelopeInternal();
            if (join_with_predicate(geom1, geom2, env1, env2,
                    stop.JOIN_PREDICATE))  {
              ReportResult(i,hits[j]);
              pairs++;
            }
        }
    }
  } // end of try
  //catch (Tools::Exception& e) {
  catch (...) {
    std::cerr << "******ERROR******" << std::endl;
    //std::string s = e.what();
    //std::cerr << s << std::endl;
    return -1;
  } // end of catch
  return pairs ;
}
Ejemplo n.º 8
0
STDMETHODIMP COAHolder::Advise(IAdviseSink FAR* pAdvSink,
		DWORD FAR* pdwConnection)
{
	VDATEHEAP();

	int iAdv;  // records the first free entry found, or (-1)
	int iAdvScan; // counts across array entries
	IAdviseSink FAR *FAR *ppIAS; // points at the array entry being examined
	IAdviseSink FAR *pIAS; // the actual entry at *ppIAS

	M_PROLOG(this);
	VDATEIFACE(pAdvSink);
	HRESULT hr = NOERROR;

	LEDebugOut((DEB_ITRACE, "%p _IN COAHolder::Advise ( %p , %p )"
		"\n", this, pAdvSink, pdwConnection));

 	// Validate where to return the connection.
	if (pdwConnection)
	{
		VDATEPTRIN(pdwConnection, DWORD);

		// Default to error case
		*pdwConnection = 0;
	}

	// check our zombie state and stabilize.  If we are in a zombie
	// state, we do not want to be adding new advise sinks.

	CStabilize stabilize((CSafeRefCount *)this);

	if( IsZombie() )
	{
		hr = ResultFromScode(CO_E_RELEASED);
		goto errRtn;
	}


	// find an empty slot and clean up disconnected handlers
	for (iAdv = (-1), ppIAS = m_ppIAS, iAdvScan = 0;
			iAdvScan < m_iSize; ++ppIAS, ++iAdvScan)
	{
		if ((pIAS = *ppIAS) == NULL)
		{
			// NULL entries are handled below, to catch
			// any of the below cases creating new NULL values
			;
		}
		else if (!IsValidInterface(pIAS))
		{
			// not valid; don't try to release
			*ppIAS = NULL;
		}
		else if (!CoIsHandlerConnected(pIAS))
		{
			// advise sink not connected to server anymore; release
			// REVIEW, why do we have to constantly poll these
			// to see if they are ok?
			pIAS->Release();
			*ppIAS = NULL;
		}

		// if first NULL, save rather than extend array
		if ((*ppIAS == NULL) && (iAdv == (-1)))
			iAdv = iAdvScan;
	}

	// if we didn't find an empty slot, we have to add space
	if (iAdv == (-1))
	{

		ppIAS = (IAdviseSink FAR * FAR *)PubMemRealloc(m_ppIAS,
			sizeof(IAdviseSink FAR *)*(m_iSize + COAHOLDER_GROWBY));
				
		if (ppIAS != NULL)
		{
                        // zero out new space
                        _xmemset((void FAR *) (ppIAS + m_iSize), 0,
                                 sizeof(IAdviseSink *) * COAHOLDER_GROWBY);
			// this is the index of the new element to use
			iAdv = m_iSize;

			// replace the old array
			m_ppIAS = ppIAS;
			m_iSize += COAHOLDER_GROWBY;
		}
		else
		{
			// quit if there was an error
			hr = ReportResult(0, E_OUTOFMEMORY, 0, 0);
		}
	}
Ejemplo n.º 9
0
	OLETRACEIN((API_CreateOleAdviseHolder, PARAMFMT("ppOAHolder= %p"), ppOAHolder));

	VDATEHEAP();

	HRESULT hr;

	VDATEPTROUT_LABEL(ppOAHolder, IOleAdviseHolder FAR* FAR*, errRtn, hr);

	LEDebugOut((DEB_ITRACE, "%p _IN CreateOleAdviseHolder ( %p )"
		"\n", NULL, ppOAHolder));

	
	*ppOAHolder = new FAR COAHolder(); // task memory; hard coded below

	hr = *ppOAHolder
		? NOERROR : ReportResult(0, E_OUTOFMEMORY, 0, 0);

	LEDebugOut((DEB_ITRACE, "%p OUT CreateOleAdviseHolder ( %lx )\n",
		"[ %p ]\n", NULL, hr, *ppOAHolder));

	CALLHOOKOBJECTCREATE(hr, CLSID_NULL, IID_IOleAdviseHolder,
			     (IUnknown **)ppOAHolder);

errRtn:
	OLETRACEOUT((API_CreateOleAdviseHolder, hr));

	return hr;
}


//+----------------------------------------------------------------------------
Ejemplo n.º 10
0
void URLLoaderHandler::ReportResultAndDie(const std::string& fname,
                                          const std::string& text,
                                          bool success) {
  ReportResult(fname, text, success);
  delete this;
}
Ejemplo n.º 11
0
HRESULT CDataAdviseCache::Advise(LPDATAOBJECT pDataObject,
		FORMATETC FAR* pFetc, DWORD advf, LPADVISESINK pAdvise,
		DWORD FAR* pdwClient)
		// first 4 parms are as in DataObject::Advise
{
	VDATEHEAP();

	DWORD dwDelegate = 0; // the delegate connection number
	HRESULT hr;

	// if there is a data object, ask to be advised of changes
	if(pDataObject != NULL)
		RetErr(pDataObject->DAdvise(pFetc, advf, pAdvise, &dwDelegate));

	// if there is no data object, (i.e. the object is not active,
	// dwDelegate is zero

	// Here we are using the data advise holder only to hold advise
	// connections. We are not going to use it to send OnDataChange to
	// sinks.
	
	// REVIEW, handling of ADVF_ONLYONCE seems broken...
	// it's clear that we can't cope with this flag properly;  we have
	// no way of knowing when the notification takes place, and therefore
	// we can't remove the entry from m_pDAH.  The notification may have
	// taken place above, and it may not have.  If the data object wasn't
	// around, then the advise request here is lost, and the sink will
	// never be notified.  Or, if the request isn't PRIMEFIRST, and the
	// data object is deactivated, then the data object loses the request,
	// and on subsequent activation, we won't readvise it on EnumAndAdvise.
	// So, what good are we for ONLYONCE sinks?  What does this break?
	if(advf & ADVF_ONLYONCE)
		return  NOERROR;

	// keep a local copy of the advise
	hr = m_pDAH->Advise(NULL, pFetc, advf, pAdvise, pdwClient);

	// if we failed to keep a local reference to the advise sink,
	// we won't be able to maintain this mapping, so remove the
	// advise on the data object, if there is one
	if (hr != NOERROR)
	{
	Exit1:
		if (pDataObject != NULL)
			pDataObject->DUnadvise(dwDelegate);

		return(hr);
	}

	// create a map entry from *pdwClient -> dwDelegate

	// if the map entry creation failed, undo all work
	if (m_mapClientToDelegate.SetAt(*pdwClient, dwDelegate) != TRUE)
	{
		// map failed to allocate memory, undo advise since we won't
		// be able to find this one again
		m_pDAH->Unadvise(*pdwClient);

		// map entry creation must have failed from lack of allocation
		hr = ReportResult(0, E_OUTOFMEMORY, 0, 0);

		// undo the advise on the data object
		goto Exit1;
	}

	return(NOERROR);
}
Ejemplo n.º 12
0
STDAPI CreateDataAdviseHolder(IDataAdviseHolder FAR* FAR* ppDAHolder)
{
	VDATEHEAP();

	OLETRACEIN((API_CreateDataAdviseHolder, PARAMFMT("ppDAHolder= %p"), ppDAHolder));

	*ppDAHolder = new FAR CDAHolder(); // task memory; use MEMCTX_TASK below

	CALLHOOKOBJECTCREATE(*ppDAHolder ? NOERROR : E_OUTOFMEMORY,
			     CLSID_NULL,
			     IID_IDataAdviseHolder,
			     (IUnknown **)ppDAHolder);

	HRESULT hr;

	hr = *ppDAHolder ? NOERROR : ReportResult(0, E_OUTOFMEMORY, 0, 0);

	OLETRACEOUT((API_CreateDataAdviseHolder, hr));

	return hr;
}



//+----------------------------------------------------------------------------
//
//	Member:
//		CDAHolder::CDAHolder, public
//
//	Synopsis:
//		constructor