cyclonedds/src/core/ddsc/tests/time.c
Jeroen Koekkoek 74a48c5731 Replace Criterion by CUnit
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2018-12-06 14:48:30 +01:00

26 lines
818 B
C

/*
* Copyright(c) 2006 to 2018 ADLINK Technology Limited and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
* v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
#include "CUnit/Test.h"
#include "ddsc/dds.h"
CU_Test(ddsc_time, request_time)
{
dds_time_t now, then;
dds_duration_t pause = 1 * DDS_NSECS_IN_SEC;
now = dds_time();
CU_ASSERT_FATAL(now > 0);
/* Sleep for 1 second, every platform should (hopefully) support that */
dds_sleepfor(pause);
then = dds_time();
CU_ASSERT_FATAL(then >= (now + pause));
}