Skip to content

Commit

Permalink
tests: Move the new typeof() namespace encoding tests into the proper…
Browse files Browse the repository at this point in the history
… file

(the new tests from e8871a7)

quirk/typeof tests the "hard" typeof, while pp/typeof tests the textual
one, which is what the namespace encoding test is about.
  • Loading branch information
dkl committed Jun 6, 2015
1 parent f596c98 commit ca605f9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
35 changes: 35 additions & 0 deletions tests/pp/typeof.bas
Expand Up @@ -138,9 +138,44 @@ sub test cdecl( )
#endif
end sub

namespace namespaces
namespace a
type T
i as integer
end type
end namespace

namespace b
type T
s as single
end type
end namespace

'' The namespace prefix should be encoded in the typeof() result,
'' to allow the two T's to be differentiated
#assert typeof(a.T) = "FBC_TESTS.PP.TYPEOF_.NAMESPACES.A.T"
#assert typeof(b.T) = "FBC_TESTS.PP.TYPEOF_.NAMESPACES.B.T"
#assert typeof(a.T) <> typeof(b.T)

sub test cdecl( )
scope
using a
#assert typeof(T) = typeof(a.T)
#assert typeof(T) <> typeof(b.T)
end scope

scope
using b
#assert typeof(T) <> typeof(a.T)
#assert typeof(T) = typeof(b.T)
end scope
end sub
end namespace

private sub ctor( ) constructor
fbcu.add_suite( "tests/pp/typeof" )
fbcu.add_test( "typeof() with PP", @test )
fbcu.add_test( "namespaces", @namespaces.test )
end sub

end namespace
35 changes: 0 additions & 35 deletions tests/quirk/typeof.bas
Expand Up @@ -319,47 +319,12 @@ sub testTypeofProcPtr cdecl( )
CU_ASSERT( (*ppFunc)( ) = 123 )
end sub

namespace namespaces
namespace a
type T
i as integer
end type
end namespace

namespace b
type T
s as single
end type
end namespace

'' The namespace prefix should be encoded in the typeof() result,
'' to allow the two T's to be differentiated
#assert typeof(a.T) = "FBC_TESTS.QUIRK.TYPEOF_.NAMESPACES.A.T"
#assert typeof(b.T) = "FBC_TESTS.QUIRK.TYPEOF_.NAMESPACES.B.T"
#assert typeof(a.T) <> typeof(b.T)

sub test cdecl( )
scope
using a
#assert typeof(T) = typeof(a.T)
#assert typeof(T) <> typeof(b.T)
end scope

scope
using b
#assert typeof(T) <> typeof(a.T)
#assert typeof(T) = typeof(b.T)
end scope
end sub
end namespace

private sub ctor( ) constructor
fbcu.add_suite( "tests/quirk/typeof" )
fbcu.add_test( "test", @test )
fbcu.add_test( "sizeof(typeof(deref))", @testSizeofTypeofDeref )
fbcu.add_test( "sizeof(typeof(...))", @testSizeofTypeofOthers )
fbcu.add_test( "typeof( sub|function(...) )", @testTypeofProcPtr )
fbcu.add_test( "namespaces", @namespaces.test )
end sub

end namespace

0 comments on commit ca605f9

Please sign in to comment.