Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added test case for jumping to the member of a wrong structure.
  • Loading branch information
llorens committed Jun 27, 2010
1 parent 3899005 commit e233443
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SmartTagTest/Rules.mk
Expand Up @@ -7,6 +7,9 @@ VIM_TEST_SCRIPT := $(dir)/SmartTagTest.vim
dir := $(d)/TestTags
include $(dir)/Rules.mk

dir := $(d)/wrong-type-member2
include $(dir)/Rules.mk

d := $(dirstack_$(sp))
sp := $(basename $(sp))

Expand Down
1 change: 1 addition & 0 deletions SmartTagTest/run-tests.vim
Expand Up @@ -5,6 +5,7 @@
let testFiles = [
\ "TestTags/TestTags.cpp"
\ , "TestTags/TestTags.h"
\ , "wrong-type-member2/file.c"
\ ]

set runtimepath=..
Expand Down
11 changes: 11 additions & 0 deletions SmartTagTest/wrong-type-member2/Rules.mk
@@ -0,0 +1,11 @@
sp := $(sp).x
dirstack_$(sp) := $(d)
d := $(dir)

LOCAL_TEST_CASES := $(d)/file.c-test
ALL_TEST_CASES := $(ALL_TEST_CASES) $(LOCAL_TEST_CASES)

d := $(dirstack_$(sp))
sp := $(basename $(sp))

# vim: ft=make isfname-== noet
7 changes: 7 additions & 0 deletions SmartTagTest/wrong-type-member2/file.c
@@ -0,0 +1,7 @@
void func()
{
CStructType *c;
// #Ama
c->AStruct.ma;
}
/* vim: set ft=c ts=4 :*/
7 changes: 7 additions & 0 deletions SmartTagTest/wrong-type-member2/file1.h
@@ -0,0 +1,7 @@
typedef struct
{
// Bma:
int ma;
int mb;
} BStructType;
/* vim: set ft=c ts=4 :*/
14 changes: 14 additions & 0 deletions SmartTagTest/wrong-type-member2/file2.h
@@ -0,0 +1,14 @@
typedef AStructType_s AStructType;

struct AStructType_s
{
// Ama:
int ma;
int mb;
};

typedef struct CStructType_s
{
AStructType AStruct;
} CStructType;
/* vim: set ft=c ts=4 :*/
17 changes: 17 additions & 0 deletions SmartTagTest/wrong-type-member2/tags
@@ -0,0 +1,17 @@
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
AStruct file2.h /^ AStructType AStruct;$/;" m struct:CStructType_s
AStructType file2.h /^typedef AStructType_s AStructType;$/;" t
AStructType_s file2.h /^struct AStructType_s$/;" s
BStructType file1.h /^} BStructType;$/;" t typeref:struct:__anon1
CStructType file2.h /^} CStructType;$/;" t typeref:struct:CStructType_s
CStructType_s file2.h /^typedef struct CStructType_s$/;" s
func file.c /^void func()$/;" f
ma file1.h /^ int ma;$/;" m struct:__anon1
ma file2.h /^ int ma;$/;" m struct:AStructType_s
mb file1.h /^ int mb;$/;" m struct:__anon1
mb file2.h /^ int mb;$/;" m struct:AStructType_s

0 comments on commit e233443

Please sign in to comment.