Skip to content

Commit

Permalink
tests/qtest: npcm7xx_emc-test: Skip running test_{tx, rx} on win32
Browse files Browse the repository at this point in the history
The test cases 'test_{tx,rx}' call socketpair() which does not exist
on win32. Exclude them.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220824094029.1634519-44-bmeng.cn@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
lbmeng authored and huth committed Aug 29, 2022
1 parent de56338 commit bf3267e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/qtest/npcm7xx_emc-test.c
Expand Up @@ -209,6 +209,7 @@ static int emc_module_index(const EMCModule *mod)
return diff;
}

#ifndef _WIN32
static void packet_test_clear(void *sockets)
{
int *test_sockets = sockets;
Expand Down Expand Up @@ -243,13 +244,15 @@ static int *packet_test_init(int module_num, GString *cmd_line)
g_test_queue_destroy(packet_test_clear, test_sockets);
return test_sockets;
}
#endif /* _WIN32 */

static uint32_t emc_read(QTestState *qts, const EMCModule *mod,
NPCM7xxPWMRegister regno)
{
return qtest_readl(qts, mod->base_addr + regno * sizeof(uint32_t));
}

#ifndef _WIN32
static void emc_write(QTestState *qts, const EMCModule *mod,
NPCM7xxPWMRegister regno, uint32_t value)
{
Expand Down Expand Up @@ -339,6 +342,7 @@ static bool emc_soft_reset(QTestState *qts, const EMCModule *mod)
g_message("%s: Timeout expired", __func__);
return false;
}
#endif /* _WIN32 */

/* Check emc registers are reset to default value. */
static void test_init(gconstpointer test_data)
Expand Down Expand Up @@ -387,6 +391,7 @@ static void test_init(gconstpointer test_data)
qtest_quit(qts);
}

#ifndef _WIN32
static bool emc_wait_irq(QTestState *qts, const EMCModule *mod, int step,
bool is_tx)
{
Expand Down Expand Up @@ -843,6 +848,7 @@ static void test_rx(gconstpointer test_data)

qtest_quit(qts);
}
#endif /* _WIN32 */

static void emc_add_test(const char *name, const TestData* td,
GTestDataFunc fn)
Expand All @@ -865,8 +871,10 @@ int main(int argc, char **argv)
td->module = &emc_module_list[i];

add_test(init, td);
#ifndef _WIN32
add_test(tx, td);
add_test(rx, td);
#endif
}

return g_test_run();
Expand Down

0 comments on commit bf3267e

Please sign in to comment.