Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DeborahOoi96 committed Jan 17, 2024
1 parent f668509 commit 9542c9f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions source/tests/system/nidaqmx_driver_api_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ constexpr auto DEVICE_DOES_NOT_SUPPORT_CDAQ_SYNC_CONNECTIONS_ERROR = -201450;
constexpr auto EVERY_N_SAMPLES_EVENT_NOT_SUPPORTED_FOR_NON_BUFFERED_TASKS = -200848;
constexpr auto EVERY_N_SAMPS_TRANSFERRED_FROM_BUFFER_EVENT_NOT_SUPPORTED_BY_DEVICE_ERROR = -200980;
constexpr auto CANNOT_UNREGISTER_DAQMX_SOFTWARE_EVENT_WHILE_TASK_IS_RUNNING_ERROR = -200986;
constexpr auto MEASUREMENT_TYPE_NOT_SUPPORTED_BY_SELECTED_PHYSICAL_CHANNEL_ERROR = -200431;
constexpr auto THERMOCOUPLE_LEAD_OFFSET_NULLING_CALIBRATION_NOT_SUPPORTED_BY_DEVICE_ERROR = -201375;
constexpr auto THRMCPL_LEAD_OFFSET_NULLING_CAL_NOT_SUPPORTED_ERROR = -201375;
constexpr auto INVALID_TASK_ERROR = -200088;

// Creates a static TResponse instance that can be used as a default/in-line value (because it's not a temporary).
template <typename TResponse>
Expand Down Expand Up @@ -2140,16 +2140,15 @@ TEST_F(NiDAQmxDriverApiTests, LoadedVoltageTask_ReadAIData_ReturnsDataInExpected
EXPECT_DATA_IN_RANGE(read_response.read_array(), AI_MIN, AI_MAX);
}

TEST_F(NiDAQmxDriverApiTests, AIBridgeChannel_BridgeOffsetNullingCal_ReturnsError)
TEST_F(NiDAQmxDriverApiTests, BridgeOffsetNullingCal_ReturnsError)
{
const auto AI_MIN = 0.0;
const auto AI_MAX = 1.0;

EXPECT_THROW_DRIVER_ERROR({
auto status = create_ai_bridge_chan(AI_MIN, AI_MAX);
}, MEASUREMENT_TYPE_NOT_SUPPORTED_BY_SELECTED_PHYSICAL_CHANNEL_ERROR);
auto response = PerformBridgeOffsetNullingCalExResponse{};
auto status = perform_bridge_offset_nulling_cal_ex(response);
}, INVALID_TASK_ERROR);
}

// X Series doesn't support thermocouple offset nulling
TEST_F(NiDAQmxDriverApiTests, AIThrmcplChannel_ThrmcplLeadOffsetNullingCal_ReturnsError)
{
const auto AI_MIN = 0.0;
Expand All @@ -2158,11 +2157,10 @@ TEST_F(NiDAQmxDriverApiTests, AIThrmcplChannel_ThrmcplLeadOffsetNullingCal_Retur

std::string channel = "";
bool skip_unsupported_channels = false;

EXPECT_THROW_DRIVER_ERROR({
auto response = PerformThrmcplLeadOffsetNullingCalResponse{};
auto status = perform_thrmcpl_lead_offset_nulling_cal(channel, skip_unsupported_channels, response);
}, THERMOCOUPLE_LEAD_OFFSET_NULLING_CALIBRATION_NOT_SUPPORTED_BY_DEVICE_ERROR);
}, THRMCPL_LEAD_OFFSET_NULLING_CAL_NOT_SUPPORTED_ERROR);
}

TEST_F(NiDAQmxDriverApiTests, SelfCal_Succeeds)
Expand Down

0 comments on commit 9542c9f

Please sign in to comment.