25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

40 lines
852 B

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://www.wtfpl.net/ for more details.
  9. //
  10. #if defined HAVE_CONFIG_H
  11. # include "config.h"
  12. #endif
  13. #include "core.h"
  14. #include "lol/unit.h"
  15. namespace lol
  16. {
  17. LOLUNIT_FIXTURE(BoxTest)
  18. {
  19. void SetUp() {}
  20. void TearDown() {}
  21. LOLUNIT_TEST(Box2DIsect)
  22. {
  23. Box2D b1(vec2(0.f, 0.f), vec2(10.f, 10.f));
  24. Box2D b2(vec2(5.f, 8.f), vec2(8.f, 12.f));
  25. Box2D b3(vec2(5.f, 11.f), vec2(8.f, 13.f));
  26. LOLUNIT_ASSERT_EQUAL(true, BoxIsectBox(b1, b2));
  27. LOLUNIT_ASSERT_EQUAL(false, BoxIsectBox(b1, b3));
  28. }
  29. };
  30. } /* namespace lol */