/src/open62541_15/tests/testing-plugins/testing_clock.c
Line | Count | Source |
1 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
2 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | | |
5 | | #include "testing_clock.h" |
6 | | #include <time.h> |
7 | | |
8 | | /* To avoid zero timestamp value in header, the testingClock |
9 | | * is assigned with non-zero timestamp to pass unit tests */ |
10 | | static UA_DateTime testingClock = 0x5C8F735D; |
11 | | |
12 | | void |
13 | 0 | UA_fakeSleep(UA_UInt32 duration) { |
14 | 0 | testingClock += duration * UA_DATETIME_MSEC; |
15 | 0 | } |
16 | | |
17 | 0 | UA_DateTime UA_DateTime_now_fake(UA_EventLoop *el) { |
18 | 0 | return testingClock; |
19 | 0 | } |