Skip to content

Commit 4e94a26

Browse files
committed
UTF_ReplayData.ipf: Add it
1 parent d866ffd commit 4e94a26

3 files changed

Lines changed: 96 additions & 0 deletions

File tree

Packages/tests/HardwareBasic/UTF_HardwareBasic_Includes.ipf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "UTF_Epochs"
1717
#include "UTF_ForeignFunctionInterfaceWithHardware"
1818
#include "UTF_HardwareTestsWithBUG"
19+
#include "UTF_ReplayData"
1920
#include "UTF_SweepFormulaHardware"
2021
#include "UTF_SweepSkipping"
2122
#include "UTF_TestPulseAndTPDuringDAQ"
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#pragma TextEncoding = "UTF-8"
2+
#pragma rtGlobals = 3 // Use modern global access method and strict wave access.
3+
#pragma rtFunctionErrors = 1
4+
#pragma ModuleName = UTF_ReplayData
5+
6+
/// @file UTF_ReplayData.ipf
7+
///
8+
/// Overview:
9+
///
10+
/// - ReplayDataTest checks that the replay data feature is disabled by default and does DAQ
11+
/// - ReplayDataTest_R1 (aka _REENTRY once) checks LBN entries and enables Replay Data
12+
/// - ReplayDataTest_R2 checks the replay data enabled settings and replays sweep zero
13+
/// - ReplayDataTest_R3 checks that replaying the data did not result in any differences
14+
/// - ReplayDataTest_R4 disables replay data again
15+
/// - ReplayDataTest_R5 checks that
16+
17+
// UTF_TD_GENERATOR DataGenerators#DeviceNameGeneratorMD1
18+
static Function ReplayDataTest([string str])
19+
20+
INFO("REPLAY_DATA is still defined, call DisableReplayData() before.")
21+
22+
REQUIRE(!RD_IsCompilationEnabled())
23+
REQUIRE(!RD_IsEnabled())
24+
25+
[STRUCT ACD_DAQSettings s] = ACD_InitDAQSettingsFromString("MD1_RA0_I0_L0_BKG1" + \
26+
"__HS0_DA0_AD0_CM:VC:_ST:StimulusSetA_DA_0:")
27+
28+
ACD_AcquireData(s, str)
29+
End
30+
31+
static Function ReplayDataTest_REENTRY([string str])
32+
33+
WAVE numericalValues = GetLBnumericalValues(str)
34+
35+
WAVE/Z settings = GetLastSetting(numericalValues, 0, "Original data", DATA_ACQUISITION_MODE)
36+
CHECK_WAVE(settings, NUMERIC_WAVE)
37+
CHECK_EQUAL_WAVES(settings, WaveDouble({NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 1}))
38+
39+
EnableReplayData()
40+
41+
RegisterReentryFunction("UTF_ReplayData#" + GetRTStackInfo(1))
42+
End
43+
44+
static Function ReplayDataTest_REENTRY_REENTRY([string str])
45+
46+
CHECK(RD_IsCompilationEnabled())
47+
CHECK(!RD_IsEnabled())
48+
49+
#ifdef REPLAY_DATA
50+
KillOrMoveToTrash(dfr = GetReplayStorage())
51+
RD_PrepareMIES()
52+
RD_ReplayData(0)
53+
#else
54+
INFO("REPLAY_DATA is not defined")
55+
FAIL()
56+
#endif // REPLAY_DATA
57+
58+
RegisterReentryFunction("UTF_ReplayData#" + GetRTStackInfo(1))
59+
End
60+
61+
static Function ReplayDataTest_REENTRY_REENTRY_REENTRY([string str])
62+
63+
WAVE numericalValues = GetLBnumericalValues(str)
64+
65+
WAVE/Z settings = GetLastSetting(numericalValues, 0, "Original data", DATA_ACQUISITION_MODE)
66+
CHECK_WAVE(settings, NUMERIC_WAVE)
67+
CHECK_EQUAL_WAVES(settings, WaveDouble({NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, 0}))
68+
69+
#ifdef REPLAY_DATA
70+
CHECK_EQUAL_VAR(RD_CompareRAC(), 0)
71+
CHECK_EQUAL_VAR(RD_CompareSCI(), 0)
72+
CHECK_EQUAL_VAR(RD_CompareLabnotebooks(), 0)
73+
#else
74+
INFO("REPLAY_DATA is not defined")
75+
FAIL()
76+
#endif // REPLAY_DATA
77+
78+
RegisterReentryFunction("UTF_ReplayData#" + GetRTStackInfo(1))
79+
End
80+
81+
static Function ReplayDataTest_REENTRY_REENTRY_REENTRY_REENTRY([string str])
82+
83+
DisableReplayData()
84+
85+
RegisterReentryFunction("UTF_ReplayData#" + GetRTStackInfo(1))
86+
End
87+
88+
static Function ReplayDataTest_REENTRY_REENTRY_REENTRY_REENTRY_REENTRY([string str])
89+
90+
CHECK(!RD_IsCompilationEnabled())
91+
// because REPLAY_DATA is not defined anymore, also the replay enable knob is disabled
92+
CHECK(!RD_IsEnabled())
93+
// although GetReplayDataEnable() would still return true
94+
End

Packages/tests/UTF_HelperFunctions.ipf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,6 +1968,7 @@ static Function/S GetDefaultTestSuitesForExperiment()
19681968
list = AddListItem("UTF_Databrowser.ipf", list, ";", Inf)
19691969
list = AddListItem("UTF_Epochs.ipf", list, ";", Inf)
19701970
list = AddListItem("UTF_ForeignFunctionInterfaceWithHardware.ipf", list, ";", Inf)
1971+
list = AddListItem("UTF_ReplayData.ipf", list, ";", Inf)
19711972
list = AddListItem("UTF_SweepFormulaHardware.ipf", list, ";", Inf)
19721973
list = AddListItem("UTF_SweepSkipping.ipf", list, ";", Inf)
19731974
list = AddListItem("UTF_TestPulseAndTPDuringDAQ.ipf", list, ";", Inf)

0 commit comments

Comments
 (0)