Commit 5238b8c8 authored by yann300's avatar yann300

fix tests

parent a8e00843
...@@ -36,8 +36,7 @@ TxBrowser.prototype.setDefaultValues = function () { ...@@ -36,8 +36,7 @@ TxBrowser.prototype.setDefaultValues = function () {
this.blockNumber = '' this.blockNumber = ''
this.txNumber = '' this.txNumber = ''
this.connectInfo = '' this.connectInfo = ''
this.basicPanel.data = {} this.basicPanel.update({})
this.basicPanel.update()
this.basicPanel.hide() this.basicPanel.hide()
this.updateWeb3Url(util.web3.currentProvider.host) this.updateWeb3Url(util.web3.currentProvider.host)
if (this.view) { if (this.view) {
......
...@@ -30,11 +30,10 @@ function VmDebugger (_parent, _traceManager, _codeManager, _solidityProxy, _call ...@@ -30,11 +30,10 @@ function VmDebugger (_parent, _traceManager, _codeManager, _solidityProxy, _call
var self = this var self = this
_traceManager.getReturnValue(index, function (error, returnValue) { _traceManager.getReturnValue(index, function (error, returnValue) {
if (error) { if (error) {
self.data = [error] self.update([error])
} else if (_parent.currentStepIndex === index) { } else if (_parent.currentStepIndex === index) {
self.data = [returnValue] self.update([returnValue])
} }
self.update()
}) })
}) })
/* Return values - */ /* Return values - */
......
...@@ -32,7 +32,7 @@ function extendBrowser (browser) { ...@@ -32,7 +32,7 @@ function extendBrowser (browser) {
} }
browser.assertStepDetail = function (vmtracestepinfo, stepinfo, addmemoryinfo, gasinfo, remaininggasinfo, loadedaddressinfo) { browser.assertStepDetail = function (vmtracestepinfo, stepinfo, addmemoryinfo, gasinfo, remaininggasinfo, loadedaddressinfo) {
assertPanel('#stepdetail', browser, ['vmtracestep' + vmtracestepinfo, 'executionstep' + stepinfo, 'addmemory' + addmemoryinfo, 'gas' + gasinfo, 'remaininggas' + remaininggasinfo, 'loadedaddress' + loadedaddressinfo]) assertPanel('#stepdetail', browser, ['vmtracestep:' + vmtracestepinfo, 'executionstep:' + stepinfo, 'addmemory:' + addmemoryinfo, 'gas:' + gasinfo, 'remaininggas:' + remaininggasinfo, 'loadedaddress:' + loadedaddressinfo])
return browser return browser
} }
...@@ -141,8 +141,12 @@ function assertPanel (id, browser, value) { ...@@ -141,8 +141,12 @@ function assertPanel (id, browser, value) {
return ret return ret
}, [id, selector], function (returnValues) { }, [id, selector], function (returnValues) {
value.map(function (item, index) { value.map(function (item, index) {
if (returnValues.value.length) {
var testValue = returnValues.value[index].replace(/\r\n/g, '').replace(/\t/g, '').replace(/\s/g, '') var testValue = returnValues.value[index].replace(/\r\n/g, '').replace(/\t/g, '').replace(/\s/g, '')
browser.assert.equal(testValue, value[index]) browser.assert.equal(testValue, value[index])
} else {
browser.assert.equal(item, '')
}
}) })
}) })
return browser return browser
......
...@@ -63,21 +63,20 @@ function panels (browser) { ...@@ -63,21 +63,20 @@ function panels (browser) {
.setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51') .setValue('#txinput', '0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd51')
.click('#load') .click('#load')
.click('#nextcall') .click('#nextcall')
.assertStack(['0x', '0x60', '0x65', '0x38', '0x55', '0x60fe47b1']) .assertStack(['0:0x', '1:0x60', '2:0x65', '3:0x38', '4:0x55', '5:0x60fe47b1'])
.pause(5000) .assertStorageChanges(['0x00:0x38'])
.assertStorageChanges(['0x000x38']) .assertCallData(['0:0x60fe47b10000000000000000000000000000000000000000000000000000000000000038'])
.assertCallData(['0x60fe47b10000000000000000000000000000000000000000000000000000000000000038']) .assertCallStack(['0:0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5'])
.assertCallStack(['0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5']) .assertStackValue(1, '1:0x60')
.assertStackValue(1, '0x60') .assertMemoryValue(6, '0x60:60606040526040516020806045833981????R??Q????E?9?')
.assertMemoryValue(6, '0x6060606040526040516020806045833981????R??Q????E?9?') .assertMemoryValue(7, '0x70:01604052808051906020019091905050???R??Q???????PP')
.assertMemoryValue(7, '0x7001604052808051906020019091905050???R??Q???????PP') .assertMemoryValue(8, '0x80:5b806001016000600050819055505b50?????????P??UP?P')
.assertMemoryValue(8, '0x805b806001016000600050819055505b50?????????P??UP?P')
.click('#intoforward') // CREATE .click('#intoforward') // CREATE
.assertStack(['Empty']) .assertStack([''])
.assertStorageChanges(['Empty']) .assertStorageChanges([''])
.assertMemory(['Empty']) .assertMemory([''])
.assertCallData(['0x0000000000000000000000000000000000000000000000000000000000000000000000000000006060606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055']) .assertCallData(['0:0x0000000000000000000000000000000000000000000000000000000000000000000000000000006060606040526040516020806045833981016040528080519060200190919050505b806001016000600050819055'])
.assertCallStack(['0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', '(ContractCreation-Step63)']) .assertCallStack(['0:0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', '1:(ContractCreation-Step63)'])
return browser return browser
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment