ovni/test/unit/thread.c

36 lines
750 B
C
Raw Normal View History

2023-02-27 13:40:20 +01:00
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#include "common.h"
2023-01-25 18:11:13 +01:00
#include "emu/thread.h"
#include "unittest.h"
2023-01-25 18:11:13 +01:00
2023-02-20 14:41:03 +01:00
/* Ensure we can load the old trace format */
static void
test_old_trace(void)
{
struct thread th;
OK(thread_init_begin(&th, "loom.0/proc.0/thread.1.obs"));
if (th.tid != 1)
die("wrong tid");
OK(thread_init_begin(&th, "loom.0/proc.0/thread.2"));
if (th.tid != 2)
die("wrong tid");
ERR(thread_init_begin(&th, "loom.0/proc.0/thread.kk"));
ERR(thread_init_begin(&th, "loom.0/proc.0/thread."));
ERR(thread_init_begin(&th, "loom.0/proc.0/thread"));
ERR(thread_init_begin(&th, "thread.prv"));
err("ok");
}
2023-01-25 18:11:13 +01:00
int main(void)
{
2023-02-20 14:41:03 +01:00
test_old_trace();
2023-01-25 18:11:13 +01:00
return 0;
}