AUnit  1.0.0
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.
Compare.cpp
1 /*
2 MIT License
3 
4 Copyright (c) 2018 Brian T. Park
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 The above copyright notice and this permission notice shall be included in all
14 copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 SOFTWARE.
23 */
24 
25 /*
26 Design Notes:
27 ============
28 
29 Template Specialization:
30 -----------------------
31 One way to implement the compareEqual() for these types is to use template
32 specialization. The problem with Template specialization is that templates
33 use strict type matching, and does not perform the normal implicit type
34 conversion, including const-casting. Therefore, all of the various c-style
35 string types, for example:
36 
37  - char*
38  - const char*
39  - char[1]
40  - char[N]
41  - const char[1]
42  - const char[N]
43 
44 are considered to be different types under the C++ templating system. This
45 causes a combinatorial explosion of template specialization which produces
46 code that is difficult to understand, test and maintain.
47 An example can be seen in the Compare.h file of the ArduinoUnit project:
48 https://github.com/mmurdoch/arduinounit/blob/master/src/ArduinoUnitUtility/Compare.h
49 
50 Function Overloading:
51 ---------------------
52 In this project, I used function overloading instead of template
53 specialization. Function overloading handles c-style strings (i.e. character
54 arrays) naturally, in the way most users expect. For example, (char*) is
55 automarically cast to (const char*), and (char[N]) is autonmatically
56 cast to (const char*).
57 
58 For the primitive value types (e.g. (char), (int), (unsigned char), etc.) I
59 attempted to use a generic templatized version, using sonmething like:
60 
61  template<typename T>
62  compareEqual(const T& a, const T& b) { ... }
63 
64 However, this template introduced this method:
65 
66  compareEqual(char* const& a, char* const& b);
67 
68 that seemed to take precedence over the explicitly defined overload:
69 
70  compareEqual(const char* a, const char*b);
71 
72 When the compareEqual() method is called with a (char*) or a (char[N]),
73 like this:
74 
75  char a[3] = {...};
76  char b[4] = {...};
77  compareEqual(a, b);
78 
79 this calls compareEqual(char* const&, const* const&), which is the wrong
80 version for a c-style string. The only way I could get this to work was to
81 avoid templates completely and manually define all the function overloads
82 even for primitive integer types.
83 
84 Implicit Conversions:
85 ---------------------
86 For basic primitive types, I depend on some casts to avoid having to define
87 some functions. I assume that signed and unsigned integers smaller or equal
88 to (int) will be converted to an (int) to match compareEqual(int, int).
89 
90 I provided an explicit compareEqual(char, char) overload because in C++, a
91 (char) type is distinct from (signed char) and (unsigned char).
92 
93 Technically, there should be a (long long) version and an (unsigned long
94 long) version of compareEqual(). However, it turns out that the Arduino
95 Print::print() method does not have an overload for these types, so it would
96 not do us much good to provide an assertEqual() or compareEqual() for the
97 (long long) and (unsigned long long) types.
98 
99 Custom Assert and Compare Functions:
100 ------------------------------------
101 Another advantage of using function overloading instead of template
102 specialization is that the user is able to add additional function overloads
103 into the 'aunit' namespace. This should allow the user to define the various
104 comporeXxx() and assertXxx() functions for a custom class. I have not
105 tested this though.
106 
107 Comparing Flash Strings:
108 ------------------------
109 Flash memory must be read using 4-byte alignment on the ESP8266. AVR doesn't
110 care. Teensy-ARM fakes the flash memory API but really just uses the normal
111 static RAM. The following code for comparing two (__FlashStringHelper*)
112 against each other will work for all 3 environments.
113 
114 Inlining:
115 --------
116 Even though most of these functions are one-liners, there is no advantage to
117 inlining them because they are almost always used through a function pointer.
118 */
119 
120 #include <stdint.h>
121 #include <string.h>
122 #include <WString.h>
123 #include "Flash.h"
124 #include "Compare.h"
125 
126 namespace aunit {
127 namespace internal {
128 
129 //---------------------------------------------------------------------------
130 // compareString()
131 //---------------------------------------------------------------------------
132 
133 int compareString(const char* a, const char* b) {
134  if (a == b) { return 0; }
135  if (a == nullptr) { return -1; }
136  if (b == nullptr) { return 1; }
137  return strcmp(a, b);
138 }
139 
140 int compareString(const char* a, const String& b) {
141  if (a == nullptr) { return -1; }
142  return strcmp(a, b.c_str());
143 }
144 
145 int compareString(const char* a, const __FlashStringHelper* b) {
146  if (a == (const char*) b) { return 0; }
147  if (a == nullptr) { return -1; }
148  if (b == nullptr) { return 1; }
149  return strcmp_P(a, (const char*) b);
150 }
151 
152 int compareString(const String& a, const char* b) {
153  return -compareString(b, a);
154 }
155 
156 int compareString(const String& a, const String& b) {
157  return strcmp(a.c_str(), b.c_str());
158 }
159 
160 int compareString(const String& a, const __FlashStringHelper* b) {
161  if (b == nullptr) { return 1; }
162  return strcmp_P(a.c_str(), (const char*) b);
163 }
164 
165 int compareString(const __FlashStringHelper* a, const char* b) {
166  return -compareString(b, a);
167 }
168 
169 int compareString(const __FlashStringHelper* a, const String& b) {
170  return -compareString(b, a);
171 }
172 
173 // On ESP8266, pgm_read_byte() already takes care of 4-byte alignment, and
174 // memcpy_P(s, p, 4) makes 4 calls to pgm_read_byte() anyway, so don't bother
175 // optimizing for 4-byte alignment here.
176 int compareString(const __FlashStringHelper* a, const __FlashStringHelper* b) {
177  if (a == b) { return 0; }
178  if (a == nullptr) { return -1; }
179  if (b == nullptr) { return 1; }
180  const char* aa = reinterpret_cast<const char*>(a);
181  const char* bb = reinterpret_cast<const char*>(b);
182 
183  while (true) {
184  uint8_t ca = pgm_read_byte(aa);
185  uint8_t cb = pgm_read_byte(bb);
186  if (ca != cb) return (int) ca - (int) cb;
187  if (ca == '\0') return 0;
188  aa++;
189  bb++;
190  }
191 }
192 
193 //---------------------------------------------------------------------------
194 // compareStringCase()
195 //---------------------------------------------------------------------------
196 
197 int compareStringCase(const char* a, const char* b) {
198  if (a == b) { return 0; }
199  if (a == nullptr) { return -1; }
200  if (b == nullptr) { return 1; }
201  return strcasecmp(a, b);
202 }
203 
204 int compareStringCase(const char* a, const String& b) {
205  if (a == nullptr) { return -1; }
206  return strcasecmp(a, b.c_str());
207 }
208 
209 int compareStringCase(const char* a, const __FlashStringHelper* b) {
210  if (a == (const char*) b) { return 0; }
211  if (a == nullptr) { return -1; }
212  if (b == nullptr) { return 1; }
213  return strcasecmp_P(a, (const char*) b);
214 }
215 
216 int compareStringCase(const String& a, const char* b) {
217  return -compareStringCase(b, a);
218 }
219 
220 int compareStringCase(const String& a, const String& b) {
221  return strcasecmp(a.c_str(), b.c_str());
222 }
223 
224 int compareStringCase(const String& a, const __FlashStringHelper* b) {
225  if (b == nullptr) { return 1; }
226  return strcasecmp_P(a.c_str(), (const char*) b);
227 }
228 
229 int compareStringCase(const __FlashStringHelper* a, const char* b) {
230  return -compareStringCase(b, a);
231 }
232 
233 int compareStringCase(const __FlashStringHelper* a, const String& b) {
234  return -compareStringCase(b, a);
235 }
236 
237 // On ESP8266, pgm_read_byte() already takes care of 4-byte alignment, and
238 // memcpy_P(s, p, 4) makes 4 calls to pgm_read_byte() anyway, so don't bother
239 // optimizing for 4-byte alignment here.
240 int compareStringCase(const __FlashStringHelper* a,
241  const __FlashStringHelper* b) {
242  if (a == b) { return 0; }
243  if (a == nullptr) { return -1; }
244  if (b == nullptr) { return 1; }
245  const char* aa = reinterpret_cast<const char*>(a);
246  const char* bb = reinterpret_cast<const char*>(b);
247 
248  while (true) {
249  uint8_t ca = pgm_read_byte(aa);
250  uint8_t cb = pgm_read_byte(bb);
251  uint8_t la = tolower(ca);
252  uint8_t lb = tolower(cb);
253  if (la != lb) return (int) la - (int) lb;
254  if (ca == '\0') return 0;
255  aa++;
256  bb++;
257  }
258 }
259 
260 //---------------------------------------------------------------------------
261 // compareStringN
262 //---------------------------------------------------------------------------
263 
264 // We need compareStringN() to support only (const char*) and (const
265 // __FlashStringHelper*). And it turns out that compareStringN(a, b, N) ==
266 // -compareString(b, a, N).
267 
268 int compareStringN(const char* a, const char* b, size_t n) {
269  if (a == b) { return 0; }
270  if (a == nullptr) { return -1; }
271  if (b == nullptr) { return 1; }
272  return strncmp(a, b, n);
273 }
274 
275 int compareStringN(const char* a, const __FlashStringHelper* b, size_t n) {
276  if (a == (const char*) b) { return 0; }
277  if (a == nullptr) { return -1; }
278  if (b == nullptr) { return 1; }
279  return strncmp_P(a, (const char*) b, n);
280 }
281 
282 int compareStringN(const __FlashStringHelper* a, const char* b, size_t n) {
283  return -compareStringN(b, a, n);
284 }
285 
286 // On ESP8266, pgm_read_byte() already takes care of 4-byte alignment, and
287 // memcpy_P(s, p, 4) makes 4 calls to pgm_read_byte() anyway, so don't bother
288 // optimizing for 4-byte alignment here.
289 int compareStringN(const __FlashStringHelper* a, const __FlashStringHelper* b,
290  size_t n) {
291  if (a == b) { return 0; }
292  if (a == nullptr) { return -1; }
293  if (b == nullptr) { return 1; }
294  const char* aa = reinterpret_cast<const char*>(a);
295  const char* bb = reinterpret_cast<const char*>(b);
296 
297  while (n > 0) {
298  uint8_t ca = pgm_read_byte(aa);
299  uint8_t cb = pgm_read_byte(bb);
300  if (ca != cb) return (int) ca - (int) cb;
301  if (ca == '\0') return 0;
302  aa++;
303  bb++;
304  n--;
305  }
306  return 0;
307 }
308 
309 //---------------------------------------------------------------------------
310 // compareEqual()
311 //---------------------------------------------------------------------------
312 
313 bool compareEqual(bool a, bool b) {
314  return (a == b);
315 }
316 
317 bool compareEqual(char a, char b) {
318  return (a == b);
319 }
320 
321 bool compareEqual(int a, int b) {
322  return (a == b);
323 }
324 
325 bool compareEqual(unsigned int a, unsigned int b) {
326  return (a == b);
327 }
328 
329 bool compareEqual(long a, long b) {
330  return (a == b);
331 }
332 
333 bool compareEqual(unsigned long a, unsigned long b) {
334  return (a == b);
335 }
336 
337 bool compareEqual(double a, double b) {
338  return (a == b);
339 }
340 
341 bool compareEqual(const char* a, const char* b) {
342  return compareString(a, b) == 0;
343 }
344 
345 bool compareEqual(const char* a, const String& b) {
346  return compareString(a, b) == 0;
347 }
348 
349 bool compareEqual(const char* a, const __FlashStringHelper* b) {
350  return compareString(a, b) == 0;
351 }
352 
353 bool compareEqual(const __FlashStringHelper* a, const char* b) {
354  return compareString(a, b) == 0;
355 }
356 
357 bool compareEqual(const __FlashStringHelper* a, const __FlashStringHelper* b) {
358  return compareString(a, b) == 0;
359 }
360 
361 bool compareEqual(const __FlashStringHelper* a, const String& b) {
362  return compareString(a, b) == 0;
363 }
364 
365 bool compareEqual(const String& a, const char* b) {
366  return compareString(a, b) == 0;
367 }
368 
369 bool compareEqual(const String& a, const String& b) {
370  return compareString(a, b) == 0;
371 }
372 
373 bool compareEqual(const String& a, const __FlashStringHelper* b) {
374  return compareString(a, b) == 0;
375 }
376 
377 //---------------------------------------------------------------------------
378 // compareLess()
379 //---------------------------------------------------------------------------
380 
381 bool compareLess(bool a, bool b) {
382  return (a < b);
383 }
384 
385 bool compareLess(char a, char b) {
386  return (a < b);
387 }
388 
389 bool compareLess(int a, int b) {
390  return (a < b);
391 }
392 
393 bool compareLess(unsigned int a, unsigned int b) {
394  return (a < b);
395 }
396 
397 bool compareLess(long a, long b) {
398  return (a < b);
399 }
400 
401 bool compareLess(unsigned long a, unsigned long b) {
402  return (a < b);
403 }
404 
405 bool compareLess(double a, double b) {
406  return (a < b);
407 }
408 
409 bool compareLess(const char* a, const char* b) {
410  return compareString(a, b) < 0;
411 }
412 
413 bool compareLess(const char* a, const String& b) {
414  return compareString(a, b) < 0;
415 }
416 
417 bool compareLess(const char* a, const __FlashStringHelper* b) {
418  return compareString(a, b) < 0;
419 }
420 
421 bool compareLess(const __FlashStringHelper* a, const char* b) {
422  return compareString(a, b) < 0;
423 }
424 
425 bool compareLess(
426  const __FlashStringHelper* a, const __FlashStringHelper* b) {
427  return compareString(a, b) < 0;
428 }
429 
430 bool compareLess(const __FlashStringHelper* a, const String& b) {
431  return compareString(a, b) < 0;
432 }
433 
434 bool compareLess(const String& a, const char* b) {
435  return compareString(a, b) < 0;
436 }
437 
438 bool compareLess(const String& a, const String& b) {
439  return compareString(a, b) < 0;
440 }
441 
442 bool compareLess(const String& a, const __FlashStringHelper* b) {
443  return compareString(a, b) < 0;
444 }
445 
446 //---------------------------------------------------------------------------
447 // compareMore()
448 //---------------------------------------------------------------------------
449 
450 bool compareMore(bool a, bool b) {
451  return (a > b);
452 }
453 
454 bool compareMore(char a, char b) {
455  return (a > b);
456 }
457 
458 bool compareMore(int a, int b) {
459  return (a > b);
460 }
461 
462 bool compareMore(unsigned int a, unsigned int b) {
463  return (a > b);
464 }
465 
466 bool compareMore(long a, long b) {
467  return (a > b);
468 }
469 
470 bool compareMore(unsigned long a, unsigned long b) {
471  return (a > b);
472 }
473 
474 bool compareMore(double a, double b) {
475  return (a > b);
476 }
477 
478 bool compareMore(const char* a, const char* b) {
479  return compareString(a, b) > 0;
480 }
481 
482 bool compareMore(const char* a, const String& b) {
483  return compareString(a, b) > 0;
484 }
485 
486 bool compareMore(const char* a, const __FlashStringHelper* b) {
487  return compareString(a, b) > 0;
488 }
489 
490 bool compareMore(const __FlashStringHelper* a, const char* b) {
491  return compareString(a, b) > 0;
492 }
493 
494 bool compareMore(const __FlashStringHelper* a, const __FlashStringHelper* b) {
495  return compareString(a, b) > 0;
496 }
497 
498 bool compareMore(const __FlashStringHelper* a, const String& b) {
499  return compareString(a, b) > 0;
500 }
501 
502 bool compareMore(const String& a, const char* b) {
503  return compareString(a, b) > 0;
504 }
505 
506 bool compareMore(const String& a, const String& b) {
507  return compareString(a, b) > 0;
508 }
509 
510 bool compareMore(const String& a, const __FlashStringHelper* b) {
511  return compareString(a, b) > 0;
512 }
513 
514 //---------------------------------------------------------------------------
515 // compareLessOrEqual
516 //---------------------------------------------------------------------------
517 
518 bool compareLessOrEqual(bool a, bool b) {
519  return (a <= b);
520 }
521 
522 bool compareLessOrEqual(char a, char b) {
523  return (a <= b);
524 }
525 
526 bool compareLessOrEqual(int a, int b) {
527  return (a <= b);
528 }
529 
530 bool compareLessOrEqual(unsigned int a, unsigned int b) {
531  return (a <= b);
532 }
533 
534 bool compareLessOrEqual(long a, long b) {
535  return (a <= b);
536 }
537 
538 bool compareLessOrEqual(unsigned long a, unsigned long b) {
539  return (a <= b);
540 }
541 
542 bool compareLessOrEqual(double a, double b) {
543  return (a <= b);
544 }
545 
546 bool compareLessOrEqual(const char* a, const char* b) {
547  return compareString(a, b) <= 0;
548 }
549 
550 bool compareLessOrEqual(const char* a, const String& b) {
551  return compareString(a, b) <= 0;
552 }
553 
554 bool compareLessOrEqual(const char* a, const __FlashStringHelper* b) {
555  return compareString(a, b) <= 0;
556 }
557 
558 bool compareLessOrEqual(const __FlashStringHelper* a, const char* b) {
559  return compareString(a, b) <= 0;
560 }
561 
562 bool compareLessOrEqual(
563  const __FlashStringHelper* a, const __FlashStringHelper* b) {
564  return compareString(a, b) <= 0;
565 }
566 
567 bool compareLessOrEqual(const __FlashStringHelper* a, const String& b) {
568  return compareString(a, b) <= 0;
569 }
570 
571 bool compareLessOrEqual(const String& a, const char* b) {
572  return compareString(a, b) <= 0;
573 }
574 
575 bool compareLessOrEqual(const String& a, const String& b) {
576  return compareString(a, b) <= 0;
577 }
578 
579 bool compareLessOrEqual(const String& a, const __FlashStringHelper* b) {
580  return compareString(a, b) <= 0;
581 }
582 
583 //---------------------------------------------------------------------------
584 // compareMoreOrEqual
585 //---------------------------------------------------------------------------
586 
587 bool compareMoreOrEqual(bool a, bool b) {
588  return (a >= b);
589 }
590 
591 bool compareMoreOrEqual(char a, char b) {
592  return (a >= b);
593 }
594 
595 bool compareMoreOrEqual(int a, int b) {
596  return (a >= b);
597 }
598 
599 bool compareMoreOrEqual(unsigned int a, unsigned int b) {
600  return (a >= b);
601 }
602 
603 bool compareMoreOrEqual(long a, long b) {
604  return (a >= b);
605 }
606 
607 bool compareMoreOrEqual(unsigned long a, unsigned long b) {
608  return (a >= b);
609 }
610 
611 bool compareMoreOrEqual(double a, double b) {
612  return (a >= b);
613 }
614 
615 bool compareMoreOrEqual(const char* a, const char* b) {
616  return compareString(a, b) >= 0;
617 }
618 
619 bool compareMoreOrEqual(const char* a, const String& b) {
620  return compareString(a, b) >= 0;
621 }
622 
623 bool compareMoreOrEqual(const char* a, const __FlashStringHelper* b) {
624  return compareString(a, b) >= 0;
625 }
626 
627 bool compareMoreOrEqual(const __FlashStringHelper* a, const char* b) {
628  return compareString(a, b) >= 0;
629 }
630 
631 bool compareMoreOrEqual(
632  const __FlashStringHelper* a, const __FlashStringHelper* b) {
633  return compareString(a, b) >= 0;
634 }
635 
636 bool compareMoreOrEqual(const __FlashStringHelper* a, const String& b) {
637  return compareString(a, b) >= 0;
638 }
639 
640 bool compareMoreOrEqual(const String& a, const char* b) {
641  return compareString(a, b) >= 0;
642 }
643 
644 bool compareMoreOrEqual(const String& a, const String& b) {
645  return compareString(a, b) >= 0;
646 }
647 
648 bool compareMoreOrEqual(const String& a, const __FlashStringHelper* b) {
649  return compareString(a, b) >= 0;
650 }
651 
652 //---------------------------------------------------------------------------
653 // compareNotEqual
654 //---------------------------------------------------------------------------
655 
656 bool compareNotEqual(bool a, bool b) {
657  return (a != b);
658 }
659 
660 bool compareNotEqual(char a, char b) {
661  return (a != b);
662 }
663 
664 bool compareNotEqual(int a, int b) {
665  return (a != b);
666 }
667 
668 bool compareNotEqual(unsigned int a, unsigned int b) {
669  return (a != b);
670 }
671 
672 bool compareNotEqual(long a, long b) {
673  return (a != b);
674 }
675 
676 bool compareNotEqual(unsigned long a, unsigned long b) {
677  return (a != b);
678 }
679 
680 bool compareNotEqual(double a, double b) {
681  return (a != b);
682 }
683 
684 bool compareNotEqual(const char* a, const char* b) {
685  return compareString(a, b) != 0;
686 }
687 
688 bool compareNotEqual(const char* a, const String& b) {
689  return compareString(a, b) != 0;
690 }
691 
692 bool compareNotEqual(const char* a, const __FlashStringHelper* b) {
693  return compareString(a, b) != 0;
694 }
695 
696 bool compareNotEqual(const __FlashStringHelper* a, const char* b) {
697  return compareString(a, b) != 0;
698 }
699 
700 bool compareNotEqual(
701  const __FlashStringHelper* a, const __FlashStringHelper* b) {
702  return compareString(a, b) != 0;
703 }
704 
705 bool compareNotEqual(const __FlashStringHelper* a, const String& b) {
706  return compareString(a, b) != 0;
707 }
708 
709 bool compareNotEqual(const String& a, const char* b) {
710  return compareString(a, b) != 0;
711 }
712 
713 bool compareNotEqual(const String& a, const String& b) {
714  return compareString(a, b) != 0;
715 }
716 
717 bool compareNotEqual(const String& a, const __FlashStringHelper* b) {
718  return compareString(a, b) != 0;
719 }
720 
721 //---------------------------------------------------------------------------
722 // compareStringCaseEqual()
723 //---------------------------------------------------------------------------
724 
725 bool compareStringCaseEqual(const char* a, const char* b) {
726  return compareStringCase(a, b) == 0;
727 }
728 
729 bool compareStringCaseEqual(const char* a, const String& b) {
730  return compareStringCase(a, b) == 0;
731 }
732 
733 bool compareStringCaseEqual(const char* a, const __FlashStringHelper* b) {
734  return compareStringCase(a, b) == 0;
735 }
736 
737 bool compareStringCaseEqual(const __FlashStringHelper* a, const char* b) {
738  return compareStringCase(a, b) == 0;
739 }
740 
741 bool compareStringCaseEqual(const __FlashStringHelper* a,
742  const __FlashStringHelper* b) {
743  return compareStringCase(a, b) == 0;
744 }
745 
746 bool compareStringCaseEqual(const __FlashStringHelper* a, const String& b) {
747  return compareStringCase(a, b) == 0;
748 }
749 
750 bool compareStringCaseEqual(const String& a, const char* b) {
751  return compareStringCase(a, b) == 0;
752 }
753 
754 bool compareStringCaseEqual(const String& a, const String& b) {
755  return compareStringCase(a, b) == 0;
756 }
757 
758 bool compareStringCaseEqual(const String& a, const __FlashStringHelper* b) {
759  return compareStringCase(a, b) == 0;
760 }
761 
762 //---------------------------------------------------------------------------
763 // compareStringCaseNotEqual()
764 //---------------------------------------------------------------------------
765 
766 bool compareStringCaseNotEqual(const char* a, const char* b) {
767  return compareStringCase(a, b) != 0;
768 }
769 
770 bool compareStringCaseNotEqual(const char* a, const String& b) {
771  return compareStringCase(a, b) != 0;
772 }
773 
774 bool compareStringCaseNotEqual(const char* a, const __FlashStringHelper* b) {
775  return compareStringCase(a, b) != 0;
776 }
777 
778 bool compareStringCaseNotEqual(const __FlashStringHelper* a, const char* b) {
779  return compareStringCase(a, b) != 0;
780 }
781 
782 bool compareStringCaseNotEqual(const __FlashStringHelper* a,
783  const __FlashStringHelper* b) {
784  return compareStringCase(a, b) != 0;
785 }
786 
787 bool compareStringCaseNotEqual(const __FlashStringHelper* a, const String& b) {
788  return compareStringCase(a, b) != 0;
789 }
790 
791 bool compareStringCaseNotEqual(const String& a, const char* b) {
792  return compareStringCase(a, b) != 0;
793 }
794 
795 bool compareStringCaseNotEqual(const String& a, const String& b) {
796  return compareStringCase(a, b) != 0;
797 }
798 
799 bool compareStringCaseNotEqual(const String& a, const __FlashStringHelper* b) {
800  return compareStringCase(a, b) != 0;
801 }
802 
803 }
804 }
This file provides overloaded compareXxx(a, b) functions which are used by the various assertXxx(a...
Various macros to smooth over the differences among the various platforms with regards to their suppo...