-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start work on PassThruStartMsgFilter
- Loading branch information
Jeremy Hahn
committed
Oct 25, 2016
1 parent
10fdf55
commit 0d171ea
Showing
20 changed files
with
499 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
bindings/ruby/spec/PassThruStartMsgFilter_ERR_EXCEEDED_LIMIT_integration_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
## | ||
# ecutools: IoT Automotive Tuning, Diagnostics & Analytics | ||
# Copyright (C) 2014 Jeremy Hahn | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
require 'spec_helper' | ||
|
||
describe Ecutools::J2534 do | ||
include_context 'J2534' do | ||
context 'PassThruSelect' do | ||
|
||
it 'returns ERR_EXCEEDED_LIMIT when more than 10 filters are specified' do | ||
things.test_with_ecutuned { | ||
|
||
expect(j2534.PassThruOpen(things[0][:name], 1)).to eq(true) | ||
|
||
resource = Ecutools::J2534::Models::Resource.new | ||
resource.Connector = Ecutools::J2534::J1962_CONNECTOR | ||
expect(j2534.PassThruConnect(1, Ecutools::J2534::CAN, Ecutools::J2534::CAN_ID_BOTH, 500000, resource, 1)).to eq(true) | ||
|
||
maskMsg = Ecutools::J2534::Models::Message.new | ||
maskMsg.ProtocolID = Ecutools::J2534::CAN | ||
maskMsg.MsgHandle = 1 | ||
maskMsg.DataBuffer = 0x7FF | ||
maskMsg.DataLength = 11 | ||
|
||
patternMsg = Ecutools::J2534::Models::Message.new | ||
patternMsg.ProtocolID = Ecutools::J2534::CAN | ||
patternMsg.MsgHandle = 2 | ||
patternMsg.DataBuffer = 0x7DF | ||
patternMsg.DataLength = 11 | ||
|
||
i = 0 | ||
10.times do | ||
i = i + 1 | ||
expect(j2534.PassThruStartMsgFilter(i, Ecutools::J2534::PASS_FILTER, maskMsg, patternMsg, 1)).to eq(true) | ||
end | ||
expect{j2534.PassThruStartMsgFilter(11, Ecutools::J2534::PASS_FILTER, maskMsg, patternMsg, 1)}.to raise_error /ERR_EXCEEDED_LIMIT/ | ||
} | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
53 changes: 53 additions & 0 deletions
53
bindings/ruby/spec/PassThruStartMsgFilter_ERR_FILTER_TYPE_NOT_SUPPORTED_integration_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## | ||
# ecutools: IoT Automotive Tuning, Diagnostics & Analytics | ||
# Copyright (C) 2014 Jeremy Hahn | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
require 'spec_helper' | ||
|
||
describe Ecutools::J2534 do | ||
include_context 'J2534' do | ||
context 'PassThruSelect' do | ||
|
||
it 'returns ERR_FILTER_TYPE_NOT_SUPPORTED when an invalid filter is specified' do | ||
things.test_with_ecutuned { | ||
|
||
expect(j2534.PassThruOpen(things[0][:name], 1)).to eq(true) | ||
|
||
resource = Ecutools::J2534::Models::Resource.new | ||
resource.Connector = Ecutools::J2534::J1962_CONNECTOR | ||
expect(j2534.PassThruConnect(1, Ecutools::J2534::CAN, Ecutools::J2534::CAN_ID_BOTH, 500000, resource, 1)).to eq(true) | ||
|
||
maskMsg = Ecutools::J2534::Models::Message.new | ||
maskMsg.ProtocolID = Ecutools::J2534::CAN | ||
maskMsg.MsgHandle = 1 | ||
maskMsg.DataBuffer = 0x7FF | ||
maskMsg.DataLength = 11 | ||
|
||
patternMsg = Ecutools::J2534::Models::Message.new | ||
patternMsg.ProtocolID = Ecutools::J2534::CAN | ||
patternMsg.MsgHandle = 2 | ||
patternMsg.DataBuffer = 0x7DF | ||
patternMsg.DataLength = 11 | ||
|
||
expect{j2534.PassThruStartMsgFilter(1, 1, maskMsg, patternMsg, 1)}.to raise_error /ERR_FILTER_TYPE_NOT_SUPPORTED/ | ||
} | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
53 changes: 53 additions & 0 deletions
53
bindings/ruby/spec/PassThruStartMsgFilter_ERR_INVALID_MSG_integration_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## | ||
# ecutools: IoT Automotive Tuning, Diagnostics & Analytics | ||
# Copyright (C) 2014 Jeremy Hahn | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
require 'spec_helper' | ||
|
||
describe Ecutools::J2534 do | ||
include_context 'J2534' do | ||
context 'PassThruSelect' do | ||
|
||
it 'returns ERR_INVALID_MSG when an invalid data length is specified' do | ||
things.test_with_ecutuned { | ||
|
||
expect(j2534.PassThruOpen(things[0][:name], 1)).to eq(true) | ||
|
||
resource = Ecutools::J2534::Models::Resource.new | ||
resource.Connector = Ecutools::J2534::J1962_CONNECTOR | ||
expect(j2534.PassThruConnect(1, Ecutools::J2534::CAN, Ecutools::J2534::CAN_ID_BOTH, 500000, resource, 1)).to eq(true) | ||
|
||
maskMsg = Ecutools::J2534::Models::Message.new | ||
maskMsg.ProtocolID = Ecutools::J2534::CAN | ||
maskMsg.MsgHandle = 1 | ||
maskMsg.DataBuffer = 0x7FF | ||
maskMsg.DataLength = 13 | ||
|
||
patternMsg = Ecutools::J2534::Models::Message.new | ||
patternMsg.ProtocolID = Ecutools::J2534::CAN | ||
patternMsg.MsgHandle = 2 | ||
patternMsg.DataBuffer = 0x7DF | ||
patternMsg.DataLength = 13 | ||
|
||
expect{j2534.PassThruStartMsgFilter(1, Ecutools::J2534::PASS_FILTER, maskMsg, patternMsg, 1)}.to raise_error /ERR_INVALID_MSG/ | ||
} | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
53 changes: 53 additions & 0 deletions
53
bindings/ruby/spec/PassThruStartMsgFilter_ERR_MSG_PROTOCOL_ID_integration_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## | ||
# ecutools: IoT Automotive Tuning, Diagnostics & Analytics | ||
# Copyright (C) 2014 Jeremy Hahn | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
require 'spec_helper' | ||
|
||
describe Ecutools::J2534 do | ||
include_context 'J2534' do | ||
context 'PassThruSelect' do | ||
|
||
it 'returns ERR_MSG_PROTOCOL_ID when an invalid protocol id is specified' do | ||
things.test_with_ecutuned { | ||
|
||
expect(j2534.PassThruOpen(things[0][:name], 1)).to eq(true) | ||
|
||
resource = Ecutools::J2534::Models::Resource.new | ||
resource.Connector = Ecutools::J2534::J1962_CONNECTOR | ||
expect(j2534.PassThruConnect(1, Ecutools::J2534::CAN, Ecutools::J2534::CAN_ID_BOTH, 500000, resource, 1)).to eq(true) | ||
|
||
maskMsg = Ecutools::J2534::Models::Message.new | ||
maskMsg.ProtocolID = 0 | ||
maskMsg.MsgHandle = 1 | ||
maskMsg.DataBuffer = 0x7FF | ||
maskMsg.DataLength = 11 | ||
|
||
patternMsg = Ecutools::J2534::Models::Message.new | ||
patternMsg.ProtocolID = 0 | ||
patternMsg.MsgHandle = 2 | ||
patternMsg.DataBuffer = 0x7DF | ||
patternMsg.DataLength = 11 | ||
|
||
expect{j2534.PassThruStartMsgFilter(1, Ecutools::J2534::PASS_FILTER, maskMsg, patternMsg, 1)}.to raise_error /ERR_MSG_PROTOCOL_ID/ | ||
} | ||
end | ||
|
||
end | ||
|
||
end | ||
|
||
end |
Oops, something went wrong.