Browse Source

* GetEnumNameCount also counted the unit name after r14511 (mantis #16402)

git-svn-id: trunk@15225 -
Jonas Maebe 15 years ago
parent
commit
700aa3cf11
3 changed files with 10 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 2 2
      rtl/objpas/typinfo.pp
  3. 7 0
      tests/webtbs/tw16402.pp

+ 1 - 0
.gitattributes

@@ -10355,6 +10355,7 @@ tests/webtbs/tw16328.pp svneol=native#text/plain
 tests/webtbs/tw1634.pp svneol=native#text/plain
 tests/webtbs/tw16366.pp svneol=native#text/plain
 tests/webtbs/tw16377.pp svneol=native#text/plain
+tests/webtbs/tw16402.pp svneol=native#text/plain
 tests/webtbs/tw1658.pp svneol=native#text/plain
 tests/webtbs/tw1677.pp svneol=native#text/plain
 tests/webtbs/tw1681.pp svneol=native#text/plain

+ 2 - 2
rtl/objpas/typinfo.pp

@@ -478,8 +478,8 @@ begin
           PS:=PShortString(pointer(PS)+PByte(PS)^+1);
           Inc(Count);
         end;
-
-      Result := Count;
+      { the last string is the unit name }
+      Result := Count - 1;
     end;
 end;
 

+ 7 - 0
tests/webtbs/tw16402.pp

@@ -0,0 +1,7 @@
+uses typinfo;
+type
+  TEnum = (Name1,Name2,Name3);
+begin
+  if GetEnumNameCount(TypeInfo(TEnum))<>3 then
+    halt(1);
+end.