diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2023-04-25 10:43:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-25 10:43:29 -0400 |
| commit | 7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0 (patch) | |
| tree | 9c71955dbc956b0058b19818ca127c8132cda512 /tools/slang-test | |
| parent | 284cee1f246c072f190c87c8fb60c1d2181e458f (diff) | |
Dictionary using lowerCamel (#2835)
* #include an absolute path didn't work - because paths were taken to always be relative.
* WIP lowerCamel Dictionary.
* WIP more lowerCamel fixes for Dictionary.
* Add/Remove/Clear
* GetValue/Contains
* Fix tabs in dictionary.
Count -> getCount
* Fix fields with caps.
* Key -> key
Value -> value
Use m_ for members where appropriate.
Use lowerCamel in linked list.
* Some small fixes/improvements to Dictionary.
* Kick CI.
Diffstat (limited to 'tools/slang-test')
| -rw-r--r-- | tools/slang-test/options.cpp | 8 | ||||
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 26 | ||||
| -rw-r--r-- | tools/slang-test/test-context.cpp | 8 | ||||
| -rw-r--r-- | tools/slang-test/test-reporter.cpp | 2 |
4 files changed, 22 insertions, 22 deletions
diff --git a/tools/slang-test/options.cpp b/tools/slang-test/options.cpp index ab0d3a01e..9989d8164 100644 --- a/tools/slang-test/options.cpp +++ b/tools/slang-test/options.cpp @@ -17,13 +17,13 @@ TestCategory* TestCategorySet::add(String const& name, TestCategory* parent) category->name = name; category->parent = parent; - m_categoryMap.Add(name, category); + m_categoryMap.add(name, category); return category; } TestCategory* TestCategorySet::find(String const& name) { - if (auto category = m_categoryMap.TryGetValue(name)) + if (auto category = m_categoryMap.tryGetValue(name)) { return category->Ptr(); } @@ -239,7 +239,7 @@ static bool _isSubCommand(const char* arg) auto category = categorySet->findOrError(*argCursor++); if (category) { - optionsOut->includeCategories.Add(category, category); + optionsOut->includeCategories.add(category, category); } } else if (strcmp(arg, "-exclude") == 0) @@ -252,7 +252,7 @@ static bool _isSubCommand(const char* arg) auto category = categorySet->findOrError(*argCursor++); if (category) { - optionsOut->excludeCategories.Add(category, category); + optionsOut->excludeCategories.add(category, category); } } else if (strcmp(arg, "-api") == 0) diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 739ea840e..94329831b 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -82,11 +82,11 @@ struct TestOptions // Small helper to help consistently interrogating for filecheck usage bool getFileCheckPrefix(String& prefix) const { - return commandOptions.TryGetValue("filecheck", prefix); + return commandOptions.tryGetValue("filecheck", prefix); } bool getFileCheckBufferPrefix(String& prefix) const { - return commandOptions.TryGetValue("filecheck-buffer", prefix); + return commandOptions.tryGetValue("filecheck-buffer", prefix); } Type type = Type::Normal; @@ -160,7 +160,7 @@ static SlangResult _readTestFile(const TestInput& input, const String& suffix, S return r; } - buf.Clear(); + buf.clear(); buf << input.filePath << suffix; return Slang::File::readAllText(buf, out); } @@ -335,11 +335,11 @@ static SlangResult _parseCommandArguments(char const** ioCursor, TestOptions& ou auto i = option.indexOf('='); if(i == -1) { - out.commandOptions.Add(option.trim(), ""); + out.commandOptions.add(option.trim(), ""); } else { - out.commandOptions.Add(option.head(i).trim(), option.tail(i+1).trim()); + out.commandOptions.add(option.head(i).trim(), option.tail(i+1).trim()); } } } @@ -1345,7 +1345,7 @@ String findExpectedPath(const TestInput& input, const char* postFix) // Try the default name StringBuilder defaultBuf; - defaultBuf.Clear(); + defaultBuf.clear(); defaultBuf << input.filePath; if (postFix) { @@ -3610,7 +3610,7 @@ bool testCategoryMatches( { for( auto item : categorySet ) { - if(testCategoryMatches(categoryToMatch, item.Value)) + if(testCategoryMatches(categoryToMatch, item.value)) return true; } return false; @@ -4381,15 +4381,15 @@ SlangResult innerMain(int argc, char** argv) return func(StdWriters::getSingleton(), context.getSession(), int(args.getCount()), args.getBuffer()); } - if( options.includeCategories.Count() == 0 ) + if( options.includeCategories.getCount() == 0 ) { - options.includeCategories.Add(fullTestCategory, fullTestCategory); + options.includeCategories.add(fullTestCategory, fullTestCategory); } // Don't include OptiX tests unless the client has explicit opted into them. - if( !options.includeCategories.ContainsKey(optixTestCategory) ) + if( !options.includeCategories.containsKey(optixTestCategory) ) { - options.excludeCategories.Add(optixTestCategory, optixTestCategory); + options.excludeCategories.add(optixTestCategory, optixTestCategory); } // Exclude rendering tests when building under AppVeyor. @@ -4397,8 +4397,8 @@ SlangResult innerMain(int argc, char** argv) // TODO: this is very ad hoc, and we should do something cleaner. if( options.outputMode == TestOutputMode::AppVeyor ) { - options.excludeCategories.Add(renderTestCategory, renderTestCategory); - options.excludeCategories.Add(vulkanTestCategory, vulkanTestCategory); + options.excludeCategories.add(renderTestCategory, renderTestCategory); + options.excludeCategories.add(vulkanTestCategory, vulkanTestCategory); } { diff --git a/tools/slang-test/test-context.cpp b/tools/slang-test/test-context.cpp index 15b07444c..e0f2749b9 100644 --- a/tools/slang-test/test-context.cpp +++ b/tools/slang-test/test-context.cpp @@ -111,7 +111,7 @@ TestContext::~TestContext() TestContext::InnerMainFunc TestContext::getInnerMainFunc(const String& dirPath, const String& name) { { - SharedLibraryTool* tool = m_sharedLibTools.TryGetValue(name); + SharedLibraryTool* tool = m_sharedLibTools.tryGetValue(name); if (tool) { return tool->m_func; @@ -135,13 +135,13 @@ TestContext::InnerMainFunc TestContext::getInnerMainFunc(const String& dirPath, tool.m_func = (InnerMainFunc)tool.m_sharedLibrary->findFuncByName("innerMain"); } - m_sharedLibTools.Add(name, tool); + m_sharedLibTools.add(name, tool); return tool.m_func; } void TestContext::setInnerMainFunc(const String& name, InnerMainFunc func) { - SharedLibraryTool* tool = m_sharedLibTools.TryGetValue(name); + SharedLibraryTool* tool = m_sharedLibTools.tryGetValue(name); if (tool) { tool->m_sharedLibrary.setNull(); @@ -151,7 +151,7 @@ void TestContext::setInnerMainFunc(const String& name, InnerMainFunc func) { SharedLibraryTool tool = {}; tool.m_func = func; - m_sharedLibTools.Add(name, tool); + m_sharedLibTools.add(name, tool); } } diff --git a/tools/slang-test/test-reporter.cpp b/tools/slang-test/test-reporter.cpp index b2d0d1a54..2d252ebed 100644 --- a/tools/slang-test/test-reporter.cpp +++ b/tools/slang-test/test-reporter.cpp @@ -121,7 +121,7 @@ void TestReporter::startTest(const char* testName) m_currentInfo = TestInfo(); m_currentInfo.name = testName; - m_currentMessage.Clear(); + m_currentMessage.clear(); } void TestReporter::endTest() |
