From f90735412169f92196a0f425e02dba5e190ac8a3 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 4 Mar 2019 22:44:23 +0100 Subject: [PATCH] make tests green again --- tests/destructor/tatomicptrs.nim | 3 +-- tests/destructor/tcast.nim | 4 ---- tests/destructor/tcustomseqs.nim | 1 - tests/destructor/tcustomstrings.nim | 1 - tests/destructor/tdestructor3.nim | 1 - tests/destructor/tmove_objconstr.nim | 27 +++++++++++++-------------- tests/destructor/topttree.nim | 1 - 7 files changed, 14 insertions(+), 24 deletions(-) diff --git a/tests/destructor/tatomicptrs.nim b/tests/destructor/tatomicptrs.nim index fd8fc34d96..96d1450761 100644 --- a/tests/destructor/tatomicptrs.nim +++ b/tests/destructor/tatomicptrs.nim @@ -11,7 +11,6 @@ deallocating allocating deallocating ''' - cmd: '''nim c --newruntime $file''' """ type @@ -125,7 +124,7 @@ proc `=`*[T](m: var MySeq[T], m2: MySeq[T]) = `=destroy`(m) m.len = m2.len - let bytes = m.len.int * sizeof(float) + let bytes = m.len.int * sizeof(float) if bytes > 0: m.data = cast[ptr UncheckedArray[T]](allocShared(bytes)) copyMem(m.data, m2.data, bytes) diff --git a/tests/destructor/tcast.nim b/tests/destructor/tcast.nim index 7d5a1954c1..35a7d874b5 100644 --- a/tests/destructor/tcast.nim +++ b/tests/destructor/tcast.nim @@ -1,7 +1,3 @@ -discard """ - cmd: '''nim c --newruntime $file''' -""" - # Make sure we don't walk cast[T] type section while injecting sinks/destructors block: type diff --git a/tests/destructor/tcustomseqs.nim b/tests/destructor/tcustomseqs.nim index 83df0053f7..c8531a79ec 100644 --- a/tests/destructor/tcustomseqs.nim +++ b/tests/destructor/tcustomseqs.nim @@ -16,7 +16,6 @@ discard """ 1 2 6 1 3 7 after 6 6''' - cmd: '''nim c --newruntime $file''' """ import typetraits diff --git a/tests/destructor/tcustomstrings.nim b/tests/destructor/tcustomstrings.nim index 1a78df20bf..343d23065c 100644 --- a/tests/destructor/tcustomstrings.nim +++ b/tests/destructor/tcustomstrings.nim @@ -5,7 +5,6 @@ foo bar to appendmore here foo bar to appendmore here foo bar to appendmore here after 20 20''' - cmd: '''nim c --newruntime $file''' """ {.this: self.} diff --git a/tests/destructor/tdestructor3.nim b/tests/destructor/tdestructor3.nim index 5756e9afb3..2f3b9f6fd0 100644 --- a/tests/destructor/tdestructor3.nim +++ b/tests/destructor/tdestructor3.nim @@ -6,7 +6,6 @@ destroy 123 destroy Foo: 5 destroy Foo: 123''' - cmd: '''nim c --newruntime $file''' """ # bug #2821 diff --git a/tests/destructor/tmove_objconstr.nim b/tests/destructor/tmove_objconstr.nim index 7e2b765fc5..1379137770 100644 --- a/tests/destructor/tmove_objconstr.nim +++ b/tests/destructor/tmove_objconstr.nim @@ -7,7 +7,6 @@ test destroyed 0 3 4 Pony is dying!''' - cmd: '''nim c --newruntime $file''' """ # bug #4214 @@ -68,7 +67,7 @@ for x in getPony(): type MySeqNonCopyable* = object - len: int + len: int data: ptr UncheckedArray[float] proc `=destroy`*(m: var MySeqNonCopyable) {.inline.} = @@ -93,7 +92,7 @@ proc `[]`*(m: MySeqNonCopyable; i: int): float {.inline.} = proc `[]=`*(m: var MySeqNonCopyable; i, val: float) {.inline.} = m.data[i.int] = val -proc setTo(s: var MySeqNonCopyable, val: float) = +proc setTo(s: var MySeqNonCopyable, val: float) = for i in 0.. 5: raise newException(ValueError, "new error") - else: newMySeq(x, 1.0), - b: 0, + else: newMySeq(x, 1.0), + b: 0, c: block: var tmp = if y > 0: move(cc) else: newMySeq(1, 3.0) tmp[0] = 5 - tmp + tmp ) - + let (seq1, seq2) = myfunc(2, 3) doAssert seq1.len == 2 @@ -141,20 +140,20 @@ seq4 = block: tmp[0] = 3.0 tmp -doAssert seq4[0] == 3.0 +doAssert seq4[0] == 3.0 import macros -seq4 = - if i > 0: newMySeq(2, 5.0) +seq4 = + if i > 0: newMySeq(2, 5.0) elif i < -100: raise newException(ValueError, "Parse Error") else: newMySeq(2, 3.0) -seq4 = +seq4 = case (char) i: - of 'A', {'W'..'Z'}: newMySeq(2, 5.0) + of 'A', {'W'..'Z'}: newMySeq(2, 5.0) of 'B': quit(-1) - else: + else: let (x1, x2, x3) = myfunc2(2, 3) x3 diff --git a/tests/destructor/topttree.nim b/tests/destructor/topttree.nim index 21b283be00..43ad4569b1 100644 --- a/tests/destructor/topttree.nim +++ b/tests/destructor/topttree.nim @@ -8,7 +8,6 @@ discard """ 90.0 120.0 8 8''' - cmd: '''nim c --newruntime $file''' """ import typetraits