aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2013-05-08 14:08:18 +1000
committernyamatongwe <unknown>2013-05-08 14:08:18 +1000
commitfb9f49fcaf224a3df72a85ffd37072f0cd282769 (patch)
treec4654b6dd69f8cff79541b921cca67f80ce85f07
parentbec5dd1f96911abfe65aded29212bd50a3d89c24 (diff)
downloadscintilla-mirror-fb9f49fcaf224a3df72a85ffd37072f0cd282769.tar.gz
Avoid warning.
-rw-r--r--lexlib/LexerModule.cxx2
-rw-r--r--test/simpleTests.py20
2 files changed, 21 insertions, 1 deletions
diff --git a/lexlib/LexerModule.cxx b/lexlib/LexerModule.cxx
index fc8884dc7..b2b0f0696 100644
--- a/lexlib/LexerModule.cxx
+++ b/lexlib/LexerModule.cxx
@@ -75,7 +75,7 @@ int LexerModule::GetNumWordLists() const {
const char *LexerModule::GetWordListDescription(int index) const {
assert(index < GetNumWordLists());
- if (index >= GetNumWordLists()) {
+ if (!wordListDescriptions || (index >= GetNumWordLists())) {
return "";
} else {
return wordListDescriptions[index];
diff --git a/test/simpleTests.py b/test/simpleTests.py
index 638634b05..9b99344f0 100644
--- a/test/simpleTests.py
+++ b/test/simpleTests.py
@@ -1520,6 +1520,26 @@ class TestLexer(unittest.TestCase):
length = self.ed.GetLexerLanguage(0, name)
name = name[:length]
self.assertEquals(name, b"cpp")
+
+ def testPropertyNames(self):
+ propertyNamesSize = self.ed.PropertyNames()
+ propertyNames = b"x" * propertyNamesSize
+ self.ed.PropertyNames(None, propertyNames)
+ self.assertNotEquals(propertyNames, b"")
+ # The cpp lexer has a boolean property named lexer.cpp.allow.dollars
+ propNameDollars = b"lexer.cpp.allow.dollars"
+ propertyType = self.ed.PropertyType(propNameDollars)
+ self.assertEquals(propertyType, self.ed.SC_TYPE_BOOLEAN)
+ propertyDescriptionSize = self.ed.DescribeProperty(propNameDollars)
+ propertyDescription = b"x" * propertyDescriptionSize
+ self.ed.DescribeProperty(propNameDollars, propertyDescription)
+ self.assertNotEquals(propertyDescription, b"")
+
+ def testWordListDescriptions(self):
+ wordSetSize = self.ed.DescribeKeyWordSets()
+ wordSet = b"x" * wordSetSize
+ self.ed.DescribeKeyWordSets(None, wordSet)
+ self.assertNotEquals(wordSet, b"")
class TestAutoComplete(unittest.TestCase):