text
stringlengths
14
100k
source
stringclasses
1 value
repo
stringclasses
810 values
language
stringclasses
13 values
<|fim_suffix|>rnsLocalVariable(void); <|fim_prefix|> int FindFunction_WhichIsBroken(int NumberToF<|fim_middle|>ind); int FunctionWhichRetu<|endoftext|>
fim
DaveGamble/cJSON
c
<|fim_prefix|> #include "ProductionCode2.h" char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) { (void)Poor; (void)Litt<|fim_suffix|> but at least we put in a TEST_IGNORE so we won't forget */ return (char*)0; } <|fim_middle|>leFunction; /* Since There Are No Tests Yet, This Function Could Be E...
fim
DaveGamble/cJSON
c
<|fim_prefix|> char*<|fim_suffix|>r* LittleFunction); <|fim_middle|> ThisFunctionHasNotBeenTested(int Poor, cha<|endoftext|>
fim
DaveGamble/cJSON
c
<|fim_prefix|> #include "ProductionCode.h" #include "unity.h" /* sometimes you may want to get at local data in a module. * for example: If you plan to pass by reference, this could be useful * however, it should often be avoided */ extern int Counter; void setUp(void) { /* This is run before EACH TEST */ Coun...
fim
DaveGamble/cJSON
c
<|fim_suffix|>id) { TEST_IGNORE_MESSAGE("This Test Was Ignored On Purpose"); } void test_AnotherIgnoredTest(void) { TEST_IGNORE_MESSAGE("These Can Be Useful For Leaving Yourself Notes On What You Need To Do Yet"); } void test_ThisFunctionHasNotBeenTested_NeedsToBeImplemented(void) { TEST_IGNORE(); /* Like...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTest<|fim_suffix|>e=====*/ #include "unity.h" #include <setjmp.h> #include <stdio.h> #include "ProductionCode2.h" /*=======External Functions This R...
fim
DaveGamble/cJSON
c
/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTestName = #TestFunc; \ Unity.CurrentTestLineNumber = TestLineNum; \ Unity.NumberOfTests++; \ if (TEST_PROTECT()) \ { \ setUp(); \ TestFunc(); ...
fim
DaveGamble/cJSON
c
<|fim_suffix|>ld therefore be caught by our tests) int FindFunction_WhichIsBroken(int NumberToFind) { int i = 0; while (i <= 8) //Notice I should have been in braces i++; if (NumbersToFind[i] == NumberToFind) //Yikes! I'm getting run after the loop finishes instead of during it! ret...
fim
DaveGamble/cJSON
c
<|fim_suffix|>sLocalVariable(void); <|fim_prefix|><|fim_middle|> int FindFunction_WhichIsBroken(int NumberToFind); int FunctionWhichReturn<|endoftext|>
fim
DaveGamble/cJSON
c
<|fim_suffix|>r All We Know. // Which isn't terribly useful... but at least we put in a TEST_IGNORE so we won't forget return (char*)0; } <|fim_prefix|> #include "ProductionCode2.h" char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) { (void)Poor; (void)LittleFunction; //S<|fim_middle|>ince Th...
fim
DaveGamble/cJSON
c
<|fim_prefix|> char* ThisFunctionHasNotBeenTested(int Poor, ch<|fim_suffix|>tleFunction); <|fim_middle|>ar* Lit<|endoftext|>
fim
DaveGamble/cJSON
c
<|fim_suffix|> test wrong. When that happens, you get a failure too... and a quick look should tell // you what actually happened...which in this case was a failure to setup the initial condition. TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); } <|fim_prefix|>#include "ProductionCode.h" #i...
fim
DaveGamble/cJSON
c
<|fim_suffix|>eaving Yourself Notes On What You Need To Do Yet"); } TEST(ProductionCode2, ThisFunctionHasNotBeenTested_NeedsToBeImplemented) { TEST_IGNORE(); //Like This } <|fim_prefix|>#include "ProductionCode2.h" #include "unity.h" #include "unity_fixture.h" TEST_GROUP(ProductionCode2); /* These should be igno...
fim
DaveGamble/cJSON
c
<|fim_prefix|>#include "unity.h" #include "unity_fixture.h" TEST_GROUP_RUNNER(ProductionCode2) { <|fim_suffix|>dTest); RUN_TEST_CASE(ProductionCode2, ThisFunctionHasNotBeenTested_NeedsToBeImplemented); }<|fim_middle|>RUN_TEST_CASE(ProductionCode2, IgnoredTest); RUN_TEST_CASE(ProductionCode2, AnotherIgnore<|endof...
fim
DaveGamble/cJSON
c
<|fim_suffix|>ldReturnTheCurrentCounterValue); RUN_TEST_CASE(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnTheCurrentCounterValueAgain); RUN_TEST_CASE(ProductionCode, FunctionWhichReturnsLocalVariable_ShouldReturnCurrentCounter_ButFailsBecauseThisTestIsActuallyFlawed); }<|fim_prefix|>#include "unity...
fim
DaveGamble/cJSON
c
<|fim_suffix|>, argv, RunAllTests); } <|fim_prefix|>#include "unity_fixture.h" static void RunAllTests(void) { RUN_TEST_GROUP(ProductionCode);<|fim_middle|> RUN_TEST_GROUP(ProductionCode2); } int main(int argc, const char * argv[]) { return UnityMain(argc<|endoftext|>
fim
DaveGamble/cJSON
c
<|fim_suffix|> y"); } <|fim_prefix|>#include "unity.h" #include "UnityHelper.h" #include <stdio.h> #include <string.h> void AssertEqualExa<|fim_middle|>mpleStruct(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line) { UNITY_TEST_ASSERT_EQUAL_INT(expected.x, actual.x, line, "Ex...
fim
DaveGamble/cJSON
c
<|fim_suffix|>expected, actual, __LINE__, NULL); #endif // _TESTHELPER_H <|fim_prefix|>#ifndef _TESTHELPER_H #define _TESTHELPER_H #include "Types.h" void AssertEq<|fim_middle|>ualExampleStruct(const EXAMPLE_STRUCT_T expected, const EXAMPLE_STRUCT_T actual, const unsigned short line); #define UNITY_TEST_ASSERT_EQUA...
fim
DaveGamble/cJSON
c
<|fim_suffix|>run_tests unit_test_files end desc 'Generate test summary' task :summary do report_summary end desc 'Build and test Unity' task all: %i(clean unit summary) task default: %i(clobber all) task ci: [:default] task cruise: [:default] desc 'Load configuration' task :config, :config_file do |_t, args| co...
fim
DaveGamble/cJSON
ruby
<|fim_prefix|>require 'yaml' require 'fileutils' require UNITY_ROOT + '/auto/unity_test_summary' require UNITY_ROOT + '/auto/generate_test_runner' require UNITY_ROOT + '/auto/colour_reporter' module RakefileHelpers C_EXTENSION = '.c'.freeze def load_configuration(config_file) $cfg_file = config_file $cfg ...
fim
DaveGamble/cJSON
ruby
<|fim_prefix|> #include "ProductionCode.h" int Counter = 0; int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; //some obnoxious a<|fim_suffix|>r number. // If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since // NumbersToFind is indexed from 1. Unfortunately it's...
fim
DaveGamble/cJSON
c
<|fim_prefix|> int FindFunction_WhichIsBroken(int NumberToFind); int F<|fim_suffix|>turnsLocalVariable(void); <|fim_middle|>unctionWhichRe<|endoftext|>
fim
DaveGamble/cJSON
c
<|fim_suffix|> (char*)0; } <|fim_prefix|> #include "ProductionCode2.h" char* ThisFunctionHasNotBeenTested(int Poor, char* LittleFunction) { (void)Poor; (void)LittleFunction; //Since There Are No Tests Yet, This F<|fim_middle|>unction Could Be Empty For All We Know. // Which isn't terribly useful... but at leas...
fim
DaveGamble/cJSON
c
<|fim_prefix|> char* ThisFunctionHasNotBeenT<|fim_suffix|> LittleFunction); <|fim_middle|>ested(int Poor, char*<|endoftext|>
fim
DaveGamble/cJSON
c
<|fim_suffix|> When that happens, you get a failure too... and a quick look should tell // you what actually happened...which in this case was a failure to setup the initial condition. TEST_ASSERT_EQUAL_HEX(0x1234, FunctionWhichReturnsLocalVariable()); } <|fim_prefix|> #include "ProductionCode.h" #include "uni...
fim
DaveGamble/cJSON
c
<|fim_suffix|>hingelse.h" void setUp(void) { } void tearDown(void) { } void test_IgnoredTest(void) { TEST_IGNORE_MESSAGE("This Test Was Ignored On Purpose"); } void test_AnotherIgnoredTest(void) { TEST_IGNORE_MESSAGE("These Can Be Useful For Leaving Yourself Notes On What You Need To Do Yet"); } void test_...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* Unity Configuration * As of May 11th, 2016 at ThrowTheSwitch/Unity commit 837c529 * Update: December 29th, 2016 * See Also: Unity/docs/UnityConfigurationGuide.pdf * * Unity is designed to run on almost anything that is targeted by a C compiler. * It would be awesome if this could be done with zer...
fim
DaveGamble/cJSON
c
<|fim_prefix|># ========================================== # Unity Project - A Test Framework for C # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams # [Released under MIT License. Please refer to license.txt for details] # ========================================== HERE = File.exp<|fim_suffix|...
fim
DaveGamble/cJSON
ruby
<|fim_prefix|># ========================================== # Unity Project - A Test Framework for C # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams # [Released under MIT License. Please refer to license.txt for details] # ========================================== require 'yaml' require 'file...
fim
DaveGamble/cJSON
ruby
<|fim_prefix|>/* Copyright (c) 2010 James Grenning and Contributed to Unity Project * ========================================== * Unity Project - A Test Framework for C * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams * [Released under MIT License. Please refer to license.txt for details] * ...
fim
DaveGamble/cJSON
c
/* Copyright (c) 2010 James Grenning and Contributed to Unity Project * ========================================== * Unity Project - A Test Framework for C * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams * [Released under MIT License. Please refer to license.txt for details] * ==============...
fim
DaveGamble/cJSON
c
<|fim_suffix|>inter_UndoAllSets(void); void UnityPointer_Init(void); #ifndef UNITY_MAX_POINTERS #define UNITY_MAX_POINTERS 5 #endif #ifdef __cplusplus } #endif #endif /* UNITY_FIXTURE_INTERNALS_H_ */ <|fim_prefix|>/* Copyright (c) 2010 James Grenning and Contributed to Unity Project * ===============================...
fim
DaveGamble/cJSON
c
<|fim_suffix|>_FREE(void* ptr); #endif #define malloc unity_malloc #define calloc unity_calloc #define realloc unity_realloc #define free unity_free void* unity_malloc(size_t size); void* unity_calloc(size_t num, size_t size); void* unity_realloc(void * oldMem, size_t size); void unity_free(void * mem); #endif ...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* Copyright (c) 2010 James Grenning and Contributed to Unity Project * ====================<|fim_suffix|>C * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams * [Released under MIT License. Please refer to license.txt for details] * ========================================== */ #in...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* Copyright (c) 2010 James Grenning and Contributed to Unity Project * ========================================== * Unity Project - A Test Framework for C * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams * [Released under MIT License. Please refer to license.txt for details] * ...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* Copyright (c) 2010 James Grenning and Contributed to Unity Project * ========================================== * Unity Project - A Test Framework for C * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams * [Released under MIT License. Please refer to license.txt for details] * ...
fim
DaveGamble/cJSON
c
<|fim_suffix|> RUN_TEST_CASE(UnityCommandOptions, OptionVerbose); RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByGroup); RUN_TEST_CASE(UnityCommandOptions, OptionSelectTestByName); RUN_TEST_CASE(UnityCommandOptions, OptionSelectRepeatTestsDefaultCount); RUN_TEST_CASE(UnityCommandOptions, OptionSe...
fim
DaveGamble/cJSON
c
/* Copyright (c) 2010 James Grenning and Contributed to Unity Project * ========================================== * Unity Project - A Test Framework for C * Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams * [Released under MIT License. Please refer to license.txt for details] * ==============...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* Copyright (c) 2010 James Grenning and Contributed to Unity Project * ========================================== * Unity Project - A Test Framework<|fim_suffix|> * UnityOutputCharSpy_Get(void); void UnityOutputCharSpy_Enable(int enable); #endif <|fim_middle|> for C * Copyright (c) 2007 Mike Karles...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* ========================================================================= Unity Project - A Test Framework for C Copyright (c) 2007-14 Mike Karlesky, Mark VanderVoord, Greg Williams [Released under MIT License. Please refer to license.txt for details] =======================================...
fim
DaveGamble/cJSON
c
<|fim_suffix|>ASSERT_FLOAT_IS_NOT_NEG_INF((actual), __LINE__, (message)) #define TEST_ASSERT_FLOAT_IS_NOT_NAN_MESSAGE(actual, message) UNITY_TEST_ASSERT_FLOAT_IS_NOT_NAN((actual), __LINE__, (message)) #define TEST_ASSERT_FLOAT_IS_NOT_DETERMINATE_MESSAGE(actual, message) ...
fim
DaveGamble/cJSON
c
<|fim_suffix|>hreshold, actual, line, message) UnityAssertGreaterOrLessOrEqualNumber((UNITY_INT)(threshold), (UNITY_INT)(actual), UNITY_GREATER_OR_EQUAL, (message), (UNITY_LINE_TYPE)(line), UNITY_DISPLAY_STYLE_UINT64) #define UNITY_TEST_ASSERT_GREATER_OR_EQUAL_HEX64(threshold, actual, line, message) ...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTestName = #TestFunc; \ Unity.CurrentTestLineNumber = TestLineNum; \ Unity.NumberOfTests++; \ if (TEST_PROTECT()) \ { \ CEXCEPTION_T e; \...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTestName = #TestFunc; \ Unity.CurrentTestLineNumber = TestLineNum; \ Unity.NumberOfTests++; \ if (TEST_PROTECT()) \ { \ setUp(); \ ...
fim
DaveGamble/cJSON
c
<|fim_suffix|>ThirdThingToTest, 53); RUN_TEST(test_TheFourthThingToTest, 58); return (UnityEnd()); } <|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTestName = #TestFunc; \ Unity.CurrentTest...
fim
DaveGamble/cJSON
c
<|fim_suffix|>; void test_TheThirdThingToTest(void); void test_TheFourthThingToTest(void); #endif <|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ #ifndef _TESTSAMPLE_HEAD1_H #define _TESTSAMPLE_HEAD1_H #include "unity.h" #include "funky.h" #include "stanky.h" #include <setjmp.h> void test_The<|fim_middle|>First...
fim
DaveGamble/cJSON
c
<|fim_suffix|> Runner Calls=====*/ extern void setUp(void); extern void tearDown(void); extern void test_TheFirstThingToTest(void); extern void test_TheSecondThingToTest(void); /*=======Mock Management=====*/ static void CMock_Init(void) { Mockstanky_Init(); } static void CMock_Verify(void) { Mockstanky_Verify();...
fim
DaveGamble/cJSON
c
<|fim_suffix|>est Reset Option=====*/ void resetTest(void); void resetTest(void) { CMock_Verify(); CMock_Destroy(); tearDown(); CMock_Init(); setUp(); } /*=======MAIN=====*/ int main(void) { UnityBegin("testdata/mocksample.c"); RUN_TEST(test_TheFirstThingToTest, 21); RUN_TEST(test_TheSecondThingToTest...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTestName = #TestFunc; \ Unity.CurrentTestLineNumber = TestLineNum; \ Unity.NumberOfTests++; \ CMock_Init(); \ UNITY_CLR_DETAILS(); \ if (TE...
fim
DaveGamble/cJSON
c
<|fim_suffix|>oid); void test_TheSecondThingToTest(void); #endif <|fim_prefix|>/* AUTOGENE<|fim_middle|>RATED FILE. DO NOT EDIT. */ #ifndef _TESTSAMPLE_MOCK_HEAD1_H #define _TESTSAMPLE_MOCK_HEAD1_H #include "unity.h" #include "cmock.h" #include "funky.h" #include <setjmp.h> void test_TheFirstThingToTest(v<|endoftext...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTestName = #TestFunc; \ Unity.CurrentTestLineNumber = TestLineNum; \ Unity.NumberOfTests++; \ CMock_Init(); \ UNITY_CLR_DETAILS(); \ if (TE...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTestName = #TestFunc; \ Unity.CurrentTestLineNumber = TestLineNum; \ Unity.NumberOfTests++; \ CMock_Init(); \ UNITY_CLR_DETAILS(); \ if (TE...
fim
DaveGamble/cJSON
c
<|fim_suffix|>s_MemFreeFinal(); return (UnityEnd()); } <|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST_NO_ARGS #define RUN_TEST(TestFunc, TestLineNum, ...) \ { \ Unity.CurrentTestName = #TestFunc "(" #__VA_ARGS__ ")"; \ Unity.CurrentTe...
fim
DaveGamble/cJSON
c
<|fim_suffix|>estroy(void) { Mockstanky_Destroy(); } /*=======Test Reset Option=====*/ void resetTest(void); void resetTest(void) { CMock_Verify(); CMock_Destroy(); tearDown(); CMock_Init(); setUp(); } /*=======MAIN=====*/ int main(void) { UnityBegin("testdata/mocksample.c"); RUN_TEST(test_TheFirstTh...
fim
DaveGamble/cJSON
c
<|fim_suffix|>t(void); extern void test_TheSecondThingToTest(void); /*=======Mock Management=====*/ static void CMock_Init(void) { Mockstanky_Init(); } static void CMock_Verify(void) { Mockstanky_Verify(); } static void CMock_Destroy(void) { Mockstanky_Destroy(); } /*=======Suite Setup=====*/ static int suite_...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTestName = #TestFunc; \ Unity.CurrentTestLineNumber = TestLineNum; \ Unity.NumberOfTests++; \ CMock_Init(); \ UNITY_CLR_DETAILS(); \ if (TE...
fim
DaveGamble/cJSON
c
<|fim_suffix|>); setUp(); } /*=======MAIN=====*/ int main(void) { UnityBegin("testdata/testsample.c"); RUN_TEST(test_TheFirstThingToTest, 21); RUN_TEST(test_TheSecondThingToTest, 43); RUN_TEST(test_TheThirdThingToTest, 53); RUN_TEST(test_TheFourthThingToTest, 58); return (UnityEnd()); } <|fim_prefix|>/...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTestName = #TestFunc; \ Unity.CurrentTestLineNumber = TestLineNum; \ Unity.NumberOfTests++; \ if (TEST_PROTECT()) \ { \ setUp(); \ ...
fim
DaveGamble/cJSON
c
/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST_NO_ARGS #define RUN_TEST(TestFunc, TestLineNum, ...) \ { \ Unity.CurrentTestName = #TestFunc "(" #__VA_ARGS__ ")"; \ Unity.CurrentTestLineNumber = TestLineNum; \ Unity.NumberOfTests++; \ if (TEST_PRO...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* AUTOGENERATED F<|fim_suffix|>nclude <setjmp.h> int GlobalExpectCount; int GlobalVerifyOrder; char* GlobalOrderError; /*=======External Functions This Runner Calls=====*/ extern void setUp(void); extern void tearDown(void); extern void test_TheFirstThingToTest(void); extern void test_TheSecondThingToT...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Ru<|fim_suffix|> Reset Option=====*/ void resetTest(void); void resetTest(void) { tearDown(); setUp(); } /*=======MAIN=====*/ int main(void) { suite_setup(); UnityBegin("testdata/testsample.c"); RUN_TEST(test_TheFirstThingToTest, 21); RUN...
fim
DaveGamble/cJSON
c
/* AUTOGENERATED FILE. DO NOT EDIT. */ /*=======Test Runner Used To Run Each Test Below=====*/ #define RUN_TEST(TestFunc, TestLineNum) \ { \ Unity.CurrentTestName = #TestFunc; \ Unity.CurrentTestLineNumber = TestLineNum; \ Unity.NumberOfTests++; \ if (TEST_PROTECT()) \ { \ CEXCEPTION_T e; \ Try { \ ...
fim
DaveGamble/cJSON
c
<|fim_prefix|># ========================================== # Unity Project - A Test Framework for C # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams # [Released under MIT License. Please refer to license.txt for details] # ========================================== require 'yaml' require 'file...
fim
DaveGamble/cJSON
ruby
<|fim_prefix|> require '../auto/generate_module.rb' require 'fileutils' def touch_src(file) FileUtils.touch "sandbox/src/#{file}" end def touch_test(file) FileUtils.touch "sandbox/test/#{file}" end def create_src_with_known_content(file) File.open("sandbox/src/#{file}", "w") {|f| f.write("the original #{file}"...
fim
DaveGamble/cJSON
ruby
<|fim_prefix|>#ifndef CEXCEPTION_H #define CEXCEPTION_H #define CEXCEPTION_BEING_USED 1 #define CEXCEPTION_NONE 0<|fim_suffix|>ne Catch(a) if (!a) #endif //CEXCEPTION_H <|fim_middle|> #define CEXCEPTION_T int e = 1; (void) #define Try if (e) #defi<|endoftext|>
fim
DaveGamble/cJSON
c
<|fim_suffix|>XTERN_DECL extern int CounterSuiteSetup; #endif //DEF_H <|fim_prefix|>#ifndef DEF_H #define DEF<|fim_middle|>_H #define E<|endoftext|>
fim
DaveGamble/cJSON
c
<|fim_suffix|>ockMock_Verify(void) { mockMock_Verify_Counter++; } void mockMock_Destroy(void) { mockMock_Destroy_Counter++; } #endif //CMOCK_H <|fim_prefix|>#ifndef CMOCK_H #define CMOCK_H int CMockMemFreeFinalCounter = 0; int mockMock_Init_Counter = 0; int mockMock_Verify_Counter = 0; int m<|fim_midd...
fim
DaveGamble/cJSON
c
<|fim_prefix|>#ifndef MOCK_MOCK_H #define MOCK_MOCK_H extern int mockMock_Init_Counter; extern int mockMock_Verify_Counter; extern int mockMock<|fim_suffix|>ter; void mockMock_Init(void); void mockMock_Verify(void); void mockMock_Destroy(void); #endif //MOCK_MOCK_H <|fim_middle|>_Destroy_Counter; extern int CMockMem...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ #include <stdio.h> #include "unity.h" #include "Defs.h" #ifdef USE_CEXCEPTION #include "CException.h" #endif /* Notes about prefixes: test - normal def<|fim_suffix|>ar(c);} // include passthrough fo...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ #include <stdio.h> #include "unity.h" #include "Defs.h" TEST_FILE("some_file.c") /* Notes about prefixes: test - normal default prefix. these are "always run" tests for this procedure spec - ...
fim
DaveGamble/cJSON
c
<|fim_prefix|>/* This Test File Is Used To Verify Many Combinations Of Using the Generate Test Runner Script */ #include <stdio.h> #include "unity.h" #include "Defs.h" #include "mockMock.h" #ifdef USE_CEXCEPTION #include "CException.h" #endif /* Notes about prefixes: test - normal default prefix. these are "a...
fim
DaveGamble/cJSON
c
<|fim_suffix|>ThisTestAlwaysIgnored' ], } }, { :name => 'ArgsNameFilterWithWildcardAsName', :testfile => 'testdata/testRunnerGeneratorSmall.c', :testdefines => ['TEST', 'UNITY_USE_COMMAND_LINE_ARGS'], :options => { :cmdline_args => true, }, :cmdline_args => "-n testRunnerGeneratorSmal...
fim
DaveGamble/cJSON
ruby
<|fim_prefix|>/* ========================================== Unity Project - A Test Framework for C Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams [Released under MIT License. Please refer to license.txt for details] ========================================== */ #include <setjmp.h> #inclu...
fim
DaveGamble/cJSON
c
<|fim_prefix|>// msvc doesn't s<|fim_suffix|>fine these functions. void setUp(void) { } void tearDown(void) { } <|fim_middle|>upport weak-linking, so we need to de<|endoftext|>
fim
DaveGamble/cJSON
c
<?php declare(strict_types=1); /** * Controller for choosing model and rendering SVG outputs */ class RendererController { /** * @var RendererModel $model */ private $model; /** * @var RendererView $view */ private $view; /** * @var array<string, string> $params */...
fim
DenverCoder1/readme-typing-svg
php
<|fim_suffix|> 12 6zM11 16H13V18H11z"></path> <path d="M12,2C6.486,2,2,6.486,2,12s4.486,10,10,10s10-4.486,10-10S17.514,2,12,2z M12,20c-4.411,0-8-3.589-8-8s3.589-8,8-8 s8,3.589,8,8S16.411,20,12,20z"></path> </svg> </a> </div> ...
fim
DenverCoder1/readme-typing-svg
php
<|fim_suffix|>me,value){if(typeof name!=="string"){throw new Error("Invalid value for channel name: "+name)}if(value===undefined){if(!this.channels.hasOwnProperty(name.toLowerCase())){console.warn("Getting unknown channel: "+name);return false}return this.channels[name.toLowerCase()]}else{var res=false;switch(name.toLo...
fim
DenverCoder1/readme-typing-svg
javascript
<|fim_prefix|>const preview = { // default values for Readme Typing SVG parameters defaults: { font: "monospace", weight: "400", color: "36BCF7", background: "00000000", size: "20", letterSpacing: "normal", center: "false", vCenter: "false", multiline: "false", width: "400", ...
fim
DenverCoder1/readme-typing-svg
javascript
<|fim_suffix|>= document.cookie.indexOf(";", begin); if (end == -1) { end = dc.length; } } return decodeURI(dc.substring(begin + prefix.length, end)); } <|fim_prefix|>// enable dark mode on load if user prefers dark themes and has not used the toggle getCookie("darkmode") === null && window.matchMedia...
fim
DenverCoder1/readme-typing-svg
javascript
<|fim_suffix|> case HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451; // 5xx: Server Error case HTTP_INTERNAL_SERVER_ERROR = 500; case HTTP_NOT_IMPLEMENTED = 501; case HTTP_BAD_GATEWAY = 502; case HTTP_SERVICE_UNAVAILABLE = 503; case HTTP_GATEWAY_TIMEOUT = 504; case HTTP_HTTP_VERSION_NOT_SUPPORTE...
fim
DenverCoder1/readme-typing-svg
php
<|fim_suffix|>Enum::HTTP_UNPROCESSABLE_ENTITY; } } <|fim_prefix|><?php <|fim_middle|>class UnprocessableEntityException extends InvalidArgumentException implements IStatusException { public function getStatus(): ResponseEnum { return Response<|endoftext|>
fim
DenverCoder1/readme-typing-svg
php
<|fim_prefix|><?php de<|fim_suffix|> $controller->render(); <|fim_middle|>clare(strict_types=1); require "../vendor/autoload.php"; // load environment variables if .env exists $dotenv = Dotenv\Dotenv::createImmutable(__DIR__); $dotenv->safeLoad(); $controller = new RendererController($_REQUEST); $controller->setHead...
fim
DenverCoder1/readme-typing-svg
php
<|fim_suffix|> } <|fim_prefix|><?php interface <|fim_middle|>IStatusException { public function getStatus(): ResponseEnum;<|endoftext|>
fim
DenverCoder1/readme-typing-svg
php
<?php declare(strict_types=1); /** * Model for error messages */ class ErrorModel { /** @var string $message Text to display */ public string $message; /** @var string $template Path to template file */ public string $template; /** * Construct ErrorModel * * @param string $messag...
fim
DenverCoder1/readme-typing-svg
php
<|fim_prefix|><?php declare(strict_types=1); /** * Class for converting Google Fonts to base 64 for displaying through SVG image */ class GoogleFontConverter { /** * Fetch CSS from Google Fonts * * @param string $font Google Font to fetch * @param string $text Text to display in font * ...
fim
DenverCoder1/readme-typing-svg
php
<|fim_prefix|><?php declare(strict_types=1); /** * Model for SVG outputs */ class RendererModel { /** @var array<string> $lines text to display */ public $lines; /** @var string $font Font family */ public $font; /** @var string $font Font weight */ public $weight; /** @var string $co...
fim
DenverCoder1/readme-typing-svg
php
<|fim_suffix|>ddle'> <?= $message . "\n" ?> </text> </svg> <|fim_prefix|><!-- https://github.com/DenverCoder1/readme-typing-svg/ --> <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 400 50' width='400px' height='50px'> <text font-family='monosp...
fim
DenverCoder1/readme-typing-svg
php
<|fim_prefix|><!-- https://github.com/DenverCoder1/readme-typing-svg/ --> <svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 <?= "$width $height" ?>' style='background-color: <?= $background ?>;' width='<?= $width ?>px' height='<?= $height ?>px'> <?= $fo...
fim
DenverCoder1/readme-typing-svg
php
<|fim_prefix|><?ph<|fim_suffix|>blic function render() { // import variables into symbol table extract(["message" => $this->model->message]); // render SVG with output buffering ob_start(); include $this->model->template; $output = ob_get_contents(); ob_end_cl...
fim
DenverCoder1/readme-typing-svg
php
<|fim_suffix|> "color" => $this->model->color, "background" => $this->model->background, "size" => $this->model->size, "center" => $this->model->center, "vCenter" => $this->model->vCenter, "width" => $this->model->width, "height" => $this->mo...
fim
DenverCoder1/readme-typing-svg
php
<|fim_suffix|>l->random); // other / false $params = [ "lines" => "text", "random" => "other", ]; $model = new RendererModel("src/templates/main.php", $params); $this->assertEquals(false, $model->random); } /** * Test Letter Spacing */ ...
fim
DenverCoder1/readme-typing-svg
php
<|fim_prefix|><?php declare(strict_types=1); use PHPUnit\Framework\TestCase; require "vendor/autoload.php"; final class RendererTest extends TestCase { /** * Static method to assert strings are equal while ignoring whitespace * * @param string $expected * @param string $actual */ pu...
fim
DenverCoder1/readme-typing-svg
php
<?php declare(strict_types=1); namespace DesignPatterns\Behavioral\ChainOfResponsibilities; use Psr\Http\Message\RequestInterface; abstract class Handler { public function __construct(private ?Handler $successor = null) { } /** * This approach by using a template method pattern ensures you tha...
fim
DesignPatternsPHP/DesignPatternsPHP
php
<|fim_suffix|> } return null; } } <|fim_prefix|><?php declare(strict_types=1); namespace Desig<|fim_middle|>nPatterns\Behavioral\ChainOfResponsibilities\Responsible; use DesignPatterns\Behavioral\ChainOfResponsibilities\Handler; use Psr\Http\Message\RequestInterface; class HttpInMemoryCacheHandle...
fim
DesignPatternsPHP/DesignPatternsPHP
php
<|fim_prefix|><?php declare(strict_types=1); namespace DesignPatterns\Behavioral\ChainOfResponsibilities\Responsible; use DesignPatterns\Behavioral\ChainOfResponsibilities\Handler; use Psr\Http\Message\RequestInterf<|fim_suffix|>lo World!'; } } <|fim_middle|>ace; class SlowDatabaseHandler extends Handler { ...
fim
DesignPatternsPHP/DesignPatternsPHP
php
<|fim_suffix|> $this->assertSame('Hello World!', $this->chain->handle($request)); } } <|fim_prefix|><?php declare(strict_types=1); namespace DesignPatterns\Behavioral\ChainOfResponsibilities\Tests; use DesignPatterns\Behavioral\ChainOfResponsibilities\Handler; use DesignPatterns\Behavioral\ChainOfResponsibi...
fim
DesignPatternsPHP/DesignPatternsPHP
php
<|fim_prefix|><?php declare(strict_types=1); namespace DesignPatterns\Behavioral\Command; /** * This concrete command tweaks receiver to add current date to messages * invoker just knows that it can call "execute" */ class AddMessageDateCommand implements UndoableCommand { /** * Each concrete command is ...
fim
DesignPatternsPHP/DesignPatternsPHP
php
<|fim_prefix|><?php declare(strict_types=1); namespace DesignPatterns\Behavioral\Command; interface Command { /** * this is the most important method in the Command pattern, * The Receiver goes in<|fim_suffix|>or. */ public function execute(); } <|fim_middle|> the construct<|endoftext|>
fim
DesignPatternsPHP/DesignPatternsPHP
php
<|fim_suffix|> * execute and output "Hello World". */ public function execute() { // sometimes, there is no receiver and this is the command which does all the work $this->output->write('Hello World'); } } <|fim_prefix|><?php declare(strict_types=1); namespace DesignPatterns\Behaviora...
fim
DesignPatternsPHP/DesignPatternsPHP
php
<?php declare(strict_types=1); namespace DesignPatterns\Behavioral\Command; /** * Invoker is using the command given to it. * Example : an Application in SF2. */ class Invoker { private Command $command; /** * in the invoker we find this kind of method for subscribing the command * There can be...
fim
DesignPatternsPHP/DesignPatternsPHP
php