FOSSology  4.7.1
Open Source License Compliance by Open Source Software
IsValidIdentifierTest Class Reference
Inheritance diagram for IsValidIdentifierTest:
Inheritance graph
Collaboration diagram for IsValidIdentifierTest:
Collaboration graph

Protected Member Functions

void testEmptyStringIsInvalid ()
 An empty string is not a valid SQL identifier.
 
void testLowercaseLettersAreValid ()
 A string of lowercase ASCII letters is valid.
 
void testUppercaseLettersAreValid ()
 A string of uppercase ASCII letters is valid.
 
void testDigitsAreValid ()
 A string of ASCII digits is valid.
 
void testUnderscoreIsValid ()
 An underscore character is valid.
 
void testMixedAlphanumericUnderscoreIsValid ()
 A typical mixed alphanumeric/underscore identifier is valid.
 
void testSpaceIsInvalid ()
 A space character makes an identifier invalid.
 
void testHyphenIsInvalid ()
 A hyphen makes an identifier invalid.
 
void testDotIsInvalid ()
 A dot makes an identifier invalid (guards against schema.table injection).
 
void testSemicolonIsInvalid ()
 A semicolon makes an identifier invalid (guards against statement injection).
 
void testSingleQuoteIsInvalid ()
 A single quote makes an identifier invalid.
 
void testDoubleQuoteIsInvalid ()
 A double quote makes an identifier invalid.
 
void testDollarIsInvalid ()
 A dollar sign makes an identifier invalid.
 
void testNullByteIsInvalid ()
 A null byte makes an identifier invalid.
 
void testSqlInjectionPatternIsInvalid ()
 A classic SQL injection pattern is rejected. More...
 
void testKnownTableNamesAreValid ()
 The three concrete uploadtree table names used in production are valid.
 

Private Member Functions

 CPPUNIT_TEST_SUITE (IsValidIdentifierTest)
 
 CPPUNIT_TEST (testEmptyStringIsInvalid)
 
 CPPUNIT_TEST (testLowercaseLettersAreValid)
 
 CPPUNIT_TEST (testUppercaseLettersAreValid)
 
 CPPUNIT_TEST (testDigitsAreValid)
 
 CPPUNIT_TEST (testUnderscoreIsValid)
 
 CPPUNIT_TEST (testMixedAlphanumericUnderscoreIsValid)
 
 CPPUNIT_TEST (testSpaceIsInvalid)
 
 CPPUNIT_TEST (testHyphenIsInvalid)
 
 CPPUNIT_TEST (testDotIsInvalid)
 
 CPPUNIT_TEST (testSemicolonIsInvalid)
 
 CPPUNIT_TEST (testSingleQuoteIsInvalid)
 
 CPPUNIT_TEST (testDoubleQuoteIsInvalid)
 
 CPPUNIT_TEST (testDollarIsInvalid)
 
 CPPUNIT_TEST (testNullByteIsInvalid)
 
 CPPUNIT_TEST (testSqlInjectionPatternIsInvalid)
 
 CPPUNIT_TEST (testKnownTableNamesAreValid)
 
 CPPUNIT_TEST_SUITE_END ()
 

Private Attributes

ReuserHelpersAccessor acc
 

Detailed Description

Definition at line 48 of file test_helpers.cc.

Member Function Documentation

◆ testSqlInjectionPatternIsInvalid()

void IsValidIdentifierTest::testSqlInjectionPatternIsInvalid ( )
inlineprotected

A classic SQL injection pattern is rejected.

Ensures the guard prevents an attacker from embedding arbitrary SQL via a crafted table name.

Definition at line 191 of file test_helpers.cc.


The documentation for this class was generated from the following file: