MCPcopy Create free account
hub / github.com/defold/defold / HttpStressThread

Function HttpStressThread

engine/dlib/src/test/test_httpclient.cpp:579–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577 assert( (_A) == (_B) );
578
579static void HttpStressThread(void* param)
580{
581 char buf[128];
582 int c = rand() % 3359;
583 HttpStressHelper* h = (HttpStressHelper*) param;
584 for (int i = 0; i < NUM_ITERATIONS; ++i) {
585 h->m_Content = "";
586 dmSnPrintf(buf, sizeof(buf), "/add/%d/1000", i * c);
587 dmHttpClient::Result r;
588 r = dmHttpClient::Get(h->m_Client, buf);
589 T_ASSERT_EQ(dmHttpClient::RESULT_OK, r);
590 T_ASSERT_EQ(1000 + i * c, strtol(h->m_Content.c_str(), 0, 10));
591 }
592}
593
594TEST_P(dmHttpClientTest, ThreadStress)
595{

Callers

nothing calls this directly

Calls 3

randClass · 0.85
dmSnPrintfFunction · 0.85
GetFunction · 0.50

Tested by

no test coverage detected