Permalink
Browse files

Style patches

  • Loading branch information...
1 parent c9279ab commit b9ba05be81dd466c15e7bf5d88e2e87a35ab3f09 @v-for-vandal v-for-vandal committed with wsfulton Oct 31, 2013
View
16 Examples/test-suite/lua/cpp_namespace_runme.lua
@@ -7,21 +7,21 @@ local env = _ENV -- Lua 5.2
if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
-assert( cn.fact(4) == 24 )
-assert( cn.Foo == 42 )
+assert(cn.fact(4) == 24)
+assert(cn.Foo == 42)
t1 = cn.Test()
-assert( t1:method() == "Test::method" )
+assert(t1:method() == "Test::method")
cn.weird("t1", 4)
-assert( cn.do_method(t1) == "Test::method" )
-assert( cn.do_method2(t1) == "Test::method" )
+assert(cn.do_method(t1) == "Test::method")
+assert(cn.do_method2(t1) == "Test::method")
t2 = cn.Test2()
-assert( t2:method() == "Test2::method" )
+assert(t2:method() == "Test2::method")
-assert( cn.foo3(5) == 5 )
+assert(cn.foo3(5) == 5)
-assert( cn.do_method3(t2, 7) == "Test2::method" )
+assert(cn.do_method3(t2, 7) == "Test2::method")
View
4 Examples/test-suite/lua/cpp_nodefault_runme.lua
@@ -17,8 +17,8 @@ foo2 = cn.create(1,2)
cn.consume(foo1,foo2)
bar1 = cn.Bar()
-bar1:consume( cn.gvar, foo2)
+bar1:consume(cn.gvar, foo2)
foo3 = bar1:create(1,2)
foo3.a = 6
-assert( foo3.a == 6 )
+assert(foo3.a == 6)
View
4 Examples/test-suite/lua/extend_placement_runme.lua
@@ -7,12 +7,12 @@ local env = _ENV -- Lua 5.2
if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
-function test_obj( main, suppl )
+function test_obj(main, suppl)
assert(main:spam() == 1)
assert(main:spam("this_is_string") == 2)
assert(main:spam(5) == 5)
assert(main:spam(5,6) == 11)
- assert(main:spam( 7,8,9) == 15)
+ assert(main:spam(7,8,9) == 15)
assert(main:spam(suppl,12.0) == 0)
assert(main:spam(suppl) == 0)
end
View
4 Examples/test-suite/lua/extend_runme.lua
@@ -24,5 +24,5 @@ assert(der1:method(5) == 10)
der2 = e.Derived(17)
assert(der2.value == 34)
der2.extendval = 200.0
-assert( math.abs(der2.actualval - 2.0) < 0.001 )
-assert( math.abs(der2.extendval - 200.0) < 0.001 )
+assert(math.abs(der2.actualval - 2.0) < 0.001)
+assert(math.abs(der2.extendval - 200.0) < 0.001)
View
2 Examples/test-suite/lua/extend_typedef_class_runme.lua
@@ -7,7 +7,7 @@ local env = _ENV -- Lua 5.2
if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
-function test_obj( obj, const )
+function test_obj(obj, const)
obj.membervar = const
assert(obj:getvar() == const)
end
View
6 Examples/test-suite/lua/extend_variable_runme.lua
@@ -9,9 +9,9 @@ setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i
e1 = ev.ExtendMe()
answ = 1.0
-assert( e1:set(7.0) )
---assert( e1:get(answ) ) -- doesn't work. Lua can't pass primitive type by non-const reference
---assert( answ == 7.0 )
+assert(e1:set(7.0))
+--assert(e1:get(answ)) -- doesn't work. Lua can't pass primitive type by non-const reference
+--assert(answ == 7.0)
e1.ExtendVar = 5.0
assert(e1.ExtendVar == 5.0)
View
2 Examples/test-suite/lua/friends_runme.lua
@@ -19,7 +19,7 @@ assert(f.get_val3(a1) == 30)
assert(f.get_val1(100, 1, 2) == 100)
-assert( f.mix(a1,b1) == 15);
+assert(f.mix(a1,b1) == 15);
d1 = f.D_i(7)
assert(f.get_val1(d1) == 7)
View
12 Examples/test-suite/lua/funcptr_cpp_runme.lua
@@ -7,12 +7,12 @@ local env = _ENV -- Lua 5.2
if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
-assert( fc.addByValue(5,10) == 15)
+assert(fc.addByValue(5,10) == 15)
-- These two won't work. Lua will successfully store the answer as userdata, but there is
-- no way of accessing the insides of userdata.
--- assert( fc.addByPointer(7, 9) == 16)
--- assert( fc.addByReference(8, 9) == 17)
+-- assert(fc.addByPointer(7, 9) == 16)
+-- assert(fc.addByReference(8, 9) == 17)
-assert( fc.call1(fc.ADD_BY_VALUE, 5, 10) == 15)
-assert( fc.call2(fc.ADD_BY_POINTER, 7, 9) == 16)
-assert( fc.call3(fc.ADD_BY_REFERENCE, 8, 9) == 17)
+assert(fc.call1(fc.ADD_BY_VALUE, 5, 10) == 15)
+assert(fc.call2(fc.ADD_BY_POINTER, 7, 9) == 16)
+assert(fc.call3(fc.ADD_BY_REFERENCE, 8, 9) == 17)
View
8 Examples/test-suite/lua/grouping_runme.lua
@@ -7,11 +7,11 @@ local env = _ENV -- Lua 5.2
if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
-assert( g.test1(5) == 5 )
+assert(g.test1(5) == 5)
g.test2(42) -- Return value is int* packed into userdata. We can't do anything with it
-assert( g.test3 == 37 )
+assert(g.test3 == 37)
g.test3 = 42
-assert( g.test3 == 42 )
+assert(g.test3 == 42)
-assert( g.do_unary(5, g.NEGATE) == -5 )
+assert(g.do_unary(5, g.NEGATE) == -5)
View
6 Examples/test-suite/lua/iadd_runme.lua
@@ -9,9 +9,9 @@ setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i
foo1 = i.Foo()
foo1_a = foo1.AsA
-assert( foo1_a.x == 5 )
-assert( foo1_a:get_me().x == 5 )
+assert(foo1_a.x == 5)
+assert(foo1_a:get_me().x == 5)
-- Unfortunately, in Lua operator+= can't be overloaded
foo1.AsLong = 1000
-assert( foo1.AsLong == 1000 )
+assert(foo1.AsLong == 1000)
View
8 Examples/test-suite/lua/keyword_rename_runme.lua
@@ -8,9 +8,9 @@ if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
--- assert( kn.end(5) == 5 ) -- Curretly SWIG/Lua doesn't rename keywords
--- assert( kn.nil(7) == 7 )
+-- assert(kn.end(5) == 5) -- Curretly SWIG/Lua doesn't rename keywords
+-- assert(kn.nil(7) == 7)
-- But you can always access wrongly named members using string constants
-assert( kn["end"](5) == 5 )
-assert( kn["nil"](7) == 7 )
+assert(kn["end"](5) == 5)
+assert(kn["nil"](7) == 7)
View
2 Examples/test-suite/lua/li_std_vector_runme.lua
@@ -43,7 +43,7 @@ for i=0,3 do
end
for i=0,3 do
- assert( swig_type(sv[i]) =='Struct *' and sv[i].num==i)
+ assert(swig_type(sv[i]) =='Struct *' and sv[i].num==i)
end
-- range checking
View
14 Examples/test-suite/lua/overload_complicated_runme.lua
@@ -7,16 +7,16 @@ local env = _ENV -- Lua 5.2
if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
-assert( oc.foo(1,1,"test",1) == 15 )
+assert(oc.foo(1,1,"test",1) == 15)
p1 = oc.Pop(nil)
p1 = oc.Pop(nil,false)
-assert( p1:hip(true) == 701 )
-assert( p1:hip(nil) == 702 )
+assert(p1:hip(true) == 701)
+assert(p1:hip(nil) == 702)
-assert( p1:hop(true) == 801 )
-assert( p1:hop(nil) == 805 )
+assert(p1:hop(true) == 801)
+assert(p1:hop(nil) == 805)
-assert( oc.muzak(true) == 3001 )
-assert( oc.muzak(nil) == 3002 )
+assert(oc.muzak(true) == 3001)
+assert(oc.muzak(nil) == 3002)
View
22 Examples/test-suite/lua/smart_pointer_extend_runme.lua
@@ -7,28 +7,28 @@ local env = _ENV -- Lua 5.2
if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
-assert( spe.CBase.hello() == 1 )
-assert( spe.CBase.z == 1 )
+assert(spe.CBase.hello() == 1)
+assert(spe.CBase.z == 1)
base1 = spe.CBase()
base1.x = 7
p1 = spe.CPtr()
-assert( spe.get_hello(p1) == 1 )
-assert( p1:foo() == 1 )
-assert( p1:bar() == 2 )
-assert( p1:boo(5) == 5 )
+assert(spe.get_hello(p1) == 1)
+assert(p1:foo() == 1)
+assert(p1:bar() == 2)
+assert(p1:boo(5) == 5)
foo = spe.Foo()
bar = spe.Bar(foo)
-assert( bar:extension(5,7) == 5 )
-assert( bar:extension(7) == 7 )
-assert( bar:extension() == 1 )
+assert(bar:extension(5,7) == 5)
+assert(bar:extension(7) == 7)
+assert(bar:extension() == 1)
dfoo = spe.DFoo()
dptr = spe.DPtrFoo(dfoo)
-assert( dptr:Ext() == 2 )
-assert( dptr:Ext(5) == 5 )
+assert(dptr:Ext() == 2)
+assert(dptr:Ext(5) == 5)
View
10 Examples/test-suite/lua/smart_pointer_inherit_runme.lua
@@ -11,8 +11,8 @@ der = spi.Derived(7)
ptr = spi.SmartDerived(der)
-assert( ptr.val == 7 )
-assert( ptr:value() == 7 )
-assert( ptr:value2() == 7 )
-assert( ptr:value3() == 7 )
-assert( ptr:valuehide() == -1 )
+assert(ptr.val == 7)
+assert(ptr:value() == 7)
+assert(ptr:value2() == 7)
+assert(ptr:value3() == 7)
+assert(ptr:valuehide() == -1)
View
10 Examples/test-suite/lua/smart_pointer_multi_runme.lua
@@ -9,15 +9,15 @@ setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i
foo = spm.Foo()
foo.x = 5
-assert( foo:getx() == 5 )
+assert(foo:getx() == 5)
bar = spm.Bar(foo)
spam = spm.Spam(bar)
grok = spm.Grok(bar)
-assert( bar:getx() == 5 )
-assert( spam:getx() == 5 )
+assert(bar:getx() == 5)
+assert(spam:getx() == 5)
spam.x = 7
-assert( grok:getx() == 7 )
+assert(grok:getx() == 7)
grok.x = 10
-assert( foo:getx() == 10 )
+assert(foo:getx() == 10)
View
8 Examples/test-suite/lua/smart_pointer_not_runme.lua
@@ -10,16 +10,16 @@ setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i
foo = spn.Foo()
foo.x = 7
-assert( foo:getx() == 7 )
+assert(foo:getx() == 7)
bar = spn.Bar(foo)
success = pcall(bar.getx, bar) -- Bar is not a smart pointer. Call should fail
-assert( not success )
+assert(not success)
spam = spn.Spam(foo)
success = pcall(spam.getx, spam) -- Spam is not a smart pointer. Call should fail
-assert( not success )
+assert(not success)
grok = spn.Grok(foo)
success = pcall(grok.getx, grok) -- Spam is not a smart pointer. Call should fail
-assert( not success )
+assert(not success)
View
10 Examples/test-suite/lua/smart_pointer_rename_runme.lua
@@ -9,10 +9,10 @@ setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i
foo = spr.Foo()
-assert( foo:ftest1(1) == 1 )
-assert( foo:ftest2(1,2) == 2 )
+assert(foo:ftest1(1) == 1)
+assert(foo:ftest2(1,2) == 2)
bar = spr.Bar(foo)
-assert( bar:test() == 3 )
-assert( bar:ftest1(1) == 1 )
-assert( bar:ftest2(1,2) == 2 )
+assert(bar:test() == 3)
+assert(bar:ftest1(1) == 1)
+assert(bar:ftest2(1,2) == 2)
View
4 Examples/test-suite/lua/smart_pointer_simple_runme.lua
@@ -9,8 +9,8 @@ setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i
foo1 = sps.Foo()
foo1.x = 5
-assert( foo1.x == 5 )
-assert( foo1:getx() == 5 )
+assert(foo1.x == 5)
+assert(foo1:getx() == 5)
bar1 = sps.Bar(foo1)
bar1.x = 3
View
4 Examples/test-suite/lua/smart_pointer_templatemethods_runme.lua
@@ -14,5 +14,5 @@ iid = spt.InterfaceId()
po2 = o1:QueryInterfaceObjct(iid)
-- we can't call po2:DisposeObjct, because smart pointer Ptr<T> always return 0 when dereferencing
-- (see interface file). So we only check that po2 has necessary method
-assert( po2.DisposeObjct ~= nil )
-assert( po2.QueryInterfaceObjct ~= nil )
+assert(po2.DisposeObjct ~= nil)
+assert(po2.QueryInterfaceObjct ~= nil)
View
4 Examples/test-suite/lua/template_extend1_runme.lua
@@ -8,7 +8,7 @@ if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
lb = te.lBaz()
-assert( lb:foo() == "lBaz::foo" )
+assert(lb:foo() == "lBaz::foo")
db = te.dBaz()
-assert( db:foo() == "dBaz::foo" )
+assert(db:foo() == "dBaz::foo")
View
4 Examples/test-suite/lua/template_extend2_runme.lua
@@ -8,7 +8,7 @@ if not env then env = getfenv () end -- Lua 5.1
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
lb = te.lBaz()
-assert( lb:foo() == "lBaz::foo" )
+assert(lb:foo() == "lBaz::foo")
db = te.dBaz()
-assert( db:foo() == "dBaz::foo" )
+assert(db:foo() == "dBaz::foo")
View
16 Examples/test-suite/lua/template_inherit_runme.lua
@@ -9,16 +9,16 @@ setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i
fi = ti.FooInt()
-assert( fi:blah() == "Foo" )
-assert( fi:foomethod() == "foomethod" )
+assert(fi:blah() == "Foo")
+assert(fi:foomethod() == "foomethod")
bi = ti.BarInt()
-assert( bi:blah() == "Bar" )
-assert( bi:foomethod() == "foomethod" )
+assert(bi:blah() == "Bar")
+assert(bi:foomethod() == "foomethod")
-assert( ti.invoke_blah_int(fi) == "Foo" )
-assert( ti.invoke_blah_int(bi) == "Bar" )
+assert(ti.invoke_blah_int(fi) == "Foo")
+assert(ti.invoke_blah_int(bi) == "Bar")
bd = ti.BarDouble()
-success = pcall( ti.invoke_blah_int, bd )
-assert( not success )
+success = pcall(ti.invoke_blah_int, bd)
+assert(not success)

0 comments on commit b9ba05b

Please sign in to comment.