fixing double late join test fail

This commit is contained in:
DadaMonad
2015-02-17 19:23:27 +00:00
parent f609c22be8
commit 77b83cae2a
23 changed files with 225 additions and 166 deletions

View File

@@ -36,7 +36,7 @@ class JsonTest extends Test
return root
elems = elems.filter (elem)->
(elem.type is "Array") or (elem.type is "Object")
elem? and ((elem.type is "Array") or (elem.type is "Object"))
if elems.length is 0
root
else
@@ -110,10 +110,19 @@ describe "JsonFramework", ->
u2 = @yTest.users[1]
ops1 = u1.HB._encode()
ops2 = u2.HB._encode()
u1.HB.renewStateVector u2.HB.getOperationCounter()
u2.HB.renewStateVector u1.HB.getOperationCounter()
u1.engine.applyOps ops2
u2.engine.applyOps ops1
u1.engine.applyOp ops2, true
u2.engine.applyOp ops1, true
compare = (o1, o2)->
if o1.type? and o1.type isnt o2.type
throw new Error "different types"
else if o1.type is "Object"
for name, val of o1.val()
compare(val, o2.val(name))
else if o1.type?
compare(o1.val(), o2.val())
else if o1 isnt o2
throw new Error "different values"
compare u1, u2
expect(test.getContent(0)).to.deep.equal(@yTest.getContent(1))
it "can handle creaton of complex json (1)", ->

View File

@@ -13,7 +13,7 @@ module.exports = class Test
constructor: (@name_suffix = "")->
@number_of_test_cases_multiplier = 1
@repeat_this = 3 * @number_of_test_cases_multiplier
@doSomething_amount = 123 * @number_of_test_cases_multiplier
@doSomething_amount = 1230 * @number_of_test_cases_multiplier
@number_of_engines = 5 + @number_of_test_cases_multiplier - 1
@time = 0 # denotes to the time when run was started
@@ -36,7 +36,7 @@ module.exports = class Test
# is called by implementing class
makeNewUser: (user)->
user.HB.setManualGarbageCollect()
user.HB.stopGarbageCollection()
user
getSomeUser: ()->